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 FW-741: //packages/bazel/test/ngc-wrapped/... tests #27470
Conversation
You can preview 31c0000 at https://pr27470-31c0000.ngbuilds.io/. |
You can preview 838ba97 at https://pr27470-838ba97.ngbuilds.io/. |
You can preview 36510e9 at https://pr27470-36510e9.ngbuilds.io/. |
Previously the ngfactory shim generator in ngtsc would always write two imports in the factory file shims: 1) an import to @angular/core 2) an import to the base file If the base file has no exports, import #2 would be empty. This turns out to cause issues downstream. This commit changes the generated shim so if there are no exports in the base file, the generated shim is empty too.
The method `ts.CompilerHost.directoryExists` is optional, and was not previously handled by our ts.CompilerHost wrapper for factory and summary shims (GeneratedShimsHostWrapper). TypeScript checks for the existence of this method and silently ignores things like typeRoots if it's not found. This commit adds proper handling of directoryExists() to the shim. A test is also added which verifies typeRoots behavior works when shims are enabled.
This commit allows //packages/bazel/test/ngc-wrapped/... tests to run under Ivy mode. To get them to pass, it addresses a problem with the way the tests are configured: both test targets have sloppy .d.ts dependencies configured, leading to many type errors being generated in TypeScript for the .d.ts files. Due to the way ngc directs TypeScript emit, it avoids type-checking .d.ts files and thus this issue does not surface. ngtsc does a whole- program emit which results in full .d.ts type-checking by default, catching this configuration issue. To fix this, skipLibCheck is added to the tsconfig.jsons for these tests, which tells TypeScript to skip type-checking of the .d.ts files, avoiding this problem in a similar way to ngc.
I've rebased and force-pushed this pr |
You can preview 99182d8 at https://pr27470-99182d8.ngbuilds.io/. |
…27470) The method `ts.CompilerHost.directoryExists` is optional, and was not previously handled by our ts.CompilerHost wrapper for factory and summary shims (GeneratedShimsHostWrapper). TypeScript checks for the existence of this method and silently ignores things like typeRoots if it's not found. This commit adds proper handling of directoryExists() to the shim. A test is also added which verifies typeRoots behavior works when shims are enabled. PR Close #27470
…#27470) This commit allows //packages/bazel/test/ngc-wrapped/... tests to run under Ivy mode. To get them to pass, it addresses a problem with the way the tests are configured: both test targets have sloppy .d.ts dependencies configured, leading to many type errors being generated in TypeScript for the .d.ts files. Due to the way ngc directs TypeScript emit, it avoids type-checking .d.ts files and thus this issue does not surface. ngtsc does a whole- program emit which results in full .d.ts type-checking by default, catching this configuration issue. To fix this, skipLibCheck is added to the tsconfig.jsons for these tests, which tells TypeScript to skip type-checking of the .d.ts files, avoiding this problem in a similar way to ngc. PR Close #27470
Previously the ngfactory shim generator in ngtsc would always write two imports in the factory file shims: 1) an import to @angular/core 2) an import to the base file If the base file has no exports, import angular#2 would be empty. This turns out to cause issues downstream. This commit changes the generated shim so if there are no exports in the base file, the generated shim is empty too. PR Close angular#27470
…ngular#27470) The method `ts.CompilerHost.directoryExists` is optional, and was not previously handled by our ts.CompilerHost wrapper for factory and summary shims (GeneratedShimsHostWrapper). TypeScript checks for the existence of this method and silently ignores things like typeRoots if it's not found. This commit adds proper handling of directoryExists() to the shim. A test is also added which verifies typeRoots behavior works when shims are enabled. PR Close angular#27470
…angular#27470) This commit allows //packages/bazel/test/ngc-wrapped/... tests to run under Ivy mode. To get them to pass, it addresses a problem with the way the tests are configured: both test targets have sloppy .d.ts dependencies configured, leading to many type errors being generated in TypeScript for the .d.ts files. Due to the way ngc directs TypeScript emit, it avoids type-checking .d.ts files and thus this issue does not surface. ngtsc does a whole- program emit which results in full .d.ts type-checking by default, catching this configuration issue. To fix this, skipLibCheck is added to the tsconfig.jsons for these tests, which tells TypeScript to skip type-checking of the .d.ts files, avoiding this problem in a similar way to ngc. PR Close angular#27470
Previously the ngfactory shim generator in ngtsc would always write two imports in the factory file shims: 1) an import to @angular/core 2) an import to the base file If the base file has no exports, import angular#2 would be empty. This turns out to cause issues downstream. This commit changes the generated shim so if there are no exports in the base file, the generated shim is empty too. PR Close angular#27470
…ngular#27470) The method `ts.CompilerHost.directoryExists` is optional, and was not previously handled by our ts.CompilerHost wrapper for factory and summary shims (GeneratedShimsHostWrapper). TypeScript checks for the existence of this method and silently ignores things like typeRoots if it's not found. This commit adds proper handling of directoryExists() to the shim. A test is also added which verifies typeRoots behavior works when shims are enabled. PR Close angular#27470
…angular#27470) This commit allows //packages/bazel/test/ngc-wrapped/... tests to run under Ivy mode. To get them to pass, it addresses a problem with the way the tests are configured: both test targets have sloppy .d.ts dependencies configured, leading to many type errors being generated in TypeScript for the .d.ts files. Due to the way ngc directs TypeScript emit, it avoids type-checking .d.ts files and thus this issue does not surface. ngtsc does a whole- program emit which results in full .d.ts type-checking by default, catching this configuration issue. To fix this, skipLibCheck is added to the tsconfig.jsons for these tests, which tells TypeScript to skip type-checking of the .d.ts files, avoiding this problem in a similar way to ngc. PR Close angular#27470
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. |
No description provided.