4 ms·
To add to your point, I feel that React/Redux is easier to debug. Redux has the developer tools, which allow you to rewind state as well as hot module reloading
by jamra 10y ago
To add to your point, I feel that React/Redux is easier to debug. Redux has the developer tools, which allow you to rewind state as well as hot module reloading, which means you can rewind state, and then replay it with your code changes. This means you don't need to log back in to your app, navigate to where you were previously at, and then recreate whatever extra state each time you try a fix.
The functional approach via Redux is what a lot of people look at, but I prefer to look at the developer tools and the state of debugging.
JSX is easier for me to debug since you can just drop breakpoints in your javascript and step through with the debugger. This encourages more vanilla javascript usage, which is easier to debug and reason about.
- rpeden 10y agoYou can use Redux with Angular 2, and it works quite well! The dev tools work the way you'd expect them to. Webpack hot module loading works well Angular 2 as well. I agree that JSX is easier to debug. The Augury[1] Chrome extension serves the same purpose for Angular 2 as the React Dev Tools extension does for React. That's not to say that React isn't great too! I like it lot. [1] https://augury.angular.io/ https://augury.angular.io/
- tracker1 10y agoHow does it do with synching your route state with the redux store? I remember when I played with it (think routing has been replaced twice since) that was the real beast, though redux was a pretty nice fit other than that.
- rpeden 10y agoThat's a good question; I didn't try it. On the bright side, if you don't mind diving one layer below the surface, the code for react-router-redux is short, well written, and easy to understand: https://github.com/reactjs/react-router-redux https://github.com/reactjs/react-router-redux Even if the equivalent already exists for the current iteration, you could probably write your own in an afternoon without rushing yourself too much.
- tracker1 10y agoThat's kind of what I did... It was not in a modular fashion though as a lot of it was trying to discover how the lifecycle worked in Angular 2... basically, I wanted to be able to trigger an effective redirect from angular or via redux action or via a route/hash change, and have the redux always reflect the current route... there were some bits with how the change detection works in ng2 that I had to tap into, apparently this is one of the bits that changed since I last used it though. If I have to use ng2 again will take the time... aside, I really wish they'd renamed it to Angular 3 (3.0) for release, given the massive changes to "Angular 2" over its' lifetime and the number of broken blog articles and tutorials...
- tracker1 10y agoAgreed, I also feel that React has the best console output in general for errors and warnings than any browser based UI system I've ever used... Absolutely fantastic, and the breakpoints are nice too. I do wish the webpack-hmr worked better with pure render components though, at least with sessionStorage backing my redux store I can refresh the browser without a lot of loss...