DEV Community

Discussion on: Moving away from ReactJs and VueJs on front-end using Clean Architecture

Collapse
 
petitkriket profile image
Sam

Not sure it scales well in a codebase maintained by a team/company. It's like asking to team mate to learn an extra layer of abstraction that fits over vue ?
Interesting, thanks for sharing !

Collapse
 
peerreynders profile image
peerreynders • Edited

It's like asking to team mate to learn an extra layer of abstraction that fits over vue ?

Perhaps the Clean Architecture ceremony is getting in the way of the core message here.

Clean Architecture is a moniker created by Robert C. Martin as an elaboration of Alistair Cockburn's Hexagonal Architecture and as such he is a proponent of keeping frameworks at arm's length. His talk Architecture the Lost Years is relevant here as he critizes frameworks (in this case Rails) for interfering with effective solution architecture (Bring clarity to your monolith with Bounded Contexts tries to address this).

In UI As An Afterthough Michel Weststrate boils it down to one core idea:

Initially, design your state, stores, processes as if you were building a CLI, not a web app.

So while his client side application is clearly a React application he can test the client side application logic without the UI (React):

A different approach to frontend architecture also demonstrates this approach by using an application specific interface instead of letting the UI bind to the stores directly.

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

You can decouple logic from react components without adding layers of abstraction other than the ones you'll get by default -usually- i.e. with HOCs (High Order Components) can be used for more things than just to increment New functionalities for other components. With HOCs you can actually separate responsibilities too.
You can create a HOC that accepts a React component as an argument, implements the data logic, and passes data, loading, and error as props into the wrapped React component.
This way your data and/or logic is decoupled from the UI.