-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add ReactDOM-like prop validation in development #47
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #47 +/- ##
==========================================
+ Coverage 95.63% 96.41% +0.78%
==========================================
Files 11 16 +5
Lines 229 335 +106
==========================================
+ Hits 219 323 +104
- Misses 10 12 +2
Continue to review full report at Codecov.
|
857c3e9
to
65673c7
Compare
65673c7
to
4bb5106
Compare
4bb5106
to
20298f0
Compare
d354c82
to
874fc02
Compare
Merged
32e4d3f
to
be6a556
Compare
be6a556
to
efb9674
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds prop validation in development mode in a way similar to
ReactDOM
(as it was based on it). I've also reorganised reconciler-related methods to be more in line with ReactDOM.There should be no breaking changes now, but this will be released under
v1.0.0
tag.I'm also thinking about lower-casing host components, i.e.
<Sprite />
would become<sprite />
etc., which would require adding one more validator but would allow for use without importing.Preview:
![image](https://user-images.githubusercontent.com/1628450/39217672-5f40d4e2-4821-11e8-9097-5d481cccd746.png)
Roadmap:
width
andheight
Stage props (deprecated in Deprecate width and height props of Stage #153)consider strict (warn on "unknown" props) mode / loose mode (warn only on invalid props) or add way to inject "custom" props (e.g. from plugins)ApplyAnimatedValues
in Animated example_app
from class ref (_app
->_app.current
)