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

Add ReactDOM-like prop validation in development #47

Merged
merged 14 commits into from
Jan 19, 2020

Conversation

michalochman
Copy link
Owner

@michalochman michalochman commented Apr 24, 2018

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

Roadmap:

  • make sure it works when not using hooks
  • make sure it works when using hooks
  • set different default props for different types
  • add option to pass PIXI.Application to Stage (port from Add app prop to Stage #154)
  • remove width and height Stage props (deprecated in Deprecate width and height props of Stage #153)
  • fix CircleCI config
  • fix tests
  • fix test coverage
  • review CodeClimate issues
  • verify there are no performance regressions
  • double check on a real-world project
  • 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)
  • fix injected ApplyAnimatedValues in Animated example
  • update README
  • update usage of _app from class ref (_app -> _app.current)

@codecov
Copy link

codecov bot commented Apr 24, 2018

Codecov Report

Merging #47 into master will increase coverage by 0.78%.
The diff coverage is 94.02%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/utils.js 100% <ø> (ø) ⬆️
src/props.js 100% <ø> (ø) ⬆️
src/inject.js 100% <ø> (ø) ⬆️
src/PixiPropertyOperations.js 100% <100%> (ø)
src/PixiProperty.js 100% <100%> (ø)
src/Stage.js 100% <100%> (ø) ⬆️
src/ReactPixiFiber.js 100% <100%> (ø) ⬆️
src/ReactGlobalSharedState.js 100% <100%> (ø)
src/possibleStandardNames.js 100% <100%> (ø)
src/ReactPixiFiberUnknownPropertyHook.js 77.55% <77.55%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8068dd3...4bb5106. Read the comment docs.

@michalochman michalochman force-pushed the feature/dev-prop-validation branch from 857c3e9 to 65673c7 Compare October 11, 2018 15:16
@michalochman michalochman added the enhancement New feature or request label Nov 9, 2018
@michalochman michalochman force-pushed the feature/dev-prop-validation branch from 65673c7 to 4bb5106 Compare November 10, 2018 16:46
@michalochman michalochman force-pushed the feature/dev-prop-validation branch from 4bb5106 to 20298f0 Compare February 23, 2019 22:12
@michalochman michalochman force-pushed the feature/dev-prop-validation branch from d354c82 to 874fc02 Compare November 15, 2019 18:24
@michalochman michalochman force-pushed the feature/dev-prop-validation branch 2 times, most recently from 32e4d3f to be6a556 Compare November 23, 2019 18:13
@michalochman michalochman force-pushed the feature/dev-prop-validation branch from be6a556 to efb9674 Compare January 19, 2020 15:49
@michalochman michalochman changed the base branch from master to develop January 19, 2020 15:52
@michalochman michalochman merged commit 429a5e4 into develop Jan 19, 2020
@michalochman michalochman deleted the feature/dev-prop-validation branch January 19, 2020 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant