docs
migration
Migration from 2.x
Migration from 2.x
v2 features may not work in v3. In order to upgrade an existing server to v3, you must apply the changes in v3.
#Packages
All actions were performed in the zely
module,
but the method has changed to the @zely-js/~
module sharing the responsibility for actions.
package | description |
---|---|
zely | re-exports of @zely-js/zely and zely-cli |
zely-cli | zely cli |
@zely-js/zely | core module of zely |
@zely-js/core | zely server |
@zely-js/loader | javascript loader manager |
@zely-js/loader-esbuild | esbuild loader (to load typescript) |
To use zely and cli together, install zely
.
If you only want to use zely API, install @zely-js/zely
.
#File Structure
$routing
is deprecated.
before | after |
---|---|
/index.ts | /index.ts |
/a/b.ts | /a/b.ts |
/book/$id.ts | /book/[id].ts |
/$id/about.ts | /[id]/about.ts |
~ | /[...params].ts |
INFO
See routing documentation.#Migration
- change
(req, res) => ...
to(ctx) => ...
in handlers.
The export
handler can also use context
.
INFO
Check the context documentTypescript
// export function get(req, res) {}
export function get(ctx) {
const req = ctx.request;
const res = ctx.response;
// ...
}
- remove
snatcher
.
snatcher
has been deprecated. Use fetch
instead.
- remove
$page.path
$page.path
is not supported in 3.0.
- replace
zely/~
withzely
.
before | after |
---|---|
zely/config | zely |
zely/methods | zely |