Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ESM module version of AMP Runtime and Components by default #1140

Merged
merged 2 commits into from
Feb 12, 2021

Conversation

sebastianbenz
Copy link
Collaborator

No description provided.

This can be configured by the esmModulesEnabled flag, which is `true` by
default.
@sebastianbenz sebastianbenz changed the title @Enable ESM module version of AMP Runtime and Components by default Enable ESM module version of AMP Runtime and Components by default Feb 11, 2021
@@ -111,6 +112,20 @@ Automatically import any missing AMP Extensions (e.g. amp-carousel).
- default: `true`
- used by: [AutoExtensionImport](lib/transformers/AutoExtensionImporter.js)

#### `esmModulesEnabled`

Enables the smaller ESM module version of AMP runtime and components:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit ambiguous - is there a way to link to some kind of docs to explain this more?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet - we should add one...once there's one.

@@ -56,7 +56,7 @@ const {calculateHost} = require('../RuntimeHostHelper');
*/
class RewriteAmpUrls {
constructor(config) {
this.esmModulesEnabled = config.experimentEsm;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you aren't supporting the old version at all, this be a breaking change as far as semver is concerned, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. My assumption is: the previous default was disabled, the new default is enabled.

Cases:

  • If someone previously enabled it, it's still going to be enabled => not a breaking change
  • If someone previously explicitly disabled it, it's going to be enabled now. This is in theory a breaking change, however, this is the new "official" default for AMP as it's valid AMP now. And the flag was named experimental + undocumented, so I wouldn't consider it part of the official API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants