4 ms·
At this point, I'm quite satisfied with React and use it for most of my new JavaScript UIs. A few potential improvements that come to mind: 1. More strictness
by supernintendo 8y ago
At this point, I'm quite satisfied with React and use it for most of my new JavaScript UIs. A few potential improvements that come to mind:
1. More strictness in terms of what is and is not valid JSX. Just today I was working on a React Native app that compiled for iOS but not Android. The issue ended up being a stray semicolon, leading to syntactically incorrect code that allowed for a valid iOS build anyway. I would expect it to fail regardless of environment. The error was also very cryptic although this probably has more to do with React Native than React [1].
2. More proactive warnings at runtime for development builds. React does a great job at telling me what I'm doing wrong; I'd also like it to tell me what I could be doing better. Some ideas are cyclomatic complexity warnings to detect when there is too much branching logic in a component or warnings that indicate that a component is getting too large and could be refactored.
3. Rebuilding the virtual DOM in WebAssembly. Now this might be excessive as React performs quite well in my experience. But it could lead to performance and portability benefits as well as just be a cool project to work on. Mozilla published an article today regarding gains in JS and WebAssembly interop performance; check it out if you haven't [2].
[1] https://github.com/facebook/react-native/issues/13243 https://github.com/facebook/react-native/issues/13243
[2] https://hacks.mozilla.org/2018/10/calls-between-javascript-and-webassembly-are-finally-fast-%F0%9F%8E%89/ https://hacks.mozilla.org/2018/10/calls-between-javascript-a...
- sophiebits 8y agoGlad to hear React is working well for you! Warning for things that aren’t errors seems like a slippery slope and one where false positives could be very annoying, but it’s an interesting request. For the specific problem of large, confusing components, we have some ideas about how to help make these more manageable that you’ll hopefully hear about soon. React implemented in WASM is also a fun possibility but not one that we’ve started on yet. :)
- acemarke 8y agoLin Clark did a talk last year where she discussed how React could _theoretically_ make use of WebAssembly, and how much benefit there was likely to be: https://www.youtube.com/watch?v=3GHJ4cbxsVQ https://www.youtube.com/watch?v=3GHJ4cbxsVQ
- scns 8y agoHave a look at reason-react, the compiler will find all syntax errors