↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

Why Discourse uses Ember.js

The post argues that client-side MVC frameworks are useful when an application becomes highly interactive. In Discourse, state such as whether a post is liked can live in a JavaScript object and template bindings can re-render the UI automatically, avoiding DOM traversal and brittle logic tied to HTML layout.

Reading notes
#

  • Client-side MVC makes more sense as interactivity increases, while simpler pages can stay server-rendered.
  • Plain jQuery becomes awkward when application state grows and logic depends on DOM structure.
  • Ember lets a Post be represented as a JavaScript object and bound to a template.
  • When the liked state changes, the template updates without a separate render function.
  • The app can update the UI optimistically and roll back if a request fails.
  • The author says Discourse is fast and that its JavaScript payload works well with CDNs.
  • A rich client-side app also gives the team a battle-tested API because the app uses its own API from the start.
  • Ember is preferred over other frameworks because its documentation is clearer, it improved quickly, the team has an open-source track record, string templates fit the author’s preferences, and the run loop batches DOM updates.