6.0.0 - The Hooks Edition
After 4 months of work, I'm happy to announce version 6 of RMWC! Open Source is a labor of love, and this revision certainly had an emphasis on the "labor" part.
Why?
Since the creation of RMWC, React and Javascript have continued their blazing pace of change. For context, this project was initially written in FlowTyped with a bunch of classes, and Google's part was plain old JS. Fast forward 2.5 years and React has undergone a paradigm shift with hooks while Typescript continues to expand… Also, a while back, Google released their own React wrapper that was very similar to this project. It was recently declared abandonware which has lead to an increase in interest in RMWC since it should be a relatively simple migration. Needless to say, RMWC needs some love! It's time for some spring cleaning.
Goals
- A full internal API rewrite to hooks
- A full internal conversion of components to idiomatic functional React components. Currently there is an abstraction called 'componentFactory' which is a barrier to entry for 3rd party contributors. With this change, anyone wanting to contribute should be able to jump in and get going.
- Removal of all existing deprecations.
- Smaller bundle size
- Better performance
- Get back in sync with the latest material-components-web
New Badge Component
Add indicators and counters to elements in your app. https://rmwc.io/badges
Bugfixes
- Too many to count ;), check out the changelog for specific details https://github.com/jamesmfriedman/rmwc/blob/master/CHANGELOG.md.
Migration Guide
There are very few breaking changes in V6 and they are relatively minor in scope.
- The rewrite to hooks requires a minimum version of React 16.8. If you were on version 16 already, you should be able to upgrade without any issues.
- List: onAction event now returns evt.detail.index instead of just evt.detail.
- Grid: GridInner has been renamed to GridRow. You should be able to do a find and replace all.
- Select:
hoistToBody
has been replaced withrenderToPortal
for select elements. See the Select documentation on how to add the main RMWC Portal element. https://rmwc.io/select-menus - Dialog: the
onStateChange
prop has been removed in favor of additionalonOpened
andonClosed
props. - CollapsibleList:
startOpen
has been renamed todefaultOpen
- All previous deprecations have been removed
- Advanced Issues: Some users more familiar with MDC-web have directly accessed the foundation on certain components to modify their behavior. This is still available but the method in which it's exposed has changed. Use the
foundationRef
prop on applicable components to get access to their foundation instance. - Remember, you can upgrade one component at a time since they are all deployed independently.
Thank you, and enjoy!