Repository navigation
refactor(docs-infra): simplify custom-element polyfill setup - #25806
robwormald wants to merge 2 commits into
Conversation
|
You can preview cc610f2 at https://pr25806-cc610f2.ngbuilds.io/. |
There was a problem hiding this comment.
Can you include package.json as well?
|
You can preview 8ba72c8 at https://pr25806-8ba72c8.ngbuilds.io/. |
8ba72c8 to
c717818
Compare
|
You can preview c717818 at https://pr25806-c717818.ngbuilds.io/. |
IgorMinar
left a comment
There was a problem hiding this comment.
@robwormald the next time please include the size increase change in the original change so that the two are connected in history. thanks
| 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.
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.
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.
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/elementsschematics setup