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

Addon-docs: Add legacy transitional support for MDX1 #20747

Merged
merged 9 commits into from
Jan 25, 2023

Conversation

shilman
Copy link
Member

@shilman shilman commented Jan 23, 2023

Issue: #20145

What I did

See attached migration notes:

If you get stuck with the MDX2 upgrade, we also provide opt-in legacy MDX1 support. This is intended as a temporary solution while you upgrade your Storybook; MDX1 will be discontinued in Storybook 8.0. The MDX1 library is no longer maintained and installing it results in npm audit security warnings.

Corresponding mdx1-csf PR here: https://github.com/storybookjs/mdx1-csf/pull/19/files

How to test

  1. Run a Webpack sandbox for template, e.g. yarn task --task sandbox --start-from auto --template cra/default-ts
  2. Rename Introduction.mdx to Introduction.stories.mdx
  3. Edit the file to contain an MDX1-only pattern, such as:
<style>{`
  .subheading {
    --mediumdark: '#999999';
  }
`}</style>
  1. Observe Storybook fails to start
  2. Follow the install instructions in the attached MIGRATION.md
  3. Observe Storybook starts successfully and you can navigate to Examples/Introduction story

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, these changes seem sensible.

So there's no way to transition partially from MDX1 -> 2? That seems OK if so.

@shilman
Copy link
Member Author

shilman commented Jan 24, 2023

@tmeasday unfortunately it's all or nothing for now. possible to enable piecemeal migration, but will require some API changes and i don't think it's worth the effort. this is really a stopgap solution and users should bite the bullet and do a full upgrade when they're ready.

@shilman shilman marked this pull request as ready for review January 25, 2023 17:09
@shilman shilman merged commit 4de2478 into next Jan 25, 2023
@shilman shilman deleted the shilman/20145-legacy-mdx1 branch January 25, 2023 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants