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

[storybook] Ignore TS-related HMR warnings #103605

Merged

Conversation

clintandrewhall
Copy link
Contributor

Summary

Storybook uses HMR out-of-the-box when you run it locally, and so it outputs a ton of warnings that specific types aren't actually exported.

Screen Shot 2021-06-28 at 10 19 07 PM

This ends up burying other valid warnings. In Canvas, for example, there was a warning that a story wasn't working properly, drowned out by a massive, irrelevant HMR warning.

Looking around, I came across this comment on an issue that led me to a common solution: a webpack plugin that suppresses that warning in the log.

After:

Screen Shot 2021-06-28 at 10 23 27 PM

There's a NPM module that uses this strategy with an optional RegEx, but I didn't think we needed to add another dependency to handle a one-off warning in Storybook.

Comments welcome...!

@spalger
Copy link
Contributor

spalger commented Jun 29, 2021

@elasticmachine merge upstream

Copy link
Contributor

@smith smith left a comment

Choose a reason for hiding this comment

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

Thanks for doing this.

You can also remove the warningsFilter from the stats config (https://github.com/elastic/kibana/blob/master/packages/kbn-storybook/webpack.config.ts#L22), which suppressed these warnings in the terminal output. I tried it and with your changes the warnings don't show up in either the terminal or the browser.

@clintandrewhall clintandrewhall added release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed labels Jun 29, 2021
@clintandrewhall clintandrewhall enabled auto-merge (squash) June 29, 2021 22:24
@clintandrewhall
Copy link
Contributor Author

jenkins test this

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@clintandrewhall clintandrewhall merged commit b7ad0c9 into elastic:master Jun 30, 2021
@kibanamachine
Copy link
Contributor

💔 Backport failed

Status Branch Result
7.15 The branch "7.15" is invalid or doesn't exist

To backport manually run:
node scripts/backport --pr 103605

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jul 2, 2021
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 103605 or prevent reminders by adding the backport:skip label.

1 similar comment
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 103605 or prevent reminders by adding the backport:skip label.

clintandrewhall added a commit to clintandrewhall/kibana that referenced this pull request Jul 6, 2021
* [storybook] Ignore TS-related HMR warnings

* Fix casing

* Remove warnings filter

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jul 6, 2021
clintandrewhall added a commit that referenced this pull request Jul 6, 2021
* [storybook] Ignore TS-related HMR warnings

* Fix casing

* Remove warnings filter

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@clintandrewhall clintandrewhall deleted the storybook/ts-module-ignore branch July 9, 2021 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed backported chore Feature:Storybook release_note:skip Skip the PR/issue when compiling release notes review v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants