Skip to content

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

Merged
sebastianbenz merged 2 commits intomainfrom
enable-esm
Feb 12, 2021
Merged

Enable ESM module version of AMP Runtime and Components by default#1140
sebastianbenz merged 2 commits intomainfrom
enable-esm

Conversation

@sebastianbenz
Copy link
Copy Markdown
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

#### `esmModulesEnabled`

Enables the smaller ESM module version of AMP runtime and components:
Copy link
Copy Markdown
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
Copy Markdown
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.

*/
class RewriteAmpUrls {
constructor(config) {
this.esmModulesEnabled = config.experimentEsm;
Copy link
Copy Markdown
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
Copy Markdown
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