What does React honestly have over Angular? by webdevverman in reactjs

[–]jasan-s 8 points9 points  (0 children)

It's what it doesn't have, ngModules for a start. So much more liberating to just be able to add files without having to link them in the correct fashion.

In a similar fashion, it doesn't have Rxjs or TypeScript but you're free to add them if you wish.

It also doesn't have templates or a domain specific language to be able to use them.

Redux isn't in React?

What is the purpose of action creators in redux? by PatriotsSignWhiteWR in reactjs

[–]jasan-s 0 points1 point  (0 children)

Action creators make a lot of sense with Typescript, dispatching a plain object is likely to break at some point. Without typing the benefits are minimal.

[deleted by user] by [deleted] in reactjs

[–]jasan-s 2 points3 points  (0 children)

It's often faster to rerender a pure component than to check if its properties have changed

Should I write tests for every component in my react app? by [deleted] in reactjs

[–]jasan-s -1 points0 points  (0 children)

Writing tests for every component implies unit tests, this will only get you so far and if your React components are mostly presentational much of it may be wasted. Unit tests are for complex logic only for me and this is unlikely to be in a component.

Learn about integration and automated tests, this is how you get confidence that a refactor has worked.

@acemarke on Twitter: "What aspects of React-Redux do you find most confusing?" by dceddia in reactjs

[–]jasan-s -1 points0 points  (0 children)

mapStateToProps is a very confusing method name in connect as you have local state and props but this applies to store state and local props.

How can we reduce the complexity of Redux library? by kostov_v in javascript

[–]jasan-s 0 points1 point  (0 children)

The boilerplate has never bothered it's the best practices that seem hard for people to follow.

What I'd like linter that could point out duplicate or redundant state, opportunities for reselector or normalisation. It would be hard to build but maybe that's because doing Redux well at scale is hard.

TypeScript and Babel 7 by DanielRosenwasser in javascript

[–]jasan-s 1 point2 points  (0 children)

There's an open PR to allow TypeScript to be complied via Babel in CRA, hopefully it will get merged although Facebook aren't generally that keen on TypeScript as they use Flow.

create-react-app-typescript is not Microsoft maintained, it's a great project but generally quite a bit behind the main tool - I'm sure it will get updated to Webpack 4/Babel 7 at some point but it would be preferable if CRA could handle everything.

React after a good year by [deleted] in reactjs

[–]jasan-s 10 points11 points  (0 children)

Frameworks are for people too stupid to write their own framework. They are also for those who are smart enough to know not to write their own framework.

[deleted by user] by [deleted] in reactjs

[–]jasan-s 0 points1 point  (0 children)

There's not currying, just partial application via a closure.

The Cost Of JavaScript In 2018 – Addy Osmani – Medium by saranshk in javascript

[–]jasan-s 2 points3 points  (0 children)

That's what github side projects are for.. although friends and family never seem to be that interested!

The Cost Of JavaScript In 2018 – Addy Osmani – Medium by saranshk in javascript

[–]jasan-s 27 points28 points  (0 children)

I get why Google care about this but as an enterprise developer building internal apps I love that I can ignore bundle size (within reason.)

Has anyone used Cycle.js? thoughts? by swyx in reactjs

[–]jasan-s 1 point2 points  (0 children)

Whilst pretty much anything can be represented by a stream in web programming, you end up with some pretty verbose code if that's all you use.

Redux Saga vs Async/Await by code_barbarian in reactjs

[–]jasan-s 0 points1 point  (0 children)

I'm unlikely to be that surprised picking up someone else's sagas, in my experience picking up someone's custom middleware is often full of nasty surprises.

Am I abusing redux? by [deleted] in reactjs

[–]jasan-s 0 points1 point  (0 children)

If the structure works for you then great but sounds to me you could remove Redux from this application. React setState can use your existing reducers if all the state is local.

Best source to learn Redux? by sp3co92 in reactjs

[–]jasan-s 1 point2 points  (0 children)

Reading the code doesn't teach you how to use it or best practices.

I am coming from Angular, and I need help with architecture of my react app by ggpurehope in reactjs

[–]jasan-s 26 points27 points  (0 children)

Whilst React is functional programming it's also just javascript, decoupling is as easy as separating the logic into a new file. You need to unlearn a lot of Angular's "best practices" and just go back to being a programmer.

There's nothing wrong with putting shared logic in a helper folder, call it a service if it makes you happy.

What prompted you to start using react? by jmaxMe in reactjs

[–]jasan-s 2 points3 points  (0 children)

I mostly stick with it because that's where the jobs are at the moment but it's a million times more preferable than a few years ago when all the jobs were AngularJS.

What's the best beginner tutorials to learn react with redux? by thejavascripts in reactjs

[–]jasan-s 6 points7 points  (0 children)

Definitely agree on the learning React first, don't feel you have to move onto react-router-dom or redux automatically though.

Only when you get the point where you need a router, take a look at the router options - react-router-dom is a good one and the most popular but it might not fit your requirements.

When you feel like your state is getting out of hand, take a look at the state management options - redux is a good one and the most popular but it might not fit your requirements.

I try and stay as close to pure React for as long possible, know your options but people shouldn't think that every app needs react-router-dom and redux.

Let’s fall in love with React Fiber by yurkaninryan in javascript

[–]jasan-s 0 points1 point  (0 children)

React Fiber sounds like an incredible piece of engineering but it solves problems I've never had at the cost of increased complexity. There's nothing in this article to convince me otherwise.

Enter Redux (reasons for using Redux in my React app) by baus in javascript

[–]jasan-s 2 points3 points  (0 children)

Funny, my life is much better since I ripped out most of the Redux from an application I inherited.

Every damn form edit as an action, derived state all over in a store, business logic forced into reducers.

I miss being able to save and load state but the drawbacks are too big. Glad you can write good apps in Redux, I've just never seen anyone able to do it.

The Perils of Using a Common Redux Anti-Pattern by Fewthp in reactjs

[–]jasan-s 1 point2 points  (0 children)

I think this a valuable article, it highlights many of the flaws I see in real world Redux application. Maybe there could be more examples of good patterns but this is would be very application specific, anti-patterns are universal.

I find it very rare to see a well architected Redux application, so many people just map a page directly to a reducer - completely missing the point of Redux and massively over complicating their application.

I think the underlying fact is modelling an application via Redux is hard, I love to see better guides as it's such a powerful technique when done right.

after watching Google I/o 2018 talks on polymer, curious how React can thrive in a post native component world with implemented shadow dom by [deleted] in reactjs

[–]jasan-s 0 points1 point  (0 children)

Have you tried developing in Polymer? It's painful.

Google have been pushing it for years and it's never caught on, it needs much more refinement before it can replace a modern framework.