-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Launch minimal-wrapper native CEv1 #26360
Conversation
Delta in bundle size expected? |
Yes, it's expected. We're now including the minimal polyfill and the checks necessary to find which polyfill to install. |
Ping @cramforce and @choumx |
Sigh, I can't rebase on upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one question
@@ -958,7 +958,7 @@ export function install(win, ctor) { | |||
const {Reflect} = win; | |||
|
|||
// "Construct" ctor using ES5 idioms | |||
const instance = Object.create(ctor.prototype); | |||
const instance = /** @type {!Function} */ (Object.create(ctor.prototype)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this the right type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure, but closure doesn't like the Function.call.call()
below without it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What were the observed results of the "Native Custom Elements V1" experiment?
*/ | ||
export function install(win, opt_ctor) { | ||
export function install(win, ctor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just remove ctor
parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we still need to detect if we're in ESM (real classes) or ES5 (transpiled classes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be inlined in install()
which would make the API a bit cleaner (optional).
win, | ||
NATIVE_CUSTOM_ELEMENTS_V1 ? class {} : undefined | ||
); | ||
installCustomElements(win, class {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We always transpile our testing code right? Did we try running our test suite against the native CE code path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if the ESM builds ran with this RTV experiment enabled. @erwinmombay?
We observed no latency impact at p95 and p50 for first contentful paint (or any metric), and no new unusual errors. |
Was there any impact for First-Viewport-Ready?
…On Wed, Jan 22, 2020 at 2:26 PM Justin Ridgewell ***@***.***> wrote:
We observed no latency impact at p95 and p50 for first contentful paint,
and no new unusual errors.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#26360?email_source=notifications&email_token=AAAV4T3AJPQUTI5PTKRD5KTQ7DBY5A5CNFSM4KHKTBE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJVKRYI#issuecomment-577415393>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAV4T346VABPEOZNTDUWMLQ7DBY5ANCNFSM4KHKTBEQ>
.
|
No, everything was completely stable. |
* master: (62 commits) 📦 Update dependency fetch-mock to v8.3.2 (ampproject#26491) Revert 'Move mutator implementations out to a standalone service' (ampproject#26479) Fix syntax error (ampproject#26481) Add pespective back. (ampproject#26486) More user friendly errors in layout.js (ampproject#26448) ✨ Start logging AMP URL on SwG Pages (ampproject#26480) Fix border around desktop amp-story-pages. (ampproject#26449) Fix Story tests. (ampproject#26464) ✨ Performance Measurement Chrome Extension (ampproject#26333) amp-consent restrict iframe fullScreen if no focus (ampproject#26461) Add performance benchmark task (ampproject#26026) ♻️ amp-script: emit warning if zero height and width. (ampproject#26444) ✨ Launch minimal-wrapper native CEv1 (ampproject#26360) ♻️ Lint: include externs (round 2) (ampproject#26446) amp-script: Create 'fill content' container for responsive/fluid (ampproject#26400) amp-consent remove cmp iframe focus (ampproject#26437) Disable macro-after-long-task in inabox. (ampproject#26459) Launch layoutbox-invalidate-on-scroll (ampproject#26430) Add amp-ad support for ByPlay (ampproject#25663) 🏗 Add specific RTV opt-in to experiments.html (ampproject#26434) ...
This pushes us closer to use real, native CEv1!
Now, instead of forcing a full polyfill in every browser, we will have the following support matrix:
false
false
false
true
true
false
HTMLElement
true
true
Note that we won't be able to eliminate the polyfill from module builds, since Firefox supported modules before CEv1. 😢