🏗 Allow array destructuring on preact hooks#26901
🏗 Allow array destructuring on preact hooks#26901jridgewell merged 2 commits intoampproject:masterfrom
Conversation
|
Hey @erwinmombay, these files were changed:
|
|
They're not approved by the linter, so it'll yell at you. |
samouri
left a comment
There was a problem hiding this comment.
LGTM. Can you update the PR description with at least an example before/after?
kristoferbaxter
left a comment
There was a problem hiding this comment.
Have to run, but wanted to ensure these comments were available.
| */ | ||
| const _temp = document, | ||
| _temp2 = _temp[0], | ||
| first = _temp2[0]; |
There was a problem hiding this comment.
Interestingly for this deep case, the output is slightly smaller than with object destructure.
let o=document[0][0];console.log(o) versus let{0:o}=document,{0:n}=o;console.log(n)
There was a problem hiding this comment.
Oh, that reminds me that I wanted to implement this with object destructure. Lol.
| const _temp2 = document, | ||
| x = _temp2[0], | ||
| z = _temp2[2]; | ||
| } |
There was a problem hiding this comment.
Looks like terser undoes some of this
let[,n]=document,[o,,c]=document
There was a problem hiding this comment.
Under what options?
There was a problem hiding this comment.
Pulled the options from our single pass configuration. But cannot reproduce now.
Looking into this again.
kristoferbaxter
left a comment
There was a problem hiding this comment.
Cannot reproduce the terser unwind. With Object destructuring, it looks good to me.
ddf0761 to
b3579e3
Compare
* 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) ...
No description provided.