Giter VIP home page Giter VIP logo

Comments (6)

Karibash avatar Karibash commented on June 1, 2024 1

@stovmascript
It has not been released yet, but it looks like the option to use SWCLoader is already supported on the Storybook side.
Maybe we can archive storybook-addon-swc already.

from storybook-addon-swc.

stovmascript avatar stovmascript commented on June 1, 2024 1

Interesting. Support in SB would be great! Apart from the useSWC builder option though, I don't see where I can pass SWC options from our .swcrc, or does swc-loader load the config by itself?

from storybook-addon-swc.

jonniebigodes avatar jonniebigodes commented on June 1, 2024 1

@Karibash, thanks for the heads up on this, and I'll defer to you to archive it. In case you do, let me know. Also, if you're interested in helping us improve the swc loader, we'd love it. Reach out to us, and we'll go from there. And @stovmascript, I'm aware of it, and this is still experimental, and there's some work that needs to be done on that front. With that in mind, if you're interested in collaborating with @Karibash and us and helping us improve it, follow up with us as well.

Looking forward to hearing from both of you.

from storybook-addon-swc.

stovmascript avatar stovmascript commented on June 1, 2024

@jonniebigodes @Karibash Hi guys. It seems this package is not an addon per se because it doesn't really add functionality to SB, in its UI, etc. This addon seems to make use of swc-loader, to enable compilation via SWC instead of Babel, which Storybook makes use of internally.

We use Next.js with SWC and currently it won't compile in SB7. Interestingly, it still seems to successfully modify the webpack config.module.rules and add swc-loader, but fails from what seems to be the final phase of the build (minification, etc.) as I see the TerserPlugin and even HtmlWebpackPlugin output show up around the point of the crash.

from storybook-addon-swc.

stovmascript avatar stovmascript commented on June 1, 2024

@jonniebigodes I'm wondering whether the Framework API suggestion is appropriate for this package. Shouldn't we be looking at the Builder API, or somewhere else? Thanks.

from storybook-addon-swc.

stovmascript avatar stovmascript commented on June 1, 2024

@jonniebigodes I would be interested in contributing the ability to add SWC options in a similar fashion to how Babel options are loaded, maybe with the distinction of not automatically parsing the user's .swcrc and having them provide the options along with useSWC.

Also, I think @swc/core should be moved to peer dependencies because of its current breaking nature. If you use SWC plugins in Next.js, @swc/core needs to be compatible by all parties - see https://swc.rs/docs/plugin/selecting-swc-core. Having Storybook depend on it by itself makes it a bit harder to resolve the correct version.

@Karibash What do you think? I see you've also moved @swc/core here in #48.

from storybook-addon-swc.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.