Colocation is king

Alex Moldovan

@alexmoldovan.dev

Founder @ JSHeroes

Product Engineer @ together.ai

🙋

Disclaimer

<CODE>

Product Roadmap

Business Priorities

Company Pivots

Staff Change

Architecture Change

Tech Stack Change

<CODE>

Product Roadmap

Business Priorities

Company Pivots

Staff Change

Architecture Change

Tech Stack Change

Resilience

Colocation = proximity principle

https://alexmoldovan.dev/code-bites/colocation-is-king

https://speakerdeck.com/didoo/let-there-be-peace-on-css?slide=62

A few examples with two levels: folder and file

Remember our initial goal?

Write

Read

👩‍💻

function whoYouGonnaCall() {
  return "GHOSTBUSTERS!";
}

👨🏽‍💻

👩🏿‍💻

👩‍💻

1

3

1

10

Write phase

Technology adoption

JSX

CSSinJS

Tailwind

tanstack/query

Bonus: AI

Read phase

Mental load

Maintenance - unused utility/component - gone

Challenge conventional wisdom

1 component = 1 exported component

index files

unit tests = integration tests

Change the priority

When should you colocate?

When should you extract?

When should you extract?

1. Complexity

2. Different domain

3. Certain reusability

Thank you! Q&A?

Alex Moldovan

@alexmoldovan.dev

Founder @ JSHeroes

Product Engineer @ together.ai

Made with Slides.com