[20.0.x]: Patch port of elements and compiler rules_js migration PR - #61769
Merged
Merged
Conversation
Migrates `packages/compiler` to `ts_project`.
Compiler now would have `.js` files. Those aren't picked up as ESM, unless we install the `package.json` with `type: module`. Sounds great on paper, but doesn't work in reality because the way the compiler packages are available to `api-gen/` is via the old `rules_nodejs` linker, so the `packages/package.json` wouldn't work; nor do the `package.json`s of the e.g. compiler-cli package work- because those already contain the `exports` of the built npm package. We fix this in a much more reasonable way, and the whole module resolution problem by leveraging the pnpm linking here. This works as expected.
Migrates `packages/elements` to `ng_project`.
See associated pull request for more information.
This is necessary to support later versions of e.g. `rules_ts`.
…er-cli Currently when linking the `@angular/compiler-cli` package, the peer dependency to `compiler` is not resolved and we are trying to make the compiler dependency available via `data`. This is unidiomatic and brittle. This commit fixes this.
The `app_bundle` rule does not work after the migration of `packages/compiler` to `ts_project` because the `.mjs` extensions are now missing in the non npm-package output. This causes runtime errors as `.js` is not recognized as ESM. Switching to the real npm package for usage, fixes this issue.
Since we are going to replace our `app_bundle` rule (custom ESBuild + Terser pipeline) with the real Angular CLI where shared/lazy/common chunks may exist, we need to update the symbol extractor to support multiple files. We could have just merged all symbols, but this commit tries to do better by detecting what symbols are loaded eagerly vs. lazily. This will be very useful for e.g. defer tests or other lazy features we are introducing in the feature.
Instead of dev-infra maintaining a custom ESBuild + Terser pipeline that tries to emulate the Angular CLI, we are switching the bundling core tests to a new rule that really leverages the Angular CLI. This involves some file renames and small adjustments. In addition, we leverage the updated symbol tracking rule to output new goldens that can work with multiple bundle files (as generated by the Angular CLI; especially with defer and its "lazy" chunks).
…on rule We are dropping the custom ESBuild and Terser pipeline from dev-infra and instead leverage the Angular CLI directly. This commit adjusts the benchmarks to use this new rule.
These are also excluded on CI, and shouldn't run locally either as they are "manual debug" targets.
devversion
marked this pull request as ready for review
May 30, 2025 07:31
crisbeto
approved these changes
May 30, 2025
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Patch port of #61566