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

Conversation

@altano
Copy link
Contributor

@altano altano commented Feb 16, 2018

Summary

Track bundle size stats by file output name

By naming bundle size stats with the bundle name instead of the package version:

  • yarn build will produce stats for both the development bundle
    (Draft.js.json) and the production bundle (Draft.min.js.json) which we can
    track separately. The minified bundle is good for understanding what file
    size we will be advertising (albeit pre-gzip/brotli) while the development version
    is useful for seeing a 1:1 mapping between changes in code and bundle size.
  • The size stats will get overwritten everytime somebody builds and checks in,
    but that is desirable. Instead of keeping the entire history of the bundle
    size always checked-in (and possibly not in sync with the actual versions),
    git will keep track of the bundle size over time. Whenever we release, the
    size of the stats file for that release is whatever is in Draft.min.js.json
    at the time of release.

Here are the separate bundles (as visualized by
https://chrisbateman.github.io/webpack-visualizer/):

Development: https://files.terriblefish.com/chrome_2018-02-16_12-11-22.png
Production: https://files.terriblefish.com/chrome_2018-02-16_12-12-01.png

Test Plan

yarn test, yarn run lint, and yarn run flow all pass.

This might not have been affecting anything (since `LoaderOptionsPlugin` is only
for legacy migration), but we should fix this.
By naming bundle size stats with the bundle name instead of the package version:
  - `yarn build` will produce stats for both the development bundle
    (Draft.js.json) and the production bundle (Draft.min.js.json) which we can
    track separately. The minified bundle is good for understanding what file
    size we will be advertising (albeit pre-gzip/brotli).
  - The size stats will get overwritten everytime somebody builds and checks in,
    but that is desirable. Instead of keeping the entire history of the bundle
    size always checked-in (and possibly not in sync with the actual versions),
    git will keep track of the bundle size over time. Whenever we release, the
    size of the stats file for that release is whatever is in Draft.min.js.json
    at the time of release.

Here are the separate bundles visualized at
https://chrisbateman.github.io/webpack-visualizer/:

Development: https://files.terriblefish.com/chrome_2018-02-16_12-11-22.png
Production: https://files.terriblefish.com/chrome_2018-02-16_12-12-01.png
Copy link
Contributor

@flarnie flarnie left a comment

Choose a reason for hiding this comment

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

Sweet! Thanks for updating this!
seal_of_approval_again

Having trouble with the import-it script but will land this as soon as I get that issue solved.

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@flarnie is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@flarnie has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

alicayan008 pushed a commit to alicayan008/draft-js that referenced this pull request Jul 4, 2023
Summary:
By naming bundle size stats with the bundle name instead of the package version:
  - `yarn build` will produce stats for both the development bundle
    (Draft.js.json) and the production bundle (Draft.min.js.json) which we can
    track separately. The minified bundle is good for understanding what file
    size we will be advertising (albeit pre-gzip/brotli) while the development version
    is useful for seeing a 1:1 mapping between changes in code and bundle size.
  - The size stats will get overwritten everytime somebody builds and checks in,
    but that is desirable. Instead of keeping the entire history of the bundle
    size always checked-in (and possibly not in sync with the actual versions),
    git will keep track of the bundle size over time. Whenever we release, the
    size of the stats file for that release is whatever is in Draft.min.js.json
    at the time of release.

Here are the separate bundles (as visualized by
https://chrisbateman.github.io/webpack-visualizer/):

Development: https://files.terriblefish.com/chrome_2018-02-16_12-11-22.png
Production: https://files.terriblefish.com/chrome_2018-02-16_12-12-01.png

`yarn test`, `yarn run lint`, and `yarn run flow` all pass.
Closes facebookarchive/draft-js#1654

Reviewed By: flarnie

Differential Revision: D7073462

Pulled By: flarnie

fbshipit-source-id: 64cbad2dcaf93641ff932a63aaa47e59d86c9df7
aforismesen added a commit to aforismesen/draft-js that referenced this pull request Jul 12, 2024
Summary:
By naming bundle size stats with the bundle name instead of the package version:
  - `yarn build` will produce stats for both the development bundle
    (Draft.js.json) and the production bundle (Draft.min.js.json) which we can
    track separately. The minified bundle is good for understanding what file
    size we will be advertising (albeit pre-gzip/brotli) while the development version
    is useful for seeing a 1:1 mapping between changes in code and bundle size.
  - The size stats will get overwritten everytime somebody builds and checks in,
    but that is desirable. Instead of keeping the entire history of the bundle
    size always checked-in (and possibly not in sync with the actual versions),
    git will keep track of the bundle size over time. Whenever we release, the
    size of the stats file for that release is whatever is in Draft.min.js.json
    at the time of release.

Here are the separate bundles (as visualized by
https://chrisbateman.github.io/webpack-visualizer/):

Development: https://files.terriblefish.com/chrome_2018-02-16_12-11-22.png
Production: https://files.terriblefish.com/chrome_2018-02-16_12-12-01.png

`yarn test`, `yarn run lint`, and `yarn run flow` all pass.
Closes facebookarchive/draft-js#1654

Reviewed By: flarnie

Differential Revision: D7073462

Pulled By: flarnie

fbshipit-source-id: 64cbad2dcaf93641ff932a63aaa47e59d86c9df7
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants