-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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]: Improve how automigrations read main.js #20955
Comments
Related from #20921 Currently
|
Yowza!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.51 containing PR #20647 that references this issue. Upgrade today to the
|
¡Ay Caramba!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.53 containing PR #21168 that references this issue. Upgrade today to the
|
Is your feature request related to a problem? Please describe
The Storybook automigrations follow this pattern:
Currently, we use AST based tooling (csf-tools) to both read main.js values in the check step, and also to manipulate main.js in the run step.
The problem
The way we read main.js by using AST analysis is error-prone given that users might have an unconventional format of their main.js files, e.g.
Here's an example of an issue caused by it: #20940 (more users got affected by it)
Describe the solution you'd like
The automigrations should be improved in two ways:
Evaluating main.js with
presets.apply
in the run stepThis way, it doesn't really matter what the main.js looks like. We will always be able to evaluate what we need. This comes with a small performance cost, and possibility of having some issues e.g. crashing if automigrations run in a project that has not installed dependencies.
Adding warnings in the check step
If users have a non AST friendly main.js, we should make sure that the automigrations don't crash, but rather tell the users that it was not possible to be done because their main.js is unconventional and we recommend changing, and provide info for them to do the migration manually themselves
The text was updated successfully, but these errors were encountered: