Full release note on Elysia blog: Elysia 1.3 and Scientific Witchery.
Named after the song Ga1ahad and Scientific Witchery by Mili.
This release doesn't come with shiny new features.
It's about refinement to make things better to the point that we consider it as "magic".
Feature:
- add
exactMirror - add
systemRouterconfig standalone Validator- add
Elysia.Reffor referencing schema with autocompletion instead oft.Ref - support Ref inside inline schema
- add sucrose cache
- new validation
t.Form,t.NoValidate - use
file-typeto check file type - add
INVALID_FILE_TYPEerror - add
sanitizeoptions
Improvement:
encodeSchemanow stable and enabled by default- optimize types
- reduce redundant type check when using Encode
- optimize isAsync
- unwrap Definition['typebox'] by default to prevent unnecessary UnwrapTypeModule call
- Elysia.form can now be type check
- refactor type-system
- refactor
_typesinto~Types - using aot compilation to check for custom Elysia type, eg. Numeric
- refactor
app.router.static, and move static router code generation to compile phase - optimize memory usage on
add,_use, and some utility functions - improve start up time on multiple route
- dynamically create cookie validator as needed in compilation process
- reduce object cloning
- optimize start index for finding delimiter of a content type header
- Promise can now be a static response
ParseErrornow keeps stack trace- refactor
parseQueryandparseQueryFromURL - add
configoptions tomount - recompile automatically after async modules is mounted
- support macro on when hook has function
- support resolve macro on ws
- #1146 add support to return web API's File from handler
- #1165 skip non-numeric status codes in response schema validation
- #1177 cookie does not sign when an error is thrown
Bug fix:
Responsereturned fromonErroris using octet stream- unintentional memory allocation when using
mergeObjectArray - handle empty space on Date query
Change:
- only provide
c.requestto mapResponse whenmaybeStreamis true - use plain object for
routeTreeinstead ofMap - remove
compressHistoryHookanddecompressHistoryHook - webstandard handler now return
text/plainif not on Bun - use non const value for
decorateunless explicitly specified Elysia.mountnow setdetail.hide = trueby default
Breaking Change:
- remove
as('plugin')in favor ofas('scoped') - remove root
indexfor Eden Treaty - remove
websocketfromElysiaAdapter - remove
inference.request
Full Changelog: 1.2.25...1.3.0