-
-
Notifications
You must be signed in to change notification settings - Fork 488
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: call stats.toJson on each time to avoid the stats mutation #293
Conversation
d7300bf
to
4f409be
Compare
4f409be
to
1cf518d
Compare
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
I'm a little worried about performance and memory aspect of this change as |
|
What I'm talking about is find places that modify original
I'm sorry I don't quite follow.
Where is this number came from? What are those logs about? Is first log represents your approach and the second one is the current implementation? Why does |
If you are still talking about one stats object does everything, I do not think I cannot because
startAnalyzerServer or generateStaticReport , it cannot show the chunk details and it will only be a rectangle box with the name. I believe this is not expected result.
Here is the scenario I need, I want the plugin output the report with the chunk details. At the same time, I want the plugin output the stat.json which will remove some fields that the report need.
What I am trying to say is this is the workaround that I am using to achieve the scenario I mentioned right before that. And I have to pay more to wait for the output. The performance and memory that you are concerned are not a lot. They are 160.253ms and 51MB of RAM
Both logs is after my fix. 160.253 comes from the statsOptions = {} in the worst case scenario which outputs everything. The first log is about when you specify statsOptions = {} you have to pay another 160.253ms to output the stats.json. If you apply the filter in statsOptions, you have to pay 13.481ms to output the stats.json. |
Ok, I finally understood what the problem is. Apologize for my dullness 😉 |
Published in |
Just a note for anyone who sees this. I am using nextjs and I was trying to generate stats with webpack-bundle-analyzer, but I kept getting truncated JSON. As in JSON that just ends randomly and is invalid. I didn't try version 3.4.0 but 3.4.1 fixed it for me. I'm guessing 3.4.0 would have worked too because it had this fix. |
fix #292. But I need some help about testing these change.