robdonn / storybook-module-federation

Make your Storybook components available as federated modules
MIT License
34 stars 5 forks source link

Add storybook 7 support #5

Open nate-summercook opened 1 year ago

nate-summercook commented 1 year ago

Recently, Storybook 7 has been released. With it, some changes in the main.js have occurred. For one, by default, webpack 5 is used. In the main.js, we now can just configure a framework like so:

framework: {
  name: '@storybook/react-webpack5',
  options: {},
},

and remove the following definition:

core: {
  builder: 'webpack5',
},

If I remove it now, I get an error from storybook-module-federation that a webpack5 builder needs to be defined. This is of course not true anymore for Storybook 7. Please make sure your otherwise awesome package is compatible with Storybook 7 :)

robdonn commented 1 year ago

Hey @nate-summercook, thanks for your feedback.

I have published a release candidate for v1 which adds Storybook v7 support. You can try it out by installing storybook-module-federation@next

nate-summercook commented 1 year ago

Thx for the ⚡️fast support! I'll try it next week! 🙏🏼

nate-summercook commented 1 year ago

Seems like your peerDependencies need updating... storybook@^6.2 won't do it for v7...

nate-summercook commented 1 year ago

But other than that everything seems to work. Would be glad for a proper release though, not so nice having to run npm install with --legacy-peer-deps or having overrides in the package.json 🫠

nate-summercook commented 1 year ago

Seems like your types in plugin.ts also need some updates. I get a typescript error because I'm passing the following property in the storybook config:

{
  ....
  core: {
    disableTelemetry: true
  }
}

Maybe rely on the types of @storybook/types instead? You can get the entire StorybookConfig type from there... https://github.com/storybookjs/storybook/blob/next/code/lib/types/src/modules/core-common.ts#L263

nate-summercook commented 1 year ago

@robdonn Will you do a regular release of this anytime soon? :)

Andrew-Kovalenko commented 1 year ago

@robdonn I also need to set up with storybook v7 Is do regular release with needed changes in your nearest plan? any ETA if yes?

Andrew-Kovalenko commented 1 year ago

@nate-summercook while we are waiting answer from @robdonn could you please say, are you using this lib with next version ? Or maybe you found another lib that works good with storybook v7?

Because when I trying to use this lib with next version a having something like infinity loading(storybook trying to load stories without any error)stories without any error)

nate-summercook commented 9 months ago

@nate-summercook while we are waiting answer from @robdonn could you please say, are you using this lib with next version ? Or maybe you found another lib that works good with storybook v7?

Because when I trying to use this lib with next version a having something like infinity loading(storybook trying to load stories without any error)stories without any error)

Sorry, saw your message only now... I've got storybook v7 working with "storybook-module-federation": "1.0.0-rc.2" and the mentioned override

  "overrides": {
    "storybook-module-federation": {
      "storybook": "$storybook"
    }
  },
nate-summercook commented 9 months ago

@robdonn any chance this will end up in a proper release at some point? :) Asking because I'm not very fond of the currently necessary overrides and RC dependency 🙃

nate-summercook commented 5 months ago

Am I silly to ask if you're going to add storybook 8 support? :D

AlexNobody112 commented 4 months ago

@nate-summercook It actually works with SB 8, you just need fix up some types :)