Disable preloading runtime script/style by default#1248
Merged
sebastianbenz merged 6 commits intomainfrom Jun 30, 2021
Merged
Conversation
c70f333 to
d3fceef
Compare
westonruter
commented
Jun 26, 2021
packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_preloads/input.html
Outdated
Show resolved
Hide resolved
packages/optimizer/spec/transformers/valid/RewriteAmpUrls/adds_esm_and_preloads/input.html
Outdated
Show resolved
Hide resolved
westonruter
commented
Jun 26, 2021
| class RewriteAmpUrls { | ||
| constructor(config) { | ||
| this.esmModulesEnabled = config.esmModulesEnabled !== false; | ||
| this.preloadEnabled = config.preloadEnabled === true; |
Member
Author
There was a problem hiding this comment.
Should this only be honored if the boilerplate was removed (i-amphtml-no-boilerplate)?
Collaborator
There was a problem hiding this comment.
Yes, only if boilertplate has been removed. I'm wondering whether we should make it configurable at all. I'd tend to remove the option.
Collaborator
|
I would suggest implementing this option in the following way:
|
westonruter
added a commit
to ampproject/amp-toolbox-php
that referenced
this pull request
Jun 29, 2021
Member
Author
|
I've removed the option to control whether preload links are added and now made it conditional based on whether the boilerplate is present. |
westonruter
added a commit
to ampproject/amp-toolbox-php
that referenced
this pull request
Jun 29, 2021
sebastianbenz
pushed a commit
that referenced
this pull request
Jul 2, 2021
* Disable preloading runtime script/style by default * Invert logic for preloadEnabled config to ensure disabled by default * Automatically omit preloads only when boilerplate is removed * Manually remove modulepreload from expected_output.fast.html * Update expected output in end-to-end tests * Update style[amp-custom] in end-to-end expected output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See ampproject/amp-toolbox-php#17.
cf. ampproject/amp-toolbox-php#261