/ specs / 0003-rendering-diff.md
0003-rendering-diff.md
 1  # SPEC-0003 — Rendering and Diff
 2  
 3  Status: Draft
 4  
 5  ## Purpose
 6  
 7  Define the rendering and patching strategy.
 8  
 9  ## Requirements
10  
11  The renderer MUST be separable from transport.
12  
13  The patch model MUST be testable without a browser.
14  
15  The browser client MUST reject malformed patches rather than applying partial invalid state.
16  
17  ## Initial patch model
18  
19  v0 may use full-fragment replacement.
20  
21  v1 should add:
22  
23  - keyed node replacement
24  - attribute update
25  - text update
26  - append/prepend operations
27  - static/dynamic segmentation
28  
29  ## Fingerprints
30  
31  A rendered fragment may include a fingerprint. The fingerprint represents the static shape of the rendered output, not the entire dynamic content.
32  
33  ## Open questions
34  
35  - Should Lightspeed use Lustre's rendering model directly?
36  - Should patching rely on morphdom-like behaviour or a Lightspeed-specific patch interpreter?
37  - Should static segments be computed at compile time, runtime, or both?