Skip to content

Commit

Permalink
chore: upgrade to TypeScript 5.2.2 (#55105)
Browse files Browse the repository at this point in the history
### What?

Upgrade TypeScript to the latest version as of this PR. **This does not affect users, as the change is only for our repository.**

### Why?

Part of some upcoming PRs to try to clean up cookie handling, now that `getSetCookie` is available. Since we use `undici`, which [implements it](nodejs/undici#1915), we can get rid of some code to rely more on the platform.

This PR is needed to get the types for `Headers#getSetCookie` which was added in 5.2

### How?

I needed to update some dependency types to get build to pass, but other than that, only needed to bump from `5.1.6` to `5.2.2`, so hopefully all is fine.
  • Loading branch information
balazsorban44 authored Sep 7, 2023
1 parent 18980a6 commit 068002b
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 91 deletions.
9 changes: 2 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,15 @@
],
// Disable Jest autoRun as otherwise it will start running all tests the first time.
"jest.autoRun": "off",

// Debugging.
"debug.javascript.unmapMissingSources": true,

"files.exclude": {
"**/node_modules": false,
"node_modules": true,
"*[!test]**/node_modules": true
},

// Ensure enough terminal history is preserved when running tests.
"terminal.integrated.scrollback": 10000,

// Configure todo-tree to exclude node_modules, dist, and compiled.
"todo-tree.filtering.excludeGlobs": [
"**/node_modules",
Expand All @@ -48,10 +44,8 @@
"[x]",
"TODO-APP"
],

// Disable TypeScript surveys.
"typescript.surveys.enabled": false,

// Enable file nesting for unit test files.
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
Expand Down Expand Up @@ -82,5 +76,6 @@
"language": "markdown",
"scheme": "file"
}
]
],
"typescript.tsdk": "node_modules/typescript/lib"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"@types/node-fetch": "2.6.1",
"@types/react": "18.2.8",
"@types/react-dom": "18.2.4",
"@types/relay-runtime": "13.0.0",
"@types/relay-runtime": "14.1.13",
"@types/selenium-webdriver": "4.0.15",
"@types/sharp": "0.29.3",
"@types/string-hash": "1.1.1",
Expand Down Expand Up @@ -226,7 +226,7 @@
"tree-kill": "1.2.2",
"tsec": "0.2.1",
"turbo": "1.10.9",
"typescript": "5.1.3",
"typescript": "5.2.2",
"unfetch": "4.2.0",
"wait-port": "0.2.2",
"webpack": "5.86.0",
Expand Down
7 changes: 1 addition & 6 deletions packages/next-swc/crates/next-core/js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,19 @@
"strict": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,

// interop constraints
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,

// js support
"allowJs": true,
"checkJs": false,

// environment
"jsx": "react-jsx",
"lib": ["ESNext", "DOM"],
"target": "esnext",

// modules
"baseUrl": ".",
"module": "esnext",
"module": "node16",
"moduleResolution": "node16",
"paths": {
"@vercel/turbopack-next/*": ["src/*"],
Expand All @@ -31,7 +27,6 @@
},
"resolveJsonModule": true,
"types": ["react/next"],

// emit
"noEmit": true,
"stripInternal": true
Expand Down
4 changes: 2 additions & 2 deletions packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
"@types/fresh": "0.5.0",
"@types/glob": "7.1.1",
"@types/jsonwebtoken": "9.0.0",
"@types/lodash": "4.14.149",
"@types/lodash": "4.14.198",
"@types/lodash.curry": "4.1.6",
"@types/lru-cache": "5.1.0",
"@types/micromatch": "4.0.2",
Expand Down Expand Up @@ -254,7 +254,7 @@
"lru-cache": "5.1.1",
"micromatch": "4.0.4",
"mini-css-extract-plugin": "2.4.3",
"msw": "^1.2.2",
"msw": "1.3.0",
"nanoid": "3.1.32",
"native-url": "0.3.4",
"neo-async": "2.6.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/compiled/debug/index.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion packages/next/src/server/web/spec-extension/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export class NextResponse<Body = unknown> extends Response {
body: JsonBody,
init?: ResponseInit
): NextResponse<JsonBody> {
// @ts-expect-error This is not in lib/dom right now, and we can't augment it.
const response: Response = Response.json(body, init)
return new NextResponse(response.body, response)
}
Expand Down
1 change: 1 addition & 0 deletions packages/react-dev-overlay/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"jsx": "react",
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"module": "Node16",
"moduleResolution": "Node16"
},
"include": ["src/**/*.ts", "src/**/*.tsx", "types/local.d.ts"],
Expand Down
Loading

0 comments on commit 068002b

Please sign in to comment.