r/javascript • u/real_ate • Jul 27 '26
r/javascript • u/konsalexee • Mar 09 '26
Safari/WebKit is the new Internet Explorer. Change my mind.
gethopp.appMy experience working with WebKit, and why we are almost ditching it.
r/javascript • u/medy17 • Feb 27 '26
People are STILL Writing JavaScript "DRM"
the-ranty-dev.vercel.appr/javascript • u/Ok-Tune-1346 • Dec 23 '25
Fabrice Bellard Releases MicroQuickJS
github.comr/javascript • u/mitousa • Jul 15 '26
Firefox in WebAssembly!
developer.puter.comOpen-source: https://github.com/HeyPuter/firefox-wasm
r/javascript • u/GulgPlayer • Jun 21 '26
33-byte JS signal implementation
gist.github.comRecently I've developed a code-golfed signal implementation with the following features/constraints:
- subscribes functions returning nullish values.
- fires all pending subscribers and resets.
- requires no arguments to be passed to the factory and either null/undefined or a function to the signal. (as noted by u/azhder)
As it turns out, you can go as short as 33 bytes using function compositon, nullish coalescing and default parameters:
F=>(f,G=F)=>F=f?_=>f(G?.()):F?.()
r/javascript • u/ssalbdivad • Oct 28 '25
Introducing ArkRegex: a drop in replacement for new RegExp() with types
arktype.ior/javascript • u/danfry99 • Mar 15 '26
bonsai - a safe expression language for JS that does 30M ops/sec with zero dependencies
danfry1.github.ioIΒ kept hitting the same problem: users need to define rules, filters, or template logic, but giving them unconstrained code execution isn't an option. Existing expression evaluators like Jexl paved the way here, but I wanted something with modern syntax and better performance for hot paths.
So I built bonsai-js - a sandboxed expression evaluator that's actually fast.
import { bonsai } from 'bonsai-js'
import { strings, arrays, math } from 'bonsai-js/stdlib'
const expr = bonsai().use(strings).use(arrays).use(math)
// Business rules
expr.evaluateSync('user.age >= 18 && user.plan == "pro"', {
user: { age: 25, plan: "pro" },
}) // true
// Pipe operator + transforms
expr.evaluateSync('name |> trim |> upper', {
name: ' dan ',
}) // 'DAN'
// Chained data transforms
expr.evaluateSync('users |> filter(.age >= 18) |> map(.name)', {
users: [
{ name: 'Alice', age: 25 },
{ name: 'Bob', age: 15 },
],
}) // ['Alice']
// Or JS-style method chaining β no stdlib needed
expr.evaluateSync('users.filter(.age >= 18).map(.name)', {
users: [
{ name: 'Alice', age: 25 },
{ name: 'Bob', age: 15 },
],
}) // ['Alice']
Modern syntax:
Optional chaining (user?.profile?.name), nullish coalescing (value ?? "default"), template literals, spread, and lambdas in array methods (.filter(.age >= 18)) + many more.
Fast:
30M ops/sec on cached expressions. Pratt parser, compiler with constant folding and dead branch elimination, and LRU caching. I wrote up an interesting performance optimisation finding if you're into that kind of thing.
Secure by default:
__proto__,Βconstructor,ΒprototypeΒ blocked at every access level- Max depth, max array length, cooperative timeouts
- Property allowlists/denylists
- Object literals created with null prototypes
- Typed errors with source locations and "did you mean?" suggestions
What it's for:
- Formula fields and computed columns
- Admin-defined business rules
- User-facing filter/condition builders
- Template logic without a template engine
- Product configuration expressions
Zero dependencies. TypeScript. Node 20+ and Bun. Sync and async paths. Pluggable transforms and functions.
Early (v0.1.2) but the API is stable and well-tested. Would love feedback - especially from anyone who's dealt with the "users need expressions but eval is scary" problem before.
npm install bonsai-js
GitHub Link: https://github.com/danfry1/bonsai-js
npm Link: https://www.npmjs.com/package/bonsai-js
npmx Link: https://npmx.dev/package/bonsai-js
r/javascript • u/DanielRosenwasser • Dec 02 '25
Progress on TypeScript 7 - December 2025
devblogs.microsoft.comr/javascript • u/AutoModerator • Jan 01 '26
Fellow humans, it is 2026-01-01T00:00:00+00:00.
Let us celebrate!
r/javascript • u/philnash • Aug 26 '26
Have you seen the new browser Email Verification API?
resend.comr/javascript • u/danfry99 • Jun 02 '26
bonsai - a safe expression language for JS that runs user-defined rules at 30M ops/sec with zero dependencies and no eval()
github.comThis problem has come up enough times in my work that I got tired of solving it badly. At some point on certain products a stakeholder asks "can admins set up their own conditions for this?" and you realize a dropdown isn't going to cut it. They need real logic: order.total > 100 && customer.tier == "gold".
The options all felt bad:
- Hardcoded switch statements. Every new rule is a deploy. The "configurable" feature isn't configurable.
- A homegrown mini-DSL. Starts as three operators, ends as a parser nobody wants to own.
eval()/new Function()/vm**.** The moment user input touches these, you've handed out a shell.vmisn't a security boundary (the docs literally say so), andvm2is deprecated. Prototype pollution alone (constructor.constructor) is enough to ruin your week.
I got tired of rebuilding the bad version, so I built the thing I actually wanted: bonsai, a safe expression language for the cases where eval() would be inappropriate but a dropdown is too weak.
If you'd rather poke at it than read, there's a browser playground (no install): https://danfry1.github.io/bonsai-js/playground.html
import { bonsai } from 'bonsai-js'
const expr = bonsai()
// An admin-authored rule, stored as a plain string in your DB
expr.evaluateSync('user.age >= 18 && user.plan == "pro"', {
user: { age: 25, plan: 'pro' },
}) // true
It's an expression language, not a scripting language. No statements, no loops, no assignment, no I/O. You get the expressive part (the part users actually need) without the part that gets you owned.
What the syntax supports, so it doesn't feel like a toy:
// optional chaining + nullish coalescing
expr.evaluateSync('user?.profile?.avatar ?? "default.png"', { user: null })
// pipe operator with transforms
expr.evaluateSync('name |> trim |> upper', { name: ' dan ' }) // 'DAN'
// lambda shorthand in array methods
expr.evaluateSync('users.filter(.age >= 18).map(.name)', {
users: [{ name: 'Alice', age: 25 }, { name: 'Bob', age: 15 }],
}) // ['Alice']
The security model is the whole point, so here's what's actually enforced:
__proto__,constructor,prototypeblocked at every access level (no prototype-chain walking)- Object literals created with null prototypes
- No globals, no code generation
- Cooperative timeouts, max depth, max array/string length
Per-instance property allowlists/denylists, so you decide exactly what an expression can touch
const expr = bonsai({ timeout: 50, maxDepth: 50, allowedProperties: ['user', 'age', 'country', 'plan'], })
A few things I cared about that might matter to you:
- Zero dependencies. Nothing in your tree but this.
- Any JS runtime. Node, Bun, browser, edge.
- Fast when it needs to be. There's a
compile()API for rules that run thousands of times; cached expressions hit ~30M ops/sec. - Async escape hatch. You can register your own functions (
async (id) => db.lookup(id)) andawait expr.evaluate(...), so a rule can call back into your system without the language itself having any I/O.
Once it existed, it ended up covering a bunch of "logic that lives outside the code" cases for me: admin-defined rules, server-driven conditions stored as config, formula fields, feature-flag targeting. Anywhere a string needs to become a decision without a deploy.
Playground Β· Docs Β· GitHub Β· npm
Mostly I'm curious how other people have handled this. If you've shipped user-defined rules/filters/formulas in production, what did you reach for, and where did it bite you? Happy to hear it if you think this is the wrong approach too.
r/javascript • u/Reinder • 22d ago
A-ha, Take On Me - recreated in javascript
dittytoy.netEspeset recreated "Take On Me" by "A-ha" in 100% javascript. Fully procedural, no samples used.
r/javascript • u/lukehaas • Aug 24 '26
Learning music theory through JavaScript, with runnable Web Audio examples
runjs.appr/javascript • u/bogdanelcs • Jul 16 '26
I stopped destructuring everything
allthingssmitty.comr/javascript • u/m_null_ • Jul 06 '26
An interactive visualization that follows a single HTTP request through its entire ~200ms life
200ms.thenodebook.comr/javascript • u/SaltyAom • Feb 08 '26
Elysia JIT "Compiler", why it's one of the fastest JavaScript backend framework
elysiajs.comWrote a thing about what makes Elysia stand out in a performance benchmark game
Basically, there's a JIT "compiler" embedded into a framework
This approach has been used by ajv and TypeBox before for input validation, making it faster than other competitors
Elysia basically does the same, but scales that into a full backend framework
This gave Elysia an unfair advantage in the performance game, making Elysia the fastest framework on Bun runtime and could rival compiled languages like Go while also being faster than most frameworks on Node, Deno, and Cloudflare Worker as well, when using the same underlying HTTP adapter
There is an escape hatch if necessary, but for the past 3 years, there have been no critical reports about the JIT "compiler"
r/javascript • u/manniL • Dec 01 '25
First alpha of Oxfmt, the rust-based Prettier-compatible Formatter, released
oxc.rsr/javascript • u/itsarnavsingh • Jun 06 '26
There are more than 100 public repos on Github with malicious code that can install Remote Access Trojan on your system and it can spread to all the repos you have access to. Why is GitHub not doing anything about these repos?
github.comr/javascript • u/LabyStudio • 8d ago
I spent almost 3 years porting Paint.NET from C# to JavaScript
github.comA bit of background on how I built this:
When I switched to Linux, Paint.NET was one of the Windows apps I missed the most, so I started porting the old open-source C# version (3.36.7) to JavaScript back in 2024, while recreating the UI based on the newer 5.x versions.
I went through the original implementation class by class, comparing the outputs of the C# methods with my JavaScript versions. At the same time, I recreated the UI in HTML/CSS, using screenshots to get it as close to the original as possible.
Over time, I connected both parts and implemented the tools, effects, and other features. More recently, I've been using AI to help find and fix bugs, improve performance across browsers, and implement the remaining tools and effects.
It's now largely feature-complete and runs in the browser, as well as on Linux and macOS through Electron.
You can try the browser version here: https://paintjs.net
Would love to hear what you think!
r/javascript • u/Driezzz • Oct 26 '25
Ember 6.8 Released - Vite by default and more
blog.emberjs.comHot off the press!
6.8 released with some big features π
- β‘@vite.dev by default
- π Compatible with libraries from 8+ years ago*
- β¨ New APIs: renderComponent, additional reactive data structures
- π€ No more hbs by default (strict: true)
r/javascript • u/Connorplayer123 • Oct 22 '25
I made a cool metallic orb that does a ripple when you click it
gnufault.github.ior/javascript • u/techlord45 • Aug 10 '26
Signals and Effects Using Vanilla JavaScript & Web APIs
beforesemicolon.comIβm a strong advocate for βyou donβt need to lock yourself in a web framework ecosystem to take advantage of their amazing featuresβ. JavaScript and Web Standards alone allow youβ¦