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
refactor(docs-infra): simplify custom-element polyfill setup #25806
Conversation
You can preview cc610f2 at https://pr25806-cc610f2.ngbuilds.io/. |
aio/yarn.lock
Outdated
@@ -469,8 +469,8 @@ | |||
long "^3.2.0" | |||
|
|||
"@webcomponents/custom-elements@^1.0.8": | |||
version "1.0.8" | |||
resolved "https://registry.yarnpkg.com/@webcomponents/custom-elements/-/custom-elements-1.0.8.tgz#b7b8ef7248f7681d1ad4286a0ada5fe3c2bc7228" | |||
version "1.2.0" |
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 you include package.json
as well?
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
You can preview 8ba72c8 at https://pr25806-8ba72c8.ngbuilds.io/. |
8ba72c8
to
c717818
Compare
You can preview c717818 at https://pr25806-c717818.ngbuilds.io/. |
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.
@robwormald the next time please include the size increase change in the original change so that the two are connected in history. thanks
@@ -36,7 +36,8 @@ | |||
* Zone JS is required by Angular itself. | |||
*/ | |||
import 'zone.js/dist/zone'; // Included with Angular CLI. | |||
|
|||
import '@webcomponents/custom-elements'; // Custom Elements Polyfill | |||
import '@webcomponents/custom-elements/src/native-shim'; |
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.
Won't this result in unnecessarily loading more code in both borwsers that don't support Custom Elements and those that do?
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.
Yes, but the shim is very minimal, and it's a lot less gross than the document.write
trick we're doing now. We'll revisit this when we look into shipping modern (esm/es2015) builds from CLI.
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.
For reference, the polyfill (which is what I was more worried about) is 15K (minified), so nothing to worry about atm (with our 476K main bundle 😁).
Accidentally broken in 46de203 (while cherry-picking angular#25806 into 6.1.x).
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Simplify the Custom Element polyfills for AIO. Previously, we had to conditionally load either the polyfill (for browsers without CE support) or the es5-shim (for browsers with native CE support to enable ES5 "classes"). The polyfills now are simplified, and shouldn't require conditional loading anymore, so we can shift them to the polyfills.ts file to simplify things.
Assuming this approach is successful, we'll follow this up with a similar change to the
@angular/elements
schematics setup