-
-
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
CLI: Add Solid integration #20991
CLI: Add Solid integration #20991
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💪 This is really good!
I've tested:
- ✅ It works in a fresh SolidJS project with
sb init
- ✅ The sandbox creation works.
- ✅
daily
CI workflow still passes - ❌ Initializing a Qwik project would fail because it tried to install a renderer that was
undefined
. I've pushed a fix for it that makes it work, hope you don't mind.
Everything checks out.
The logic around external frameworks is getting a bit convoluted, but I think that's okay since all of this should only be temporary until we move external frameworks out of the CLI altogether.
@@ -45,15 +45,32 @@ const getBuilderDetails = (builder: string) => { | |||
|
|||
const getExternalFramework = (framework: string) => | |||
externalFrameworks.find( | |||
(exFramework) => exFramework.name === framework || exFramework.packageName === framework | |||
(exFramework) => | |||
framework !== undefined && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would framework
be undefined here, parameter typings suggests it can't be?
I'll admit though that I'm very confused about these typings, some places it's optional, other places it's not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic around external frameworks is getting a bit convoluted, but I think that's okay since all of this should only be temporary until we move external frameworks out of the CLI altogether.
I agree. It needs some refactoring in the future once you have standardized the new way for handling frameworks.
why would framework be undefined here, parameter typings suggests it can't be?
I think it's because the' undefined' type is considered in ts
a subtype of all other types, including string.
For this reason, ts doesn't complain at line 92
when receives framework?
from getFrameworkDetails
fn. So It's needed to add this possible scenario when framework
is undefined
.
@webblocksapp this is fantastic. Thank you so much for taking the time and effort to introduce support for SolidJS. We appreciate it 🙏 ! I want to follow up on one thing that was left out of this pull request. If you're ok with it. Can you message me on our Discord Server (same username) so that we can go over it? Looking forward to hearing from you. Hope you have a fantastic weekend. Stay safe |
What I did
This feature adds the Storybook SolidJS framework to the Storybook CLI (Only client-side rendering). It was registered as an external framework while it becomes more popular to be integrated as part of the Storybook core frameworks.
This PR also adds support for reading external frameworks with
frameworks
andrenderers
folder structure, where each one is annpm
package (Current standard used by core frameworks).Previous implementations for external frameworks like
qwik
uses a single folder for loading theframework
andrenderer
being only a singlenpm
package. You can see the example here.It's pending to define if both standards will be used for external frameworks - @JReinhold, @tmeasday.
The Storybook SolidJS framework is on a
beta
version, some features are still under development however the main core functionalities are working for visualizing stories using SolidJS and fine-grained updates.How to test
Checklist
MIGRATION.MD
Maintainers
make sure to add the
ci:merged
orci:daily
GH label to it.["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]