Skip to content

chore: Upgrade to TypeScript 5.4#10076

Merged
slorber merged 1 commit intomainfrom
slorber/upgrade-typescript
Apr 25, 2024
Merged

chore: Upgrade to TypeScript 5.4#10076
slorber merged 1 commit intomainfrom
slorber/upgrade-typescript

Conversation

@slorber
Copy link
Collaborator

@slorber slorber commented Apr 25, 2024

Motivation

Upgrade to latest TS stable version

Note: I'm not yet using mode-resolution (ttps://github.com/microsoft/TypeScript/issues/49721) (TS 5.3) because:

  • I need to check if it impacts user min TS version, it might be a breaking change
  • Our version of Prettier does not support import attributes yet, we need to upgrade it first
import type {Transformer} from 'unified' with {"resolution-mode": "import"};

Test Plan

CI + min/max range tests (see #10063)

Test links

https://deploy-preview-10076--docusaurus-2.netlify.app/

@slorber slorber added the pr: ignore This PR is not meaningful enough to appear in the changelog. label Apr 25, 2024
@slorber slorber requested a review from Josh-Cena as a code owner April 25, 2024 14:45
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 25, 2024
@netlify
Copy link

netlify bot commented Apr 25, 2024

[V2]

Name Link
🔨 Latest commit 31d5eee
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/662a6ca69fc1550008274512
😎 Deploy Preview https://deploy-preview-10076--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 65 🟢 98 🟢 96 🟢 100 🟠 88 Report
/docs/installation 🟠 59 🟢 96 🟢 100 🟢 100 🟠 88 Report
/docs/category/getting-started 🟠 74 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog 🟠 66 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 63 🟢 96 🟢 100 🟢 100 🟠 88 Report
/blog/tags/release 🟠 68 🟢 100 🟢 100 🟠 80 🟠 88 Report
/blog/tags 🟠 75 🟢 100 🟢 100 🟢 90 🟠 88 Report

@github-actions
Copy link

Size Change: 0 B

Total Size: 1.59 MB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/codeTranslations.json 2 B
website/.docusaurus/docusaurus.config.mjs 26.7 kB
website/.docusaurus/globalData.json 91.2 kB
website/.docusaurus/i18n.json 930 B
website/.docusaurus/registry.js 247 kB
website/.docusaurus/routes.js 156 kB
website/.docusaurus/routesChunkNames.json 109 kB
website/.docusaurus/site-metadata.json 2.17 kB
website/build/assets/css/styles.********.css 113 kB
website/build/assets/js/main.********.js 810 kB
website/build/index.html 38 kB

compressed-size-action

@slorber slorber merged commit da2c0b4 into main Apr 25, 2024
@slorber slorber deleted the slorber/upgrade-typescript branch April 25, 2024 15:04
@csantos-nydig
Copy link

csantos-nydig commented May 22, 2024

Hey @slorber I landed here because of the reference I found in code:

// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
import type {ProcessorOptions} from '@mdx-js/mdx';
// TODO as of April 2023, no way to import/re-export this ESM type easily :/
// This might change soon, likely after TS 5.2
// See https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1517839391
type Pluggable = any; // TODO fix this asap

I wonder if that type can be cleaned up now?


Context:
I have a bunch of custom rehypePlugins plugins, that I need to TS-type but not sure how to type them now 😞

@slorber
Copy link
Collaborator Author

slorber commented May 23, 2024

@csantos-nydig you can do the cleanup in your own codebase

But we can't do it on Docusaurus because it would emit d.ts files with newer TS features which require all users to upgrade TS (breaking change). We'll do the cleanup for the next major version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: ignore This PR is not meaningful enough to appear in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants