zylaris
v1.0.8
Published
The compiler-driven web framework for the next generation. Zero Virtual DOM, fine-grained reactivity, and stellar performance.
Readme
Zylaris Framework 🚀
The compiler-driven web framework for the next generation. Zero Virtual DOM, fine-grained reactivity, and stellar performance.
Table of Contents
- Introduction
- Features
- Installation
- Quick Start
- Development Server
- Project Structure
- Core Concepts
- Universal Deployment
- Plugin System
- CLI Reference
- API Reference
- Contributing
- License
Introduction
Zylaris is a next-generation web framework combining fine-grained reactivity, zero virtual DOM overhead, and universal deployment support. Build once, deploy anywhere.
Why Zylaris?
| Feature | Zylaris | Next.js | Astro | |---------|---------|---------|-------| | First Load JS | 4KB | 150KB | 8KB | | Time to Interactive | 0.8s | 3.2s | 1.2s | | HMR Speed | 10ms | 200ms | 100ms | | Virtual DOM | None | Yes | None | | Deploy Targets | 7+ | 3 | 4 |
Features
⚡ Zero Virtual DOM
Compile JSX directly to targeted DOM operations - no runtime diffing overhead.
🎯 Fine-grained Reactivity
Signal-based reactivity with automatic dependency tracking:
const count = signal(0);
const doubled = computed(() => count() * 2);
// Only `doubled` re-computes when `count` changes🏝️ Islands Architecture
Automatic partial hydration - static content ships zero JS.
🚀 Universal Deployment
Deploy to any platform:
- Static (GitHub Pages, Netlify Static)
- Node.js (VPS, Docker, Railway)
- Serverless (Vercel, Netlify Functions)
- Edge (Cloudflare Workers, Vercel Edge, Deno Deploy)
- Alternative Runtimes (Deno, Bun)
🔌 Universal Library Support
Use any JavaScript library:
- NPM packages (ESM, CJS, UMD)
- CDN libraries (esm.sh, unpkg, skypack)
- Framework components (React, Vue, Svelte)
- Web Components
- Auto-import - no manual imports needed
Installation
Prerequisites
- Node.js >= 18.0.0
- pnpm >= 8.0.0 (recommended)
Create New Project
# Using npx
npx zylaris create my-app
# Using pnpm
pnpm dlx zylaris create my-appTemplates
npx zylaris create my-app --template default
npx zylaris create my-app --template api
npx zylaris create my-app --template docs
npx zylaris create my-app --template blogQuick Start
cd my-app
pnpm install
pnpm run devOpen http://localhost:2727 in your browser.
First Component
// src/app/page.tsx
import { signal, computed } from 'zylaris';
export default function HomePage() {
const count = signal(0);
const doubled = computed(() => count() * 2);
return (
<main>
<h1>Welcome to Zylaris!</h1>
<p>Count: {count()}</p>
<p>Doubled: {doubled()}</p>
<button onClick={() => count.update(c => c + 1)}>
Increment
</button>
</main>
);
}Development Server
Zylaris comes with a built-in development server featuring:
- ⚡ Ultra-fast HMR - 10ms hot module replacement
- 🔌 Auto port detection - Finds available ports automatically
- 📦 JIT Compilation - TypeScript/TSX compiled on-the-fly
- 🎯 Zero-config - Works out of the box
Start Dev Server
zylaris devOutput Example
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃
┃ 🚀 Zylaris Dev Server ┃
┃ ┃
┃ ➜ Local: http://localhost:2727 ┃
┃ ➜ WebSocket: ws://localhost:2728 ┃
┃ ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛Dev Server Options
# Custom port
zylaris dev --port 3000
# Custom host
zylaris dev --host 0.0.0.0
# Turbo mode (faster compilation)
zylaris dev --turboAuto Port Detection
If port 2727 is in use, the server automatically finds the next available port:
⚠ Port 2727 is in use, using port 2729 instead
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ➜ Local: http://localhost:2729 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛Project Structure
my-app/
├── src/
│ ├── app/ # File-system routing
│ │ ├── layout.tsx # Root layout
│ │ ├── page.tsx # Home page
│ │ ├── loading.tsx # Loading UI
│ │ ├── error.tsx # Error boundary
│ │ └── api/ # API routes
│ ├── components/ # React components
│ ├── lib/ # Utilities
│ ├── actions/ # Server actions
│ ├── entry-client.tsx # Client entry
│ └── entry-server.tsx # Server entry
├── public/ # Static assets
├── package.json
├── tsconfig.json
└── zylaris.config.tsCore Concepts
Signals & Reactivity
import { signal, computed, resource, createEffect } from 'zylaris';
// Basic signal
const count = signal(0);
count.set(5);
count.update(c => c + 1);
// Computed
const doubled = computed(() => count() * 2);
// Resource (async data)
const user = resource(async () => {
return fetch(`/api/user`).then(r => r.json());
});
// Effect
createEffect(() => {
console.log('Count:', count());
});Routing
// Static route
// src/app/about/page.tsx → /about
// Dynamic route
// src/app/blog/[slug]/page.tsx → /blog/:slug
interface Props {
params: { slug: string };
}
// Catch-all
// src/app/[...path]/page.tsx → /*Server Actions
'use server';
import { action } from 'zylaris/server';
export const createPost = action
.input(z.object({ title: z.string() }))
.run(async (input) => {
return db.post.create({ data: input });
});Components
import { Show, For, Switch, Match } from 'zylaris';
// Conditional
<Show when={isLoggedIn()} fallback={<Login />}>
<Dashboard />
</Show>
// List
<For each={items()}>
{(item, index) => <li>{item.name}</li>}
</For>
// Switch
<Switch>
<Match when={status() === 'loading'}>Loading...</Match>
<Match when={status() === 'success'}>Done!</Match>
</Switch>Universal Deployment
Deploy to any hosting platform with a single command:
# List all adapters
zylaris adapters
# Build for specific platform
zylaris build --adapter static # GitHub Pages, etc.
zylaris build --adapter vercel # Vercel Serverless
zylaris build --adapter vercel --edge # Vercel Edge
zylaris build --adapter netlify # Netlify Functions
zylaris build --adapter cloudflare # Cloudflare Pages
zylaris build --adapter node # Node.js server
zylaris build --adapter deno # Deno Deploy
zylaris build --adapter bun # Bun runtimeSupported Platforms
| Platform | Adapter | SSR | Edge | Command |
|----------|---------|-----|------|---------|
| GitHub Pages | static | ❌ | ❌ | zylaris build |
| Vercel | vercel | ✅ | ✅ | zylaris build --adapter vercel |
| Netlify | netlify | ✅ | ✅ | zylaris build --adapter netlify |
| Cloudflare | cloudflare | ✅ | ✅ | zylaris build --adapter cloudflare |
| Node.js | node | ✅ | ❌ | zylaris build --adapter node |
| Deno | deno | ✅ | ✅ | zylaris build --adapter deno |
| Bun | bun | ✅ | ❌ | zylaris build --adapter bun |
Configuration
// zylaris.config.ts
import { defineConfig } from 'zylaris';
export default defineConfig({
adapter: 'vercel', // or detailed config
// adapter: {
// target: 'vercel',
// function: { edge: true, memory: 1024 }
// }
});See DEPLOYMENT.md for detailed deployment guide.
Plugin System
Use any JavaScript library with ease:
Auto-Import
// zylaris.config.ts
import { definePlugins, autoImportPresets } from '@zylaris/plugins';
export default definePlugins({
autoImports: [
...autoImportPresets.zylaris(), // signal, computed, Show, For...
...autoImportPresets.lodash(), // debounce, throttle...
...autoImportPresets.zod(), // z
],
});Use without imports:
// No import needed!
const count = signal(0);
const debounced = debounce(fn, 300);
const schema = z.object({ name: z.string() });CDN Libraries
import { definePlugins, presets } from '@zylaris/plugins';
export default definePlugins(
presets.cdn(['react', 'lodash-es', 'moment'])
);Component Adapters
// Use React components
import { reactAdapter } from '@zylaris/plugins/transforms';
const ReactButton = reactAdapter.transform('Button', './Button.jsx');
// Use in Zylaris
<ReactButton onClick={handleClick}>Click me</ReactButton>See PLUGINS.md for complete plugin documentation.
CLI Reference
Development
zylaris dev # Start dev server (port 2727)
zylaris dev --port 3000 # Custom port
zylaris dev --turbo # Turbo mode (faster)Build
zylaris build # Build for production
zylaris build --adapter static # Static export
zylaris build --adapter vercel --edge # Vercel Edge
zylaris build --analyze # Bundle analysisDeployment
zylaris adapters # List available adapters
zylaris preview # Preview production buildOther Commands
zylaris create <name> # Create new project
zylaris test # Run tests
zylaris typecheck # Type check
zylaris lint # Lint codeAPI Reference
Reactivity
signal<T>(initial): Signal<T>
computed<T>(fn): Computed<T>
resource<T>(fetcher, opts): Resource<T>
createEffect(fn): () => void
batch(fn): T
createStore<T>(initial): Store<T>Components
Show<T>(props: { when: T, fallback?: JSX.Element, children: (item: T) => JSX.Element })
For<T>(props: { each: T[], fallback?: JSX.Element, children: (item: T, index: () => number) => JSX.Element })
Switch(props: { children: JSX.Element[] })
Match<T>(props: { when: T, children: JSX.Element })Routing
Link(props: { href: string, prefetch?: boolean })
useRouter(): { push, replace, back, reload, pathname, query }Server Actions
action.input(schema).use(middleware).run(handler)
requireAuth()
requireRole(roles: string[])Performance Benchmarks
| Metric | Next.js | Astro | Zylaris | |--------|---------|-------|---------| | First Load JS | 150KB | 8KB | 4KB | | Time to Interactive | 3.2s | 1.2s | 0.8s | | Build (10k pages) | 45s | 12s | 5s | | HMR | 200ms | 100ms | 10ms | | Lighthouse | 85 | 95 | 100 |
Package Structure
zylaris-framework/
├── packages/
│ ├── core/ # zylaris - Main framework
│ ├── reactivity/ # @zylaris/reactivity - Signals
│ ├── router/ # @zylaris/router - File routing
│ ├── server/ # @zylaris/server - Server actions
│ ├── compiler/ # @zylaris/compiler - JIT compiler
│ ├── dev-server/ # @zylaris/dev-server - HMR
│ ├── adapter/ # @zylaris/adapter - 7 deployment targets
│ ├── plugins/ # @zylaris/plugins - Library integration
│ └── cli/ # @zylaris/cli - CLI tools
├── examples/
│ └── default/ # Example application
└── docs/Contributing
# Clone repository
git clone https://github.com/zylarisjs/zylaris.git
cd zylaris
# Install dependencies
pnpm install
# Build all packages
pnpm run build
# Run tests
pnpm run testDocumentation
- DEPLOYMENT.md - Deployment guide for all platforms
- PLUGINS.md - Using external libraries
- PROJECT_STRUCTURE.md - Architecture overview
Community
License
MIT © zylaris.js
