Skip to content

Commit 6ffd0e2

Browse files
virgofxjquense
authored andcommitted
Enhancement for best practice prop types. (#70)
* Fixes #69: Adding capability to reduce production build output size and allow users that import this package to include prop types in development and optionally remove them using Webpacks UglifyJS + Define plugin. * Updated .babelrc that properly wraps prop-types. * Restoring the original constant declaration for prop types as uglify does find dead code and remove it. * Updating changelog.
1 parent b54588a commit 6ffd0e2

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"plugins": [
1010
"dev-expression",
1111
"add-module-exports",
12-
"transform-object-assign"
12+
"transform-object-assign",
13+
["transform-react-remove-prop-types", { mode: "wrap" }]
1314
],
1415
}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,24 @@
22
> 2017-XX-XX
33
44
- **Feature:** Dist build now includes both production and development builds ([#64])
5+
- **Feature:** PropTypes are now wrapped allowing for lighter weight production builds ([#69])
6+
7+
[#64]: https://github.com/reactjs/react-transition-group/issues/64
8+
[#69]: https://github.com/reactjs/react-transition-group/issues/69
9+
[v1.1.X]: https://github.com/reactjs/react-transition-group/compare/v1.1.3...master
510

611
## [v1.1.3]
712
> 2017-05-02
813
914
- bonus release, no additions
1015

16+
[v1.1.3]: https://github.com/reactjs/react-transition-group/compare/v1.1.2...v1.1.3
17+
1118
## [v1.1.2]
1219
> 2017-05-02
1320
1421
- **Bugfix:** Fix refs on children ([#39])
22+
1523
[v1.1.2]: https://github.com/reactjs/react-transition-group/compare/v1.1.1...v1.1.2
1624
[#39]: https://github.com/reactjs/react-transition-group/pull/39
1725

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"babel-plugin-add-module-exports": "^0.2.1",
5858
"babel-plugin-dev-expression": "^0.2.1",
5959
"babel-plugin-transform-object-assign": "^6.22.0",
60+
"babel-plugin-transform-react-remove-prop-types": "^0.4.5",
6061
"babel-preset-latest": "^6.24.0",
6162
"babel-preset-react": "^6.23.0",
6263
"babel-preset-stage-2": "^6.18.0",

0 commit comments

Comments
 (0)