-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
feat(core): support TypeScript 5.5 #56096
Conversation
Currently some places import the `ts_library` from the node_modules while others import it from `defaults.bzl`. This causes a mismatch in the `target` that ends up being used and breaking angular/angular#56096. These changes switch the imports to go through `defaults.bzl`.
Currently some places import the `ts_library` from the node_modules while others import it from `defaults.bzl`. This causes a mismatch in the `target` that ends up being used and breaking angular/angular#56096. These changes switch the imports to go through `defaults.bzl`.
Currently the default `target` for the code compiled with `ts_library` is set through the `ts_library` exposed in `defaults.bzl`, however the code under the `bazel` directory isn't allowed to use `defaults.bzl` which meant that it was defaulting to es2015. These changes add a `defaults.bzl` specific to the `bazel` directory which allows us to maintain the defaults in a single place. This came up due to a breakage in angular/angular#56096.
Currently the default `target` for the code compiled with `ts_library` is set through the `ts_library` exposed in `defaults.bzl`, however the code under the `bazel` directory isn't allowed to use `defaults.bzl` which meant that it was defaulting to es2015. These changes add a `defaults.bzl` specific to the `bazel` directory which allows us to maintain the defaults in a single place. This came up due to a breakage in angular/angular#56096.
Currently the default `target` for the code compiled with `ts_library` is set through the `ts_library` exposed in `defaults.bzl`, however the code under the `bazel` directory isn't allowed to use `defaults.bzl` which meant that it was defaulting to es2015. These changes add a `defaults.bzl` specific to the `bazel` directory which allows us to maintain the defaults in a single place. This came up due to a breakage in angular/angular#56096.
Currently the default `target` for the code compiled with `ts_library` is set through the `ts_library` exposed in `defaults.bzl`, however the code under the `bazel` directory isn't allowed to use `defaults.bzl` which meant that it was defaulting to es2015. These changes add a `defaults.bzl` specific to the `bazel` directory which allows us to maintain the defaults in a single place. This came up due to a breakage in angular/angular#56096.
Currently the default `target` for the code compiled with `ts_library` is set through the `ts_library` exposed in `defaults.bzl`, however the code under the `bazel` directory isn't allowed to use `defaults.bzl` which meant that it was defaulting to es2015. These changes add a `defaults.bzl` specific to the `bazel` directory which allows us to maintain the defaults in a single place. This came up due to a breakage in angular/angular#56096.
4a8f2d4
to
9001876
Compare
// changing since TypeScript will `switchToScriptVersionCache` when a file is opened. | ||
// Note that this emulates what we have to do in the server/extension as well. | ||
// TODO: remove this once PR #41475 lands | ||
this.tsProject.markAsDirty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Context here is that the markAsDirty
method doesn't exist anymore and the TODO above mentioned that it should've been removed a long time ago.
@@ -3375,7 +3375,7 @@ runInEachFileSystem((os: string) => { | |||
|
|||
env.driveMain(); | |||
const jsContents = env.getContents('test.js'); | |||
expect(jsContents).toMatch(/function Test_Factory\(t\) { i0\.ɵɵinvalidFactory\(\)/ms); | |||
expect(jsContents).toMatch(/function Test_Factory\(t\) { i0\.ɵɵinvalidFactory\(\)/m); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The s
flag wasn't doing anything here so I removed it.
newText, | ||
{ | ||
// Not passing the implied Node format appears not break program reuse in TS 5.5. | ||
impliedNodeFormat: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one took a while to track down, but for some reason omitting the impliedNodeFormat
prevented the program from being reused. It showed up in our own unit tests as well.
@@ -83,6 +83,10 @@ export function typeToValue( | |||
return typeOnlyImport(typeNode, firstDecl); | |||
} | |||
|
|||
if (!ts.isImportDeclaration(firstDecl.parent)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary, because import clauses can now be inside ImportDeclaration
or JSDocImportTag
.
@@ -171,7 +171,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDE | |||
type: Directive, | |||
args: [{ | |||
standalone: true, | |||
selector: '[direct]', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trailing comma removal is adding a large amount to the diff for this PR. Is this something that is expected and can we fix that somehow? Keeping the trailing commas would better align with the formatting throughout the rest of the repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the sort of thing that TS changes once in a while for no reason. We might be able to get it back, but I'm not sure it's worth the hassle just for this one PR.
Updates the repo to add support for TypeScript 5.5. Includes resolving some compilation errors and broken tests.
This is still missing approvals for
|
This PR was merged into the repository by commit e5a6f91. |
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. |
Updates the repo to add support for TypeScript 5.5. Includes resolving some compilation errors and broken tests.