Architecture Note: Controlling Backbone.sync Persistence Boundaries
Treat Backbone.sync as a trust boundary: define what persists, how errors surface, and when to override the default REST contract.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Treat Backbone.sync as a trust boundary: define what persists, how errors surface, and when to override the default REST contract.
Use fetch({ reset: true }) and a parse hook to replace a Backbone collection's contents with a full server response.
Stop re-rendering entire Backbone views on every model change. Use change:attribute events to update only the DOM nodes that actually need it — faster, cleaner, and less fragile.
Backbone.js validation is opt-in. Compare built-in Model.validate against manual checks and plugins, then implement a model-centric pattern with console verification steps.
Choose between Backbone.js pushState and hash routing by evaluating browser support, server rewrite needs, and SEO impact. Follow this guide to decide, compare options, and implement the right setup.
Backbone’s built‑in Events mixin lets you decouple views and models with a publish‑subscribe bus. This guide walks through the basics, a global event aggregator, a to‑do list example, trade‑offs, and practical steps to adopt the pattern safely.
When Backbone.js fetches return empty or crash, the culprit is often mismatched JSON keys, nested data, or a broken custom sync. This guide walks through diagnosing the problem, checking idAttribute, parse overrides, and promise‑based syncs, with concrete code examples.
Learn how to use Backbone.Events to decouple components, avoid 'zombie listeners' with listenTo, and manage synchronous communication in Backbone.js applications.
Learn how to debug why Backbone collections fail to update the UI, handle nested API responses, and prevent zombie views from leaking memory.