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 9, 2018

Summary

Misc changes that:

  1. Make the dev environment work on Windows and Node v9.
  2. Upgrade Webpack and UglifyJS.
  3. Build now outputs build stats to the meta/bundle-size-stats directory/ dir.
    1. The build stats are named the current package version, e.g. the current one is version-0.10.5.json.
    2. An example of this file can be seen here: https://files.terriblefish.com/version-0.10.5.json
    3. This json file can be visualized in any of the various tools online, e.g. the official tool which is great for visualizing module dependencies and this one from Chris Bateman that makes visualizing file sizes really nice.

Test Plan

npm test, npm run lint, and npm run flow all pass

Misc

  • I don't think any of these changes need tests
  • No API changes

The test and test-ci npm scripts currently rely on setting the NODE_ENV environment variable in a Unix-specific way. This moves the logic to set the environment variable into the cross-env package which makes this work on both Windows and Unix environments.

After applying this change I can successfully run `npm test` which I couldn't before.
Everything seems to work under 9.x so I'm adding it to the list of devEngines supported.
By upgrading webpack-stream to 4.x, we update webpack from version ^1.12.9 to ^3.4.1. This requires multiple fixes:
	* OccurenceOrderPlugin was renamed to OccurrenceOrderPlugin and can be removed as it is now on by default (https://webpack.js.org/guides/migrating/#occurrenceorderplugin-is-now-on-by-default)
	* Top-level 'debug' option is deprecated (https://stackoverflow.com/a/41779342)
	* DedupePlugin no longer needed (https://webpack.js.org/guides/migrating/#dedupeplugin-has-been-removed)
	* UglifyJs compression warnings are off by default so this option can be removed (https://webpack.js.org/guides/migrating/#uglifyjsplugin-warnings)
This will allow us to keep a historical record of how large the bundle size is to aid in seeing how we are improving (or regressing) the bundle size. The json file can be visualized in tools such as https://webpack.github.io/analyse or http://chrisbateman.github.io/webpack-visualizer/.
@flarnie
Copy link
Contributor

flarnie commented Feb 9, 2018

:D Thanks! I'll land this asap.

sofreshsoclean1

@flarnie flarnie self-requested a review February 9, 2018 17:49
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.

thibaudcolas added a commit to thibaudcolas/draft-js that referenced this pull request Feb 16, 2018
This dependency got introduced in a separate commit (f8ca29d) from the others in facebookarchive#1644. I imagine this is a mistake since it only provides dev-time tooling.
facebook-github-bot pushed a commit that referenced this pull request Feb 26, 2018
Summary:
**Summary**

This dependency got introduced in a separate commit (f8ca29d) from the others in #1644. I imagine this is a mistake since it only provides dev-time tooling.

**Test Plan**

For development, we can try a fresh install of the project:

1. `rm -rf node_modules`
2. `yarn install`. This runs `npm run build` via the `prepublish` script, so if it works it's good to go.

I don't think dependencies and devDependencies are processed any differently in a development environment, so not sure this check is even necessary.

For the published package:

1. `mkdir test`
2. `npm init -y`
3. `npm install git+https://github.com/thibaudcolas/draft-js.git#patch-2`
4. `npm ls --depth=1`

The `npm ls` result should be:

```
├─┬ draft-js@0.10.5 (git+https://github.com/thibaudcolas/draft-js.git#cb06920d0f3dea77692680dddba6ec475663c7b2)
│ ├── fbjs@0.8.16
│ ├── immutable@3.7.6
│ └── object-assign@4.1.1
├── UNMET PEER DEPENDENCY react@^0.14.0 || ^15.0.0-rc || ^16.0.0-rc || ^16.0.0
└── UNMET PEER DEPENDENCY react-dom@^0.14.0 || ^15.0.0-rc || ^16.0.0-rc || ^16.0.0
```

Note `uglifyjs-webpack-plugin` is absent, whereas it would have been there with `npm install git+https://github.com/thibaudcolas/draft-js.git#master`.
Closes #1653

Differential Revision: D7073476

fbshipit-source-id: f69e31c2ca252062d2d66080055fd08b88c5a275
alicayan008 pushed a commit to alicayan008/draft-js that referenced this pull request Jul 4, 2023
Summary:
**Summary**

Misc changes that:
1. Make the dev environment work on Windows and Node v9.
1. Upgrade Webpack and UglifyJS.
1. Build now outputs build stats to the `meta/bundle-size-stats directory/` dir.
    1. The build stats are named the current package version, e.g. the current one is `version-0.10.5.json`.
    1. An example of this file can be seen here: https://files.terriblefish.com/version-0.10.5.json
    1. This json file can be visualized in any of the various tools online, e.g. [the official tool](https://webpack.github.io/analyse) which is great for visualizing module dependencies and [this one from Chris Bateman](http://chrisbateman.github.io/webpack-visualizer/) that makes visualizing file sizes really nice.

**Test Plan**

`npm test`, `npm run lint`, and `npm run flow` all pass

**Misc**
* I don't think any of these changes need tests
* No API changes
Closes facebookarchive/draft-js#1644

Reviewed By: flarnie

Differential Revision: D6950926

Pulled By: flarnie

fbshipit-source-id: 47de3b030087af010a19694caeca3de13d16a099
aforismesen added a commit to aforismesen/draft-js that referenced this pull request Jul 12, 2024
Summary:
**Summary**

Misc changes that:
1. Make the dev environment work on Windows and Node v9.
1. Upgrade Webpack and UglifyJS.
1. Build now outputs build stats to the `meta/bundle-size-stats directory/` dir.
    1. The build stats are named the current package version, e.g. the current one is `version-0.10.5.json`.
    1. An example of this file can be seen here: https://files.terriblefish.com/version-0.10.5.json
    1. This json file can be visualized in any of the various tools online, e.g. [the official tool](https://webpack.github.io/analyse) which is great for visualizing module dependencies and [this one from Chris Bateman](http://chrisbateman.github.io/webpack-visualizer/) that makes visualizing file sizes really nice.

**Test Plan**

`npm test`, `npm run lint`, and `npm run flow` all pass

**Misc**
* I don't think any of these changes need tests
* No API changes
Closes facebookarchive/draft-js#1644

Reviewed By: flarnie

Differential Revision: D6950926

Pulled By: flarnie

fbshipit-source-id: 47de3b030087af010a19694caeca3de13d16a099
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