Skip to content
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

test(e2e): TypeCheck website/starter in min/max range of TS versions #10063

Merged
merged 3 commits into from
Apr 19, 2024

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Apr 19, 2024

Motivation

We have no tests covering that we keep supporting older versions of TypeScript.

As we upgrade TypeScript on our monorepo, it's easy to be misled and release some libs that are incompatible with former TS versions.

Now we ensure that our website + starter remains compatible with TS 5.1

Note, although v3.0 is supposed to support TS 5.0, I think it never actually worked in practice. I can't get it working and get errors such as:

CleanShot 2024-04-19 at 18 46 08@2x

I suspect this is a bug related to the newly released v5.0 moduleResolution "bundler", but can't be sure. Starting v5.1 it works fine.

Also I think it's not a bad idea to require TS 5.1 in Docusaurus v3, because it permits to use ReactNode instead of JSX.Element:
https://devblogs.microsoft.com/typescript/announcing-typescript-5-1/#decoupled-type-checking-between-jsx-elements-and-jsx-tag-types

Considering Docusaurus v3 was released after TS 5.1, I suspect it never worked under v5.0 and nobody noticed. So I'll bump the docs to mention v5.1 instead of v5.0 as the minimum version, and will not consider it as a breaking change.

Test Plan

CI

@slorber slorber requested a review from Josh-Cena as a code owner April 19, 2024 16:38
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 19, 2024
@slorber slorber added pr: maintenance This PR does not produce any behavior differences to end users when upgrading. and removed CLA Signed Signed Facebook CLA labels Apr 19, 2024
Copy link

netlify bot commented Apr 19, 2024

[V2]

Name Link
🔨 Latest commit 41253cf
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6622a1a7847b040008598380
😎 Deploy Preview https://deploy-preview-10063--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.

Copy link

github-actions bot commented Apr 19, 2024

⚡️ Lighthouse report for the deploy preview of this PR

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

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 19, 2024
@slorber slorber merged commit e736dcb into main Apr 19, 2024
20 checks passed
@slorber slorber deleted the slorber/test-ts-version-range-typecheck branch April 19, 2024 17:01
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

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: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants