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

Core: Clear manager cache on runtime error #13230

Merged
merged 4 commits into from Nov 23, 2020
Merged

Core: Clear manager cache on runtime error #13230

merged 4 commits into from Nov 23, 2020

Conversation

ghengeveld
Copy link
Member

@ghengeveld ghengeveld commented Nov 23, 2020

Issues: #13199 #13209

What I did

This reports back any runtime (console) errors from the browser to the dev server, and clears the manager cache if there's a runtime error originating from the manager UI.

This also includes some smaller tweaks and fixes, including one for the TypeError: Cannot read property 'publicPath' of undefined error reported in #13209.

Screenshot 2020-11-23 at 20 13 46

Screenshot 2020-11-23 at 20 04 51

How to test

Run start-storybook to make sure the manager UI is cached. Then throw an error at the end of manager.js and restart Storybook. Note that it will used the cached manager and therefore is not broken. Now start again with --no-manager-cache. Note that the UI is now broken (white screen) with a runtime error in the browser console. Also note that the CLI will now show the browser error in your terminal. Finally, start-storybook again without the --no-manager-cache flag, so it'll build cache. Then exit and run it again. Note it will not have a cached manager this time, because it got cleared when the runtime error occurred.

  • Is this testable with Jest or Chromatic screenshots? No
  • Does this need a new example in the kitchen sink apps? No
  • Does this need an update to the documentation? No

If your answer is yes to any of these, please make sure to include it in your PR.

@ghengeveld ghengeveld changed the title Clear manager cache on runtime error Core: Clear manager cache on runtime error Nov 23, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Nov 23, 2020

Fails
🚫

Please choose only one of these labels: ["feature request","bug"]

Generated by 🚫 dangerJS against 99160ef

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @ghengeveld

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @ghengeveld

@shilman shilman added this to the 6.1 perf milestone Nov 23, 2020
@shilman shilman merged commit 48da1b4 into next Nov 23, 2020
@shilman shilman deleted the dev-server-fixes branch November 23, 2020 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants