Skip to content
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

Several fixes for differential loading bundle downleveling #15666

Merged
merged 5 commits into from
Sep 26, 2019

Conversation

clydin
Copy link
Member

@clydin clydin commented Sep 25, 2019

This corrects SRI value injection into the runtime bundle as well as accurately displaying file sizes following a differential loading build.

Fixes #15468
Fixes #15425
Fixes #15625

@clydin clydin added the target: patch This PR is targeted for the next patch release label Sep 25, 2019
@clydin clydin force-pushed the fix-downlevel-sri branch 5 times, most recently from 7413236 to 0f65c82 Compare September 25, 2019 16:40
@clydin clydin requested a review from alan-agius4 September 25, 2019 17:12
Copy link
Collaborator

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vikerman vikerman merged commit 08aa5c6 into angular:master Sep 26, 2019
@clydin clydin deleted the fix-downlevel-sri branch September 26, 2019 17:02
@lppedd
Copy link

lppedd commented Oct 2, 2019

@clydin hi! could this be backported to 8.3.*?

@clydin
Copy link
Member Author

clydin commented Oct 2, 2019

It will be in the next patch release which will be released this week.

@lppedd
Copy link

lppedd commented Oct 2, 2019

@clydin thank you, awesome!

@lppedd
Copy link

lppedd commented Oct 3, 2019

@clydin Updated. I've noticed the bundles are "mixed", and only after generating the ES5 ones chunks are displayed. I still receive the budget warning (don't understand if ES5 or ES2015, but ES2015 is way lower). Is this wanted?

image

@paul-davis-sp
Copy link

@clydin We are having the same issue as @lppedd. The bundle sizes have decreased on disk after upgrading to Angular 8, but the budget is still complaining.

The size of our main-es2015 bundle is 1.3M, but the budget fails:
ERROR in budgets, maximum exceeded for main. Budget 1.33 MB was exceeded by 309 kB.

@william-chen-iress
Copy link

william-chen-iress commented Oct 7, 2019

We tested this in ng cli 8.3.8

we still have SRI error for lazy load module.

The steps to reproduce is in #15468.
My environment:
Angular CLI: 8.3.8
Node: 12.9.1
OS: win32 x64
Angular: 8.2.9
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package Version

@angular-devkit/architect 0.803.8
@angular-devkit/build-angular 0.803.8
@angular-devkit/build-optimizer 0.803.8
@angular-devkit/build-webpack 0.803.8
@angular-devkit/core 8.3.8
@angular-devkit/schematics 8.3.8
@angular/cli 8.3.8
@ngtools/webpack 8.3.8
@schematics/angular 8.3.8
@schematics/update 0.803.8
rxjs 6.4.0
typescript 3.5.3
webpack 4.39.2

for (const file of chunk.files as string[]) {
files.push({
id: chunk.id.toString(),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clydin This will fail when the chunk id is null, since the id definition in Chunk class tells us that it can also be null.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The types are incorrect there. It can actually be a string or a number. At successful completion of the build an id is also required to properly construct the runtime from within Webpack. Also of note, the name field which from the link says it is always a string, can in fact be null.

@clydin
Copy link
Member Author

clydin commented Oct 9, 2019

Additional fixes/improvements are being backported to 8.3, this will resolve the remaining SRI issues. There are unfortunately still some situations where the bundle budgets can trigger errantly. These are in the process of being corrected.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: patch This PR is targeted for the next patch release
Projects
None yet
8 participants