-
Notifications
You must be signed in to change notification settings - Fork 11.9k
build: migrate build_angular to ts_project #29189
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
Merged
Merged
Conversation
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
clydin
reviewed
Dec 19, 2024
packages/angular_devkit/build_angular/src/builders/browser/tests/options/named-chunks_spec.ts
Outdated
Show resolved
Hide resolved
Currently the interop resulting target of a `ts_project` ends up not necessarily working at runtime. This may be the case because a consuming Node program may end up with mixes of `node_modules` dependencies from `rules_nodejs` (old) and `rules_js` (new). This sounds fine at first glance, but in practice can break very subtly because: * Rules NodeJS leverages the linker, creating `node_module` directories outside of Bazel, at runtime. These don't depend on symlink resolving. * Rules JS puts real node module folders via Bazel actions. These rely on `pnpm` non-hoisting layout, and symlink resolving. As we can see there is a hard conflict with symlinks. They need to be enabled with the new toolchain, but the other one doesn't enable symlink resolution, and enabling is not possible as we'd otherwise risk escaping the sandbox and cause even more subtle errors. A good compromise solution is to automatically drop the `rules_js` node module files/folder in the interop-`rules_nodejs` target and instead brining in the equivalent `@npm//` dependencies from `rules_nodejs`. This kind of keeps the logic similar to when not using `rules_js` or the interop, and enables the simplest & safest mental model; and it works compared to other solutions I tried with symlinking. Notably, we can't keep both node module variants as the linker doesn't override existing node module files from e.g. rules_js then (and would break then).
This commit updates `build_angular` to the `rules_js` ts_project rule. Notably a few real type issues surfaced but previously didn't surface due to some unknown resolution issues that resulted in `never` types; where every possible value was assignable; so this change improves type safety and a TODO was left for the "brittle code fragment".
This reverts commit 3af88fe. No longer needed because the interop lays out the node modules directory like without the interop & `ts_project` migration; so the chunk name changed back to what it was before. Good news.
josephperrott
approved these changes
Dec 19, 2024
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
clydin
approved these changes
Dec 19, 2024
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. |
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
area: build & ci
Related the build and CI infrastructure of the project
target: minor
This PR is targeted for the next minor release
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.
See individual commits