JesusTheHun / storybook-addon-remix-react-router

Use your app router in your stories. A decorator made for Remix React Router and Storybook
Apache License 2.0
48 stars 11 forks source link

storybooks makes outbound request to https://registry.npmjs.org/storybook-addon-react-router-v6/latest #59

Open ferdicus opened 9 months ago

ferdicus commented 9 months ago

hi there, first of all, sorry if there is a related ticket to this, i unfortunately wasn't able to find one :(

the question at hand would be: i'm using storybook-addon-react-router-v6 within my storybook setup. on start-up i see, that it's making outbound requests to https://registry.npmjs.org/storybook-addon-react-router-v6/latest (which i assume are to verify, that it's the latest version?)

i'd like to run my stories in a contained, non connected manner i've set up MSW to intercept all of my outbound requests (unsuccessfully tried with the mentioned request as well)

can you let me know/ maybe point me towards an answer how to configure/ disable this behavior?

thanks in advance

DEP DETAILS: "@storybook/addon-a11y": "^7.6.3", "@storybook/addon-essentials": "^7.6.3", "@storybook/blocks": "^7.6.3", "@storybook/react": "^7.6.3", "@storybook/react-vite": "^7.6.3", "msw-storybook-addon": "^1.10.0", "storybook": "^7.6.3", "storybook-addon-react-router-v6": "^2.0.10",

JesusTheHun commented 9 months ago

I guess we could have a flag in the globalTypes. Would you mind making a PR for this please ?

ferdicus commented 9 months ago

I guess we could have a flag in the globalTypes. Would you mind making a PR for this please ?

hi there, would gladly open a PR for this, just need a few pointers:

globalTypes refers to this?

would i then add an additional config param like:

  globalTypes: {
    storybookAddonReactRouterV6: {
      addonVersionsFetch: false
    }
  },

to it

which is then used in https://github.com/JesusTheHun/storybook-addon-react-router-v6/blob/main/src/features/panel/hooks/useAddonVersions.ts

to conditionally fetch or not?

thanks in advance 🙇🏿

JesusTheHun commented 9 months ago

@ferdicus I'm not sure that's the right option, can I leave you the research ?

ferdicus commented 9 months ago

@ferdicus I'm not sure that's the right option, can I leave you the research ?

thanks for the show of confidence, but quite honestly, i don't feel qualified enough for that 😅

i have no idea about this repos codebase or where any injection point within storybooks config would make sense - i think it would be more beneficial to have some pointers from you (at least, where you'd think would be a good first place to look at in both projects)

otherwise i'd imagine we'd get into a cycle of me trying some esoteric solution, that you'd reject anyways

ferdicus commented 8 months ago

@JesusTheHun , hope you made it safely and relaxed into 2024

Did you find the time to consider my last comment?

thanks in advance 🙇🏿

JesusTheHun commented 8 months ago

@ferdicus I hope you are well yourself.

Research is the part that takes the most time ; I asked on the Storybook's Discord channel without success. You can always check other addons, try & error to see what's working. I've started to do that a bit but I don't have a lot of free time at the moment.

ferdicus commented 7 months ago

hi there, thanks, all good here :)

This is a feature that is specifically introduced in this addon via file src/features/panel/hooks/useAddonVersions.ts added with this change

there is no such thing in this addon we're also using for example: https://github.com/mswjs/msw-storybook-addon

i'm sure the intention is good - but an option to disable this would be great

there is this flag when running storybook: --no-version-updates

would be wonderful if this addon could consider that flag within useAddonVersions

not sure, how one could access this option within

JesusTheHun commented 7 months ago

That would be a good solution indeed. Can you see if you have access to that information from the storybook hooks ? Or as a fallback, if it's available in the environment ? Either node or browser.