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

⬆️ Upgrade storybook 7.0 (previously mdx 2) #2514

Closed
mimarz opened this issue Sep 22, 2022 · 5 comments · Fixed by #2866
Closed

⬆️ Upgrade storybook 7.0 (previously mdx 2) #2514

mimarz opened this issue Sep 22, 2022 · 5 comments · Fixed by #2866
Assignees
Labels
core-react eds-core-react lab-react eds-lab-react storybook 🔨 technical Technical debt and similar

Comments

@mimarz
Copy link
Contributor

mimarz commented Sep 22, 2022

MDX has been updated to 2.0 with big changes: https://mdxjs.com/blog/v2/

Storybook will eventually move to mdx-2, migration guide for experimental support: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#opt-in-mdx2-support

@mimarz mimarz added core-react eds-core-react storybook lab-react eds-lab-react 🔨 technical Technical debt and similar labels Sep 22, 2022
@oddvernes
Copy link
Collaborator

Is this done, since it is listed as a blocker for react 18?

@mimarz
Copy link
Contributor Author

mimarz commented Oct 10, 2022

Is this done, since it is listed as a blocker for react 18?

Its not done, but had to be done after #2285 as it had upgrades and changes to Storybook config.

Should be good to do the migration now.

@oddvernes oddvernes self-assigned this Jan 12, 2023
@oddvernes
Copy link
Collaborator

oddvernes commented Feb 1, 2023

From what I can see, the experimental mdx2 support in storybook 6.5 is still problematic and I am not the only one getting styling issues. They say it will work better out of the box with storybook 7, So I think perhaps we should just wait for that and upgrade to storybook 7 whenever that is stable.

Things to note when upgrading:
mdx2 does not support html comments (<!--...-->) and should be replaced with {/*...*/}
<strong>word</strong> must be replaced with **word**
It also complained about newline here:
bilde
But hopefully that is fixed with the 7.0 implementation
Other than that it runs, but there are issues with styling, especially code blocks which just renders as black text currently.

@oddvernes oddvernes changed the title Upgrade mdx to v2 in Storybooks Upgrade ~~mdx to v2 in Storybooks~~ storybook 7.0 Feb 1, 2023
@oddvernes oddvernes changed the title Upgrade ~~mdx to v2 in Storybooks~~ storybook 7.0 Upgrade storybook 7.0 (previously mdx 2) Feb 1, 2023
@oddvernes oddvernes removed their assignment Feb 1, 2023
@oddvernes
Copy link
Collaborator

Storybook 7.0 is now released. We'll probably wait for at least 7.1.0 (currently in alpha)

@oddvernes oddvernes changed the title Upgrade storybook 7.0 (previously mdx 2) ⬆️ Upgrade storybook 7.0 (previously mdx 2) Apr 12, 2023
@oddvernes oddvernes self-assigned this Apr 27, 2023
@oddvernes
Copy link
Collaborator

Note: in storybook 7, the ArgsTable has been deprecated and you are supposed to use <Controls /> instead, however this new block does not support subComponents. According to this issue ArgsTable will be kept around until a working replacement for subComponents is in place, so we should just keep using ArgsTable until then (which is called <PropsTable /> in our storybook to add some default values)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-react eds-core-react lab-react eds-lab-react storybook 🔨 technical Technical debt and similar
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants