Migrate to standalone @neabyte/dve, refresh rendering API, internal pipeline, and tests#1
Migrate to standalone @neabyte/dve, refresh rendering API, internal pipeline, and tests#1NeaByteLab wants to merge 1 commit into
@neabyte/dve, refresh rendering API, internal pipeline, and tests#1Conversation
- Remove editor README and packaged VSIX - Remove language configuration, package manifest, and snippets - Remove tmLanguage grammar for dve files
Context API Redesign - Decision Record (v0.15.0)This release is bigger than a DVE dependency swap. The The API is now organized into three namespaces, where Why it changedThe old
The goal of this redesign is a shape that explains itself, where the request is read with What changed, read side:
|
| Namespace | What it does | Behavior |
|---|---|---|
ctx.get.* |
read the request | never mutates, never responds |
ctx.set.* |
stage response changes | chainable, never responds |
ctx.send.* |
produce the Response |
ends the handler |
ctx.render() |
produce an HTML Response | ends the handler, stream is an option |
Three verbs, one job each. A handler reads like a sentence, where it gets what is needed, sets what should change, and sends or renders the result.
Migration cheat sheet
| Old | New |
|---|---|
ctx.header(k) |
ctx.get.header(k) |
ctx.query(k) |
ctx.get.query(k) |
ctx.cookie(k) |
ctx.get.cookie(k) |
ctx.param(k) |
ctx.get.param(k) |
ctx.json() or body() |
ctx.get.json() or ctx.get.body() |
ctx.ip or ctx.directIp |
ctx.get.ip() or ctx.get.ip({ direct: true }) |
ctx.setHeader(k, v) |
ctx.set.header(k, v) |
ctx.setHeaders(rec) |
ctx.set.headers(rec) |
ctx.streamRender(t, d) |
ctx.render(t, d, { stream: true }) |
ctx.send.html(html) |
ctx.send.html(html), unchanged |
Removed features, such as the state helpers and the validator surface, are out of scope for this record. Most of them are planned to come back. The intent is to lock the shape first, then add capability on top of a surface that is settled.
Warning
Draft pull request for extracting the bundled DVE rendering layer out of Deserve, depending on the standalone
@neabyte/dvepackage, and modernizing the rendering API, internal rendering pipeline (compile, render, stream flow), and test suite. This is a breaking change. The public rendering API will change and is intentionally not backward compatible in this PR. Downstream usage and docs are reconciled in a follow-up once the new surface is finalized.Summary
Deserve currently ships its own copy of the DVE template engine under
src/rendering/engine/. That engine has since been pulled into a dedicated, runtime-agnostic package:@neabyte/dve.This PR is a larger rendering-layer overhaul, not just a dependency swap. It:
The standalone engine is not a 1:1 copy. It dropped all filesystem coupling, switched to a synchronous streaming core, and gained a larger template feature set (layouts, blocks, slots, comments, whitespace control,
else if, static validation). Deserve keeps owning the filesystem, caching, discovery, and hot reload while the parsing and rendering core moves to the package.Motivation
Scope
In scope:
src/rendering/engine/(Tokenizer, Parser, Expression, Eval, Utils) and itsindex.tsre-export.@neabyte/dvetodeno.jsonimports and update the lockfile.src/rendering/Engine.tsand thectx.render/ctx.streamRendersurface around the package.src/interfaces/Rendering.tslocal AST, token, and option types with the package types.Context,Handler, andRouter.Out of scope:
References