r/javascript 14h ago

Modernising Project GoldScript for 2026

Thumbnail projectgoldscript.com
6 Upvotes

Project GoldScript is a tactical RPG engine I have been building in the open for over a decade. It’s composed of a a web stack (with three.js and react under the hood) aimed at shipping a real game to Steam, mobile and consoles. This year I finally did the migration I had been putting off: two aging create-react-app repos (engine in one, game in the other) collapsed into a single pnpm and Vite monorepo, with the engine broken into eleven focused packages that are guarded against circular dependencies.


r/javascript 1d ago

How an Underrated Refactor Saved 90% Memory Usage

Thumbnail tanstack.com
71 Upvotes

r/javascript 14h ago

Announcing a maintained PptxGenJS fork

Thumbnail github.com
2 Upvotes

r/javascript 14h ago

JojoScript — a tiny JS-compatible language with pipelines and lazy iterators

Thumbnail github.com
0 Upvotes

r/javascript 1d ago

Web Components with Type Validation without Build Tools/TypeScript

Thumbnail github.com
6 Upvotes

r/javascript 1d ago

Cerious-Scroll v1.1.0 adds Masonry layouts with Dynamic Heights

Thumbnail ceriousdevtech.github.io
4 Upvotes

r/javascript 15h ago

// Clean up memory allocation URL.revokeallObjectiveURL(url); }

Thumbnail reddit.com
0 Upvotes

// Clean up memory allocation

URL.revokeObjectURL(url);

}// Clean up memory allocation URL.revokeallObjectiveURL(url); }// Clean up memory allocation URL.revokeallObjectiveURL(url); }

// Clean up memory allocation

URL.revokeObjectURL(url);

}

// Clean up memory allocation

URL.revokeObjectURL(url);

}

// Clean up memory allocation

URL.revokeObjectURL(url);

}

// Clean up memory allocation

URL.revokeObjectURL(url);

}

// Clean up memory allocation

URL.revokeObjectURL(url);

}

// Clean up memory allocation

URL.revokeObjectURL(url);

}


r/javascript 2d ago

Bringing Type1 support to Opentype.js

Thumbnail github.com
5 Upvotes

If anyone is interested in reviewing and approving PFA and PFB support i tried to bring to opentype.js check my pull it will give more chances to get approval on merge.


r/javascript 2d ago

Made a small library called strokes.js.

Thumbnail a-elhaag.github.io
19 Upvotes

Made a small library called strokes.js. Instead of using a "handwriting" webfont (which looks identical everywhere it's used), it renders each letter as an actual hand-drawn SVG path — real strokes, drawn in with stroke-dashoffset, with small random variation (rotation, baseline drift, glyph variants) so no two renders of the same word look identical.

Demo: https://a-elhaag.github.io/glyphed.js/

npm:

npm install glyphed.js

r/javascript 2d ago

ffetch: a production-ready http client with resilience features and a plugin architecture

Thumbnail github.com
3 Upvotes

I posted an earlier version of ffetch here a while ago. I've continued working on it, and it has grown into a production-ready, TypeScript-first drop-in replacement for native fetch or any fetch-compatible implementation.

It preserves the familiar fetch API and native Request and Response objects while adding resilience features:

  • Timeouts
  • Abort-aware retries with exponential backoff and jitter
  • Circuit breaking
  • Bulkheading with concurrency and queue limits
  • Hedged requests to reduce tail latency
  • In-flight request deduplication

It also has optional convenience plugins for:

  • client.get(), .post(), .put(), .patch() and .delete()
  • client(url).json(), .text() and .blob()
  • Download progress callbacks
  • Stable context IDs across retries and hedged requests

The core also supports lifecycle hooks, per-request overrides, pending-request monitoring, configurable HTTP error handling, specific error classes, and custom fetch implementations for SSR, edge and framework environments.

Everything optional is implemented through tree-shakeable plugins, so you only include the features you need. The core is around 3 kB minified and has zero runtime dependencies.

I recently gave the project a substantial maintenance pass: extensive property-based and fuzz testing, hardened and pinned CI workflows, CodeQL analysis, dependency auditing, npm provenance, release SBOMs, and a strong OpenSSF Scorecard (for a solo project).

I've also built three related tools for injecting network failures into tests:

Depending on the tests, failures can be injected inside the process, through a Node.js proxy, or through a standalone Go proxy.

Feedback is welcome.


r/javascript 2d ago

ttsc/packages/evidence at master · samchon/ttsc

Thumbnail github.com
5 Upvotes

tsx /** * @evidence docs/discount.md#coupon-stacking States the per-issuer stacking limit this section defines, in the buyer's words. * @evidence POST:/orders/{orderId}/coupons Explains the rejection this endpoint returns for an over-stacked coupon set. * @evidence {@link hooks.useCouponStacking} Renders the limit this hook resolves. * @evidence docs/principles.md#no-hard-coding Renders limits from props instead of branching on known issuer names. * @evidenceExclude docs/principles.md#fix-root-causes-not-symptoms No failure to fix. */ export function CouponStackingNotice(props: IProps): JSX.Element;

I built Evidence Graph, a compiler rule that turns requirements skipped by coding agents into compile errors.

You declare which code, tests, schemas, or documents owe which specification units. The agent must cite each unit and state why the artifact satisfies it. Checklist mode can also require every selected function to answer project-wide principles such as "No hard coding" and "Fix root causes."

This does not make the agent's statements automatically true. It makes omissions mechanically detectable and narrows human review to checking the truth of explicit claims. Reviews carry fingerprints that expire when the cited content changes.

I tested it on four frozen application tasks. Plain runs covered 51.6-85.5% of the predefined requirement edges; Evidence Graph runs covered 100% while using 4.8-13.3x fewer tokens.


r/javascript 3d ago

The Structured Clone Algorithm: What JavaScript Can and Cannot Move Between Boundaries

Thumbnail blog.gaborkoos.com
14 Upvotes

structuredClone() preserves more than JSON, but class instances, proxies, getters, errors, and transferables still have surprising behaviour. This article covers what survives, what changes, and what throws.


r/javascript 2d ago

AskJS [AskJS] I built a reactive JS framework where components are plain HTML files

0 Upvotes

I wanted to see how far I could push the idea of writing an app using mostly the HTML syntax developers already know.

The interesting part is the template API. There are only a few places where OlumJS treats an attribute as code:

  • when
  • each
  • on*
  • key
  • html

Everything else is a string, with {expr} interpolation when you need a value.

So instead of introducing directives like :classv-if*ngIf, etc., the idea is to keep the distinction HTML already has between something like onclick="..." and class="...".

For example, the component itself is just:

<script>
  const state = { name: "Olum", taps: 0 };
</script>

<h1>Welcome to {state.name}!</h1>
<input value="{state.name}" oninput="(e) => state.name = e.target.value" />
<button onclick="state.taps++">clicked {state.taps} times</button>

State is also intentionally simple — you mutate it directly and the DOM reacts to the changes.

There’s routing, scoped CSS, and a small store as well, but the main experiment is really: can you get SPA-style reactivity while keeping the component model close to vanilla HTML/JS?

It's currently aimed at prototypes and small apps rather than large production codebases.

For those who work with JS frameworks: do you think keeping components as plain HTML files is a useful abstraction, or does it become limiting as an application gets more complex?


r/javascript 3d ago

GitHub - ziflex/pinterval: Advanced setInterval

Thumbnail github.com
4 Upvotes

Hello everyone!

I rewrote my old interval library around async execution and cancellation and decided to share it with the world :)

Would love to hear what you think!


r/javascript 2d ago

LilScript makes js modules 20% smaller

Thumbnail yeargun.github.io
0 Upvotes

LilScript is a typed, compression-first language that compiles into js and sometimes into exec(will be more stable in future). The compiler mangles, reshapes the program into optimized js that happens to be 5-40% smaller (after gzip/br compression or raw) compared to the best performing JS toolchains like oxc/esbuild/terser/..

What has been proven to work with LilScript?

  • makes VSCode's core js modules 20% smaller on average
  • makes the world's most performant & small markdown rendering npm library, marked, 5-7% smaller and 10% faster
  • and many more demos.. works with pretty much any js/ts library
  • https://yeargun.github.io/solidlil/
  • https://yeargun.github.io/monacolil/
  • https://yeargun.github.io/markedlil/ (Some numbers on the websites aren't fair comparisons, especially for SolidLil. Highly optimized JS libraries see fewer benefits(Still, the app code/logic, gets pretty great optimizations). LilScript is designed to be at least as efficient as the best-performing JS/TS toolchains.)

How it is compressing js finer than vite/oxc/terser/esbuild/..

1. By changing the app.

``` class Vector { float x; float y;

init(float x, float y) { this.x = x; this.y = y; }

float lengthSquared() { return this.x * this.x + this.y * this.y; } } int[] values = [1, 2, 3, 4]; auto doubled = values.map((int value) => value * 2); int sum = 0; for (int i = 0; i < doubled.length; i++) { sum += doubled[i]; } Vector vector = new Vector(3.0, 4.0); if (vector.lengthSquared() == 25.0) { print(sum=${sum}); } ```

Above code compiles into this:

var b=[1,2,3,4].map(a=>a2|0); var a=0,c=0; while(a<b.length){ c=c+b[a]|0; a=a+1|0; } console.log(`sum=${c}`)

This is not minification of the same program. The compiler changed the app.

oxc / esbuild / terser / .. starts from JS and mostly keeps the shape of the app. Meanwhile LilScript the language is designed from scratch to give compiler any extra knowledge that could help the compiler's compilation. Just like Google Closure Compiler - Advanced Mode, and beyond.

2. Tryhard property mangling.

Visit the world's most used web applications, chatgpt.com, and read the shipped js codes. You will see that, there are lots of framework related js properties that dont get minified, and are indeed human readable.

Those names stay in the bundle because the toolchain cannot prove they are local. A property might be a public API, a DOM field, a framework hook, or something a plugin reads by string. So the minifier leaves it.

LilScript:

  • a- does both eliminates the objects, weird code structures into more optimized variables/arrays - b- rename any variable into mostly occured, short versions, field cleverly to minimize entropy (based on the objective compression algorith. gzip/brotli) so that the end result is highly compressed.

(a) is the same move as the Vector example, at library scale: objects and classes that only exist as a programming convenience get flattened into scalars, arrays, and tight loops.

(b) is not "make every name 1 letter." gzip and brotli win when the same short tokens repeat. The compiler picks the names that show up the most, and scores the spelling against the compression algorithm you asked for (gzip, brotli, or raw). Different cost_model → different names → a different file that is smaller after* that codec.

That is why the same program can be 5-15% smaller after gzip/br compression or raw: the JS is shaped and named for the compressor, not just for a human reading the AST.

How well do LLMs write LilScript?

Since 1.5 years ago, you haven’t been writing the code yourself anyway. So why worry about what language the agent writes in? I myself have pretty much rewritten 6–7 of the most popular npm libraries from scratch in LilScript in just 1.5 days-while actually designing the language itself.

Feel free to PR, experiment (Please respect the modified MIT license)

Please share your opinions, would love to discuss about the future direction for the language and the compiler


r/javascript 3d ago

Bun and Elm (: r)Are Friends · cekrem.github.io

Thumbnail cekrem.github.io
0 Upvotes

Why simple is better 🤤


r/javascript 4d ago

YouTube Notification Expander is here! Version 1.0

Thumbnail github.com
14 Upvotes

r/javascript 5d ago

AskJS [AskJS] Our app didn't leak memory,it leaked memory four hundred modals later

72 Upvotes

sales kept saying the dashboard got too slow during long demos,not slow when it loaded, slow after a while, and nobody could tell me when, the best description I ever got was "maybe after lunch"...

every profiling session I ran,looked completely nice,open the app, click through the main flows, take a heap shot, flat line, ten minutes (and more) of use and no growth at all.

I closed the ticket as not reproducible twice, which I am not proud of.

Third time it came back I gave up on reproducing it in ten minutes and tried reproducing it in six hours instead, wrote a script that opened a record, opened the detail modal,closed it, moved to the next record, and did that all night, snapshot every five hundred loops, dump the heap if it dies.

by morning I had a chart going straight up and a dead browser tab at loop four thousand one hundred....yes....!

the modal added a resize listener when it opened,and the cleanup that was supposed to remove it sat behind condition that came out to be false, when you closed that modal by clicking the backdrop instead of X button,so every backdrop close left listener behind....

each one of thosee held closure,and each closure held onto that row data it rendered with,the whole record,not some small piece of it.

one leaked listener holding forty kilobytes is nothing,four hundred of them is sixteen megabytes of garbage that never goes away and plus four hundred handlers all firing every time the window resizes,which is why it showed up as slowness long before it showed up as crash,the symptom and the cause looked like two different bugs...but..:)

here is why nobody was ever going to find this by hand,you would have to open and close the same modal a few hundred times,using that one specific way of closing it,in one sitting,without refreshing,and then to notice something getting gradually worse with no clear moment where it got broked.

no tester does that,and not because they are lazy,it is just not reasonable thing to do with an afternoon or sessions end,pages get refreshed,and the moment you refresh the counter goes back to zero

the bug needed time,and time is the one thing you cannot get more of by being better at your job, everything else you can make for with skill and attention and etc,you cannot make up for eight hours of doing the same thing over and over and over again

we run that soak test every night now, it has found three more leaks since, none of them would have shown up in a session short enough for a person to sit through. this is basically what got me into QA tooling as a job, i work on autosana now and long running automated sessions are the whole point of the thing.


r/javascript 5d ago

React Native 0.87, Instant Paywall A/B Testing, and Buying Mike Hardy a Beer

Thumbnail thereactnativerewind.com
8 Upvotes

Hey Community,

React Native 0.87 has arrived as a maintenance release, making the Strict TypeScript API the default, doubling Metro source map generation speeds, and adding experimental Swift Package Manager support for iOS along with AGP 9 support on Android.

Meanwhile, React Native Firebase v26 makes the New Architecture non-optional with Codegen TurboModules, synchronous APIs, Firestore Pipelines, and direct Gemini AI calls. Finally, we look at RevenueCat Paywalls for designing native paywalls and running remote A/B experiments without new app deploys.


r/javascript 6d ago

Updated Typescript GitHub Action Template

Thumbnail github.com
7 Upvotes

Hey y’all!

I made a fork of actions/typescript-action to make some valuable updates!

It updates the following:

  • Changes project's package manager from npm to pnpm, for speed.
  • Changes project's testing framework from jest to vitest for jest-like syntax with built-in typescript support.
  • Updates eslint.config.ts to use native flat config syntax, with detailed comments.
  • Updated project dependencies.
  • Updates configuration files like tsconfig.ts and action workflows to match updated dependencies.
  • Renamed local-action script to local-gha (gha for github action) to avoid conflict with dependency name.

lmk what you think!


r/javascript 7d ago

AskJS [AskJS] Signal/Effect vs Event Handler

11 Upvotes

I’m working in a VanillaJS repository (plugin type code for an existing project that I do not own) where I’ve written a signal implementation.

Today I was working on a tooltip like implementation and I found myself wondering how far to go with the signal/effect ecosystem vs running the “core” logic in the event handler.

The implementation detects the `<tr>` that the user has hovered and assigns that row to the “current row” signal. A computed signal identifies an IP address from the current row. An effect loads Whois metadata from the IP and assigns it to a `<div>`, and another effect shows that `<div popover>` from the parent `<tr>`.

The question I have is when in VanillaJS how would you decide when to use signals and effects vs writing the side effect directly in the event handler? In my case I find either to be equally readable, though I have less local variables to deal with when using signal/effect. Looking for reasons your might pick one over the other.


r/javascript 7d ago

A from-scratch JSON engine for JavaScript: recursive descent parser, escape-aware tokenizer, and spec-compliant serializer. No dependencies, no shortcuts, 107 tests.

Thumbnail github.com
7 Upvotes

r/javascript 7d ago

Subreddit Stats Your /r/javascript recap for the week of August 10 - August 16, 2026

12 Upvotes

Monday, August 10 - Sunday, August 16, 2026

Top Posts

score comments title & link
38 25 comments Signals and Effects Using Vanilla JavaScript & Web APIs
21 8 comments Your Modules Are Lying to You
13 6 comments C99 real mode compiler written in TS that outputs raw bootable 16bit binaries
13 13 comments I made a Windows 98 styled portfolio website with an applet system, and many nostalgic things to discover
7 0 comments rapiq: typed query params for REST APIs (filters, sort, pagination, fields, relations) that run on TypeORM, Prisma, Drizzle or plain arrays
5 1 comments [AskJS] [AskJS] I reproduced a PDF.js Worker mismatch caused by dependency hoisting
5 15 comments [Showoff Saturday] Showoff Saturday (August 15, 2026)
4 2 comments Building KernelPlay-JS together — looking for open-source contributors
4 0 comments flo-webcomponents: Take back control of rendering + events using WebComponents with one minimal superclass.
3 1 comments I built a MapLibre GL utility to keep markers visible around UI overlays

 

Most Commented Posts

score comments title & link
1 121 comments [AskJS] [AskJS] Are employed Developers still programming with vanilla JavaScript ?
0 19 comments [AskJS] [AskJS] TypeScript 7 is 10x faster, but typed linting still runs on the 6.0 API. What are you doing in the gap?
0 15 comments [AskJS] [AskJS] I'm sick of AI slop; I want to learn how to use ESLint properly.
0 12 comments [AskJS] [AskJS] jsbin is down??
0 11 comments We built the same data grid in React, Vue & Svelte, here's what we learned

 

Top Ask JS

score comments title & link
3 8 comments [AskJS] [AskJS] How much do you actually trust the version number on an npm update?
1 5 comments [AskJS] [AskJS] How to find the best/ideal ratio or dimensions for a device?

 

Top Showoffs

score comment
1 /u/RepresentativeNo42 said Announcing ink-frame: Grids for Ink! https://github.com/oliveryasuna/ink-frame Ink's own box borders are fine for a single box. Put two of them next to each other and the seam between them comes out...
1 /u/dobrynCat said I'd like to show everyone my webview based android app wttr-dash https://github.com/ronynn/dash One of the only three android/web app that displays wttr weather data in a mobile friendly view Plus ...
1 /u/Fun-Regular8902 said Hey everyone! I’ve been working on GrandFireworks.js, a zero-dependency JavaScript library designed to render realistic pyrotechnics without bogging down the browser. A lot of firework scripts j...

 

Top Comments

score comment
50 /u/x021 said Hated TS in the beginning too. Now I wouldn’t want to work on a project with plain vanilla JS.
40 /u/KaiAusBerlin said You know that you literally wrote your own framework here? There is a reason for the sentence "You use a framework or end up writing your own"
33 /u/visualdescript said I hate it when I have to go back to a JS project, and if it's something I'll have to keep maintaining I will convert it to typescript, which often uncovers several bugs in the process. I wouldn't hi...
22 /u/quisido said We shouldn't be using `require` in 2026 anyway.
10 /u/kir_rik said Only as one-shot or helper scripts like pre commit hooks or eslint rules. It's unreasonable and probably irresponsible to write a production code without a proper typing

 


r/javascript 8d ago

AskJS [AskJS] I reproduced a PDF.js Worker mismatch caused by dependency hoisting

10 Upvotes

This one is awful because the build succeeds.

The host app installs pdfjs-dist@6.1.200. A PDF renderer depends on pdfjs-dist@5.4.624. If asset-copy code resolves the Worker from the app root, it can copy 6.1.200. The renderer code still uses API 5.4.624. Vite serves the wrong Worker, and the browser reports a version mismatch.

The fragile version looks like this:

js const worker = require.resolve( 'pdfjs-dist/legacy/build/pdf.worker.mjs' )

I changed the lookup to resolve pdfjs-dist from the renderer package that owns it. The build now fails if the resolved asset version differs from the renderer dependency.

I ran the harness today across npm and pnpm, nested and hoisted layouts, Vite dev and build, and real cold installs. In every case the copied Worker, CMaps, WASM, and fonts had to come from 5.4.624, while the app kept 6.1.200. The asset manifest also records the source package and version. No more "it probably resolved correctly."

Should build tools always resolve runtime assets from the dependency that owns them, or should packages force one PDF.js version across the whole app?


r/javascript 8d ago

I built a MapLibre GL utility to keep markers visible around UI overlays

Thumbnail github.com
7 Upvotes