A lightweight micro-services producing deno-[p]react SSG-first SEO-friendly framework.
For a new era of frontend development with NO node_modules (Save GB+ files on disk).
- Produces bundles within seconds for 100s of apps.
- Cross-compile from multiple projects
- Supports scss
- Scaffolding
- Has livereload
- denocacheusage: 10MB only, bundle sizes less than 20KB (if u use preact), and 200KB for react.
Compare this with 200MB-400MB node_modules for a react hello world project.
Finally, you can rimraf node_modules
.
✨ Sergeant 🫡 A front-end microservices framework!
███████╗███████╗██████╗ ██████╗ ███████╗ █████╗ ███╗ ██╗████████╗
██╔════╝██╔════╝██╔══██╗██╔════╝ ██╔════╝██╔══██╗████╗ ██║╚══██╔══╝
███████╗█████╗ ██████╔╝██║ ███╗█████╗ ███████║██╔██╗ ██║ ██║
╚════██║██╔══╝ ██╔══██╗██║ ██║██╔══╝ ██╔══██║██║╚██╗██║ ██║
███████║███████╗██║ ██║╚██████╔╝███████╗██║ ██║██║ ╚████║ ██║
╚══════╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠀⠀⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⠀⢀⣾⣷⡀⠀⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀⣰⣿⡟⢻⣿⣆⠀⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡿⠟⠁⠀⣠⣾⣿⠋⠀⠀⠙⣿⣷⣄⠀⠈⠻⢿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⠀⠀⣠⣾⣿⠟⠁⢀⣴⣦⡀⠈⠻⣿⣷⣄⡀⠀⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣴⣿⣿⡿⠋⠀⣠⣾⡿⢿⣷⣄⠀⠙⢿⣿⣿⣦⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⠟⠋⠀⢀⣼⣿⠟⠀⠀⠻⣿⣷⡀⠀⠙⠻⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⠁⠀⣠⣴⣿⡿⠁⠀⣠⣄⠀⠘⢿⣿⣶⣄⠀⠈⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣤⣾⣿⡿⠋⠀⢀⣾⣿⣿⣷⡀⠀⠙⢿⣿⣷⣤⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⢀⣴⣿⣿⣿⣿⣿⣿⣦⡀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⠉⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠉⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣠⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
Building enabled apps:
Building: apps/app2
apps/app2/dist/app-esbuild.main.js 160 KB
Building: apps/app1
apps/app1/dist/app-esbuild.main.js 10 KB
Done
- No breaking changes (versioned imports)
- SSG over SSR
- Always bundle to one-file for 1-SPA
- Support bundling multiple apps, SPAs via micro-services / app-routing
- Support progressive and offline apps
sergeant
sergeant build
sergeant serve
sergeant serve --dev
Only need deno to install sergeant (esbuild is automatically imported):
deno install -A -f https://cdn.jsdelivr.net/gh/scriptmaster/[email protected]/sergeant.ts
Only need deno and sergeant and you can do sergeant
or sergeant serve
sergeant build
sergeant serve
sergeant build
sergeant serve
https://docs.deno.com/runtime/manual/getting_started/installation
Using PowerShell (Windows): irm https://deno.land/install.ps1 | iex
choco install deno
Uses: https://github.com/scriptmaster/esbuild_deno_loader https://deno.land/x/esbuild_plugin_sass_deno https://github.com/esbuild/community-plugins#plugins-for-deno
How packages are downloaded?
Packages are primarily downloaded as ESM modules from https://esm.sh/package/ (instead of registry.npmjs.org).
- It can be swapped to use enterprise ESM packages repository.
- Packages
The package can be looked up in ./vendor/ and ./node_modules/ in the format mod.ts index.mjs index.cjs index.js
React Context API is an incorrect implementation of a simple DI with prop drilling. In apps containing 20+ dependencies to provider, the context pattern could become 20+ nested nodes.
DI enables you to directly provide the service/implementation for the consumer.
Extra watch dirs
Create app level deno.json and configure watching extra deps:
{ "watch": "emeraldcss" }
if an app dir contains mithril dir, its files (i.e., apps/appname/mithril/.html or src/mithril/.html) will be compiled as mithril files.