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

Second iteration of rules_js migration #30648

Merged
merged 4 commits into from
Mar 19, 2025
Merged

Conversation

devversion
Copy link
Member

@devversion devversion commented Mar 18, 2025

See individual commits

@devversion devversion changed the title Rjs 2 Second iteration of rules_js migration Mar 18, 2025
@angular-robot angular-robot bot added the area: build & ci Related the build and CI infrastructure of the project label Mar 18, 2025
@devversion devversion force-pushed the rjs-2 branch 5 times, most recently from 0496438 to 4d7bd95 Compare March 19, 2025 14:01
For linking of Angular packages we are using something more clever than
what we are doing with `rules_nodejs`. Instead of maintaing complexity
where we pre-link FESM bundles and somehow inject them into other Bazel
bundling steps (with complex linker mappings), we pre-link as part of
individual package postinstall steps, exposing the linked bundles via a
NodeJS exports condition.

This is possible vis this package/script:
https://github.com/devversion/angular-linking

Clearly this is not at a good location, but it's necessary right now to
ship this code via npm because `rules_js` struggles to use pnpm
extensions onto workspace 1st-party packages. Long-term we can either
decide to keep it that way, move it into e.g. dev-infra repository, or
we can explore shipping pre-linked bundles via APF. TBD.
@devversion devversion added the target: patch This PR is targeted for the next patch release label Mar 19, 2025
@devversion devversion marked this pull request as ready for review March 19, 2025 15:49
@devversion devversion requested review from a team as code owners March 19, 2025 15:49
@devversion devversion requested review from andrewseguin and wagnermaciel and removed request for a team March 19, 2025 15:49
Migrates all `ts_library` targets in `tools/` to use the `rules_js`
`ts_project` rule.
Improves the `ts_project` interop to work with Esbuild bundling. Right
now we can end up with multiple copies of the same source file.

e.g. input might import from `@angular/cdk/testing` and end up with
the version of `rules_nodejs` linker, while other imports to the native
`ts_library` targets end up being mapped to their actual sources in the
`bazel-bin`, and not inside `node_modules`
Migrates more `ts_library` targets to `rules_js`
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

@devversion devversion merged commit 1c223d9 into angular:main Mar 19, 2025
19 checks passed
@devversion devversion deleted the rjs-2 branch March 19, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build & ci Related the build and CI infrastructure of the project target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants