Skip to content

perf(@angular-devkit/build-angular): add vendor chunking to server builder#24223

Merged
dgp1130 merged 1 commit intoangular:mainfrom
alan-agius4:vendor-chunk-server-builder
Nov 15, 2022
Merged

perf(@angular-devkit/build-angular): add vendor chunking to server builder#24223
dgp1130 merged 1 commit intoangular:mainfrom
alan-agius4:vendor-chunk-server-builder

Conversation

@alan-agius4
Copy link
Copy Markdown
Collaborator

@alan-agius4 alan-agius4 commented Nov 14, 2022

With this change we add the vendorChunk option in the server builder. This option should only be used in development as it is intended to be used to improve the incremental re-build time.

This improves the rebuild time as Webpack will have less modules to analyse during a change in the application. Below, we can see the impact this change has in a ng new application.

Without vendor chunking

$ ng run ssr-vendor:server:development --watch --no-vendor-chunk
Build at: 2022-11-14T08:42:27.089Z - Hash: 0325905b63e43ddb - Time: 15357ms
Build at: 2022-11-14T08:42:37.565Z - Hash: 05cb180a02524656 - Time: 2498ms
Build at: 2022-11-14T08:42:40.325Z - Hash: c5a6996ed1924088 - Time: 1862ms
Build at: 2022-11-14T08:42:43.043Z - Hash: 92ce99f38a769c19 - Time: 1516ms

With vendor chunking

$ ng run ssr-vendor:server:development --watch --vendor-chunk
Build at: 2022-11-14T08:43:13.631Z - Hash: 28bdfea879d01a31 - Time: 15561ms
Build at: 2022-11-14T08:43:19.396Z - Hash: cc95e2b6cb403111 - Time: 1705ms
Build at: 2022-11-14T08:43:21.296Z - Hash: 204138490668a16c - Time: 848ms
Build at: 2022-11-14T08:43:23.835Z - Hash: 4fa294b261917944 - Time: 824ms

FYI: @AndrewKushnir & @mgechev

@alan-agius4 alan-agius4 added target: minor This PR is targeted for the next minor release target: rc This PR is targeted for the next release-candidate and removed target: minor This PR is targeted for the next minor release labels Nov 14, 2022
@alan-agius4 alan-agius4 requested a review from clydin November 14, 2022 09:05
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Nov 14, 2022
@alan-agius4 alan-agius4 force-pushed the vendor-chunk-server-builder branch from 75b96bc to 3b6d0fc Compare November 14, 2022 09:57
Comment thread packages/angular_devkit/build_angular/src/builders/browser/schema.json Outdated
Comment thread packages/angular_devkit/build_angular/src/builders/browser-esbuild/schema.json Outdated
…ilder

With this change we add the `vendorChunk` option in the server builder. This option should only be used in development as it is intended to be used to improve the incremental re-build time.

This improves the rebuild time as Webpack will have less modules to analyse during a change in the application. Below, we can see the impact this change has in a `ng new` application.

Without vendor chunking
```
$ ng run ssr-vendor:server:development --watch --no-vendor-chunk
Build at: 2022-11-14T08:42:27.089Z - Hash: 0325905b63e43ddb - Time: 15357ms
Build at: 2022-11-14T08:42:37.565Z - Hash: 05cb180a02524656 - Time: 2498ms
Build at: 2022-11-14T08:42:40.325Z - Hash: c5a6996ed1924088 - Time: 1862ms
Build at: 2022-11-14T08:42:43.043Z - Hash: 92ce99f38a769c19 - Time: 1516ms
```

With vendor chunking
```
$ ng run ssr-vendor:server:development --watch --vendor-chunk
Build at: 2022-11-14T08:43:13.631Z - Hash: 28bdfea879d01a31 - Time: 15561ms
Build at: 2022-11-14T08:43:19.396Z - Hash: cc95e2b6cb403111 - Time: 1705ms
Build at: 2022-11-14T08:43:21.296Z - Hash: 204138490668a16c - Time: 848ms
Build at: 2022-11-14T08:43:23.835Z - Hash: 4fa294b261917944 - Time: 824ms
```
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 15, 2022
@alan-agius4 alan-agius4 force-pushed the vendor-chunk-server-builder branch from 3b6d0fc to 4905a92 Compare November 15, 2022 07:50
@dgp1130 dgp1130 merged commit 11bb8ce into angular:main Nov 15, 2022
@alan-agius4 alan-agius4 deleted the vendor-chunk-server-builder branch November 15, 2022 18:23
@angular-automatic-lock-bot
Copy link
Copy Markdown

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 Dec 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants