Skip to content

build: fix adev first party linking and re-enable tests - #60825

Closed
devversion wants to merge 2 commits into
angular:mainfrom
devversion:fix-first-party-linking
Closed

devversion wants to merge 2 commits into
angular:mainfrom
devversion:fix-first-party-linking

Conversation

@devversion

@devversion devversion commented Apr 10, 2025 •

Copy link
Copy Markdown
Member

Follow-up to #55282

This commit attempts to finally fix the long-standing first-party package linking issue with the rather tricky rules_nodejs toolchain.

I've verified that no version of e.g. @angular/core ends up in the Bazel sandbox. This is achieved by also filtering transitive Angular deps for first-party linked packages. e.g. @angular/docs.

In addition, @angular/docs accidentally ended up bundling parts of Angular core because it relied on an entry-point that was not part of the "well known externals". As part of the ongoing ng_package update/rewrite, we should look into disabling bundling of ANY external dependency/module. This is possible because we use relative imports inside APF packages as of recently!

This commit should allow us to develop and continue new compiler features, without having to temporarily (or longer) disable all angular.dev unit tests!

@angular-robot angular-robot Bot added the area: build & ci Related the build and CI infrastructure of the project label Apr 10, 2025
@ngbot ngbot Bot added this to the Backlog milestone Apr 10, 2025
@devversion devversion added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Apr 10, 2025
Comment thread .github/workflows/ci.yml Resolved
This commit attempts to finally fix the long-standing first-party
package linking issue with the rather tricky `rules_nodejs` toolchain.

I've verified that no version of e.g. `@angular/core` ends up in the
Bazel sandbox. This is achieved by also filtering transitive Angular
deps for first-party linked packages. e.g. `@angular/docs`.

In addition, `@angular/docs` accidentally ended up bundling parts of
Angular core because it relied on an entry-point that was not part of
the "well known externals". As part of the ongoing `ng_package`
update/rewrite, we should look into disabling bundling of ANY external
dependency/module. This is possible because we use relative imports
inside APF packages as of recently!

This commit should allow us to develop and continue new compiler
features, without having to temporarily (or longer) disable all
`angular.dev` unit tests!

Fixes angular#54858.
@devversion
devversion force-pushed the fix-first-party-linking branch from 5931dee to 96b99f5 Compare April 10, 2025 11:15

@josephperrott josephperrott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker adev: preview and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 10, 2025

@alan-agius4 alan-agius4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@github-actions

github-actions Bot commented Apr 10, 2025 •

Copy link
Copy Markdown

Deployed adev-preview for 2f623b4 to: https://ng-dev-previews-fw--pr-angular-angular-60825-adev-prev-zoohhc53.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

@JeanMeche JeanMeche added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Apr 10, 2025
@devversion devversion added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Apr 10, 2025
@devversion devversion removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Apr 10, 2025
…hunks

Since APF can contain shared chunks, where e.g. `eetemplate` lives, the
`coreHasSymbol` check is no longer reliable. Right now it even prevents
the version range check (that is reliably working) from running because
we detect a `index.d.ts` file but simply don't find the requested
symbol in there (we don't expand exports via type checker).
@devversion
devversion force-pushed the fix-first-party-linking branch from 320259e to 2f623b4 Compare April 10, 2025 13:08

@alan-agius4 alan-agius4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@devversion

Copy link
Copy Markdown
Member Author

This PR was merged into the repository by commit abe9691.

The changes were merged into the following branches: main

devversion added a commit that referenced this pull request Apr 10, 2025
…hunks (#60825)

Since APF can contain shared chunks, where e.g. `eetemplate` lives, the
`coreHasSymbol` check is no longer reliable. Right now it even prevents
the version range check (that is reliably working) from running because
we detect a `index.d.ts` file but simply don't find the requested
symbol in there (we don't expand exports via type checker).

PR Close #60825
@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 May 11, 2025
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 adev: preview area: build & ci Related the build and CI infrastructure of the project target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants