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

build: properly compile tests in core with Angular compiler #60268

Closed
wants to merge 1 commit into from

Conversation

devversion
Copy link
Member

Previously we never could use relative imports to import e.g. Component in e.g. the core/tests/bundling folder. This was necessary because otherwise the Angular compiler wouldn't process those files as it wouldn't recognize the Angular decorator as the one from @angular/core.

Notably this still isn't a large issue because relative imports still work for most core tests, that are JIT compiled!

For bundling tests though, or some smaller targets, our new upcoming guidelines for using relative imports inside the full package; fall apart. This commit unblocks this effort and allows us to use relative imports in all tests of packages/core. This is achieved by leveraging the existing isCore functionality of the compiler, and fixing a few instances that were missing before.

@devversion devversion requested a review from crisbeto March 7, 2025 11:32
@angular-robot angular-robot bot added the area: build & ci Related the build and CI infrastructure of the project label Mar 7, 2025
@ngbot ngbot bot added this to the Backlog milestone Mar 7, 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 Mar 7, 2025
@devversion devversion marked this pull request as ready for review March 7, 2025 11:33
Previously we never could use relative imports to import e.g. `Component`
in e.g. the `core/tests/bundling` folder. This was necessary because otherwise the
Angular compiler wouldn't process those files as it wouldn't recognize
the Angular decorator as the one from `@angular/core`.

Notably this still isn't a large issue because relative imports still
work for most core tests, that are JIT compiled!

For bundling tests though, or some smaller targets, our new upcoming
guidelines for using relative imports inside the full package; fall
apart. This commit unblocks this effort and allows us to use relative
imports in all tests of `packages/core`. This is achieved by leveraging
the existing `isCore` functionality of the compiler, and fixing a few
instances that were missing before.
@devversion devversion force-pushed the compile-core-tests branch from 1d40f8c to 06a41ac Compare March 7, 2025 11:52
@devversion devversion added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 7, 2025
@AndrewKushnir
Copy link
Contributor

This PR was merged into the repository by commit a02e270.

The changes were merged into the following branches: main, 19.2.x

AndrewKushnir pushed a commit that referenced this pull request Mar 7, 2025
Previously we never could use relative imports to import e.g. `Component`
in e.g. the `core/tests/bundling` folder. This was necessary because otherwise the
Angular compiler wouldn't process those files as it wouldn't recognize
the Angular decorator as the one from `@angular/core`.

Notably this still isn't a large issue because relative imports still
work for most core tests, that are JIT compiled!

For bundling tests though, or some smaller targets, our new upcoming
guidelines for using relative imports inside the full package; fall
apart. This commit unblocks this effort and allows us to use relative
imports in all tests of `packages/core`. This is achieved by leveraging
the existing `isCore` functionality of the compiler, and fixing a few
instances that were missing before.

PR Close #60268
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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: 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