chore: update typescript to v6#16661
Conversation
🦋 Changeset detectedLatest commit: 72e86c4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 422 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
47d2017 to
189e6a3
Compare
| typescript@5.9.3: | ||
| resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} | ||
| engines: {node: '>=14.17'} | ||
| hasBin: true | ||
|
|
||
| typescript@6.0.3: | ||
| resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} | ||
| engines: {node: '>=14.17'} | ||
| hasBin: true | ||
|
|
There was a problem hiding this comment.
Note the lock file. We have both TS v5 and v6 installed. We still have TS v5 because of dependents/node-precinct#154. It seems okay to have two TS versions installed for now.
| "module": "commonjs", | ||
| // TODO: when upgrading to TS 6, will need to be set to "bundler" | ||
| "moduleResolution": "node", | ||
| "moduleResolution": "bundler", |
| "module": "commonjs", | ||
| // TODO: when upgrading to TS 6, will need to be set to "bundler" | ||
| "moduleResolution": "node", | ||
| "moduleResolution": "bundler", |
There was a problem hiding this comment.
Can somehow explain why this change and why it's good?
There was a problem hiding this comment.
TLDR:
- We use
commonjsoutput for language tool packages. - In TS 5.x, to use
--module commonjs, you have to use--moduleResolution node(AKA--moduleResolution node10). - Since TS 6.x,
--moduleResolution nodeis deprecated and not allowed to be used anymore by default. - In TS 6.x, to use
--module commonjs, we need to use--moduleResolution bundler.
More to read:
|
I would like to have a changeset so that we can create a preview release. Since we're changing the output of the code, we need to make sure things are still working. Can you do that @ocavue ? We could remove it later if it's not needed, but it's needed to trigger a preview release |
Done |
|
@ematipico the astro/.github/workflows/preview-release.yml Lines 27 to 31 in 299f19c |
I tested it. Diff of Only 5 files differ, all in
Every other package is byte-identical. |
Co-authored-by: Emanuele Stoppa <estoppa@cloudflare.com>
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [astro](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/astro)) | [`6.3.3` → `6.3.5`](https://renovatebot.com/diffs/npm/astro/6.3.3/6.3.5) |  |  | --- ### Release Notes <details> <summary>withastro/astro (astro)</summary> ### [`v6.3.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#635) [Compare Source](https://github.com/withastro/astro/compare/astro@6.3.4...astro@6.3.5) ##### Patch Changes - [#​16771](withastro/astro#16771) [`07c8805`](withastro/astro@07c8805) Thanks [@​ematipico](https://github.com/ematipico)! - Fixes `position` prop on `<Image>` and `<Picture>` components breaking Content Security Policy (CSP). - [#​16593](withastro/astro#16593) [`50924ce`](withastro/astro@50924ce) Thanks [@​yanthomasdev](https://github.com/yanthomasdev)! - Improves error messages with more consistent and correct writing. - [#​16757](withastro/astro#16757) [`5d661cd`](withastro/astro@5d661cd) Thanks [@​astrobot-houston](https://github.com/astrobot-houston)! - Fixes dev server serving stale content when SSR-only modules change (e.g. `.astro` files outside the project root in a monorepo, or dynamically imported components). Previously, the `astro:hmr-reload` plugin returned an empty array after detecting SSR-only module changes, which prevented Vite's `updateModules` from propagating the invalidation to the SSR module runner. The runner's evaluated module cache stayed stale, so subsequent requests continued returning old content. Now the plugin returns the SSR-only modules so Vite can process them through `updateModules`, which properly invalidates the module runner's cache and ensures fresh content on the next request. ### [`v6.3.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#634) [Compare Source](https://github.com/withastro/astro/compare/astro@6.3.3...astro@6.3.4) ##### Patch Changes - [#​16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@​matthewp](https://github.com/matthewp)! - Adds `fetchFile` option to `experimental.advancedRouting` to customize or disable the entrypoint file ```js export default defineConfig({ experimental: { advancedRouting: { fetchFile: 'fetch.ts', }, }, }); ``` - [#​16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@​matthewp](https://github.com/matthewp)! - Fixes Hono `cache()` middleware to follow the standard wrapper pattern - [#​16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@​matthewp](https://github.com/matthewp)! - Adds `App.Providers` interface for typing custom context providers on `Astro` and `ctx` ```ts declare namespace App { interface Providers { oauth: import('./lib/oauth').OAuthSession; } } ``` - [#​16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@​matthewp](https://github.com/matthewp)! - Adds `FetchState.response` property, set automatically after `pages()` or `middleware()` completes ```ts const response = await middleware(state, (s) => pages(s)); console.log(state.response === response); // true ``` - [#​16723](withastro/astro#16723) [`0f10bfe`](withastro/astro@0f10bfe) Thanks [@​matthewp](https://github.com/matthewp)! - Adds `Fetchable` type export for typing the advanced routing entrypoint ```ts import type { Fetchable } from 'astro'; export default { async fetch(request) { return new Response('ok'); }, } satisfies Fetchable; ``` - [#​16572](withastro/astro#16572) [`4a5a077`](withastro/astro@4a5a077) Thanks [@​DORI2001](https://github.com/DORI2001)! - Suppresses `[WARN] Vite warning: unused imports from "@​astrojs/internal-helpers/remote"` during prerender builds. The package is now bundled alongside `astro` in the prerender environment, matching how it is handled in the SSR environment. - [#​16756](withastro/astro#16756) [`b6ee23d`](withastro/astro@b6ee23d) Thanks [@​astrobot-houston](https://github.com/astrobot-houston)! - Fixes styles from Markdoc/MDX custom components not being extracted to `<head>` in the dev server when using the Cloudflare adapter with `prerenderEnvironment: 'node'` and rendering content through a wrapper component. - [#​16747](withastro/astro#16747) [`904d19a`](withastro/astro@904d19a) Thanks [@​astrobot-houston](https://github.com/astrobot-houston)! - Fixes Astro action requests failing in `astro dev` when using the Cloudflare adapter with `prerenderEnvironment: 'node'` alongside a prerendered catch-all route such as `[...page].astro`. Actions and other SSR POST endpoints now continue to work in dev instead of returning an HTTP 500 error. - [#​16701](withastro/astro#16701) [`3495ce4`](withastro/astro@3495ce4) Thanks [@​demaisj](https://github.com/demaisj)! - Fix `Map` and `Set` instances saved in a content collection being broken when retrieving entries. - [#​16614](withastro/astro#16614) [`fca1c32`](withastro/astro@fca1c32) Thanks [@​Eptagone](https://github.com/Eptagone)! - Fixes `entry.data` type inference when a live collection is configured without a schema. - [#​16661](withastro/astro#16661) [`03b8f7f`](withastro/astro@03b8f7f) Thanks [@​ocavue](https://github.com/ocavue)! - Updates `typescript` to v6. No changes are needed from users. - [#​16681](withastro/astro#16681) [`c22770a`](withastro/astro@c22770a) Thanks [@​dotnetCarpenter](https://github.com/dotnetCarpenter)! - Fixes an issue where SVG images with `width="0"` or `height="0"` incorrectly threw a `NoImageMetadata` error instead of being treated as valid dimensions. </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xODIuMSIsInVwZGF0ZWRJblZlciI6IjQzLjE4Mi4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Changes
typescriptfrom v5 to v6.UpdateDone in a separate PRtypescript-eslintto the latest version so that typescript v6 is supported.Testing
CI should pass
Docs
Only devDeps changed. No docs needed.