Engineering Notes · Architecture
Reading time · 10 min
One Website Across Editing, Versions, and Export
How validated state, ordered changes, and verified resources connect editing, version restore, preview, and export through shared materialization and consistency checks.

A website built in a visual editor exists in more contexts than most users realize.
It is viewed in the editing canvas while changes are being made. It is previewed in a separate environment for review. It is saved as a version that can be restored later. It is exported as a downloadable archive. It may be published to production hosting.
Each of those contexts has different runtime constraints, different available resources, and different expectations about what scripts are present and what URLs are valid.
If the system treats each context as an independent rendering problem, they drift. A section hidden in the editor reappears after export. An image visible in preview resolves to a broken URL in the download. A restored version does not match the state the user remembers saving.
StackLiberate is designed around one authoritative representation of the website. Different contexts materialize that state for different purposes, rather than maintaining independent editable copies. The comparison that matters is between outputs of the same confirmed revision.
One website. Multiple outputs. One authoritative state.
The source of truth is not a rendered page
The authored state of a StackLiberate website combines three things:
- A validated starting document derived from the selected template.
- An ordered record of accepted editing operations.
- The resources and definitions needed to reconstruct those changes.
Neither the editor canvas, nor a preview iframe, nor a previously exported ZIP is the source of truth. They are projections of that underlying state.
Order matters. Editing a card after duplicating it is not equivalent to editing the original and duplicating it later. Reconstruction evaluates each accepted operation against the state produced by the operations before it, preserving that chronology across content, structure, and design changes.
The authoritative representation is not a DOM tree in a running browser. A rendered page is an output, not a substitute for the data and resources needed to rebuild it.
Editing operates on the representation, not the view
When a user changes a headline, the editor submits a structured change to a logical target. The change can include content and supported formatting; it is not an arbitrary replacement of the page's DOM.
Before accepting a change, the system checks the target, its editing capabilities, the expected prior state, and the resulting candidate. A change based on stale or incompatible state must not silently overwrite newer work.
The accepted state is projected onto the canvas for immediate feedback. Browser rendering is transient; a durable local draft and a server-confirmed revision are separate persistence states, not interchangeable descriptions of the same save.
This distinction is critical for multi-context consistency:
- A local draft can survive a reload without having been confirmed on the server. Its recovery still depends on that browser's retained storage.
- Reopening reconstructs authored state from retained data rather than trusting a previously rendered page.
- Restoring a version validates its saved state and establishes a new current revision.
- Export materializes confirmed state on the server without reading the running editor canvas.
This keeps rendering, local recovery, and server persistence tied to an explicit state instead of allowing each view to become an independent writer.
Versions capture authored state
A StackLiberate version captures confirmed authored state, including the accepted changes and the source and resource references required to reproduce them. It is not simply a screenshot or a copy of the browser's current HTML.
Saving a version records a specific checkpoint. Restoring it checks that checkpoint and its required resources before establishing a new current revision. Restore is a controlled state transition, not an unchecked replacement of whichever document happens to be open.
This has important properties:
Versions stay tied to their source. A saved checkpoint identifies the starting state and retained definitions it belongs to. A newer catalog entry is not silently substituted when reconstructing older work.
Reconstruction is checked. The accepted changes must reconstruct the expected authored state. Missing or inconsistent required material causes a rejection rather than a guessed replacement.
Restored state uses the normal output path. Once Restore has completed, preview and export consume the restored current revision through the same materialization path used for other confirmed revisions.
Preserving authored state does not freeze third-party services or browser behavior. It preserves the website's accepted content, structure, design, and retained resources.
Preview and export share a rendering contract
The preview system and the export pipeline both need to answer the same question: "What website does this confirmed revision describe?"
They share the server-side projection and materialization path for that state. The editing canvas has an additional responsibility: presenting local changes and editing controls while the user works.
The rendering contract is:
- Identify and validate the revision being materialized.
- Reconstruct accepted changes in their original order.
- Resolve the required resources for the target context.
- Apply the delivery checks and transformations appropriate to that output.
Preview presents the result for review; it is not another editable copy. Export packages static files and required resources, rewrites portable references, and removes editor-only instrumentation. Public scripts needed for supported navigation and interactions remain part of the website.
Consistency does not require identical runtime presentation. Selection handles do not belong in the download. An accordion expanded for editing may start closed for visitors. Those delivery differences should not change the underlying authored content.
Shared state and shared materialization reduce the opportunities for divergence. Tests still need to verify that browser presentation and static output preserve the intended result.
Asset identity is separate from its URL
A common source of inconsistency in website builders is asset handling. An image might display correctly in the editor (because it resolves against a CDN), fail in local preview (because the URL is absolute and the server is different), and break in export (because the file was never downloaded).
StackLiberate separates resource identity from the address used to deliver it. Retained template resources and admitted uploads carry the information needed to check that the bytes being used are the expected ones. A temporary display URL is not the resource's authority.
Each context delivers those resources differently:
- Editing and preview: use delivery references appropriate to that session and context.
- Export: includes required packaged resources and rewrites their references to portable paths.
- Publish: uses the shared static materializer to prepare files for deployment.
The pipeline checks required packaged resources rather than assuming that a reachable URL is sufficient. If those bytes cannot be obtained and verified, output generation must fail rather than silently omit them. External links, embedded maps, and form destinations remain external dependencies; portability does not mean that every service runs offline.
The save confirmation contract
Local durability and server confirmation solve different problems. A retained draft supports recovery in the same browser. Server confirmation establishes the revision that server-backed versions and outputs can use. A local draft alone does not establish that the same changes are available on another device.
The important invariant is:
A save response confirms a specific revision, not every edit currently visible in the browser.
This is a concurrency problem. A save request takes time. During that time, the user may continue editing. If the system marks state as "clean" when the save response arrives, it may be lying — the user has made changes that were not included in the saved payload.
StackLiberate distinguishes pending work from the server-confirmed revision. Confirmation is checked against the submitted state, and a late response does not make newer changes confirmed. Output preparation must resolve pending submissions and obtain a confirmed revision, or report that it cannot proceed.
This boundary matters more than whether a save was triggered automatically or explicitly. A successful request is not proof that all subsequent edits have been saved, and a recoverable local draft is not a substitute for server confirmation.
Export is not a separate system
Export becomes fragile when it tries to infer a website from a live editing session or maintains a separate interpretation of the user's changes.
In StackLiberate, export is a delivery path over confirmed authored state. It does not scrape the editor canvas to decide which content or styling the user intended:
Validated starting document + Ordered, accepted changes + Required resources ↓ Confirmed website revision ↓ Delivery checks and portable resource references ↓ Static website files (ZIP)Artifact generation runs on the server and does not require a running browser canvas. The request still requires appropriate access, a confirmed revision, available resources, and valid output configuration. Generating and delivering the archive involves storage and network operations; the whole service is not a pure function.
The reproducible boundary is the confirmed authored state and its verified inputs. A restored version can become that current state after Restore completes; an arbitrary local draft is not automatically the state being exported.
The delivered website uses standard HTML, CSS, JavaScript, and packaged resources. It does not need the visual editor to render or be hosted elsewhere. Services that the website deliberately depends on, such as an external form destination, remain dependencies.
Consistency by design, verified by testing
A shared representation narrows the places where behavior can diverge. It does not make separate rendering environments automatically equivalent, and it does not eliminate implementation defects.
StackLiberate combines chronological reconstruction and explicit revision checks with tests of browser and server projections, saved versions, restored state, and static artifacts. These checks examine the resulting documents and resources, not merely whether a command returned success.
A complete editing capability needs more than a control that looks correct in the canvas. Its accepted changes must survive persistence, reconstruction, and the relevant output paths. That requires validation of the change itself and regression coverage of the projections that consume it.
Structural checks and browser checks answer different questions. The first can detect an incorrect item order or a missing resource; the second can reveal that a valid-looking style change has no visible effect, or that a responsive layout breaks.
The goal is consistent authored content and behavior across supported contexts, with intentional delivery differences understood and failures reported. It is not a claim of identical pixels on every device or that drift is impossible.
The lifecycle as a single path
A StackLiberate website follows a single continuous path from creation through editing, versioning, preview, and export:
- Creation: A selected template establishes the validated starting document and its resources.
- Editing: Supported changes are validated, accepted in order, and projected onto the canvas.
- Persistence: Local drafts and server confirmation have distinct roles; pending changes are not mistaken for confirmed state.
- Versioning: A saved checkpoint captures confirmed authored state. Restore validates it and establishes a new current revision.
- Preview: Confirmed state is materialized for review without creating another editing authority.
- Export: Confirmed state is materialized into static files with verified packaged resources and portable references.
- Publish: The shared static-output path prepares files for deployment.
At each boundary, the system must identify which state it is using and verify the inputs needed to reproduce it. An editor with newer pending work is not the same revision as the last confirmed preview or export.
That explicit boundary is the point: shared authority, reproducible materialization, and checks where the contexts differ.
The editor and hosting environment can evolve without requiring an exported website to retain the editor's runtime. Its content and design are delivered as web files rather than existing only inside a particular editing session.