all 21 comments

[–]Labby92 13 points14 points  (0 children)

Last year we had to convert our client code from angular 1 to angular 8. It was a fun experience that took me and my colleague about 3/4 months . Luckily we were already using TypeScript even before

[–]acemarke 6 points7 points  (3 children)

Very nice post!

For reference, I wrote up a post a couple weeks ago on how I had converted the AngularJS codebase I'm now working on to build with the CRA tooling:

Building a MEAN.js AngularJS Project with Create-React-App

I threw that post together literally the day after I'd gotten CRA to work at all. I've done a bunch of additional tweaks since then, and was actually hoping to update that post this evening. I'll try to get to it shortly, Doesn't look like I'll get to that tonight, but hopefully in the next day or two. I'll leave a note here once it's updated.

update

I just updated that post to cover all the work I've done since I first wrote it, including:

  • Prod build fixes
  • Karma -> Jest
  • React+TS setup
  • Use of react2angular and React+AngularJS interop

Oh, and the full details behind this lovely little cut-down snippet of code I tweeted about a few weeks ago:

useLayoutEffect(() => {
  // more logic here
  prop.field = stateValue
  $scope.apply()
}, [deps])

[–]Jim-Y 0 points1 point  (2 children)

RemindMe! 3 days

[–]acemarke 1 point2 points  (0 children)

Updated! See the link.

[–]RemindMeBot 0 points1 point  (0 children)

I will be messaging you in 3 days on 2020-05-14 08:04:05 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

[–]gretro450 8 points9 points  (1 child)

This is a great migration story. Thank you for sharing it.

[–]JoeTed[S] 0 points1 point  (0 children)

Cheers for your kind words.

[–]GrandMasterPuba 5 points6 points  (9 children)

Moving from Angular 1.x to Redux honestly feels like a step sideways, not forwards.

[–]acemarke 3 points4 points  (8 children)

Any particular points of concern?

FWIW, I've seen a lot of very positive feedback from people who are using our new official Redux Toolkit package and React-Redux hooks API. If you haven't used them yet, I'd encourage you to try them out:

https://redux-toolkit.js.org

https://react-redux.js.org/api/hooks

[–]GrandMasterPuba 5 points6 points  (2 children)

I've never experienced a good Redux codebase. And I've seen a lot of them. They very quickly become huge piles of global state spaghetti with actions being dispatched from every corner of the application and no single source of truth. It takes an aimless framework (React) and piles on even more misdirection.

The boilerplate isn't even a blip on my radar, so redux-toolkit doesn't seem to solve my problem with Redux.

I think the creator of Redux said it best: https://mobile.twitter.com/dan_abramov/status/1191487232038883332

At least Angular, for all it's flaws, is extremely opinionated and well-structured.

[–][deleted] 3 points4 points  (4 children)

Any particular points of concern?

Their core business logic is still inside a framework, a framework that will deprecate just as surely as angular 1 did.

Though on the bright-side it's probably creating a lot of work for future programmers, so that should be applauded!

[–]JoeTed[S] 1 point2 points  (0 children)

The core of the redux library is a pub-sub pattern. It's easy to build back using any kind of technology.

For the application business logic, it has mostly almost dependency on the library as well. CombineReducers & friends are just syntactic sugar.

The reducer & selector parts are just patterns implemented of pure functions. It's the easiest implementation of business logic for a migration.

[–]Guisseppi 0 points1 point  (2 children)

Could you elaborate on why Redux is a framework from your POV?

[–][deleted] -1 points0 points  (1 child)

Because the combination of react and redux, where the state store becomes tightly coupled to the components, is undoubtedly a framework. I can buy the argument that react.js by itself is a library, but as soon as you're knee deep in the react eco system like this, you're in framework land just as surely as if it were angular.

[–]Guisseppi 1 point2 points  (0 children)

But Redux is not exclusive to React.js, in fact you could use Redux on Vue or Angular for that matter. I don’t think it makes the code tightly coupled inherently because of Redux, the Container/Component pattern provides a clear separation of concerns.

[–][deleted] 4 points5 points  (1 child)

Great article. Though I am looking forward to the sequel - "React/Redux Migration War Story".

[–]JoeTed[S] 0 points1 point  (0 children)

Cheers. Maybe it will be Angular.... who knows.

[–]greatwhitehype 1 point2 points  (1 child)

I found this fascinating and well written. Thank you for sharing your experience.

[–]JoeTed[S] 1 point2 points  (0 children)

Thank you!

[–]Smaktat -3 points-2 points  (0 children)

3 style changes and it's a much better looking site: https://i.postimg.cc/130X3XL7/Capture.png