Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Documentation for bundle-size-stats #1900

Open
flarnie opened this issue Oct 14, 2018 · 14 comments
Open

Documentation for bundle-size-stats #1900

flarnie opened this issue Oct 14, 2018 · 14 comments

Comments

@flarnie
Copy link
Contributor

flarnie commented Oct 14, 2018

Do you want to request a feature or report a bug?
This is a documentation request.

What is the current behavior?

  • When the build runs, the JSON files in draft-js/meta/bundle-size-stats/ are updated. They are not human readable and it confuses people, and we have not documented how to use them.

Goals:

  • MVP would be a couple of steps:
    • to somehow make it optional to update these files, so that they don't update every time the build runs. I had thought this would be handy to always have them updated, but since it is confusing people I think we could make it a separate step.
    • to add a file inside the draft-js/meta/bundle-size-stats/ that explains that you can drag the JSON file and drop it onto a page like this and see the current state of the bundle, giving the size of every module. We could briefly explain this in the README or CONTRIBUTING documents and link to the full guide.
  • Bonus ideas:
    • Set up a github bot to comment on pull requests and mention the size increase or decrease they would cause for the bundle.
    • Rig up a page in the Draft.js documentation to show the bundle analysis for the latest release.
    • Look at the data and find some easy ways to decrease the bundle size. It's too big right now.

For context see the two PRs which introduced the bundle-size-stats tracking:
#1644
and
#1654

Please comment on this issue if you are working on it, and I will check in here roughly weekly to review/answer questions. Thanks! ✨

Tagging @altano who added this cool feature and can maybe give context on this.

@flarnie
Copy link
Contributor Author

flarnie commented Oct 22, 2018

I may look for an internal contributor from FB to work on this, going to give it one more week and see if folks in open source are interested.

@altano
Copy link
Contributor

altano commented Oct 22, 2018 via email

@cojennin
Copy link

In PR #1654, @altano mentions that The size stats will get overwritten everytime somebody builds and checks in, but that is desirable...git will keep track of the bundle size over time

If updating the JSON files in draft-js/meta/bundle-size-stats/ becomes optional, will folks who create PR's on the draftjs repo have to make sure they update the JSON files before creating their PR?

@sneha122
Copy link

Hey can i work on this issue??

@altano
Copy link
Contributor

altano commented Oct 19, 2019

Hey can i work on this issue??

That would be awesome, @sneha122. I'm available to answer questions should you have any.

@altano
Copy link
Contributor

altano commented Oct 19, 2019

If updating the JSON files in draft-js/meta/bundle-size-stats/ becomes optional, will folks who create PR's on the draftjs repo have to make sure they update the JSON files before creating their PR?

I'm not super familiar with git but is there a git commit hook that could be leveraged to make this seamless for contributors? Maybe looking at how other open source projects do size tracking could be helpful, e.g. seeing how bundlesize can show bundle stats on Github pull requests: https://github.com/siddharthkp/bundlesize

@sohamsshah
Copy link

@altano Can i work on this issue? I would be glad to take up an opportunity to be a part of this!

@altano
Copy link
Contributor

altano commented Oct 1, 2020

I believe the issue is still open and no one is working on it. @sneha122 can you confirm?

@MageshSundarG
Copy link

Can I work on this issue? I'm interested in working on the issue. Assign Me!

@altano
Copy link
Contributor

altano commented Apr 12, 2021

@MageshSundarG go for it: no one has done the work yet.

@ramHruday
Copy link

ramHruday commented Dec 22, 2021

@altano I have raised a PR #3094 for this, do let me know if it's good.
Instead of adding a doc file in the meta folder,
I have found a plugin that generates an HTML page like the website
mentioned by @flarnie.

Also, can u give me more context on the command param which should decide the stats generation?
For now I just added a script yarn build --stats to determine to build the stattistics.html

@altano
Copy link
Contributor

altano commented Dec 31, 2021

Hey @ramHruday, I'm not authorized to merge so I pinged some folks who can hopefully help review and merge.

Thanks for contributing!

@nawed2611
Copy link

Hey! Is this issue still open to work on?

@altano
Copy link
Contributor

altano commented May 6, 2022

I believe @ramHruday did the work and is awaiting a review in #3094. Perhaps you could help review it? There's a bit of a PR backlog =\

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants