Lessons learned: rebuild Twitter web app

My notes from - https://paularmstrong.dev/blog/2022/11/28/lessons-learned-how-i-would-rebuild-twitter-today/

Great article from the core member of the original team that built the Twitter web app. He describes how he would approach building an app like Twitter nowadays.

  • No React Native for Web: They used React Native for Web but not for its main selling point - cross-platform components. Instead, they used it for default styling, automatic LTR/RTL text direction swapping, and some performance help. It was not the best experience for the team, and it had impact on performance.

  • Solid-js or another non-virtual DOM framework: He doesn't want large cascading effects when updating something in a virtual DOM tree (so React-like frameworks). He prefers frameworks like Solid.

  • Use Tailwind CSS, not CSS-in-JS: Tailwind is the best for almost all new projects. CSS-in-JS solutions are too heavy.

  • Use Vite or TurboPack: Webpack has reached its peak, most likely Vite is the best option now.

  • Split into multiple applications with module federation: Split the app into smaller apps to make code reviews, CI and deploys faster. Then use Module Federation (micro frontends) to glue it all together.

  • Deno vs Node.js: Possibly consider Deno over Node, it has nicer core APIs, better patterns and ergonomics.

  • HTTP server framework: Surprisingly, not a lot of would have changed with a faster web server. Therefore, the main contenders would be either Express or Fastify (or Oak in Deno).