Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert accidental breaking change for 15.5 #20

Merged
merged 13 commits into from Apr 11, 2017
Merged

Conversation

gaearon
Copy link
Contributor

@gaearon gaearon commented Apr 11, 2017

There's a bunch of changes to unpack here but basically:

  • Created a separate text fixtures for development, production in 15, and production with dependency on standalone prop-types package.
  • Their intended behavior is this:
    • PropTypesDevelopmentReact15: When you depend on React@15.PropTypes in development, it runs type checks and shows warnings.
    • PropTypesProductionReact15: When you depend on React@15.PropTypes in production, everything is a no-op. It doesn't run the type checks but the code is still there. Calling validators doesn’t throw. This fixes PropTypes throwing errors in production? #17.
    • PropTypesDevelopmentStandalone and PropTypesProductionStandalone:: When you depend on prop-types, it runs type checks and shows warnings in development. Manually calling validators throws. (Just like we warned in earlier releases of React itself.) This is not a breaking change because migrating to prop-types is an intentional decision, and requires you to update your code. We could call it out more explicitly but it’s explained in README.

I also cherry-picked @aweary’s two commits for reducing the browserify bundle from #18 so that I could verify my changes. Production UMD bundle shows dead code is eliminated correctly.

When we release 16, we can drop the React15 tests, delete the factory indirection and bump the major version.

@flarnie
Copy link
Contributor

flarnie commented Apr 11, 2017

Great commit message - reading the code now. And let me know if there are any other checks I should do to verify this - pulling down the change and running fixtures, or anything like that.

@gaearon
Copy link
Contributor Author

gaearon commented Apr 11, 2017

I don't really have any ideas for testing this except creating a project, dropping this version of prop-types there, and verifying proptypes work as expected in prod builds (according to the above matrix).

@gaearon gaearon merged commit ceb4a9e into master Apr 11, 2017
@gaearon gaearon deleted the revert-breaking-change branch April 11, 2017 18:53
@gaearon gaearon mentioned this pull request Apr 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PropTypes throwing errors in production?
2 participants