🏗 Transform aliased configured components#26541
Merged
alanorozco merged 36 commits intoampproject:masterfrom Feb 26, 2020
Merged
🏗 Transform aliased configured components#26541alanorozco merged 36 commits intoampproject:masterfrom
alanorozco merged 36 commits intoampproject:masterfrom
Conversation
|
Hey @erwinmombay, these files were changed:
|
3fc5316 to
cbc0b0b
Compare
cbc0b0b to
46f1d72
Compare
fa772e4 to
3069003
Compare
erwinmombay
reviewed
Feb 6, 2020
build-system/babel-plugins/babel-plugin-transform-inline-configure-component/index.js
Outdated
Show resolved
Hide resolved
Contributor
kevinkimball
left a comment
There was a problem hiding this comment.
Seems promising if we are going to go this way.
build-system/babel-plugins/babel-plugin-transform-inline-configure-component/index.js
Outdated
Show resolved
Hide resolved
erwinmombay
reviewed
Feb 13, 2020
| const currentDirname = dirname(file.opts.filename); | ||
| const importedModule = join(currentDirname, importPath); | ||
|
|
||
| // TODO(alanorozco): sourcemaps |
Member
There was a problem hiding this comment.
Can you add a tracking issue for this, i believe you're possibly going to need resorcery and terser for this
Member
Author
There was a problem hiding this comment.
Added issue. Why terser? What am I missing :)
Member
There was a problem hiding this comment.
https://github.com/ampproject/amphtml/blob/master/build-system/compile/single-pass.js#L771-L803
i'm not sure but @kristoferbaxter and @jridgewell used it in these to fix up the source maps in conjunction with resorcery (they can probably explain)
erwinmombay
reviewed
Feb 13, 2020
build-system/babel-plugins/babel-plugin-transform-inline-configure-component/index.js
Outdated
Show resolved
Hide resolved
erwinmombay
reviewed
Feb 13, 2020
build-system/babel-plugins/babel-plugin-transform-inline-configure-component/index.js
Outdated
Show resolved
Hide resolved
erwinmombay
approved these changes
Feb 24, 2020
c5c243f to
47bc1c5
Compare
robinvanopstal
added a commit
to jungvonmatt/amphtml
that referenced
this pull request
Feb 27, 2020
* master: (54 commits) inabox-resources: Minor test improvement (ampproject#26916) DocInfo: replace metaTags with viewport in API (ampproject#26687) 🐛 SwG now uses AMP sendBeacon interface (ampproject#26970) 🏗 Allow array destructuring on preact hooks (ampproject#26901) Gulp Dep Check: fail on unused entries (ampproject#26981) Update no-import lint rule to forbid sub-paths (ampproject#26531) 🐛 amp-ad type blade - fix bladeOnLoad callback (ampproject#26627) 📖 Clarify when max-age is required (ampproject#26956) ♻️ Consolidate players as .i-amphtml-media-component (ampproject#26967) Add Preact Enzyme tests (ampproject#26529) Fixes `update_tests` flag on `gulp validator` (ampproject#26965) 📦 Update dependency google-closure-library to v20200224 (ampproject#26986) 🏗 Transform aliased configured components (ampproject#26541) ✨ InaboxResources: Observe intersections for some elements' viewportCallbacks (ampproject#26942) variable substitutions: Support allowlist lookup in AmpDocShadow (ampproject#26731) cl/297197875 Revision bump for ampproject#26877 (ampproject#26982) Json fix (ampproject#26971) 📦 Update dependency mocha to v7.1.0 (ampproject#26976) Add documentation for amp-access-scroll (ampproject#26782) make controls always shown in amp for email (ampproject#25714) ...
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.
Partial for #26572.
Transformer
transform-inline-configure-componentfindsconfigureComponent(MyConstructor, {foo: 'bar'})calls and:Inlines imported
MyConstructorin current scope.Replaces
*.*.STATIC_CONG_.fooaccess with its value as defined in config object{foo: 'bar'}.Replaces
configureComponent()call with inlinedMyConstructor's id.For runtime use of
configureComponentlike:Composed class gets aliased, hoisted and its configuration replaced inline: