r/javascript • u/Boydbme • Mar 23 '26
r/javascript • u/cochinescu • Mar 23 '26
agentmarkup: Vite/Astro plugin that makes your site machine-readable for AI agents at build time
github.comr/javascript • u/Terrible_Village_180 • Mar 22 '26
I built a tiny utility to know when your form is dirty
everythingfrontend.comWorks with native HTML forms and controlled state (React, Vue, Svelte). Same API, same result. No React, no Lodash, no form library. Pure TypeScript class you drop into any project.
r/javascript • u/mogera551 • Mar 22 '26
@wcstack/state β reactive state in plain HTML with no build step
github.comSmall experiment/library I built. This is not about a lighter template DSL. Itβs about using paths as the contract between UI and state.
It makes plain HTML reactive with one module import:
Count is:
Open it directly in a browser and it works. No JSX, no virtual DOM, no bundler, no config. Bindings live in HTML via data-wcs, while state lives in <wcs-state>. Internally it uses Proxy-based path tracking, so updates only touch affected bindings. The main rule is: update the path directly (this.count += 1), not via a detached nested reference.
List iteration is written using the <template> tag.
The * in users.*.name refers to "the current element." Since * is automatically resolved to the correct index on each iteration, you don't need to manage indices manually. Inside a loop, you can also use the shorthand notation .name.
<!-- same as users.*.name -->
npm: @wcstack/state
Repo: https://github.com/wcstack/wcstack
Docs: https://github.com/wcstack/wcstack/tree/main/packages/state
Story: What If HTML Had Reactive State Management
r/javascript • u/jxd-dev • Mar 22 '26
Building a Legal Chatbot with OpenPolicy and AI SDK
openpolicy.shr/javascript • u/chapoisme • Mar 22 '26
AskJS [AskJS] New to Javascript
Iβm new to JavaScript and still learning the basics. What are some tips i should follow to improve my coding?
r/javascript • u/_ilamy • Mar 21 '26
testoise - lazy, type-safe test variables for Bun, Vitest, and Jest (inspired by RSpec)
github.comBuilt a small library that replaces the let + beforeEach reassignment pattern with RSpec-style lazy variables. Define with def, access with get. Variables evaluate lazily, cache per test, and dependents re-evaluate automatically when overridden in nested blocks. Fully type-safe with a suite wrapper for automatic TypeScript inference.
Zero dependencies, MIT licensed. Feedback welcome!
r/javascript • u/imicnic • Mar 21 '26
slot-variants: utility for component styling
npmjs.comHey everyone, Iβve been working for few months on a small library called slot-variants, for managing complex states in components with css utility classes, itβs inspired by class-variance-authority (CVA) and tailwind-variants (TV). I tried to take the best parts of both approaches and add some distinct features with a focus on ergonomic API and high performance (benchmarks included). The API is a superset of both CVA's and TV's API so the migration is pretty straightforward, in the case of CVA it's a drop-in replacement. The package also includes an AI agent guide how to use it, best practices and common patterns.
Features you'd expect from it:
- Variants API (similar to CVA & TV)
- Slots support (inspired from TV)
- Full TypeScript support
- Extendable to work with
tailwind-merge
Distinct features:
- Required Variants (this is why I started this library)
- Presets (for grouping variants often used together)
- Conditional default variants
- LRU Cache (can be configured)
- Can event replace
classnames/clsxusages (added in latest version)
If youβre building design systems or complex UI components, Iβd love feedback, ideas, or critiques. Still early but stable enough to use, happy to hear what the community thinks!
r/javascript • u/indutny • Mar 20 '26
Petition: No AI code in Nodeβ.βjs Core
github.comI posted this originally on r/node, but thought it might be deserve extra attention in bigger JavaScript community.
---
Hello everyone!
Some of you may remember me for my work on Node.js core (and io.js drama), but if not I hope that this petition resonates with you as much as it does with me.
I've opened it in response to a 19k LoC LLM-generated PR that was trying to land into Node.js Core. The PR merge is blocked for now over the objections that I raised, but there is going to be a Technical Steering Committee vote in two weeks where its fate is going to be decided.
I know that many of us use LLM for research and development, but I firmly believe that the critical infrastructure the Node.js is is not the place for such changes (and especially not at the scale where it changes most of the FS internals for the sake of a new feature).
I'd love to see your signatures there even if you never contributed to Node.js. The only requirement is caring about it!
(Also happy to answer any questions!)
r/javascript • u/SignificantBend5042 • Mar 20 '26
MoltenDB: The Embedded Database for the Modern Web
github.comOn this beautiful day, as both hemispheres achieve perfect symmetry for the Spring Equinox, it felt like the right moment to launch a first major open-source project: MoltenDB.
It is an embedded JSON document database written from scratch in pure Rust that compiles to both a native server binary and a WebAssembly module running in the browser via OPFS.
How it started:
Basically curiosity to experiment with Rust and WebAssembly. Then realizing it may actually solve a real problem.
Coming from a web development background, this project was born out of everyday frustration with browser storage. Persistent storage often means fighting with IndexedDBβs clunky API or the strict capacity limits of localStorage. With the stabilization of the Origin Private File System (OPFS), building a real, high-performance database in the browser is finally a reality.
Furthermore, on the server side, quickly prototyping an end-to-end web app usually means spinning up a heavy separate backend and a standalone DB. Having one isomorphic engine solves that
Beyond the tech, there was a simple driving factor: the desire to finally finish a personal project and ship it to the world. So, straight from the GitHub graveyard.
r/javascript • u/Sea-Bodybuilder-8901 • Mar 21 '26
AskJS [AskJS] Making an SVG interactable
So im a beginner in CSS and JS and im making my first portfolio. I have this idea that i dont know if its possible to make it work in the way im thinking. I have an SVG design, like a simple 2d drawing i made in AI and i made it into a bitmap. Would it be possible to put that SVG in my project and make the individual squares appear/dissapear on hover? I wanna put it on the main banner.
I really have no idea if this is even possible or if i would have to just copy the design square by square in CSS, so any advice would be helpful!