Release notes
Flare 0.3.x breaking changes and new surfaces since 0.2.
What changed since Flare 0.2, summarized from the @flare-ts/core changelog. Signatures and validator codes live in the API Reference.
Added in 0.3.1
Section titled “Added in 0.3.1”WebSocket upgrade hook. One pre-handshake moment with request context, attached with .upgrade() on the handle route() or controller() returns (the controller form now returns a WebSocketControllerHandle). Return nothing to proceed (with provides seeding ws.state), a FlareResponse to deny before the handshake, or a WebSocketRefusal(code, reason) to accept then immediately close with a code and reason a browser can read. Front-door only: a hooked route on a Durable Object’s .ws arc fails host.build() with WS_UPGRADE_IN_DURABLE_OBJECT.
Logging. New log.unhandledErrors config field (default true): errors reaching the framework’s fallback response are logged at error level before the response envelope replaces them.
0.3.0 breaking changes
Section titled “0.3.0 breaking changes”| Change | Migration |
|---|---|
flareContract renamed to httpContract | Update imports; no alias ships |
Handler inject: [Token] removed | Use named map: inject: { name: Token }, read scope.name |
scope.inject(token) removed | Destructure from scope or use property access |
Bare object contract route option removed | Use inline descriptor fields or a branded httpContract entry |
CFWExportedHandle renamed | Import WorkerExportedHandle from @flare-ts/core/cloudflare |
Vocabulary renames
Section titled “Vocabulary renames”Renamed type and accessor names, with no aliases. Update imports mechanically; the shapes are unchanged.
| Old | New |
|---|---|
FlareHandlerScope | HttpHandlerScope |
FlareErrorHandler | HttpErrorHandler |
RouteOptions | HttpRouteOptions |
RouteHandler | HttpRouteHandler |
MiddlewareOptions | HttpMiddlewareOptions |
BeforeMiddlewareHandler | HttpBeforeHandler |
AfterMiddlewareHandler | HttpAfterHandler |
FinallyMiddlewareHandler | HttpFinallyHandler |
ErrorHandlerOptions | HttpErrorHandlerOptions |
FlareHostConfig | HostConfig |
FlareCookiesConfig | CookiesConfig |
FlareLogConfig | LogConfig |
FlareWebSocketsConfig | WebSocketsConfig |
exposedDetail | rawDetail |
CFWLoggerTransport | CfLoggerTransport |
CFWLoggerTransportClass | CfLoggerTransportClass |
FlareReadonly | DeepReadonly |
FlareErrorCategories | ErrorCategories |
FlareErrorCategory | ErrorCategory |
CodeDescriptor | ErrorCodeDescriptor |
FlareTestReq | TestRequestInit |
FlareBuildSnapshot | BuildSnapshot |
Added in 0.3
Section titled “Added in 0.3”Durable Objects. host.durableObject(Class) registers a class extending FlareDurableObject with typed .http, .ws, .mount, and .resolve on the returned handle. Request state crosses the Worker-to-instance boundary through blessed seams (.mount, durable(...).forward); raw durable(...).fetch() strips framework state headers by design. White-box testing helpers ship on @flare-ts/core/cloudflare (composeDurableInstance, fakes for env and storage).
WebSockets. host.ws.route(path) and host.ws.controller register WebSocket endpoints on Node, Workers, and Durable Objects. socketContract types messages; scope.input carries upgrade params and parsed messages. Channels (WebSocketChannels), per-connection ws.state, and hibernation on Durable Objects are first-class.
Host extensions. defineHostExtension lets packages add typed members to FlareHost when passed in the constructor array.
HTTP additions. Server-sent events via ctx.sse(producer). Signed cookies via ctx.cookies.setSigned / getSigned with a cookies config section and optional signedCookies: true on route descriptors.
Logging. WebSocket connections get a WebSocketLogContext; Durable Object handlers can correlate to the parent HTTP request via parentRequestId.
Changed (non-breaking highlights)
Section titled “Changed (non-breaking highlights)”httpContractentries are branded by arc; wrong-arc contracts fail atbuild()withCONTRACT_KIND_MISMATCH.- Inline HTTP handlers read parsed route, query, and body values from
scope.inputwhen declared on the route options. Controller methods withhttpContractstill usectx.extract(entry).
Documentation
Section titled “Documentation”This site is a greenfield rewrite for 0.3. Old 0.2 paths (/core/http/routes/, etc.) do not carry forward. Use the sidebar to find a topic’s new home.
Full framework changelog: github.com/lumex-solutions/flare-ts.