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
fix(compiler-cli): ensure LogicalFileSystem maintains case in paths #37008
fix(compiler-cli): ensure LogicalFileSystem maintains case in paths #37008
Conversation
e1e1512
to
ed12b52
Compare
e8a8656
to
6439b18
Compare
CI tests on Windows are passing for this PR: https://app.circleci.com/pipelines/github/angular/angular/14835/workflows/7f8b8352-63e9-4707-9da0-0b605ca91b3a |
@alxhub can you identify what failed in the presubmit? |
6439b18
to
fc4253a
Compare
The work to support case-sensitivity in the `FileSystem` went too far with the `LogicalFileSystem`, which is used to compute import paths that will be added to files processed by ngtsc and ngcc. Previously all logical paths were canonicalised, which meant that on case-insensitive file-systems, the paths were all set to lower case. This resulted in incorrect imports being added to files. For example: ``` import { Apollo } from './Apollo'; import { SelectPipe } from './SelectPipe'; import * as ɵngcc0 from '@angular/core'; import * as ɵngcc1 from './selectpipe'; ``` The import from `./SelectPipe` is from the original file, while the import from `./selectpipe` is added by ngcc. This causes the TypeScript compiler to complain, or worse for paths not to be matched correctly. Now, when computing logical paths, the original absolute paths are matched against rootDirs in a canonical manner, but the actual logical path that is returned maintains it original casing. Fixes angular#36992, angular#36993, angular#37000
fc4253a
to
3a49f9c
Compare
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. |
…ngular#37008) The work to support case-sensitivity in the `FileSystem` went too far with the `LogicalFileSystem`, which is used to compute import paths that will be added to files processed by ngtsc and ngcc. Previously all logical paths were canonicalised, which meant that on case-insensitive file-systems, the paths were all set to lower case. This resulted in incorrect imports being added to files. For example: ``` import { Apollo } from './Apollo'; import { SelectPipe } from './SelectPipe'; import * as ɵngcc0 from '@angular/core'; import * as ɵngcc1 from './selectpipe'; ``` The import from `./SelectPipe` is from the original file, while the import from `./selectpipe` is added by ngcc. This causes the TypeScript compiler to complain, or worse for paths not to be matched correctly. Now, when computing logical paths, the original absolute paths are matched against rootDirs in a canonical manner, but the actual logical path that is returned maintains it original casing. Fixes angular#36992, angular#36993, angular#37000 PR Close angular#37008
The work to support case-sensitivity in the
FileSystem
went too farwith the
LogicalFileSystem
, which is used to compute import pathsthat will be added to files processed by ngtsc and ngcc.
Previously all logical paths were canonicalised, which meant that on
case-insensitive file-systems, the paths were all set to lower case.
This resulted in incorrect imports being added to files. For example:
The import from
./SelectPipe
is from the original file, while theimport from
./selectpipe
is added by ngcc. This causes theTypeScript compiler to complain, or worse for paths not to be
matched correctly.
Now, when computing logical paths, the original absolute paths
are matched against rootDirs in a canonical manner, but the actual
logical path that is returned maintains it original casing.
Fixes #36992, #36993, #37000
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information