Skip to content

Commit

Permalink
feat: update TypeScript to 5.3-rc (#7923)
Browse files Browse the repository at this point in the history
* feat: update TypeScript to 5.3-rc

* Add 5.3.0-beta ||

* yarn.lock too

* Revert "Went back to 5.3.0-beta"

This reverts commit a2bef1d.

* Use 5.4.0-dev.20231117

* Revert warnAboutTSVersion range

* Aha, checksum now updates
  • Loading branch information
JoshuaKGoldberg committed Nov 19, 2023
1 parent 5dbf622 commit 9034d17
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts
index d785077fd9e4eb5959c0badb857358fad09d4d3f..54f71344b098e8d46acd8dd77638c60d505bb996 100644
index 5ee1d5258cb019bddb259c7d31b1ae0156a98f0c..fc5f4d2a757a9fef92b2135148c22bb0cc81b2c1 100644
--- a/lib/typescript.d.ts
+++ b/lib/typescript.d.ts
@@ -4491,8 +4491,8 @@ declare namespace ts {
Expand Down Expand Up @@ -54,7 +54,7 @@ index d785077fd9e4eb5959c0badb857358fad09d4d3f..54f71344b098e8d46acd8dd77638c60d
}
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer {
readonly kind: SyntaxKind.ConstructorType;
@@ -8978,7 +8992,13 @@ declare namespace ts {
@@ -8991,7 +9005,13 @@ declare namespace ts {
function symbolName(symbol: Symbol): string;
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined;
function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined;
Expand All @@ -68,7 +68,7 @@ index d785077fd9e4eb5959c0badb857358fad09d4d3f..54f71344b098e8d46acd8dd77638c60d
function getModifiers(node: HasModifiers): readonly Modifier[] | undefined;
/**
* Gets the JSDoc parameter tags for the node if present.
@@ -9508,7 +9528,13 @@ declare namespace ts {
@@ -9521,7 +9541,13 @@ declare namespace ts {
function isModuleName(node: Node): node is ModuleName;
function isBinaryOperatorToken(node: Node): node is BinaryOperatorToken;
function setTextRange<T extends TextRange>(range: T, location: TextRange | undefined): T;
Expand Down
84 changes: 84 additions & 0 deletions .yarn/patches/typescript-npm-5.4.0-dev.20231117-78a04a34c5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts
index 7135bb786332478763097e4fa2274ac0222ecbb2..446baab7b0d29f1e88842f97f58d343b816c8df0 100644
--- a/lib/typescript.d.ts
+++ b/lib/typescript.d.ts
@@ -4493,8 +4493,8 @@ declare namespace ts {
JSDocFunctionType = 324,
JSDocVariadicType = 325,
JSDocNamepathType = 326,
+ /** @deprecated This was only added in 4.7 */
JSDoc = 327,
- /** @deprecated Use SyntaxKind.JSDoc */
JSDocComment = 327,
JSDocText = 328,
JSDocTypeLiteral = 329,
@@ -5068,6 +5068,8 @@ declare namespace ts {
readonly name: PropertyName;
readonly questionToken?: QuestionToken;
readonly type?: TypeNode;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly initializer?: Expression | undefined;
}
interface PropertyDeclaration extends ClassElement, JSDocContainer {
readonly kind: SyntaxKind.PropertyDeclaration;
@@ -5093,6 +5095,10 @@ declare namespace ts {
readonly parent: ObjectLiteralExpression;
readonly name: PropertyName;
readonly initializer: Expression;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly questionToken?: QuestionToken | undefined;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly exclamationToken?: ExclamationToken | undefined;
}
interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDocContainer {
readonly kind: SyntaxKind.ShorthandPropertyAssignment;
@@ -5100,6 +5106,12 @@ declare namespace ts {
readonly name: Identifier;
readonly equalsToken?: EqualsToken;
readonly objectAssignmentInitializer?: Expression;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly modifiers?: NodeArray<Modifier> | undefined;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly questionToken?: QuestionToken | undefined;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly exclamationToken?: ExclamationToken | undefined;
}
interface SpreadAssignment extends ObjectLiteralElement, JSDocContainer {
readonly kind: SyntaxKind.SpreadAssignment;
@@ -5224,6 +5236,8 @@ declare namespace ts {
}
interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer {
readonly kind: SyntaxKind.FunctionType;
+ /** @deprecated removed in 5.0 but we want to keep it for backwards compatibility checks! */
+ readonly modifiers?: NodeArray<Modifier> | undefined;
}
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer {
readonly kind: SyntaxKind.ConstructorType;
@@ -8995,7 +9009,13 @@ declare namespace ts {
function symbolName(symbol: Symbol): string;
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined;
function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined;
+ /**
+ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getDecorators from `@typescript-eslint/type-utils`.
+ */
function getDecorators(node: HasDecorators): readonly Decorator[] | undefined;
+ /**
+ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getModifiers from `@typescript-eslint/type-utils`.
+ */
function getModifiers(node: HasModifiers): readonly Modifier[] | undefined;
/**
* Gets the JSDoc parameter tags for the node if present.
@@ -9525,7 +9545,13 @@ declare namespace ts {
function isModuleName(node: Node): node is ModuleName;
function isBinaryOperatorToken(node: Node): node is BinaryOperatorToken;
function setTextRange<T extends TextRange>(range: T, location: TextRange | undefined): T;
+ /**
+ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getModifiers from `@typescript-eslint/type-utils`.
+ */
function canHaveModifiers(node: Node): node is HasModifiers;
+ /**
+ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getDecorators from `@typescript-eslint/type-utils`.
+ */
function canHaveDecorators(node: Node): node is HasDecorators;
/**
* Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes
7 changes: 3 additions & 4 deletions docs/maintenance/Dependency_Version_Upgrades.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,14 @@ We generally start the process of supporting a new TypeScript version just after
1. Once the TypeScript RC version is released, start merging PRs
- Whenever a PR is merged, change the respective heading's emoji from 🏗 to ✅
1. Create a PR with a title like `feat: update TypeScript to X.Y-rc` and the following changes:
- In the root `package.json`, add `|| X.Y.2-rc2` to the `dependency` on `typescript`
- In the root `package.json`, change the `devDependency` on `typescript` to `~X.Y.2-rc2`
- In the root `package.json`, add `|| X.Y.1-rc2` to the `devDependency` on `typescript`
- Change the `SUPPORTED_TYPESCRIPT_VERSIONS` constant's `<` version to the next version of TypeScript
- Change the `SUPPORTED_PRERELEASE_RANGES` constant to equal `['X.Y.2-rc']`
- Change the `SUPPORTED_PRERELEASE_RANGES` constant to equal `['X.Y.1-rc']`
- Rename and update `patches/typescript*` to the new TypeScript version
- Run `yarn generate-lib` to update `scope-manager`
1. Once all PRs needed for the RC update PR are merged, merge the RC update PR
1. Once TypeScript releases the stable X.Y version, create and merge a PR with a title like `chore: bump TypeScript from X.YRC to X.Y` and the following changes:
- In the root `package.json`, remove `|| X.Y.2-rc2` from the `dependency` on `typescript`, and bump its `<` version to the next version of TypeScript
- In the root `package.json`, remove `|| X.Y.1-rc2` from the `dependency` on `typescript`, and bump its `<` version to the next version of TypeScript
- In the root `package.json`, change the `devDependency` on `typescript` to `~X.Y.3`
- Rename and update `patches/typescript*` to the new TypeScript version
- Any other changes made necessary due to changes in TypeScript between the RC version and stable version
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"ts-node": "10.7.0",
"tslint": "^6.1.3",
"tsx": "^3.12.7",
"typescript": ">=4.3.5 <5.4.0"
"typescript": ">=4.3.5 <5.4.0 || 5.3.0-beta || 5.3.1-rc || 5.4.0-dev.20231117"
},
"resolutions": {
"@jest/create-cache-key-function": "^29",
Expand All @@ -141,7 +141,7 @@
"pretty-format": "^29",
"react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch",
"tsx": "^3.12.7",
"typescript": "patch:typescript@npm%3A5.3.0-beta#./.yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch"
"typescript": "patch:typescript@npm%3A5.4.0-dev.20231117#./.yarn/patches/typescript-npm-5.4.0-dev.20231117-78a04a34c5.patch"
},
"packageManager": "yarn@3.7.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const SUPPORTED_TYPESCRIPT_VERSIONS = '>=4.3.5 <5.3.0';
* The semver package will ignore prerelease ranges, and we don't want to explicitly document every one
* List them all separately here, so we can automatically create the full string
*/
const SUPPORTED_PRERELEASE_RANGES: string[] = [];
const SUPPORTED_PRERELEASE_RANGES: string[] = ['5.3.1-rc'];
const ACTIVE_TYPESCRIPT_VERSION = ts.version;
const isRunningSupportedTypeScriptVersion = semver.satisfies(
ACTIVE_TYPESCRIPT_VERSION,
Expand Down
26 changes: 13 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6120,7 +6120,7 @@ __metadata:
ts-node: 10.7.0
tslint: ^6.1.3
tsx: ^3.12.7
typescript: ">=4.3.5 <5.4.0"
typescript: ">=4.3.5 <5.4.0 || 5.3.0-beta || 5.3.1-rc || 5.4.0-dev.20231117"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -20163,33 +20163,33 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:5.3.0-beta":
version: 5.3.0-beta
resolution: "typescript@npm:5.3.0-beta"
"typescript@npm:5.4.0-dev.20231117":
version: 5.4.0-dev.20231117
resolution: "typescript@npm:5.4.0-dev.20231117"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 12c5b05df8be536c3f5789323ca2e2f21ab6b7571bd21407b152c080be1dc8628c3cd9fb5fa342a304a266f5ad22827f3a27b7961da1600d27890be93f3e2d73
checksum: c538a15c3c528275591f40a0d3db191be6410d0da91fa24bd78376b0b674721382ae80f30f1625f565d41c755fab4659e8c6af5072a695401ff6cfb849b3e06e
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A5.3.0-beta#./.yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch::locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A.":
version: 5.3.0-beta
resolution: "typescript@patch:typescript@npm%3A5.3.0-beta#./.yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch::version=5.3.0-beta&hash=aba397&locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A."
"typescript@patch:typescript@npm%3A5.4.0-dev.20231117#./.yarn/patches/typescript-npm-5.4.0-dev.20231117-78a04a34c5.patch::locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A.":
version: 5.4.0-dev.20231117
resolution: "typescript@patch:typescript@npm%3A5.4.0-dev.20231117#./.yarn/patches/typescript-npm-5.4.0-dev.20231117-78a04a34c5.patch::version=5.4.0-dev.20231117&hash=f57760&locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A."
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 85a8cc0ce7b9d4243db899dbf77632d63cf32818cfc076f27e929f1b89c062c2a94f5fa2f0a72e9fc315164532aac1580c9cad5b453f4a4aed464557593c8168
checksum: eb20effe30527f1a08981f985cd002519d52a5314cd4feca5e145987bea8ac09e023b95c5d82fddb12bedc8401255209ec6e076a48aab6519dbcafce60f5f219
languageName: node
linkType: hard

"typescript@patch:typescript@patch%3Atypescript@npm%253A5.3.0-beta%23./.yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch%3A%3Alocator=%2540typescript-eslint%252Ftypescript-eslint%2540workspace%253A.#~builtin<compat/typescript>":
version: 5.3.0-beta
resolution: "typescript@patch:typescript@patch%3Atypescript@npm%253A5.3.0-beta%23./.yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch%3A%3Aversion=5.3.0-beta&hash=aba397&locator=%2540typescript-eslint%252Ftypescript-eslint%2540workspace%253A.#~builtin<compat/typescript>::version=5.3.0-beta&hash=29ae49"
"typescript@patch:typescript@patch%3Atypescript@npm%253A5.4.0-dev.20231117%23./.yarn/patches/typescript-npm-5.4.0-dev.20231117-78a04a34c5.patch%3A%3Alocator=%2540typescript-eslint%252Ftypescript-eslint%2540workspace%253A.#~builtin<compat/typescript>":
version: 5.4.0-dev.20231117
resolution: "typescript@patch:typescript@patch%3Atypescript@npm%253A5.4.0-dev.20231117%23./.yarn/patches/typescript-npm-5.4.0-dev.20231117-78a04a34c5.patch%3A%3Aversion=5.4.0-dev.20231117&hash=f57760&locator=%2540typescript-eslint%252Ftypescript-eslint%2540workspace%253A.#~builtin<compat/typescript>::version=5.4.0-dev.20231117&hash=e012d7"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: d1ed47d2a7f35e4692c439bca41f0622be732f33927e59afe4af9c6640219a2f1cc7c4622852787a96c5300f2b88fb06bb46b5125ae8db2c080b0fad2f12ae98
checksum: 923f407da16df26c7810244c3455cc88e1d9db20067fbac7f988f484fea6239f89da9d41ae5ebbf7e0b86e096c4d809cb4b0732c6d40a634cb0fdbefd210bc18
languageName: node
linkType: hard

Expand Down

0 comments on commit 9034d17

Please sign in to comment.