News for hackers. Stuff that matters.
Re:Angular v8.0 by azangru on Wednesday May 29, 2019 @11:40AM (#20041452)
> It's also interesting to see the React community move towards some of the things that Angular has been doing for years: embracing TypeScript, extracting business logic to services (or you can call them Hooks), creating injectable shared state (or you can call it Context).

Huh? Hooks are just a way to use component lifecycle in absence of classes (note how React is pushing towards having components as functions as opposed to Angular's components as classes/objects). The new context api is basically just a replacement/improvement of the old context api, which has been in React for ages (React Router was built upon the old context api from get go), but has always been badly documented and considered a private interface, something you were not supposed to touch. As for embracing Typescript, the React community has extensively used static typing with Flow (since this is something that the React team itself uses) for a couple of years, which is very similar to Typescript.

Having CLI generators (such as create-react-app) is definitely something that React borrowed from other communities, but I am not sure whether Ember or Angular was the main influence.

Re:Angular v8.0 by pure on Wednesday May 29, 2019 @12:11PM (#20041951)
Definitely correct me if I'm wrong, but I also thought hooks were for factoring out common logic and sharing it among functional components. I see lots of "hooks" libraries floating around.

For Context, like you said, it existed before, but everyone was told not to use it. After the new API came out, people started suggesting ditching Redux for Context, and I know a lot of people did that. Using Context in that way is very similar to creating a stateful service in Angular and injecting it into your components.

Re:Angular v8.0 by ng12 on Wednesday May 29, 2019 @02:48PM (#20043884)
Hooks are used for abstracting component state logic. React is just as agnostic concerning how you implement your business logic as ever.
Re:Angular v8.0 by nicoburns on Wednesday May 29, 2019 @03:31PM (#20044362)
I agree that the pattern of "services" is a good one. But you don't really need Angular's DI for this in javascript. You can just use an ES6 module.
Re:Angular v8.0 by bradstewart on Wednesday May 29, 2019 @03:55PM (#20044629)
Unless you care about the scope/lifecycle of the service. Or want to easily replace its implementation in different contexts (like tests).
Re:Angular v8.0 by ng12 on Wednesday May 29, 2019 @03:57PM (#20044654)
Most test frameworks allow you to stub imports. DI is just one of the many wheels Angular has reinvented.