Skip to main content

3 posts tagged with "patterns"

View All Tags

Props, Composers, and Providers: the composition pattern we're converging on

· 12 min read
Maxime Grébauval
Maxime Grébauval
Senior Front-end Software Engineer
Cover

Our frontend has grown fast. Along the way we accumulated props drilled several layers deep to reach one leaf, components that fetch data, hold state, and render markup at once, and rows steered by a growing pile of props.

None of this is a disaster. It is just friction, and it compounds. So we made a deliberate call: converge on composition, and treat it as a ladder. You start on the cheapest rung, and you only climb when a concrete pain pushes you up.

This article is about that ladder: how we compose React components, and when each step is worth its cost. The wider story, where the Orus frontend is heading, is for another article.

How we use dependency injection with TypeScript at Orus

· 6 min read
Marvin Roger
Marvin Roger
Squad Lead
Cover

Curiously, dependency injection is not something that we often see in the JavaScript ecosystem.

Still, it's a powerful pattern that can help you make your code more flexible and easier to test, if implemented properly.

After a lot of iterations, we've come up with a dependency injection system that works well for us at Orus. The point of this article is not to cover exactly how dependency injection works, but rather to share our learnings in building it.

Future-proof union values handling with TypeScript

· 7 min read
Samuel Rossille
Samuel Rossille
Chief Technology Officer
Cover

Unions and discriminated unions are great tools that can make the code flexible, while keeping the complexity to a low level. But tiny differences in the style of the code that uses them can make the difference between robust code, and bugs waiting to happen.

In this article, we will dive into two patterns that can help us make our code more future-proof.

But before "future-proofing" our code, let's remember that many technical debt nightmares originate from unfortunate attempts to be future-proof.

So let's be clear about what we mean by future-proof code.

Early abstraction meme