-
Notifications
You must be signed in to change notification settings - Fork 243
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
Conversation
This can be configured by the esmModulesEnabled flag, which is `true` by default.
@@ -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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
No description provided.