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] SB 7.0 Automigration #20674

Closed
16 tasks done
vanessayuenn opened this issue Jan 18, 2023 · 0 comments
Closed
16 tasks done

[Feature Request] SB 7.0 Automigration #20674

vanessayuenn opened this issue Jan 18, 2023 · 0 comments

Comments

@vanessayuenn
Copy link
Contributor

vanessayuenn commented Jan 18, 2023

Storybook 7 is our first major release in over 2 years. A lot has changed during that time, so we want to make it as easy as possible for users to get upgraded to the latest APIs, formats, and conventions.

There are currently three types of migrations:

  • Migrations. Codemods initiated manually by the user.
  • Automigrations. Checks that run automatically on upgrade which can perform codemods, add/remove/upgrade dependencies, and so forth.
  • Linter rules. Can run in the editor or over the entire project in batch.

We have a full (work in progress) Storybook 7 migration guide. Leading up to SB7’s final release, we need to automate as much as possible from the guide and fine-tune the experience for our users.

Infrastructure

Before we get into specific issues, we should answer a few questions:

  • Are we OK with the current sb migrate format for manual migrations?

    npx storybook@next migrate csf-2-to-3 --glob="**/*.stories.js"

    -> make --glob optional

  • Are we OK with the current package structure where the sb CLI depends on jscodeshift which is bloated & contains security warnings.
    -> yes

  • Are we OK with the current automigrations structure where all automigrations run on every upgrade, vs some other system that records which automigrations have run so that we can only run expensive migrations once (e.g. csf-2-to-3 which needs to scan lots of files etc). We opted to skip this earlier when [it was first proposed](https://www.notion.so/CLI-automigration-overhaul-d4c98228a7634d2a814ede6a9563e499), but we can revisit this decision if it’s important enough.
    -> yes

Migration priorities

We can prioritize all issues by the following rubric:

  • Fixing upgrade problems that affect lots of users is high priority.
  • Supporting feature posts (CSF3, Docs2, TypeScript support) is second priority, and ideally would be finished a week before the corresponding post to give it time to settle.
  • Upgrading to a working Storybook (with deprecations) is third priority.
  • Upgrading to remove deprecation warnings is lowest priority.

Problem areas

Currently, the most problematic areas of the upgrade are:

  • Babel mode v7 - users lack project babelrc the upgraded project does not support TS
  • MDX2 - users use MDX1 syntax that breaks in MDX2

#20674 (comment)

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

No branches or pull requests

1 participant