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

[Feature Request]: Investigate Typescript 5.0 #21276

Closed
2 tasks
valentinpalkovic opened this issue Feb 27, 2023 · 10 comments
Closed
2 tasks

[Feature Request]: Investigate Typescript 5.0 #21276

valentinpalkovic opened this issue Feb 27, 2023 · 10 comments

Comments

@valentinpalkovic
Copy link
Contributor

valentinpalkovic commented Feb 27, 2023

Is your feature request related to a problem? Please describe

Typescript 5.0 release is around the corner (March 14th), and the 5.0 RC is available on February 28th. We should make sure that Storybook works with Typescript 5.0.

Describe the solution you'd like

We should set up an internal sandbox that runs Typescript 5.0 prerelease version to avoid unpleasant surprises on the release date.

Questions:

  1. Should prerelease sandboxes (Typescript RC, Angular 16 RC,...) block PRs from being mergeable as soon as they fail? @shilman
  2. Should we report failures of prerelease sandboxes in our Discord monitoring channel? @shilman
  3. What is the cadence and procedure of fixing prerelease sandboxes and turning them green again when they fail? @vanessayuenn

Work items

  • set up sandbox that runs typescript 5.0
  • manual QA to ensure compatibility

Describe alternatives you've considered

No response

Are you able to assist to bring the feature to reality?

yes, I can

Additional context

No response

@shilman
Copy link
Member

shilman commented Feb 28, 2023

Should prerelease sandboxes (Typescript RC, Angular 16 RC,...) block PRs from being mergeable as soon as they fail?
Should we report failures of prerelease sandboxes in our Discord monitoring channel?

Probably yes to both. By the time a dependency reaches RC, we probably want to make sure it's green all the way up until the release. We can adjust this if it becomes too noisy.

Prior to RC, we should probably either remove that test from our CI, or treat it like a community framework, where we want to know when it fails, but we shouldn't block anything when it fails.

@wegry
Copy link

wegry commented Mar 13, 2023

Is TS 5.0 support intended to only be available in storybook@7?

@valentinpalkovic
Copy link
Contributor Author

@wegry Currently, yes. Only critical security fixes are patched back to 6.5.

It does not mean, though, that SB 6.5 does not work with TS 5.0. We just don't guarantee it.

@pachuka
Copy link

pachuka commented Mar 16, 2023

Just upgraded to TS 5.0.2, and storybook fails on startup in the @storybook/react-docgen-typescript-plugin which in @storybook/react@6.5.16 seems to be pinned at 1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0 so unable to upgrade that to latest canary to see if that would resolve the issue.

Error:

TypeError: typescript_1.default.createIdentifier is not a function
    at setDisplayName (/packages/web/node_modules/@storybook/react/node_modules/@storybook/react-docgen-typescript-plugin/dist/generateDocgenCodeBlock.js:37:186)
    at /packages/web/node_modules/@storybook/react/node_modules/@storybook/react-docgen-typescript-plugin/dist/generateDocgenCodeBlock.js:201:34

@jdelStrother
Copy link

@pachuka I'm also seeing that with storybook 6.5.16 & ts 5.0.2

On the plus side, it works ok for me with storybook 7.0.0-rc.3 & ts 5.0.2

@pachuka
Copy link

pachuka commented Mar 17, 2023

Yep I figured it would be fine with storybook 7, but I'd like to upgrade to that after RC/beta is complete, just wanted to point out that if folks wanted it working on 6.5.x probably need a patch for it.

@ndelangen
Copy link
Member

@vanessayuenn I think there's nothing to do here before GA.

I chatted with @valentinpalkovic and identified though there are some possible incompatibilities, users have a few options:

  • Not use the new syntax features in code bundled/transpiled by storybook. This isn't as hard as it seems, considering the new language feature aren't super common place yet., and aren't likely to be unless the renderer/framework relies heavily on classes.
  • The new language features CAN be used if the right version of the right packages are used. The user could ensure these versions are used via lockfiles or resolutions.

This isn't blocking GA IMHO.

@vanessayuenn
Copy link
Contributor

@ndelangen thanks for the investigation! Good to know this isn't GA-blocking, but is there anything else to be done post-GA? For now, we can update the documentation with the potential incompatibilities you mentioned.

@ndelangen
Copy link
Member

Long term, we'll want to:

  • Upgrade storybook's monorepo to TypeScript 5 (this is a maintenance task)
  • Ensure storybook is compatible with 5.0.0 and the generators we're compatible with (this will sort of happen automatically because generators will publish new versions and we'll start using them after ~24h)
  • Maybe add an internal sandbox to test compatibility with TypeScript 5, but I'm not sure there's a need for this.
  • Maybe investigate if the new language features might be useful for storybook or it's users.

@shilman
Copy link
Member

shilman commented Mar 28, 2023

closing with followup tasks in #21792

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

No branches or pull requests

7 participants