r/javascript • • Mar 19 '26

Bun is Fast. Your Event Loop is Not.

Thumbnail howtocenterdiv.com
0 Upvotes

Bun wins benchmarks. Your app still bottlenecks on DB connections, blocking CPU work, and N+1 queries. Switching runtimes before fixing those is optimizing the wrong layer. MigrateΒ bun installΒ andΒ bun testΒ today β€” safe, immediate wins. Move the runtime only when the profiler tells you to.


r/javascript • • Mar 19 '26

Implemented hot config reload in both Node and Go for the same proxy. They felt worlds apart.

Thumbnail github.com
5 Upvotes

I built the same proxy in two codebases, one in Node and one in Go, and implemented the same hot config reload contract in both.

For context, the proxy sits between your app and an upstream API, forwards traffic, and injects failures like latency, intermittent 5xxs, connection drops, throttling, and transforms.
I built it first in Node for JS/TS testing workflows, then rewrote it in Go for performance. And then I decided to add hot config reload to both. Same external contract:

  • POST /reload with full config snapshot
  • build then swap, all-or-nothing
  • deterministic in-flight behavior
  • reject concurrent reloads
  • same status model: 400, 409, 415, success returns version and reload duration

I expected similar implementations. They were very different.

  • Runtime model: Node implementation stayed dynamic: rebuild middleware chain and swap active runtime object. Go implementation pushed toward immutable runtime snapshots: config + router + version behind an atomic pointer.
  • Concurrency shape: Node: most complexity is guarding reload so writes are serialized. Go: explicit read/write split: read path loads snapshot once at request start, write path locks reload, builds fresh state, atomically swaps pointer. Same behavior, but Go makes the memory/concurrency story more explicit.
  • In-flight guarantees: Both guarantee request-start snapshot semantics. In Node, that guarantee is easier to violate accidentally if mutable shared state leaks into request handling. In Go, snapshot-at-entry is structurally enforced by the pointer-load pattern.
  • Router lifecycle: Node composition is lightweight and ergonomic for rebuilds. Go required reconstructing a fresh chi router on each reload and re-registering middlewares deterministically. More ceremony, but very predictable.
  • Validation and rollback boundaries: Both use parse -> validate -> build -> swap. Node gives flexibility but needs extra discipline around runtime guards. Go’s type-driven pipeline made failure paths and rollback behavior cleaner to reason about.
  • Stateful middleware behavior: Both rebuild middleware instances on reload, so in-memory counters/tokens reset by design. Same product behavior, different implementation feel.

This was honestly a lot of fun to build.
Tests pass and behavior looks right, but I am sure both versions can be improved.
Would love feedback from people who have built hot-reload systems across different runtimes and had to preserve strict in-flight consistency.


r/javascript • • Mar 18 '26

Build Privacy Policies Your Customers Actually Want to Read

Thumbnail openpolicy.sh
5 Upvotes

r/javascript • • Mar 18 '26

"Vite+ is kinda underwhelming" - a comprehensive review of the new release

Thumbnail github.com
6 Upvotes

r/javascript • • Mar 18 '26

Library that generates web interfaces from data.

Thumbnail github.com
0 Upvotes

r/javascript • • Mar 18 '26

Codegen based on .env.schema from varlock

Thumbnail github.com
1 Upvotes

Varlock has a pretty neat spec building around .env files: https://github.com/dmno-dev/varlock/discussions/17, but Varlock itself is still in its infancy regarding non-JS projects. We wrote envgen as a workaround, and it works for our use case.

Check it out as well as Varlock.


r/javascript • • Mar 17 '26

ORM Comparison (2026)

Thumbnail uql-orm.dev
9 Upvotes

r/javascript • • Mar 17 '26

Edge.js: Running Node apps inside a WebAssembly Sandbox

Thumbnail wasmer.io
19 Upvotes

r/javascript • • Mar 18 '26

I built a shadcn/ui-inspired PDF component library for React β€” pdfx add heading (like shadcn add button). Looking for honest feedback.

Thumbnail github.com
0 Upvotes

Hey r/reactjs,

I've been frustrated with PDF generation in React for a while. The options are basically:

- Write raw `@react-pdf/renderer` JSX (verbose, no design system)

- Pay for SaaS tools that lock you in

- Pray someone made a template that kinda fits

So I built **PDFx** β€” a copy-paste PDF component library inspired by shadcn/ui.

The idea: instead of installing a package, you run `pdfx add heading` and the component lives in your codebase. You own it, modify it, theme it.

---

## What's working right now (alpha)

**CLI commands:** `pdfx init`, `pdfx add`, `pdfx list`, `pdfx diff`, `pdfx theme switch`

**20 components:** heading, text, table, data-table, badge, card, form, graph, signature, page-header, page-footer and more

**Theme system** with Professional, Modern, Minimal presets

**7 templates:** 3 invoice styles + 4 report types

---

## Quick start

```bash

npx @akii09/pdfx-cli@alpha init

pdfx add heading text table

```

- GitHub: [github.com/akii09/pdfx](https://github.com/akii09/pdfx)

## What I'm genuinely trying to figure out

  1. Is the copy-paste model the right approach for PDFs, or would you rather a proper npm package?
  2. What templates would actually be useful? (Invoice? Resume? Report? Something else?)
  3. Is the CLI friction too high for a first experience?

Roast me if needed. Alpha = rough edges exist and I'd rather know about them.


r/javascript • • Mar 17 '26

Introducing Revise.js – A foundational library for building contenteditable-based web text editors

Thumbnail revise.js.org
17 Upvotes

r/javascript • • Mar 17 '26

I needed a tiny frontend framework with no bloat, so I built a 1.7kb one

Thumbnail github.com
15 Upvotes

Hey there o/
I've been building an ecosystem of zero-friction, local-first productivity tools called "That Just Works". For the UI, I needed something incredibly fast and lightweight. I love the ergonomics of Vue/React, but I didn't want a 40kb+ payload.
So, I built Sigwork.
It's a 1.7kb (gzipped) fine-grained reactive engine based on signals. Instead of VDOM diffing, components run exactly once. When a signal changes, it surgically updates only the affected text node or DOM attribute via microtask batching.

A few highlights:
JSX or Buildless: You can use it with Vite/JSX, or directly in the browser via CDN, maybe paired with htm for a JSX-like experience.
Built-in components: <Component> and <Transition>
Features: Props, events, slot, provide/inject, life-cycle hooks. Basically everything I usually use on Vue.

I've just released v0.1.0 and would love to hear your thoughts on it.

Docs & Demos: https://framework.thatjust.works
Repo: https://github.com/thatjustworks/sigwork


r/javascript • • Mar 18 '26

`new Date()` considered harmful

Thumbnail futuresearch.ai
0 Upvotes

r/javascript • • Mar 17 '26

Mandelbrot.js – Fractal Explorer in WebGL with Quad-Trees and Double-Emulation

Thumbnail mandelbrot.musat.ai
7 Upvotes

Hi everyone,

I built a WebGL web app to explore the Mandelbrot Set, focusing on rendering deep zooms directly in the browser. Here is a breakdown of how it works under the hood:

  • Deep zoom (10^14): You can zoom in up to a hundred trillion times using WebGL double precision emulation. I used a logarithmic color palette so the colors stay vibrant and detailed at extreme depths.
  • Progressive rendering: To maintain a smooth fps while panning, it shows an instant low-res preview while moving, and then refines it into high-res up to 8x subpixel sampling.
  • Quad-tree tile caching: It's designed to be efficient by never calculating the same pixels twice. It caches rendered tiles and actively garbage-collects off-screen tiles.
  • Dynamic iteration scaling: To ensure the set doesn't turn into a solid black blob as you dive deeper, the app automatically scales up the maximum iteration count to keep the fractal edges sharp and complex.
  • Shareable coordinates: Everything runs client-side via JS/WebGL. You can easily copy the URL to share the exact X/Y coordinates and zoom level of your favorite finds.
  • Open source: All the code is public and available for free on GitHub if you want to see how the rendering pipeline works.

I'd love for you to try it out and share your feedback, or even some links to the most interesting coordinates you can find!

App: https://mandelbrot.musat.ai/
Code: https://github.com/tiberiu02/mandelbrot-js