react-gradual-upgrade-demo
eslint-plugin-react
Our great sponsors
react-gradual-upgrade-demo | eslint-plugin-react | |
---|---|---|
9 | 67 | |
420 | 8,818 | |
0.2% | 0.6% | |
0.0 | 8.4 | |
over 1 year ago | 11 days ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
react-gradual-upgrade-demo
-
Node module issues when gradually upgrading to React 17 from React 15
I've run into a weird issue when trying to gradually upgrade. If you don't know, React Gradual upgrade is a fun process where you require three package.json's - one in the root directory, one in src/legacy and one in src/modern. Refer to here for more info: GitHub I am getting the errors after running npm start ("webpack-dev-server --hot"):
-
TodoMVC App Written in Vanilla JavaScript
The event listeners get cleaned up by the GC. At least in modern browsers.
While events aren’t explicitly mentioned, MDN offers an insightful read:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memo...
Alternately, one can use event delegation [0]. As does React under the hood [1].
0 - https://javascript.info/event-delegation
1 - https://reactjs.org/blog/2020/08/10/react-v17-rc.html#change...
-
Enzyme is dead. Now what?
React 17 Release Candidate came out. Shortly after, an issue has been raised in Enzyme repository to add support for React 17. Immediately after, @layershifter has opened a PR adding an official enzyme-adapter-react-17.
-
React 17 runs useEffect cleanup functions asynchronously
Yes, the React core team discussed that in their blog post on the release candidate of v.17, and advised those who really need synchronous cleanup to use the useLayoutEffect.
-
The Plan for React 18
React 17 included quite a bit of that work. Most of the event system was simplified/rewritten, pooling was removed, and delegation moved to the root.
-
React 17 DOM tree inside of React 16.2 DOM
Is it possible to do the reverse of the demo? - https://github.com/reactjs/react-gradual-upgrade-demo/
-
Two versions in the same web app
See https://github.com/reactjs/react-gradual-upgrade-demo
-
React.js 17: No New Features and New JSX Transform
You can take a look at a demo of gradual updates on an example repository put together by the React team.
-
What’s new in React v17.0 ?
Checkout the demo for gradual upgrade.
eslint-plugin-react
-
Interesting Bugs Caught by ESLint's no-constant-binary-expression
> [1] https://github.com/jsx-eslint/eslint-plugin-react/blob/maste...
From what I remember, being able to pass children as a prop is considered a side-effect of an implementation detail, that breaks the expected abstraction. There really isn't any reason to use it, and I think there's a chance it may even confuse the virtual dom diffing?
Also this would prevent you from accidentally doing both at once:
Is it me?}>
-
Speeding up the JavaScript ecosystem – Polyfills gone rogue
I try to focus on the issues rather than individuals, but the root of the problems in the listed eslint plugin libraries points to ljharb.
If you do some simple digging into these libraries, you will find that these types of commits are quite common within them.
https://github.com/jsx-eslint/eslint-plugin-react/commit/e1d...
https://github.com/jsx-eslint/jsx-ast-utils/commit/bad51d062...
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/...
He would rather see the download count of these polyfill libraries https://github.com/ljharb/ljharb#projects-i-maintain increase, compared to assessing the health of the JavaScript ecosystem.
-
The Best ESLint Rules for React Projects
An obvious pick for React projects, but eslint-plugin-react along with their plugin:react/recommended rule set is a must. This will give you some sensible rules such as requiring a key to be specified in JSX arrays. eslint-config-airbnb is another good (if a bit loose) base rule set on top of eslint-plugin-react to start from.
-
Avoid "&&" Operator for Conditional Rendering in React
If you already have the eslint-plugin-react installed, you can enable the following rule.
-
Create React UI Lib 1.1: Ladle and ESLint
You can also add ESLint now (props to @femincan for the suggestion). It comes with recommended settings for these plugins: typescript, prettier, react, react-hooks, jsx-a11y.
- Confusion over one of the examples of the jsx-no-literals linting rule
-
What's weirdest webdev practice in your company?
Also for what it’s worth, there’s a React ESLint code rule that can enforce this behavior either way for Component props - I’m not in front of a code base atm, but I wonder if my preference for the syntax above is influenced by a popular linting preset like AirBnB which enforces this rule? https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
-
Removing Default React Imports. For a Cleaner Code
The missing piece is on this page, in a small note at the end of the page: the eslint rule to disallow missing React when using JSX.
-
Ask HN: What are you predictions for 2023?
Thanks for weighing in, that's good to know. After wondering if this could be auto-refactored, I came across https://github.com/jsx-eslint/eslint-plugin-react/blob/maste..., will definitely have to give that (with `--fix`) a try in the new year and see if I can get the team on board! – desire for typescript being a compelling factor.
Personally I do like the non-destructured `props.abc` throughout component code, really helps clarify at a glance where something is coming from, whether it's locally or externally defined, etc. Code style is an endless exercise in compromises/opinions though, even _with_ tools like eslint and prettier.
-
Recommended React Hooks Convention
eslint-plugin-react react/hook-use-state
What are some alternatives?
fastdom - Eliminates layout thrashing by batching DOM measurement and mutation tasks
stylelint-config-prettier - Turns off all rules that are unnecessary or might conflict with prettier.
react-codemod - React codemod scripts
berry - 📦🐈 Active development trunk for Yarn ⚒
react-18 - Workgroup for React 18 release.
prop-types - Runtime type checking for React props and similar objects
react-pdf - Display PDFs in your React app as easily as if they were images.
javascript - JavaScript Style Guide
react-date-picker - A date picker for your React app.
razzle - ✨ Create server-rendered universal JavaScript applications with no configuration
useThrottledState - Drop-in replacement for `useState` with throttling capabilities.
eslint-plugin-prettier - ESLint plugin for Prettier formatting