It has been seven months since 4.0.0-next.0
was released.
This new version brings both feature updates and major internal performance improvements.
Here’s a summary of everything that has changed.
In line with zely's philosophy, performance has been dramatically improved.
Compared to previous versions, the latest update significantly reduces latency and nearly triples throughput (requests/sec and bytes/sec). This level of performance leap is not just a minor improvement—it redefines how lightweight servers can operate at scale.
PERFORMANCE
Pkg | Latency | Requests/Sec | Bytes/Sec |
---|---|---|---|
4.0.0:serpack-on (latest) | 0.02 ms | 19.5K | 2.49 MB |
4.0.0:serpack-off (latest) | 0.01 ms | 19.5K | 2.49 MB |
3.0.0 | 1.06 ms | 6.5K | 848.84 KB |
2.0.0-next.24 | 0.1 ms | 12.7K | 1.63 MB |
1.0.0 | 0.02 ms | 18.7K | 2.39 MB |
Even when serpack is enabled, there is no noticeable performance loss, proving that the new compiler is lightweight enough for production environments.
zely now supports a new compiler to allow for more flexibility in future updates.
Although esbuild
remains the default loader, zely introduces serpack, a custom loader built on top of swc
.
zely dev --serpack
While serpack is slightly less performant than esbuild
(but still fast!), it is tightly optimized for zely's internal systems and unlocks powerful features not available with esbuild.
WARNING
Although serpack is mostly stable, undiscovered issues may still occur.
You can now compile and deploy your zely-powered server as JavaScript.
The old version of build feature (provided by @zely/builder) became incompatible after 3.0 due to internal changes, but the feature is now back in 4.0—completely rebuilt.
While the original builder only copied and transpiled the server, the new build system routes all requests directly through the zely server runtime.
For details, refer to the build documentation.
$store
is a server-side cache utility.
It runs the given callback function only once, caches the result, and reuses it for 3 minutes.
import { GET } from '@zely-js/core';
import { setTimeout } from 'timers/promises';
async function greeting() {
await setTimeout(1000);
return 'Hello, Doe!';
}
export default [
GET(async (ctx) => {
const { data } = await $store(greeting);
ctx.send(data);
}),
];
$store
is already globally declared, so you don’t need to import it manually.
WARNING
Since $store internally depends on features provided by serpack, please
activate it using the --serpack
flag when running your server.
Note: This is an experimental feature for upcoming frontend support.
The new HTML loader compiles the HTML file instead of directly serving it, improving responsiveness and enabling future extensibility. Learn more
Enable the loader with experimental.useHTML
in zely.config.ts
:
import { defineConfig } from 'zely';
export default defineConfig({
experimental: {
useHTML: true,
},
});
INFO
Example: simple counter
No need to write temporary scripts to test your server during development.
$ zely request
▸ baseURL: http://localhost:3001
[12:31:35 AM] info checking server... (requesting /)
GET> /
200 {"msg":"Hello","name":""}
GET>
You can also use JavaScript to configure method, headers, and body inline:
GET> config1 = { method: "POST", headers: { }, body: { name: "Cat" } }
GET> set(config1)
POST(config1)> /greeting
200 Hello, Cat!
TIP
Declare variables without using const
or let
—just type them directly in the prompt.
Check the debugging documentation for more details.
This release makes zely faster, more modular, and ready for future features like frontend rendering and build-time optimizations. With the introduction of serpack, a new compiler architecture, and the return of server builds, zely is growing beyond just a micro-framework—it’s evolving into a complete platform for building fast, modern web applications.
Give it a try and let us know what you think.