-
Notifications
You must be signed in to change notification settings - Fork 26.2k
fix(compiler-cli): support relative imports to symbols outside rootDir
#60555
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
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.
This comment was marked as outdated.
This comment was marked as outdated.
Caretaker note: PR is green; it just seems to be stuck with the mergeability status |
This PR was merged into the repository by commit 9f18c7c. The changes were merged into the following branches: main, 19.2.x |
…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
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
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
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
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
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
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. |
By default, the compiler-cli uses the relative import strategy when there is no
rootDir
orrootDirs
. 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 theLogicalProjectStrategy
for this reason. This strategy is able to respectrootDirs
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 calledrootDirs
. The compiler currently confuses this and accidentally enters this mode when there is just arootDir
— breaking in monorepos that imports can point outside therootDir
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.