DEV Community

Zastinian
Zastinian

Posted on

Hedystia 2.3: Universal WebSocket, Native Node.js, PostgreSQL, and 20+ New Validations

Native Node.js Support

The HTTP layer now runs natively on Node.js — no adapter required. listen(port) works the same on Bun and Node.

Before:

import { adapter } from "@hedystia/adapter";
import { createServer } from "node:http";
const app = new Framework().get("/", () => "ok");
createServer(adapter(app).toNodeHandler()).listen(3000);
Enter fullscreen mode Exit fullscreen mode

After:

import Framework from "hedystia";
new Framework().get("/", () => "ok").listen(3000);
Enter fullscreen mode Exit fullscreen mode

@hedystia/ws — Universal WebSocket

A new package that works identically across Bun, Node.js, and Deno. Topic-based pub/sub, runtime-aware client, portable server that plugs into any HTTP runtime.

import { WebSocketServer } from "@hedystia/ws/server";
import { createWebSocket } from "@hedystia/ws/client";
Enter fullscreen mode Exit fullscreen mode

PostgreSQL Driver for @hedystia/db

Native PostgreSQL support via the pg package. Full CRUD, transactions, caching, migrations, and schema sync.

const db = database({
  schemas: { users },
  database: { name: "postgres", provider: "pg" },
  connection: { host: "localhost", user: "postgres", database: "mydb" },
});
Enter fullscreen mode Exit fullscreen mode

Validations Expansion

20+ new schema factories: h.bigint(), h.tuple(), h.record(), h.map(), h.set(), h.intersection(), h.discriminatedUnion(), h.lazy(), h.default(), h.transform(), h.refine(), h.pipe(), plus object methods (.strict(), .pick(), .partial(), etc.) and coercion shortcuts.

Ecosystem Integrations (2.2)

  • @hedystia/astro — Use reactive View components inside Astro with client directives. View is a fine-grained reactive UI engine with no virtual DOM — signals, memos, effects, JSX, flow components, and SSR.
  • @hedystia/better-auth — Plug @hedystia/db into Better Auth as your auth database. @hedystia/db is a type-safe ORM supporting SQLite, MySQL, PostgreSQL, File, and S3 with smart caching and migrations.

Full changelog

https://docs.hedystia.com/blog/2.3

Docs

https://docs.hedystia.com

Top comments (0)