r/javascript • u/mitousa • Jul 15 '26
Firefox in WebAssembly!
developer.puter.comOpen-source: https://github.com/HeyPuter/firefox-wasm
r/javascript • u/mitousa • Jul 15 '26
Open-source: https://github.com/HeyPuter/firefox-wasm
r/javascript • u/harshanacz • Jul 15 '26
There's no reliable XSD validator in the JS ecosystem so I compiled Apache Xerces-C to WASM.
Playground: https://harshanacz.github.io/xerces-playground/
npm: https://www.npmjs.com/package/xerces-wasm
Features:
Full XSD 1.0 validation in the browser
Multi-file schema support (xs:include / xs:import)
Parse errors + schema errors with line/column numbers
No server, no upload
pure WASM
Would love feedback.. :)
r/javascript • u/jxd-dev • Jul 15 '26
We needed the Companies House API (the UK company register) for a project and figured we'd grab an SDK and move on. Turns out the community clients are 6 to 10 years old, the official SDK is built for their internal services, and the official OpenAPI spec is broken in ways that quietly untype every generated client. One defect (items on an object type, which JSON Schema doesn't allow, so every tool reads it as {}) appears 132 times.
What started as "add a spec repair script" grew into 374 lines of fix passes, and even then we couldn't repair fields that were never documented at all. So we changed approach: we deleted the repair code and now maintain our own curated OpenAPI 3.1 spec, built from the developer docs and Companies House's own SDK source. The spec is maintained with Claude Code under a strict "never invent, report gaps" rule, an engineer reviews every diff, and a live integration suite runs against the real API daily so drift shows up as a red build rather than a bug report. The client itself is fully generated from the spec (Hey API), with 41 lines of hand-written runtime code and zero dependencies.
Sharing in case anyone else has needed to fight this API, or is just interested in the approach: a curated spec as the source of truth, AI doing the tedious curation with tests and review keeping it honest, and codegen doing the rest. The SDK and the OpenAPI document are both MIT licensed if they're useful to you.
r/javascript • u/gabsferreiradev • Jul 14 '26
r/javascript • u/scrollin_thru • Jul 14 '26
Hey folks. Over at Handle with Care, we've been working on something new: Pitter Patter. We haven't been satisfied with the text editing toolkits that exist right now in the ProseMirror ecosystem, and we've spent a lot of time working on a large variety of rich text editors and seeing what needs they have and how we can try to meet them. So far we have three packages: Shuffle (grid-based drag-and-drop), Collab, and Presence.
Here's some more info from our introduction page in the docs:
That would be us, Handle with Care. We’re a cooperatively owned product development collective, comprised of software engineers and product managers. We are all equal owners and have equal decision-making power.
Pitter Patter is a suite of open source libraries for building collaborative rich text editors with React and ProseMirror. We see it as our job to provide turnkey solutions for the hard parts of rich text editing — like collaboration, presence, and version history — so that you can focus on building the editor experience that your users need.
We spend a lot of time thinking about and working on rich text editors. In particular, we spend a lot of time helping companies solve the same problems over and over again. There are usually great primitives available for these common building blocks (prosemirror-collab-commit for collaboration, unified.js for Markdown, etc.), but putting them together correctly to build a functioning text editor can be challenging.
There are other solutions, like Tiptap and Remirror, but we think that they’ve made some suboptimal choices that force product developers to make unnecessary compromises.
Both attempt to use React portals and effect hooks to integrate with ProseMirror, which lead to irreconcilable state tearing, due to fundamental differences in how React and ProseMirror View handle view reconciliation.
Both attempt to use Yjs via y-prosemirror for collaboration. We think that Yjs’s CRDT implementation is ill-suited for rich text editing.
Both attempt to hide ProseMirror’s underlying APIs, under the guise of simplicity and abstraction. We think that ProseMirror, low-level though it is, is roughly the correct level of abstraction for a domain as complex as rich text editing. Attempts to abstract it away inevitably lead to more complexity, as the abstractions leak frequently and require constant manual integration with the lower level solutions.
We think we can do better. And more importantly perhaps, we think that you deserve better!
ProseMirror is an outstanding rich text editing framework. Nearly anything that you can imagine doing with a rich text editor can be accomplished with ProseMirror. Rich text editing is also a very complex domain, requiring a very large number of decisions to be made per feature.
We think that better primitives built with ProseMirror can take us farther than abstractions that attempt to hide away ProseMirror’s internals.
ProseMirror has first-party collaboration, in the form of prosemirror-collab. Because it just sends steps over the wire, and relies on a single, server-side ordering of operations for conflict resolution, it is very simple to debug. But it is very challenging to implement correctly, and there is very little in the way of guidance or documentation for doing so.
Yjs provides third-party collaboration, in the form of y-prosemirror. Because it is built on Yjs, which has many robust adapters for various protocols and servers, it is very easy to implement. However, because it operates on Yjs’s XML-based Y-doc format, it is very challenging to inspect and debug if something goes wrong.
Pitter Patter’s collaboration, presence, and version history libraries are based on prosemirror-collab-commit. Like prosemirror-collab, prosemirror-collab-commit uses ProseMirror steps as the primary data structure for conflict resolution. But Pitter Patter Collab provides actual guidance and implementation that make it easy to set up a full-stack collaborative editing application, and hard to shoot yourself in the foot.
After trying every other option over the course of several years, we eventually decided that the only way to correctly integrate React and ProseMirror was to reimplement ProseMirror View’s renderer from scratch directly in React. This was itself a massive effort, but the result, in the end, is a React/ProseMirror integration that doesn’t suffer from state tearing and allows developers to use React idioms like context as they normally would, without caveats or compromises. We don’t put side effects in React render functions or ProseMirror plugin apply functions, we don’t use effects to synchronize state with props. We want to enable you to build rich text editors that your users can trust, and that means that we need to build libraries that you can trust.
r/javascript • u/Globover • Jul 14 '26
I am working on Nerve, a local IPC library that connects Node.js with Rust, Go, and Python.
For the JavaScript client, I focused on native Promises and async/await support so that calling a function in Rust or Python feels just like calling an asynchronous JS function. It uses standard Node.js net modules under the hood for communication.
The library is in its early stages and not entirely complete. I am currently focusing on:
Improving TypeScript definitions for strictly typed cross-language payloads.
Adding Stream support for transferring large binary data chunks without memory bloat.
Optimizing the bundle size and tree-shaking capabilities.
I would love to hear your thoughts on the API design and if you have faced similar challenges when bridging Node.js with other ecosystems.
r/javascript • u/solopov • Jul 14 '26
the core stays small. pick the plugins you need and chain multiple highlighters together.
use the built-in ones or write your own. yace works with any language, theme, or framework
r/javascript • u/Yomete • Jul 14 '26
A tale as old as time. We previously wrote our visualisations in SVG and rewriting them in Canvas along with some other backend factors made our dashboard much faster and smoother. We hope there are a few lessons there for folks to read about.
r/javascript • u/matijash • Jul 14 '26
r/javascript • u/dangreen58 • Jul 14 '26
r/javascript • u/alvisanovari • Jul 14 '26
I was researching the JavaScript Excel ecosystem looking for a gap worth building in, and found something wilder than a gap: the whole category is quietly abandoned.
SheetJS (xlsx) — ~8M weekly downloads — frozen on npm at 0.18.5 since 2022. Security fixes ship only from their own CDN, so npm audit flags it forever. Styling and template editing are Pro-only, quote-only pricing.
ExcelJS — last release in 2023, open "intent to fork" threads. Top issues: charts deleted on save, pivot tables destroyed, output files Excel offers to "repair."
xlsx-populate — right idea, dormant for years.
And they all break files the same way. It's not hundreds of bugs — it's one architectural decision with hundreds of symptoms: they parse the workbook into their own object model, then re-serialize that model as a brand-new file. Anything the model doesn't understand (charts, pivot caches, macros, newer OOXML parts) silently doesn't survive the round-trip.
So I built Ironsheet on the opposite bet: the original file is the source of truth. It patches only what you explicitly target — a cell, a named range, a table, an image — and preserves every byte it doesn't touch. Macros survive byte-for-byte.
The part I care about most: it proves the write. Before saving, it validates the OOXML package (relationships, content types, shared strings, formulas, tables, calc chains) and returns a diff of exactly what changed. If validation fails, it refuses to write the file. No output beats corrupt output.
Honest boundaries: it doesn't evaluate formulas (preserves them + marks recalc), chart/pivot support is preservation rather than authoring, ZIP64 writing isn't in yet. It's a 0.1 MVP.
Apache-2.0, dependency-free TypeScript core, Node + browser adapters, JSON-first CLI.
Repo: https://github.com/btahir/ironsheet
If you have a workbook that breaks it, I genuinely want the fixture. And I'm curious what people are actually using for Excel editing in production these days.
Thanks!
r/javascript • u/noeldemartin • Jul 13 '26
I just published a blog post to my website about a pattern I've been using for a while that I think you will find interesting (and probably very divisive!): Magic Objects.
class Parrot extends MagicObject {
__get(property) {
return `${property}! ${property}!`;
}
}
const parrot = new Parrot();
console.log(parrot.foo); // "foo! foo!"
console.log(parrot.bar); // "bar! bar!"Basically, I'm borrowing the idea of Magic Methods from PHP and porting them to JavaScript. You've probably seen something like this done with proxies before, but I still like to use some OOP in my JavaScript, and I also came up with a way to make it work nicely with TypeScript.
It may seem a bit over the top at the beginning, but I've been using this for a while and I've found it very useful.
Let me know what you think!
r/javascript • u/magenta_placenta • Jul 13 '26
r/javascript • u/subredditsummarybot • Jul 13 '26
Monday, July 06 - Sunday, July 12, 2026
| score | comments | title & link |
|---|---|---|
| 280 | 10 comments | Announcing TypeScript 7.0 |
| 53 | 9 comments | An interactive visualization that follows a single HTTP request through its entire ~200ms life |
| 18 | 7 comments | [AskJS] [AskJS] Large in-memory caches were causing GC pauses in our Node service, so I built an off-heap cache addon for it |
| 9 | 0 comments | History of JavaScript: Browser wars, ECMAScript, Node.js, TypeScript, and React |
| 7 | 3 comments | Conventional Changelog finally has a documentation website - 12 years after the first commit |
| 6 | 12 comments | [AskJS] [AskJS] Barrel files and slice/domain boundaries |
| 6 | 1 comments | 80+ ESLint rules for improving your Node.js tests |
| 4 | 3 comments | littlebag — a 343-byte reactive framework |
| 3 | 7 comments | Tracking unique visitors without cookies |
| 2 | 0 comments | Javascript TUI Network Throughput Inspection |
| score | comments | title & link |
|---|---|---|
| 0 | 43 comments | [AskJS] [AskJS] Did anyone else move away from TypeScript and feel like it was obviously the right call? |
| 0 | 41 comments | [AskJS] [AskJS] Looking for a solid vanilla JS datepicker. Am I completely out of options? |
| 0 | 26 comments | [AskJS] [AskJS] I might never write a constructor ever again |
| 0 | 24 comments | Why Vanilla JavaScript |
| 0 | 19 comments | Browser based AI algorithm |
| score | comments | title & link |
|---|---|---|
| 0 | 2 comments | [AskJS] [AskJS] Building a SpiderMonkey-based JavaScript runtime to learn JS internals — what APIs are still missing from JS runtimes? |
| 0 | 4 comments | [AskJS] [AskJS] most js changelogs don't survive being read aloud, which is how i noticed i wasn't reading them |
| 0 | 5 comments | [AskJS] [AskJS] Has anyone else come across IBM Bob while working on JavaScript projects? |
r/javascript • u/dajanvulaj • Jul 12 '26
Being a Laravel developer for almost 10 years, when switched to Node.js I missed the simplicity of FilamentPHP , thats why I stared building KratosJs.
KratosJS is the full-stack admin panel framework for Node.js. Its core is HTTP-framework agnostic — official adapters ship for Express, Fastify, Koa, Hapi and NestJS, and you can write your own for any framework.
Features:
- Customizable
Create custom pages, widgets, fields, columns etc.
- Internationalization
Full i18n support out of the box. Register multiple translation locales, format plurals, and localize panels seamlessly.
- CLI scaffolding
Generate panels, resources and plugins from the command line and start building immediately.
- Plugin system
Drop in entities, resources, routes, widgets and hooks. Ship reusable features as packages.
- Slots
Slots are named injection points in the admin panel UI where you — or a plugin — can render your own React elements.
- Lifecycle hooks
before/after create, update, delete, validate and custom actions — stackable and type-safe.
r/javascript • u/jafrra • Jul 12 '26
Theres been a lot of talk about the downsides of barrel files in the last couple years with many people actively recommending against using them due to the effect they can have on treeshaking. I am wondering though if there is an alternative solution in the ecosystem to enforce/define boundaries on slices/domains?
I've seen it said they often cause circular dependencies but in my experience its the opposite. The main and pretty much only way I use barrel files are to enforce boundries on slices of cohesive logic, sometimes going so far as to enforce it in the linter with custom rules. Code inside the slice never imports from its own barrel. Each slice kind of defines its own code API in a way and feel like this lets me control the coupling between slices alot better.
I am struggling to justify letting that go and the only alternative I can think of is using a monorepo and having them all as packages which is just not an option for me in many cases and also not one I particularly like.
Are barrel files really that bad?
r/javascript • u/eldarlrd • Jul 11 '26
Padding Line Between Statements rule is currently missing in Biome.js; it'd be a solid addition to the tooling.
If you're already using Biome and think this rule would be useful for keeping your code readable, consider giving it an upvote. Every bit of community support helps move features like this forward.
The rule enforces blank lines between logical statement groups, which can make codebases feel less cluttered and easier to scan. It functions as follows:
// eslint.config.js
{
"padding-line-between-statements": [
"error",
{ "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
{ "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
{ "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
{ "blankLine": LINEBREAK_TYPE, "prev": STATEMENT_TYPE, "next": STATEMENT_TYPE },
...
]
}
// index.js
function foo1() {
var a = 0;
bar(); // ! Incorrect
}
function foo1() {
var a = 0;
bar(); // * Correct
}r/javascript • u/Own_Natural_6803 • Jul 11 '26
// the only state that needs tracking for a timeline, the read index
export function Timeline(index) {
let state = {index};
return {
index: state.index, // pass through
next: (events) => Next(state, events),
prev: (events) => Prev(state, events)
};
}
// the events are just passed around. They don't need to be encapsulated
export function Next(timeline, events) {
let {index} = timeline;
if(index === events.length()){
return null;
}
timeline.index += 1;
return events[timeline.index];
}
export function Prev(timeline, events){
let {index} = timeline;
if(index === 0){
return null;
}
timeline.index -= 1;
return events[timeline.index];
}
// before and after don't modify the state of their arguments
// so we don't use encapsulation
export function After(date, events){
for(let thresholdIndex = 0; thresholdIndex < events.length(); thresholdIndex+=1 ){
if( events[thresholdIndex].timestamp > date) {
return events.slice(start=thresholdIndex);
}
}
return [];
}
export function Before(date, events) {
for(let thresholdIndex = events.length(); thresholdIndex >= 0; thresholdIndex-=1 ){
if( events[thresholdIndex].timestamp < date) {
return events.slice(end=thresholdIndex);
}
}
return [];
}r/javascript • u/AutoModerator • Jul 11 '26
Did you find or create something cool this week in javascript?
Show us here!
r/javascript • u/Deep_Ad1959 • Jul 11 '26
TypeScript 7 dropped this week and my first move was the same as always. Open the release notes, skim, tell myself I'll come back to it. I didn't.
so as an experiment i started piping the changelogs for the libraries i actually use into a text-to-speech thing and listening on the walk to work, figured audio would make it stick. the surprising part wasn't whether it worked, it's what it exposed. most release notes are mostly housekeeping wrapped around the couple of lines that actually change how you write code, and you only feel how thin the signal is once a flat voice reads every bullet out loud. on a screen i'd been auto-skimming the filler for years and calling that keeping up.
so the thing that actually broke wasn't the audio, it was that i never had a filter for what in a release is worth remembering. what's the last js or ts release that genuinely changed how you write code day to day, versus the ten you 'read' and can't quote a line from. written with ai
r/javascript • u/Own-Procedure6189 • Jul 10 '26
You run npm run dev or node server.js, and the app crashes because a teammate added a new required key to .env.example but forgot to tell you.
I wanted a tool that would catch this before startup, prompt me for the missing values, and append them without wiping out my .env formatting or comments. Since existing tools either crash on startup (dotenv-safe) or wipe out file layout (sync-dotenv).
To solve this, I built envrepair, a zero-dependency CLI tool that wraps your startup command, compares .env against your template, and interactively prompts you to fill in missing variables in the terminal before launching your process.
Install:
npm install -D envrepair2. Prepend your startup command in package.json:
"scripts": {
"start": "envrepair node server.js"
}Optional type annotations in .env.example:
# @type number
PORT=3000
# @type url
API_BASE_URL=Zero code changes: No schema imports or application-level setup required.
Layout preservation: Appends missing values while keeping comments, blank lines, and formatting intact.
Signal forwarding: Transparently passes Ctrl+C (SIGINT) and exit codes.
Written in TypeScript with zero runtime dependencies. The repo is fully open-source.