fix(compiler-cli): support relative imports to symbols outside rootDir#60555
Closed
devversion wants to merge 1 commit intoangular:mainfrom
Closed
fix(compiler-cli): support relative imports to symbols outside rootDir#60555devversion wants to merge 1 commit intoangular:mainfrom
rootDir#60555devversion wants to merge 1 commit intoangular:mainfrom
Conversation
By default, the compiler-cli uses the relative import strategy when there is no `rootDir` or `rootDirs`. This is expected as everything is assumed to be somehow reachable through relative imports. With `rootDirs` that allow for a "virtual file system"-like environment, the compiler is not necessarily able to always construct proper relative imports. The compiler includes the `LogicalProjectStrategy` for this reason. This strategy is able to respect `rootDirs` to construct relative paths when possible. This logic currently accidentally triggers when there is a `rootDir` set. This option is not to be confused with the virtual directory option called `rootDirs`. The compiler currently confuses this and accidentally enters this mode when there is just a `rootDir`— breaking in monorepos that imports can point outside the `rootDir` to e.g. other compilation unit's `.d.ts` (which is valid; just not `.ts` sources can live outside the root dir). This is necessary for our Bazel toolchain migration.
alxhub
approved these changes
Mar 25, 2025
This comment was marked as outdated.
This comment was marked as outdated.
Member
Author
|
Caretaker note: PR is green; it just seems to be stuck with the mergeability status |
Member
|
This PR was merged into the repository by commit 9f18c7c. The changes were merged into the following branches: main, 19.2.x |
alxhub
pushed a commit
that referenced
this pull request
Mar 27, 2025
…ir` (#60555) By default, the compiler-cli uses the relative import strategy when there is no `rootDir` or `rootDirs`. This is expected as everything is assumed to be somehow reachable through relative imports. With `rootDirs` that allow for a "virtual file system"-like environment, the compiler is not necessarily able to always construct proper relative imports. The compiler includes the `LogicalProjectStrategy` for this reason. This strategy is able to respect `rootDirs` to construct relative paths when possible. This logic currently accidentally triggers when there is a `rootDir` set. This option is not to be confused with the virtual directory option called `rootDirs`. The compiler currently confuses this and accidentally enters this mode when there is just a `rootDir`— breaking in monorepos that imports can point outside the `rootDir` to e.g. other compilation unit's `.d.ts` (which is valid; just not `.ts` sources can live outside the root dir). This is necessary for our Bazel toolchain migration. PR Close #60555
crisbeto
added a commit
to crisbeto/material2
that referenced
this pull request
Apr 5, 2025
Updates the repo to the Angular 20.0.0-next.5 version which we need so we can move the `DOCUMENT` imports from `common` to `core`, and it allows us to remove a build patch because it includes angular/angular#60555
crisbeto
added a commit
to crisbeto/material2
that referenced
this pull request
Apr 5, 2025
Updates the repo to the Angular 20.0.0-next.5 version which we need so we can move the `DOCUMENT` imports from `common` to `core`, and it allows us to remove a build patch because it includes angular/angular#60555
crisbeto
added a commit
to crisbeto/material2
that referenced
this pull request
Apr 5, 2025
Updates the repo to the Angular 20.0.0-next.5 version which we need so we can move the `DOCUMENT` imports from `common` to `core`, and it allows us to remove a build patch because it includes angular/angular#60555
crisbeto
added a commit
to crisbeto/material2
that referenced
this pull request
Apr 7, 2025
Updates the repo to the Angular 20.0.0-next.5 version which we need so we can move the `DOCUMENT` imports from `common` to `core`, and it allows us to remove a build patch because it includes angular/angular#60555
crisbeto
added a commit
to angular/components
that referenced
this pull request
Apr 7, 2025
Updates the repo to the Angular 20.0.0-next.5 version which we need so we can move the `DOCUMENT` imports from `common` to `core`, and it allows us to remove a build patch because it includes angular/angular#60555
mistrykaran91
pushed a commit
to mistrykaran91/components
that referenced
this pull request
Apr 8, 2025
Updates the repo to the Angular 20.0.0-next.5 version which we need so we can move the `DOCUMENT` imports from `common` to `core`, and it allows us to remove a build patch because it includes angular/angular#60555
|
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.
By default, the compiler-cli uses the relative import strategy when there is no
rootDirorrootDirs. This is expected as everything is assumed to be somehow reachable through relative imports.With
rootDirsthat allow for a "virtual file system"-like environment, the compiler is not necessarily able to always construct proper relative imports. The compiler includes theLogicalProjectStrategyfor this reason. This strategy is able to respectrootDirsto construct relative paths when possible.This logic currently accidentally triggers when there is a
rootDirset. This option is not to be confused with the virtual directory option calledrootDirs. The compiler currently confuses this and accidentally enters this mode when there is just arootDir— breaking in monorepos that imports can point outside therootDirto e.g. other compilation unit's.d.ts(which is valid; just not.tssources can live outside the root dir).This is necessary for our Bazel toolchain migration.