This content originally appeared on DEV Community and was authored by Mahdi
Hey everyone!
I'm still developing Gland, and after a lot of refactoring and R&D, I've reached some interesting results. Gland is getting closer to its final syntax, and I decided to make it fully EDS-based, inspired by NestJS and Angular.
It means:
- It has a DI system similar to NestJS
- It uses Controller, Import, Export like NestJS
- But instead of Providers, it uses Channels to handle logic
- It might include features like Pipes, Reactors, and Wildcards
- Its middleware system is similar to Guards in NestJS (though Wildcards might change that a bit)
Why EDS? (Event-Driven System)
Instead of returning data directly in the controller, I emit an event, and a Channel handles it.
Example:
@Controller('users')
class UserController {
@Get('/:id')
getUser(ctx: Context) {
const result = ctx.emit('read:server', ctx);
try {
throw Error('Hello world');
} catch (error) {
return ctx.emit('read:server:error', { error, result });
}
}
}
Here, ctx.emit('read:server', ctx)
sends an event called users:read:server
, and a Channel handles it like this:
@Channel('users')
class UserChannel {
@On('read:server')
get(ctx: Context) {
return 10;
}
}
Now the entire data flow is event-driven
Gland vs NestJS: What's the difference?
- Gland is fully event-driven, while NestJS is still more request-response based
- Gland is Channel-based, grouping events, while in NestJS, you manually manage providers
Now the question
What do you think about this system?
Does it feel more flexible and logical than NestJS? Or do you see any potential weaknesses?
This content originally appeared on DEV Community and was authored by Mahdi

Mahdi | Sciencx (2025-02-28T23:03:03+00:00) new web framework. Retrieved from https://www.scien.cx/2025/02/28/new-web-framework/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.