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

[chore] Update Storybook to v7 & Cypress to use Vite #8936

Merged
merged 5 commits into from
May 23, 2023
Merged

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented May 22, 2023

No description provided.

@fzaninotto
Copy link
Member

It seems the new storybook code panel rewrites the code and doesn't allow to see the surrounding code. For many of our stories, it means the code isn't explicit...

Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

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

I noticed that the Code pane no longer displays the full storybook code, but only the (merged) code of the currently displayed component:

2023-05-22_18-16

Do you think we should keep it this way? Is there an option to go back the way it was before?

Other than that, it seems to work just fine! Well done! 👏

@djhi djhi changed the title Update Storybook & Cypress to use Vite Update Storybook to v7 & Cypress to use Vite May 23, 2023
@fzaninotto
Copy link
Member

When launching the storybook, the terminal is filled with logs saying:

Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-class-properties since the "loose" mode option was set to "true" for @babel/plugin-proposal-private-property-in-object.
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
["@babel/plugin-proposal-class-properties", { "loose": true }]
to the "plugins" section of your Babel config.

Can we avoid that?

@djhi
Copy link
Collaborator Author

djhi commented May 23, 2023

It only does that the first time right? If you start it again, it shouldn't display them

@fzaninotto
Copy link
Member

That's right. But still, can we avoid it?

@djhi
Copy link
Collaborator Author

djhi commented May 23, 2023

That's right. But still, can we avoid it?

As you probably noticed, the message includes a recommanded fix that is already applied in https://github.com/marmelab/react-admin/pull/8936/files#diff-cafe2123a72c4ce3a9f7e9ee4b0e188256eb02d7ec1e54fa2cadfac99b22f92bR38

Not sure what else I can do

.storybook/main.js Outdated Show resolved Hide resolved
@fzaninotto
Copy link
Member

You've added loose: true in another rule than the one advised in the logged message I pasted.

@babel/plugin-proposal-private-property-in-object

vs

@babel/plugin-proposal-class-properties

@djhi
Copy link
Collaborator Author

djhi commented May 23, 2023

You've added loose: true in another rule than the one advised in the logged message I pasted.

@babel/plugin-proposal-private-property-in-object

vs

@babel/plugin-proposal-class-properties

Good catch, there are actually three rules to add. It's done

.storybook/main.js Outdated Show resolved Hide resolved
@slax57 slax57 added this to the 4.10.6 milestone May 23, 2023
@slax57 slax57 merged commit 8c8ae07 into master May 23, 2023
@slax57 slax57 deleted the upgrade-storybook branch May 23, 2023 12:51
@slax57 slax57 changed the title Update Storybook to v7 & Cypress to use Vite [chore] Update Storybook to v7 & Cypress to use Vite May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants