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

Write JSON stats file in streaming fashion and omit chunks for brevity #15889

Merged
merged 3 commits into from Aug 26, 2021

Conversation

ghengeveld
Copy link
Member

Issue: -

What I did

Some people have reported out-of-memory errors when using --webpack-stats-json on their very large Storybook. This was tracked to JSON.stringify using too much memory. This PR addresses that by using json-ext's stringifyStream and piping the result into the target file.

I've also omitted chunks from the data, because it accounts for about half of the total blob size and isn't particularly useful to have. Technically that's a breaking change but it's very unlikely anybody is actually using that field.

How to test

  • 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.

@nx-cloud
Copy link

nx-cloud bot commented Aug 20, 2021

Nx Cloud Report

We didn't find any information for the current pull request with the commit 091bf73.
You might need to set the 'NX_BRANCH' environment variable in your CI pipeline.

Check the Nx Cloud Github Integration documentation for more information.


Sent with 💌 from NxCloud.

package.json Outdated Show resolved Hide resolved
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

LGTM apart from maybe @shilman's thing.

@ghengeveld ghengeveld merged commit ed40e92 into next Aug 26, 2021
@ghengeveld ghengeveld deleted the streaming-webpack-stats branch August 26, 2021 09:26
@shilman shilman added this to the 6.4 PRs milestone Sep 1, 2021
@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Sep 3, 2021
shilman pushed a commit that referenced this pull request Sep 3, 2021
Write JSON stats file in streaming fashion and omit `chunks` for brevity
@anilanar
Copy link

anilanar commented Sep 9, 2021

This works!

@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-storybook cli maintenance User-facing maintenance tasks patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants