draft-js icon indicating copy to clipboard operation
draft-js copied to clipboard

Documentation for `bundle-size-stats`

Open flarnie opened this issue 6 years ago • 14 comments

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: https://github.com/facebook/draft-js/pull/1644 and https://github.com/facebook/draft-js/pull/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 avatar Oct 14 '18 21:10 flarnie

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.

flarnie avatar Oct 22 '18 00:10 flarnie

Sounds good. I definitely won’t get to it this week but if it languishes beyond that I might beat others to doing it. Just let me know if someone tackles it :)


From: Flarnie Marchan [email protected] Sent: Sunday, October 21, 2018 5:15 PM To: facebook/draft-js Cc: Alan; Mention Subject: Re: [facebook/draft-js] Documentation for bundle-size-stats (#1900)

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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/facebook/draft-js/issues/1900#issuecomment-431716344, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAAD8V9vq9DyYPu46VwHn3QTP9S4Q97_ks5unQ4NgaJpZM4XbVMO.

altano avatar Oct 22 '18 16:10 altano

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?

cojennin avatar Oct 22 '18 21:10 cojennin

Hey can i work on this issue??

sneha122 avatar Oct 19 '19 06:10 sneha122

Hey can i work on this issue??

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

altano avatar Oct 19 '19 06:10 altano

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

altano avatar Oct 19 '19 06:10 altano

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

sohamsshah avatar Oct 01 '20 12:10 sohamsshah

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

altano avatar Oct 01 '20 19:10 altano

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

MageshSundarG avatar Apr 12 '21 06:04 MageshSundarG

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

altano avatar Apr 12 '21 07:04 altano

@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

ramHruday avatar Dec 22 '21 21:12 ramHruday

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

Thanks for contributing!

altano avatar Dec 31 '21 01:12 altano

Hey! Is this issue still open to work on?

nawed2611 avatar May 06 '22 11:05 nawed2611

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 =\

altano avatar May 06 '22 22:05 altano