-
Notifications
You must be signed in to change notification settings - Fork 179
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
fix(deps-dev): downgrade all Storybook breakage from dependabot et al #567
fix(deps-dev): downgrade all Storybook breakage from dependabot et al #567
Conversation
- go back to Storybook v6 addons, matching the `storybook` dep - the addons were partially auto-upgraded to breaking versions by dependabot - go back to Webpack v4, matching Storybook v6 - this was also auto-upgraded to a breaking version by dependabot - go back to `ts-loader` v8, matching Webpack v4 - and this too had a breaking dependabot upgrade Signed-off-by: Anton Gilgur <[email protected]>
or, actually that looks like the error originates from
and The upgrade path from it to |
I commented some pieces out and, well, it did finally build, and then the Storybook window opened in the browser and completely froze. Suffice to say, I am pretty partial to just deleting the Storybook entirely now, so there is no confusion about its state or usability and to continue reducing the scope of this codebase until it is no longer used. |
Huh it did actually load and work fine, after I waited 3 minutes of my fans spinning quite loudly. So this actually might work... |
Signed-off-by: Anton Gilgur <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
- the latter took some manual editing and resolutions until it got it, and now it reproduces the minimal variant Signed-off-by: Anton Gilgur <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
- as per its archived docs - tried to make the diff as small as possible Signed-off-by: Anton Gilgur <[email protected]>
- same as downstream in Workflows, in order to code split properly, can't use the `src/` or `src/components/` imports as they have side effects (and therefore can't be tree-shaken) - instead have to do individual component imports to tree shake properly - this seems to substantially improve performance from lethargic minutes of loading on first page load to seconds - I believe Storybook tries to code split things itself, so maybe it was making a giant bundle for each story file? Signed-off-by: Anton Gilgur <[email protected]>
despite this long load time, the CSS also did not load, which makes the v1 Storybook not very useful. the v2 one loads fine. This PR is still useful as-is though, so I guess we'll leave that for another PR or maybe the upgrade to Storybook v7 or v8 or Webpack v5 will resolve this.
The biggest difference seemed to not be the upgrade from |
Huh, CI has a failure that I don't have locally:
|
- it was tested with and without the comment, to be specific - as well as several other ways Signed-off-by: Anton Gilgur <[email protected]>
Ah it only happens on |
- per, well, my own SO answer: https://stackoverflow.com/a/78770854/3431180 - also remove old, no longer unused `@types/storybook*` deps - Storybook has types built-in now (and is written in TS, not sure if it wasn't before or something) Signed-off-by: Anton Gilgur <[email protected]>
I tried downgrading to Storybook That does also suggest that without all the other errors, #244 would also have broken the build 😕
|
For better or for worse, I had a pretty bad migraine all of yesterday (and a bit of the night before and this morning), so I worked on this yesterday as it was something fairly straightforward that didn't require a lot of brainpower, i.e. trial, wait, error, trial, wait, error, repeat until working with right versions, config, etc. Tedious af, but not really "difficult" per se. 🙃 |
thank you @agilgur5 for putting the effort. I agree with you comments and I think this is good starting point to get the storybook fix. I'm not sure if the dependent bot will update the dependencies and break again. |
It won't, it now only runs for security fixes: #537 |
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.
LGTM
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.
Local test checks out. Thanks so much @agilgur5!
Fixes #469
Motivation
Dependabot made lots of breaking changes prior to #537 that made the Storybook unrunnable
Modifications
devDeps
go back to Storybook v6 addons, matching the
storybook
depv6.5.0-beta.1
specifically? See below commentgo back to Webpack v4, matching Storybook v6
ts-loader
v8, matching Webpack v4remove deprecated, no longer used
@types/storybook*
depsmigrate from
@dump247/storybook-state
touseState
hook in v1Args
like v2 does. that's for future work though, as I don't believestoriesOf
syntax even supports thatothers
Per fix: upgrade
argo-ui
components to latest argo-workflows#11585, thereact-toastify
pin in fix: pin react-toastify #379 seemed to have been made to work with Webpack v5 in Argo CD, but this repo's Webpack was on v4 via Storybook v6 (per above)react-toastify
to9.0.8
or other viaresolutions
etc if neededmatch
tsconfig.json
from chore: upgrade uuid #367import individual v1 components in stories instead of from
src/components
, speeding upyarn start
from minutes to seconds by avoiding importing all other components due to side-effects (see refactor(ui): code-split out largexterm
dep argo-workflows#12158 for reference)Verification
Storybooks for v1 and v2 work now via
yarn start
andyarn start-v2
:Screenshots:
Notes to Reviewers
I could still not getEDIT: and apparently I was one change from it working apparently 😅yarn start
to work. Got through a bunch of errors. I've put in too much time on attempting this, so I am giving up at this point since this repo is deprecated anyway per #453. Leaving this as a draft of my work for reference.I did also try upgrading everything to Storybook v7 or at least Storybook v6 with Webpack v5 in #432 (comment) and #568, and those had many more issues, so upgrading is not time well spent either.EDIT: now that this and #568 work, the upgrade might actually be doable. All the original dep mismatches etc might have been part of the issue.The CSS does not work for v1's Storybook and I couldn't get it to work after several attempts, but this is still much better than the previous unrunnable state and v2 at least works now.
Future Work
useState
to StorybookArgs
, per abovePostscript
It seems likely that the Storybook build has not been working for years, since some of the reverts are years old and the incompatible changes made by humans would not have worked with the Storybook build. I am guessing it was only tested against Argo CD and the Storybook was unused.
If that is the case, it may be worth deleting the Storybook entirely as it's been broken and unused for years and not worth maintaining. And has not been used in the dev process for at least an equivalent amount of time