npm / edge.js
edge.js
What changed in edge.js 2 to 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-15.
27 breaking27 new APIs and options3 behavior and defaults1 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initedge.js 624 changes
Breaking changes 21
Use @assign to update an existing variable or mutate object properties in place of @set.
The e helper has been removed in favor of html.escape.
Its functionality is now built into Edge, so developers can uninstall the package and remove its usage.
All packages are now ESM only, so projects must migrate to ES modules.
Use except followed by toAttrs to serialize all props except the mentioned attributes.
Use html.escape in place of the removed e helper.
Use html.safe in place of the removed safe helper.
Use js.stringify in place of the removed stringify helper.
Layouts have been removed; components are recommended instead. The compatibility plugin can preserve layouts.
Use @let to define a new variable in place of @set.
Use merge to add custom attributes before serializing props with toAttrs.
Edge now requires Node.js >= 18.16.0.
Use only followed by toAttrs to serialize only the mentioned attributes.
The raise helper has been removed; the notes say it was never documented.
The safe helper has been removed in favor of html.safe.
Sections have been removed.
The Props API's serialize method no longer exists; use toAttrs instead.
The Props API's serializeExcept method no longer exists; use except and toAttrs instead.
The @set tag has been removed; use @let to define variables and @assign to update existing variables or mutate object properties.
The stringify helper has been removed in favor of js.stringify.
Use toAttrs to serialize component props; the former serialize and serializeExcept methods no longer exist.
New APIs and options 3
Adds pushToTop to the API.
Adds pushToTopOnce to the API.
The migrate plugin provides compatibility between version 5 and 6 for projects not ready for breaking changes, except the ESM migration.
edge.js 54 changes
Breaking changes 3
edge.render is now async, so developers must account for its asynchronous behavior.
inject replaces share.
tag.boot replaces tag.run.
New APIs and options 1
A synchronous rendering method is added.
edge.js 45 changes
Breaking changes 3
Removes Edge.claimTag in favor of Edge.compiler.claimTag.
Moves claimTag to Edge.compiler.claimTag, replacing Edge.claimTag.
Removes the yield tag because it wasn't used.
New APIs and options 2
Adds a Context API similar to Svelte's, with edge-specific syntax.
Adds async rendering, allowing await expressions in edge templates; internals adjust to async APIs, including the @each loop.
edge.js 39 changes
New APIs and options 6
Components can pass data to slots used inside them, enabling more powerful components.
An excerpt tag is added.
The @includeIf tag is added.
The helper inspects objects and pretty prints them.
Safe global methods are added.
A truncate tag is added.
Behavior and default changes 3
Compile-time and runtime errors point back to actual source code instead of compiled output.
Almost every JavaScript expression is supported inside Mustache braces, giving developers more flexibility in templates.
Expressions inside Mustache braces can be written across multiple lines.
edge.js 216 changes
New APIs and options 15
A component tag is available in templates.
Components can pass data to slots.
Slots can define their own prop name.
A debugger tag is available in templates.
An each tag is available in templates.
A file system loader is available.
The if, elseif, and else tags are implemented.
An include tag is available in templates.
Layouts are implemented in the compiler.
The each loop exposes a runtime $loop value.
The loader supports a presenter.
A set tag is available in templates.
Templates can be registered as strings.
An unless tag is available in templates.
A yield tag is available in templates.
Fixes and other changes 1
The state defaults to an empty object when rendering.