A state management library by Facebook that helps with React applications that requires state coordination between elements far from each other in the component tree. Similar to MobX, it features auto subscriptions of data to component so it only re-render components if the data that it subscribes to changes. One notable difference of Recoil compared to other existing libraries is it is very React-centered and its concepts seems very natural if you're already familiar with React. The way I look at it is "super-powered" `useState`. As of now, it's still considered as experimental.
This Month on React
- Recoil, an Experimental State Management Library by Facebook
- Mock Service Worker, mocking your API for development and testing
MSW (Mock Service Worker) is a mocking utility that mock your network requests using Service Worker. It supports mocking in NodeJS environment so you can use the same sets of mocking in your development and Jest testing.
- Remix, React framework by creators of React Router
React framework from the creators of React Router, Ryan Florence and Michael Jackson. It is still under development, but they have a newsletter that talk about the problems in current React ecosystem and their approach on how to solve them.
- Cypress Component Tests - test your components in real browser environment
Cypress, the end-to-end testing framework that we featured previously, has added a beta feature - Component Testing. You can use it to test a React component in isolation. The benefit of it over using Jest is it will runs in actual browser environment instead of JSDOM.
- Yarn v2 Rollout Causes Intense Debates
Yarn 2's rollout plan causes intense debates because its maintainers intends to mark Yarn v1 as "legacy" while v2 could not support many existing projects and libraries yet. The "legacy" tag concerns some developers because it may cause confusions, especially new developers. Some even suggest yarn v2 should not name themselves as yarn2 as it's entire new code from scratch and there is no clear migration path at the moment. At the end, the maintainers decide to mark yarn v1 as "classic" and the website is now https://classic.yarnpkg.com for yarn1 while https://yarnpkg.com/ is used for yarn v2.
- Learn JavaScript Mental Model from Dan Abromov
Dan Abromov (one of the core maintainers of React) had recently started a course, Just Javascript that teaches you the mental model for JavaScript. Highly recommended. You can signup at its website.
- Cross Browsers E2E Testing Getting Easier
Microsoft had released a library, playwright that allows you to test in Webkit, Chromium, and Firefox. At the same time puppeteer and Cypress had just released a new version that supports testing on Firefox, in addition of Chrome.
- React Router v6 Beta Release
react-router releases v6 beta. Key features are relative link, nested routes, and suspense-ready navigate API.