Changelog
All notable changes to Coherent.js, following Semantic Versioning.
v2.0.02026-09-26Current
The upgrade guide lists every breaking change and what to do about it.
Breaking changes
- core: A function component that throws makes
render()throw aRenderingError; passonErrorto render a fallback instead. - core: A Promise or async component in the tree makes
render()throw. - core: The render cache is off by default (
enableCache: trueto opt in). - core: Function components are always called with no arguments.
- core: Function-valued
on*props render no attribute;hydrate()attaches them in the browser. - core: Booleans in
childrenrender nothing,classNamearrays and objects are joined, andclassandclassNameare merged. - core: Attribute names containing whitespace, quotes,
<,>,/,=or control characters makerender()throw. - core: Only markers created by
dangerouslySetInnerContent()are trusted. - core: An object with several keys renders every key as a sibling element.
- core: Scoped CSS ids are content hashes (
coh-<hash>). - client: Mismatch detection is off unless in development or explicitly enabled.
- client: Delegated event handlers bubble from the innermost element.
- client: The router writes browser history and follows links; the last navigation wins.
- client: Type declarations for APIs that do not exist at runtime are removed.
- state: On Node,
provideContext()throws outsiderunWithContext(); context is isolated per request. - state: Reactive watchers run after the write completes, and dotted keys are paths.
- state: Persistence with
encrypt: truerequiresencryptionKey. - api: JWT helpers require an explicit secret.
- api: 5xx responses no longer include the error message (
exposeErrors: trueto restore). - api: Rate limiting uses the socket address unless
trustProxyis set. - api: Handlers no longer run after middleware has responded.
- api: Validation enforces all documented keywords, and
withValidation()replacesreq.bodywith the validated data. - api: WebSocket handshakes from other origins are refused unless allowed.
- api: JSON error bodies use
errorinstead of_error. - integrations: Express, Fastify and Koa no longer render responses automatically; use
res.coherent(),reply.coherent()orctx.coherent(), or setautoRender: true. - integrations: Express registers the view engine only with
useEngine: true. - integrations: Remix
withCoherent()renders markup inside a wrapper element. - database: The query builder rejects invalid identifiers, operators, directions and limits, and UPDATE or DELETE without
where. - database:
Modelquery methods requireModel.setDatabase(db), andfind()returnsnullwhen nothing matches. - database:
Model.create()appliesfillableandguarded. - forms: One validator convention across all entry points;
data-validatorsis JSON. - i18n: Regional locales resolve to their language, and interpolation is literal and single-pass.
- seo: Sitemap fields are validated.
- cli: The dev server only serves files inside the project and answers only local hosts.
- cli: Scaffolded auth reads its secret from
.env. - devtools: DevTools no longer patches
renderor installs process handlers by default. - tooling:
extendExpect()no longer overrides Vitest's built-in matchers.
Added
- core:
renderToStream()andstreamingUtilsexported, with backpressure and client-disconnect handling. - core:
onErrorrender option. - api:
trustProxy,exposeErrorsandwsAllowedOriginsoptions. - forms: CSRF support.
- forms: String validators with arguments, such as
'minLength:8'. - i18n:
Translator#forLocale()for request-scoped translation, and anescapeoption. - cli:
coherent dev --fs-allow <dirs>. - database: Transactions for the MongoDB and memory adapters.
Changed
- core: Rendering is 2–5× faster, with identical output.
- database: Database drivers are optional peer dependencies.
- Peer dependencies are declared for every package that uses them.
Fixed
- core: Render cache keys no longer collide between different trees, and
memo()keeps one cache per component. - core:
htmlForrenders asfor; null and false style values are dropped; custom property names keep their case. - core:
renderToStream()honoursminifyandmaxDepth. - core: The same object can appear more than once in a tree.
- core:
lazy()values render. - core: Error boundaries are per request on the server and catch nested errors.
- client: Hydration binds handlers to the elements that rendered them, and
setState()patches the DOM. - client: Hydration and patching read component trees the same way the server renders them.
- client: HMR reloads the page for modules without an
accepthandler, anddisconnect()no longer reconnects. - state: Context values no longer leak between requests on a keep-alive connection.
- state:
withIndexedDBhonoursdbNameandstoreName. - api: Router matching, request body decoding and rate-limiter memory use.
- api: Field maps with a field named
items,defaultorconstare validated. - database: Migrations run; transactions and retries release pooled connections.
- database: PostgreSQL placeholders are converted without touching strings or comments.
- database:
withModelanswers 404 under the@coherent.js/apirouter. - integrations: Astro, SvelteKit, Next.js and Fastify adapter fixes.
- cli:
coherent generate apiproduces code that runs, and everycoherent createcombination boots. - cli:
coherent devshuts down promptly with open connections. - tooling: The VS Code extension activates and its language server starts.
Security
- core: Invalid attribute names are rejected, and trusted-content markers cannot be forged from JSON.
- core: Server-side event handlers are no longer kept in a global registry.
- api: JWT signatures and password hashes are compared in constant time.
- api:
withSanitization()blocks__proto__. - database:
Model.create()no longer allows mass assignment of unlisted columns. - database: The query builder rejects SQL injection through identifiers and clauses.
- seo: JSON-LD and sitemap output is escaped.
- cli: Scaffolded auth uses a random secret; the dev server refuses dotfiles, symlinks out of the project and foreign
Hostheaders. - Parsing of select columns, routes, trailing slashes and tags is linear on crafted input.
v2.0.0-rc.02026-09-26Pre-release
Release candidate for 2.0.0, published under the rc tag. It contains the changes listed under 2.0.0.
v1.1.22026-08-30
Supersedes 1.1.1, which was only partially published.
Changed
- api:
corsOriginaccepts a string or an array of origins.
Fixed
- api: Request bodies are no longer rewritten during parsing; arrays stay arrays and text is left unchanged. Only
__proto__,constructorandprototypekeys are removed. - core: Void elements are built as self-closing tags.
- client: The HMR error overlay escapes the line, column and editor values it displays.
Security
- api: CORS credentials are only sent to an origin listed in
corsOrigin;'*'is served without credentials. - forms, state, api: Email validation runs in linear time and rejects addresses with consecutive dots or whitespace.
- Eight more regular expressions made linear (api route compilation, core comment stripping, client HMR, devtools, tooling).
- devtools: Profiler session ids use
crypto.getRandomValues.
v1.1.12026-08-30
Partial release: only @coherent.js/cli and @coherent.js/client were published. Superseded by 1.1.2.
v1.1.02026-08-04
Changed
- forms: Forms submit and validate natively by default;
enhance: trueandnovalidate: trueopt in to scripted handling. - Peer dependency ranges use
^instead of exact versions.
Added
- forms:
classNamesoption andDEFAULT_CLASS_NAMESexport.
Fixed
- forms:
FormField.attributes(such asautocomplete,maxlength,data-*) are applied to the rendered control. - forms: The builder no longer emits an inline
onsubmithandler.
v1.0.12026-07-30
Added
- CI check that type declarations match runtime exports.
Fixed
- forms:
buildForm()returns a renderable node; the<form>element keepsaction,methodandname. - forms:
textareaandselectfields render as real elements. - forms:
registerValidator()registers validators. - Type declarations of
seo,state,i18n,devtoolsandformsmatch their runtime APIs.
Security
- All open dependency advisories resolved.
v1.0.02026-07-29
First stable release.
Fixed
- Eleven defects found building a production site on 1.0.0-rc.6.
- state:
clearAllContexts()clears contexts between renders. - TypeScript project references use file paths.
v1.0.0-rc.62026-07-20Pre-release
Changed
- Breaking: All packages are ESM-only. Node 22.12+ can still load them with
require(). - Breaking:
engines.nodeis>=22.12.0.
Fixed
- cli: Scaffolded auth hashes passwords (scrypt) and verifies them on login.
- cli: TypeScript scaffolds with auth or a database typecheck; auth-only scaffolds boot.
- cli: Auth scaffolding requires a SQL database, and session auth is offered for Express only.
- cli: MySQL and MongoDB scaffold models work against the database layer.
- database: The MongoDB adapter exposes
collection(), andDatabaseManager.close()works for every adapter.
v1.0.0-rc.52026-07-19Pre-release
Changed
- Dependencies updated: commander 15, ora 9, fastify-plugin 6, vscode-languageserver 10.
Fixed
- core:
VERSIONreports the installed version. - tooling:
typescriptis a runtime dependency of the language server. - cli:
wsand optional bundler peers use version ranges.
Security
- Remaining low and moderate transitive advisories resolved.
v1.0.0-rc.42026-07-19Pre-release
Added
- CI check that fails when a type declaration names a value missing at runtime.
- End-to-end CI test that scaffolds, builds and boots generated projects.
Fixed
- core: Void elements render without closing tags.
- Type declarations for 69 values that did not exist at runtime removed (api, cli, core, database, devtools, forms, state, tooling).
- tooling: Each testing subpath ships its own declarations.
- api:
ObjectRoutertypes match the implementation. - cli: Express TypeScript scaffolds typecheck.
Security
- High-severity transitive advisories resolved (undici, astro, form-data, ws).
v1.0.0-rc.32026-07-19Pre-release
Added
- Documentation for testing, i18n and SEO.
Fixed
- Package
exportsmaps point at published files for every package. - devtools: The package can be imported when installed.
- cli: Scaffolded projects'
testandtypecheckscripts work, and generated code only uses existing APIs. - api:
ObjectRouter.handle()types match the implementation. - Documentation and examples use the current APIs.
v1.0.0-rc.22026-05-25Pre-release
Changed
- Breaking:
engines.nodeis>=22.0.0.
Added
- integrations:
fastify-plugindependency.
Fixed
- integrations: The Fastify plugin applies to the root instance and sends rendered HTML;
setupCoherentworks as a plugin. - integrations: Koa
setupCoherentforwards thetemplateoption. - database: The
sqlite3peer accepts any version from 5.0.0. - cli: SQLite, Fastify and full-stack scaffolds boot; auth routes are mounted and no longer protect every page; generated apps render a full HTML document.
- cli: New scaffolds depend on the current CLI version.
v1.0.0-rc.12026-05-17Pre-release
Added
- cli: Built-in dev server with HMR (
coherent dev --coherent), with--no-hmr. - integrations: New package containing the Express, Fastify, Koa, Next.js, Astro, Remix and SvelteKit adapters as subpath exports.
- tooling: New package containing the testing utilities (
@coherent.js/tooling/testing) and the language server. - cli: Build tool plugins as
@coherent.js/cli/build-tools/*. - devtools: Performance utilities as
@coherent.js/devtools/performance/*.
Changed
- forms:
createFormBuilder({ fields })registers the given fields.
Removed
- Breaking: Packages merged into others:
@coherent.js/express,fastify,koa,nextjsandadapters(use@coherent.js/integrations/*);testingandlanguage-server(use@coherent.js/tooling);build-tools(use@coherent.js/cli/build-tools);performance(use@coherent.js/devtools/performance). - Breaking: Packages removed:
@coherent.js/runtime,web-components,profilerandlanguage-service. - Breaking (client): Legacy hydration APIs removed (
legacyHydrate,hydrateAll,hydrateBySelector,enableClientEvents,makeHydratable,autoHydrate,registerEventHandler) along with the./hydrationsubpath; usehydrate(). - Breaking (forms):
createForm,formValidators,enhancedFormand the./formsand./advanced-validationsubpaths removed; usecreateFormBuilderandhydrateForm.
v1.0.0-beta.82026-04-06Pre-release
Added
- Documentation website rebuilt with Coherent.js, including search, dynamic docs and island hydration.
Fixed
- core: CommonJS builds no longer warn about
import.meta.url. - client:
WebSocket.OPENis guarded for Node.js.
v1.0.0-beta.72026-04-04Pre-release
Added
- core:
Island()andselectiveHydrate()for selective hydration. - core:
hoc,composeandfphelpers. - core:
keyprops for reconciliation, and HTML nesting validation. - client: HMR with state preservation and an error overlay.
- client: Hydration with event delegation, state serialization and mismatch detection.
- VS Code extension with a language server.
- Stricter HTML element types.
Changed
- core:
renderToStreamsupports the same components asrender. - core: Faster cache key generation.
v1.0.0-beta.62025-12-15Pre-release
Added
- cli: Docker scaffolding.
v1.0.0-beta.52025-12-05Pre-release
Added
- api: LRU cache for compiled routes, and security header presets.
Fixed
- api: Validation function return type.
v1.0.0-beta.42025-11-25Pre-release
Security
- Moderate and high-severity dependency advisories resolved.
v1.0.0-beta.32025-11-17Pre-release
Fixed
- api: Route compilation no longer produces double slashes or broken patterns.
- Documentation reorganized; READMEs added for every package.
v1.0.0-beta.22025-11-10Pre-release
Added
- state: New package for reactive state, persistence, validation and the context API.
- core: Lifecycle hooks, the
h/createElementfactory and component caching are exported. - client: Router with prefetching, transitions and scroll restoration.
Changed
- Forms validation consolidated into
@coherent.js/formsand developer tools into@coherent.js/devtools.
v1.0.0-beta.12025-11-03Pre-release
First beta. All packages were reset to 1.0.0-beta.1 and earlier versions were removed from npm.
Added
- Object-based components with server-side rendering, streaming and client-side hydration.
- Framework adapters for Express, Fastify, Koa and Next.js.
- Packages for the API layer, database adapters, forms, i18n, SEO, testing and developer tools.