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

Replace rollup-plugin-node-polyfills to analogs #18975

Merged

Conversation

dartess
Copy link
Contributor

@dartess dartess commented Aug 21, 2022

Issue:

#17019 (related)

What I did

Replace package rollup-plugin-node-polyfills to process and util.

Why:

When a storybook is installed, among other things, I get this warning:

npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.

I decided to unwind this story.

> npm ls rollup-plugin-inject
└─┬ [email protected]
  └─┬ @storybook/[email protected]
    └─┬ @storybook/[email protected]
      └─┬ @storybook/[email protected]
        └─┬ [email protected]
          └── [email protected]

Looking at the code as well, I found out that the Storybook only relies on a few polyfills, not the entire package from rollup-plugin-node-polyfills.

Looking at the package code, I noticed that it is similar to the node-polyfill-webpack-plugin, but unlike the latter, it comes with its own polyfills.

I replaced the polyfills from rollup-plugin-node-polyfills with polyfills that are in separate packages (as happens in node-polyfill-webpack-plugin). I also skimmed through their code and found the polyfills to be very similar (except for the import formats).

In addition to the fact that now users will not receive warning, the Storybook will rely on packages that are much more popular in terms of downloads than the current one.

How to test

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

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

@MichaelArestad MichaelArestad added maintenance User-facing maintenance tasks core labels Aug 22, 2022
@ndelangen ndelangen merged commit 5a213bd into storybookjs:next Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants