Skip to content

Conversation

@jakeboone02
Copy link
Member

@jakeboone02 jakeboone02 commented Jul 29, 2019

This PR rewrites react-querybuilder to use React Hooks. It also increases test coverage to 100% and avoids warnings in React 16.9 about unsafe lifecycle methods.

This library will not be compatible with React 17 without changing the lifecycle names to "UNSAFE_*", so some change is necessary anyway. Might as well future-proof it with Hooks.

@jakeboone02 jakeboone02 marked this pull request as ready for review July 29, 2019 21:42
@codecov-io
Copy link

codecov-io commented Jul 30, 2019

Codecov Report

Merging #87 into master will increase coverage by 21.15%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #87       +/-   ##
=========================================
+ Coverage   78.84%   100%   +21.15%     
=========================================
  Files           7     11        +4     
  Lines         156    169       +13     
  Branches       24      9       -15     
=========================================
+ Hits          123    169       +46     
+ Misses         32      0       -32     
+ Partials        1      0        -1
Impacted Files Coverage Δ
src/Rule.jsx 100% <100%> (ø) ⬆️
src/utils/getLevel.js 100% <100%> (ø)
src/QueryBuilder.jsx 100% <100%> (+37.5%) ⬆️
src/utils/findRule.js 100% <100%> (ø)
src/utils/generateValidQuery.js 100% <100%> (ø)
src/RuleGroup.jsx 100% <100%> (ø) ⬆️
src/utils/isRuleGroup.js 100% <100%> (ø)
... and 1 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 6a3e56a...93506de. Read the comment docs.

Copy link
Contributor

@pavanpodila pavanpodila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@jakeboone02 jakeboone02 merged commit e55d524 into master Aug 17, 2019
@jakeboone02 jakeboone02 deleted the hooks branch August 17, 2019 22:04
@jakeboone02
Copy link
Member Author

Thanks, @pavanpodila! I went ahead and merged this into master. Can you publish a new version on npm? It may need a major version bump since it now requires React >= 16.8.

@pavanpodila
Copy link
Contributor

Done: https://www.npmjs.com/package/react-querybuilder. Thanks for the great work Jake! 🚀

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.

4 participants