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
build: update angular and dev-infra package while accounting for rule changes #44490
Conversation
13209ed
to
7d9a1cc
Compare
You can preview a159198 at https://pr44490-a159198.ngbuilds.io/. |
You can preview 7d9a1cc at https://pr44490-7d9a1cc.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.
LGTM
Reviewed-for: global-approvers
You can preview 59190c2 at https://pr44490-59190c2.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.
Overall lgtm 👍
One more question:
I noticed that the new rule makes the following changes (compared to the old rule) to the generated ngsw-worker.js
:
- Removes comments.
- Removes
/*@__PURE__*/
annotations - Downlevels 2016+ features, such as
async/await
,{...props}
,?.
and??
(I assume due to us targeting ES2015).
Are these changes intentional? (Why not target >ES2015, for example?)
@gkalpak I think we accidentally shipped that file as ES2020 at some point. I think we should ship it as ES2015 (did that intentionally) since not all browsers support ES2020 fully, and the file is put into apps by the CLI without any downleveling/processing IIRC. This also explains why the pure annotations etc should not matter I think. Especially since all of that is within a IIFE. These things are likely controlled by some esbuild options. The pure annotations were added by build optimizer IIRC (not even sure if that is expected) What do you think? I'm not super familiar with the service worker code |
For reference here is the simple copy logic in the CLI: https://cs.opensource.google/angular/angular-cli/+/master:packages/angular_devkit/build_angular/src/utils/service-worker.ts;l=115-120?q=ngsw-worker&ss=angular%2Fangular-cli. The pure annotations really were just added by build optimizer as a "side-effect" (ironically) of the benchmarking rule being used, or was that decision deliberately made? |
TBH, I don't recall if it was intentional that we switched from ES2015 to ES2020 😅
Yes, you are right about the pure annotations. They shouldn't have any effect (at least not atm). Finally, the comments were nice to preserve for debugging. Bundle size is little of a concern for the SW script, because (a) it is not on a critical path and (b) it is only fetched when it changes (which for the Angular SW is fairly infrequent). Not a big issue, but if it is easy to preserve comments with (NOTE: If we are concerned about the bundle size, we should minify the script and provide sourcemaps for debugging. This is being tracked in #27490 btw.) |
Updates Angular and the dev-infra package to the latest version/build.
…nctions Updates the symbol extractor to support IIFE bundles using arrow-functions instead of function declarations. This is in preparation for running symbol extraction tests with the overhauled optimization pipeline for Angular v13, relying on ESBuild internally. Also removes rollup-specific code that does not seem to be relevant anymore / rollup will be replaced anyway.
…y rule Adds the postinstall script as runfile for the `yarn_install` repository rule, so that the dependencies are re-fetched when the script changes.
…es in dev-infra We are in an inconvenient situation where the ng-dev package might rely on packages from the Angular framework repository. Given that we install this package in the framework repository, we need to update some references through a postinstall. This commit updates the patches to account for the latest changes in the dev-infra package/repository.
The `ng_rollup_bundle` rule has been replaced with a new rule called `app_bundle`. This rule replicates the Angular v13 optimization pipeline in the CLI, so that we can get better benchmarking results. Also the rule is much simpler to maintain as it relies on ESbuild. The old `ng_rollup_bundle` rule did rely on e.g. build-optimizer that no longer has an effect on v13 Angular packages, so technically size tests/symbol tests were no longer as correct as they were before. This commit fixes that. A couple of different changes and their explanation: * Language-service will no longer use the benchmark rule for creating its NPM bundles! It will use plain `rollup_bundle`. ESBuild would have been nice but the language-service relies on AMD that ESBuild cannot generate (yet?) * Service-worker ngsw-worker.js file was generated using the benchmark bundle rule. This is wrong. We will use a simple ESbuild rule in the future. The output is more predictable that way, and we can have a clear use of the benchmark bundle rule.. * A couple of benchmarks in `modules/` had to be updated to use e.g. `initTableUtils` calls. This is done because with the new rule, all files except for the entry-point are considered side-effect free. The utilities for benchmarks relied on side-effects in some transitively-loaded file (bad practice anyway IMO). We are now initializing the utilities using a proper init function that is exported...
The ng-dev release config changed its release configuration in order to support experimental packages. This commit updates the FW release config to work with the new config signature of ng-dev. All of our peackages are non-experimental, so we do not specify an explicit `experimental` property.
Updates the size goldens to the reflect the latest CLI devkit updates.
59190c2
to
127dafd
Compare
Addressed all feedback, and switched the worker target to |
You can preview 127dafd at https://pr44490-127dafd.ngbuilds.io/. |
This PR was merged into the repository by commit 3a29c57. |
Updates Angular and the dev-infra package to the latest version/build. PR Close #44490
…nctions (#44490) Updates the symbol extractor to support IIFE bundles using arrow-functions instead of function declarations. This is in preparation for running symbol extraction tests with the overhauled optimization pipeline for Angular v13, relying on ESBuild internally. Also removes rollup-specific code that does not seem to be relevant anymore / rollup will be replaced anyway. PR Close #44490
…es in dev-infra (#44490) We are in an inconvenient situation where the ng-dev package might rely on packages from the Angular framework repository. Given that we install this package in the framework repository, we need to update some references through a postinstall. This commit updates the patches to account for the latest changes in the dev-infra package/repository. PR Close #44490
…44490) The `ng_rollup_bundle` rule has been replaced with a new rule called `app_bundle`. This rule replicates the Angular v13 optimization pipeline in the CLI, so that we can get better benchmarking results. Also the rule is much simpler to maintain as it relies on ESbuild. The old `ng_rollup_bundle` rule did rely on e.g. build-optimizer that no longer has an effect on v13 Angular packages, so technically size tests/symbol tests were no longer as correct as they were before. This commit fixes that. A couple of different changes and their explanation: * Language-service will no longer use the benchmark rule for creating its NPM bundles! It will use plain `rollup_bundle`. ESBuild would have been nice but the language-service relies on AMD that ESBuild cannot generate (yet?) * Service-worker ngsw-worker.js file was generated using the benchmark bundle rule. This is wrong. We will use a simple ESbuild rule in the future. The output is more predictable that way, and we can have a clear use of the benchmark bundle rule.. * A couple of benchmarks in `modules/` had to be updated to use e.g. `initTableUtils` calls. This is done because with the new rule, all files except for the entry-point are considered side-effect free. The utilities for benchmarks relied on side-effects in some transitively-loaded file (bad practice anyway IMO). We are now initializing the utilities using a proper init function that is exported... PR Close #44490
…44490) The ng-dev release config changed its release configuration in order to support experimental packages. This commit updates the FW release config to work with the new config signature of ng-dev. All of our peackages are non-experimental, so we do not specify an explicit `experimental` property. PR Close #44490
Updates the size goldens to the reflect the latest CLI devkit updates. PR Close #44490
…nctions (#44490) Updates the symbol extractor to support IIFE bundles using arrow-functions instead of function declarations. This is in preparation for running symbol extraction tests with the overhauled optimization pipeline for Angular v13, relying on ESBuild internally. Also removes rollup-specific code that does not seem to be relevant anymore / rollup will be replaced anyway. PR Close #44490
…es in dev-infra (#44490) We are in an inconvenient situation where the ng-dev package might rely on packages from the Angular framework repository. Given that we install this package in the framework repository, we need to update some references through a postinstall. This commit updates the patches to account for the latest changes in the dev-infra package/repository. PR Close #44490
…44490) The `ng_rollup_bundle` rule has been replaced with a new rule called `app_bundle`. This rule replicates the Angular v13 optimization pipeline in the CLI, so that we can get better benchmarking results. Also the rule is much simpler to maintain as it relies on ESbuild. The old `ng_rollup_bundle` rule did rely on e.g. build-optimizer that no longer has an effect on v13 Angular packages, so technically size tests/symbol tests were no longer as correct as they were before. This commit fixes that. A couple of different changes and their explanation: * Language-service will no longer use the benchmark rule for creating its NPM bundles! It will use plain `rollup_bundle`. ESBuild would have been nice but the language-service relies on AMD that ESBuild cannot generate (yet?) * Service-worker ngsw-worker.js file was generated using the benchmark bundle rule. This is wrong. We will use a simple ESbuild rule in the future. The output is more predictable that way, and we can have a clear use of the benchmark bundle rule.. * A couple of benchmarks in `modules/` had to be updated to use e.g. `initTableUtils` calls. This is done because with the new rule, all files except for the entry-point are considered side-effect free. The utilities for benchmarks relied on side-effects in some transitively-loaded file (bad practice anyway IMO). We are now initializing the utilities using a proper init function that is exported... PR Close #44490
…44490) The ng-dev release config changed its release configuration in order to support experimental packages. This commit updates the FW release config to work with the new config signature of ng-dev. All of our peackages are non-experimental, so we do not specify an explicit `experimental` property. PR Close #44490
Updates the size goldens to the reflect the latest CLI devkit updates. PR Close #44490
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. |
See individual commits