Skip to content
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

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

Open
ferdicus opened this issue Dec 12, 2023 · 8 comments

Comments

@ferdicus
Copy link

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
Copy link
Owner

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

@ferdicus
Copy link
Author

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
Copy link
Owner

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

@ferdicus
Copy link
Author

ferdicus commented Dec 14, 2023

@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
Copy link
Author

ferdicus commented Feb 1, 2024

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

Did you find the time to consider my last comment?

thanks in advance 🙇🏿

@JesusTheHun
Copy link
Owner

@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
Copy link
Author

ferdicus commented Feb 9, 2024

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
Copy link
Owner

JesusTheHun commented Feb 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants