♻️ Condense polyfills and lock down imports#34151
Merged
rcebulko merged 8 commits intoampproject:mainfrom May 3, 2021
Merged
Conversation
samouri
approved these changes
Apr 30, 2021
| // Some deferred polyfills. | ||
| scheduleInObUpgradeIfNeeded(global); | ||
| scheduleResObUpgradeIfNeeded(global); | ||
| const extensionsFor = Services.extensionsFor(global); |
Member
There was a problem hiding this comment.
Clever way to avoid Services for now ⭐
Contributor
Author
There was a problem hiding this comment.
Yeah! I figure this barely is owned by polyfills themselves, and this is literally the only place those methods were used, so it seemed like an efficient way to untangle some AMP dependencies
|
Hey @rsimha! These files were changed: |
rsimha
reviewed
Apr 30, 2021
| */ | ||
|
|
||
| /** @fileoverview */ | ||
| /** @fileoverview Installs polyfills depending on build environment. */ |
Contributor
There was a problem hiding this comment.
Looks like there are ~300 comments that read // src/polyfills.js must be the first import., that could do with an update. They mostly live in 3p code.
Contributor
Author
There was a problem hiding this comment.
Yep I've seen em all. I plan to update all of those in a separate PR so Justin or Kris can rubber-stamp without needing to look
f673c0a to
1ae540e
Compare
caroqliu
approved these changes
May 3, 2021
This was
linked to
issues
May 12, 2021
rochapablo
pushed a commit
to rochapablo/amphtml
that referenced
this pull request
Aug 30, 2021
* Remove src/polyfills dependency on Services * Move get-bounding-client-rect polyfill into polyfills * Move src/polyfills.js to src/polyfills/index.js * Update dep-check config * Lock down imports within src/polyfills * Update references to polyfills.js * Update stragglers * Fix forbidden terms exception
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.
Moves all polyfills into
src/polyfillsand adds a lint rule preventing imports outside of polyfills/core. In preparation for enabling/passing typechecking onsrc/polyfills