r/javascript • • Jun 08 '26

Subreddit Stats Your /r/javascript recap for the week of June 01 - June 07, 2026

6 Upvotes

Monday, June 01 - Sunday, June 07, 2026

Top Posts

scorecommentstitle & link
12323 commentsVoidZero is Joining Cloudflare
8033 commentsbonsai - a safe expression language for JS that runs user-defined rules at 30M ops/sec with zero dependencies and no eval()
6818 commentsThere 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?
6524 commentsRed Hat npm packages reportedly hijacked with a self-propagating JS credential stealer
2111 commentsObscura — a Rust port of javascript-obfuscator. 100% feature parity, ~700× faster
197 commentsIntentionally blocking rendering with JavaScript
1516 commentsLooking for Teammates: Building a Native HTML Component Library (No Shadow DOM)
1120 comments[AskJS] [AskJS] I am creator of minify-js.com. Ask me anything.
1017 commentsBuild reactive UIs with plain JavaScript functions. No JSX or build step.
100 commentsAnnouncing Angular v22

 

Most Commented Posts

scorecommentstitle & link
045 comments[AskJS] [AskJS] Maybe we need a different kind of NPM Registry. Maybe a registry that works more like App Store to minimize these frequent supply chain attacks.
114 commentsI built a CLI that checks which free perks your open-source project qualifies for
012 comments[AskJS] [AskJS] Why for-loop counting up faster than couting down?
09 comments[AskJS] [AskJS] keeping up with dependency churn feels like a pull problem and i want it to be push
07 commentsI got tired of hand-editing 200 ad variants in Photoshop, so I built an API that does it from one template

 

Top Ask JS

scorecommentstitle & link
72 comments[AskJS] [AskJS] built an experimental browser runtime to learn WebAssembly, Workers, SharedArrayBuffer, Atomics, and runtime architecture
64 comments[AskJS] [AskJS] Built a Worker Pool runtime for the browser to learn Web Workers, scheduling, and runtime architecture
52 comments[AskJS] [AskJS] Storing data from two domains in a single IndexedDB data store

 

Top Showoffs

scorecomment
2/u/OGMYT said Built WeSearch Canvas, a collaborative pixel‑art game in vanilla JS and WebSockets place one pixel every few seconds, no accounts required. Would love feedback from fellow JS devs on performance and a...
1/u/fckueve_ said Build (in progress) app for reviewing url adresseres. For example YouTube video with comments disabled? Paste url. Disagree with an article? Comment via url. Got scamed online? Write a review ...
1/u/meloalright said A shell exposed as an ACP agent. It speaks ACP (JSON-RPC 2.0 over stdio), so an ACP client such as cc-connect spawns it as a backend and bridges it to Telegram, Lark, Slack, Discord, and more...

 

Top Comments

scorecomment
32/u/matsie said Did you review any of this code that Cursor wrote? Or is that my responsibility?
29/u/CodePalAI said the "why no shadow DOM" question is the one you need a crisp answer to before recruiting, because that constraint is the whole project. without shadow DOM you get easy global styling and SSR-friendlin...
26/u/wattty1 said They are? They've taken down hundreds of releases infected by shai halud and it's variants. This rep, for example, no longer works. It's no different than Google removing malware from search results....
25/u/jessepence said First Astro, now this? Cloudflare is getting all the good JS talent. The monetization story never really made sense to me. It seems really hard to carve out a space in the managed hosting world. Are ...
20/u/snnsnn said Just because code is hosted on GitHub does not guarantee it will be published on npm. Developers can upload anything to their personal repositories. How would GitHub know their actual intentions? Do y...

 


r/javascript • • Jun 07 '26

I made Google OR-Tools solvers compile to WASM so you can solve more complex optimization problems fully in the browser

Thumbnail github.com
9 Upvotes

I tried to include a lot of fun examples on the demo site in the readme. You can run it in all modern browsers, and other JavaScript runtimes like node. It can run multithreaded, and has mostly comparable performance to native OR-Tools (see Benchmarking).

These solvers are ported:
- CP-SAT, Routing (VRP), GLOP, PDLP, SAT MIP, CLP, GLPK, SCIP / GSCIP, CBC, BOP, Knapsack, Network flow algorithms, Assignment algorithms, Set Cover, RCPSP

And APIs:
- MPSolver, MathOps (including incremental solve)

Hoping this will help lower the bar to playing around with these algorithms. Try the examples and feel free to leave a star on the repo if you find it cool.


r/javascript • • Jun 06 '26

AskJS [AskJS] Maybe we need a different kind of NPM Registry. Maybe a registry that works more like App Store to minimize these frequent supply chain attacks.

0 Upvotes

Given the frequency of supply chain attacks, maybe we need a different approach to package managers & registries.

  • Maybe a database of JavaScript packages that works more like the App Store.
  • Every package gets reviewed by real people and AI for security issues before going live.
  • Developers will have to pay a monthly fee to download and update packages, and that money will be distributed among open source maintainers & code reviewers.
  • The more downloads a package gets, the more its maintainer earns.
  • For every package update, maintainers will be asked to pay a very small fee. This would discourage attackers further (attackers would never reveal their banking details) & it would limit the amount of low-quality packages.
  • People should also be able to rate a package and leave a review.
  • This new registry should also support multiple languages, not just JavaScript.

This would:

  • Highly minimize supply chain attacks
  • Ensure open source maintainers get paid well
  • Encourage more innovation by allowing maintainers to monetize their packages
  • This will also provide more employment opportunities for code reviewers and open source maintainers.

We can't step into the future with the current state of unpaid maintainers and a system that keeps getting breached every few months. We need a system in which people who work hard get paid well, a system we could trust, a system that focuses on quality rather than quantity.

This will slow things down, packages will take time to get approved, but what's the point of speed when you have to spend weeks fixing the mess caused by repeated supply chain attacks?

Currently, the number of packages affected by the supply chain attack is in the thousands. If this continues, people will lose trust in the JS ecosystem. Something needs to change.

I understand this idea might have a few flaws. I'd really appreciate a healthy discussion on what this new system should look like.


r/javascript • • Jun 06 '26

Obscura — a Rust port of javascript-obfuscator. 100% feature parity, ~700× faster

Thumbnail github.com
25 Upvotes

I rewrote javascript-obfuscator in Rust because it was the slowest step in our build. Shipping v0.1.0 today.

Repo: https://github.com/Crash0v3rrid3/obscura

Release: https://github.com/Crash0v3rrid3/obscura/releases/tag/v0.1.0

What it does: Drop-in obfuscator. Same options, same output behavior, same CLI flags. All 21 upstream transforms — string array (with base64/RC4 + rotation/shuffle/index-shift/calls-transform/wrappers), control flow flattening, dead code injection, identifier + property renaming, self-defending, debug protection, domain lock, source maps, the lot.

Speed (heavy preset, single thread):

FileSizeUpstreamObscuraSpeedup
d3.min.js273K193.9s98ms1977×
vue.min.js141K28.6s32ms900×
jquery86K12.1s17ms705×
lodash71K14.5s21ms692×
moment58K8.6s16ms529×
react11K2.0s15ms130×

Median ~700×. CLI also parallelizes directory mode with rayon.

How it stays correct: 321-test conformance suite runs every obfuscated output through vm.runInNewContext to verify behavioral parity with the input. Determinism contract: same (source, options, seed) → byte-identical output across runs (ChaCha20Rng, no wall clock).

Stack: oxc for parse/semantic/codegen, napi-rs for the Node addon, wasm-bindgen for the browser build. Library is #![forbid(unsafe_code)], zero unwrap in core (clippy-enforced).

Surfaces shipped:

- cargo install obscura-cli — or grab a binary (macOS arm64/x64, Linux gnu+musl arm64/x64, Windows x64)

- npm package with prebuilt napi addons (macOS + Linux glibc)

- WASM (web + nodejs targets)

Not yet: the injected helper templates (self-defending etc.) ship un-re-obfuscated, renamePropertiesMode=unsafe, and ignoreImports. Tracked in docs/TASKS.md. PRs welcome.

Feedback / bug reports / "this output breaks my code" issues very much wanted — the conformance suite catches a lot but real bundles will surface things it can't.


r/javascript • • Jun 06 '26

Showoff Saturday Showoff Saturday (June 06, 2026)

8 Upvotes

Did you find or create something cool this week in javascript?

Show us here!


r/javascript • • 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?

Thumbnail github.com
82 Upvotes

r/javascript • • Jun 05 '26

GitHub - paradedb/drizzle-paradedb: Official extension to Drizzle for use with ParadeDB

Thumbnail github.com
1 Upvotes

Hi all! We created this NPM package to make it easier to use ParadeDB (a full-text & vector search extension for Postgres) within the JavaScript ecosystem. It is built as an extension to the Drizzle ORM. Would love your feedback!


r/javascript • • Jun 05 '26

Wrote a rule, found a real bug, had to ignore it anyway

Thumbnail pvs-studio.com
11 Upvotes

We made a rule to detect typos like identical operands in binary expressions. It had a few good and valid catches but turns out 1 << 1 triggers it in basically every codebase (Angular, Babel, pdf.js). So the tool issues a valid warning of 1 << 1 in one case and makes a lot of noise in many others. To make things clear: the story comes from our experience of building a static analyzer for JS and TS (currently in beta, we're collecting feedback on it).

That's why we had to make a trade-off. Any similar stories from your dev experience?


r/javascript • • Jun 05 '26

AskJS [AskJS] Storing data from two domains in a single IndexedDB data store

6 Upvotes

You might know different client-side data storage methods in #JavaScript: #cookies, #localStorage, #sessionStorage, and perhaps even #IndexedDB. All share the same limitation: they won't let you store data across domains.

But if you can write and use a browser extension, these come with another data storage bucket. Browser extensions come with a manifest.json file that lets you specify all the domains you want to work with. #Chrome.storage will let you store and read data across domains.

I used chrome.storage.local as a temporary data storage place. I use the #Dexie library to create my IndexedDB data store, database, and to insert the records. I monkey patched Dexie's add() and bulkPut() methods to send a message to background.js. Upon receiving the message, background.js clears chrome.local.storage and inserts what we inserted in IndexedDB.

Then, when I switch to another tab showing my second domain, background.js responds to chrome.tabs.onActivated and calls a function on that page with the data from chrome.local.storage. That function does a bulk insert of the data in a second IndexedDB data store and database.

And voilà, you now have the data from both domains in a single IndexedDB data store.


r/javascript • • Jun 05 '26

AskJS [AskJS] I built a browser-only document extractor in JavaScript. These 5 functions created most of the value.

3 Upvotes

I've been working on a small tool that converts semi-structured documents into JSON schemas entirely in the browser.

The interesting part wasn't the OCR itself. The interesting part was how a handful of fairly ordinary JavaScript functions ended up creating most of the product value.

The pipeline looks roughly like this:

Image/PDF
  ↓
Canvas preprocessing
  ↓
Tesseract.js OCR
  ↓
Text normalization
  ↓
Pattern extraction
  ↓
JSON Schema generation

The functions that ended up doing the heavy lifting were surprisingly mundane:

1. Image preprocessing

Before OCR, every page is upscaled, converted to greyscale and thresholded.

preprocessImage(image)

Improving the input quality often produced larger gains than changing the OCR configuration itself.

2. Text normalization

OCR output is messy.

normalizeText(rawText)

This function cleans line endings, spacing, punctuation inconsistencies and common OCR artefacts before any parsing begins.

Without it, every downstream step becomes more complicated.

3. Pattern extraction

This is where the useful information starts emerging.

extractFields(text)

The function looks for recurring structures:

CUSTOMER_NAME:
POLICY_ID:
AMOUNT:

and converts them into machine-readable field definitions.

4. Type inference

inferType(value)

A surprisingly small function that decides whether something is:

string
number
boolean
date

This single step makes generated schemas dramatically more useful.

5. Schema generation

Finally:

generateSchema(fields)

takes the extracted structure and produces a Draft 2020-12 JSON Schema.

The result is something a developer can immediately use for validation or downstream processing.

The most interesting lesson for me was that the product's value wasn't hidden in a giant model or some clever AI trick.

Most of it came from a chain of small, focused JavaScript functions, each doing one job well and passing cleaner data to the next step.

Curious what other people have found: which "boring" utility function ended up creating disproportionate value in your projects?


r/javascript • • Jun 05 '26

Build reactive UIs with plain JavaScript functions. No JSX or build step.

Thumbnail github.com
14 Upvotes

Elemental is a personal library I’ve been using for a while. I really don’t like how much frontend frameworks require you to invest in them. You have to learn funky domain specific languages and magic render lifecycles just to debug anything. I mostly just want to create and append elements with better ergonomics.

el(document.body,
  el('main',
    el('h1', 'Hello World!'),
    el('h2', (x) => { x.id = 'foo' }, () => 'returned text'),
    el('div.note', ['this', 'is', 'an', 'array']),
    el('p.greeting', ob(() => ('My name is ' + rx.name)))
  )
)

The syntax lets you build the DOM declaratively with plain nested functions, so logic and views live together in one structure instead of being split across separate layout and behavior. Reactivity is handled by observers (the ob(...) call above): they automatically track whatever reactive properties they read and retrigger when it changes. No manual subscriptions and no dependency arrays. And because everything is just normal DOM elements and functions, you can adopt it one component at a time instead of overhauling a whole project.

It's about 3.3 KB gzipped with no third-party dependencies. The library is just under 300 lines of code so it's easy to understand.

Would love to get feedback from having fresh eyes on it.


r/javascript • • Jun 04 '26

I built a CLI for VSCode extension development in TypeScript

Thumbnail github.com
1 Upvotes

r/javascript • • Jun 04 '26

VoidZero is Joining Cloudflare

Thumbnail voidzero.dev
136 Upvotes

r/javascript • • Jun 04 '26

Wraplet vs Web Components

Thumbnail wraplet.dev
0 Upvotes

r/javascript • • Jun 04 '26

AskJS [AskJS] Looking for feedbacks.

0 Upvotes

I’ve been experimenting with mcp server with node and built an npm package ai-chat-toolkit-widget and ai-chat-toolkit-server .

The goal was to make it easier to embed AI chat into websites while keeping setup easy.

I’d love some inputs from people who maintain or use npm packages:

  • how to make people trust a npm package?
  • Do I need to add more docs?
  • Anything specific that you usually avoid?
  • If possible please look into it and give me feedback for improvement.

Since this is first node package I published as open source, need feedback to improve and make it more usable.

Thanks!


r/javascript • • Jun 03 '26

AskJS [AskJS] Process question

3 Upvotes

When you’re working on a personal/solo project how do you organize the steps in your process? I keep finding myself working on one part and then getting side tracked by another thought like I don’t like where this button is, how this page looks or a bug I notice in a function somewhere and I just feel all over the place. I know there’s like Jira and ClickUp etc but they don’t really help me stay on task or is it just me?


r/javascript • • Jun 03 '26

Intentionally blocking rendering with JavaScript

Thumbnail jayfreestone.com
21 Upvotes

You nearly always want to put <script> tags in the <head> and mark them as non-blocking using either async or defer. However, there’s an interesting use-case for actually wanting to block paint.


r/javascript • • Jun 03 '26

Announcing Angular v22

Thumbnail blog.angular.dev
13 Upvotes

r/javascript • • Jun 03 '26

Everything you need to know about Sourcemaps

Thumbnail neciudan.dev
11 Upvotes

I was always curious about Sourcemaps and the cool stuff they do. Here is a quick rundown of what they are, how they help, and how they can be dangerous!

Let me know if I missed anything


r/javascript • • Jun 03 '26

Meteor + Resend: Sending Transactional Emails the Modern Way

Thumbnail blog.galaxycloud.app
2 Upvotes

r/javascript • • Jun 03 '26

Looking for Teammates: Building a Native HTML Component Library (No Shadow DOM)

Thumbnail gitlab.com
15 Upvotes

r/javascript • • Jun 03 '26

TanStack Start Adds First-Class Rsbuild Support

Thumbnail tanstack.com
3 Upvotes

r/javascript • • Jun 02 '26

AskJS [AskJS] keeping up with dependency churn feels like a pull problem and i want it to be push

0 Upvotes

every week something i depend on moves and i find out late. npm i bumps a pile of transitive deps, a framework cuts a release (Ember 7 just dropped), some package picks up a security advisory, and the real changes live in scattered changelogs i'm never going to open. So keeping current is technically possible, it's just all pull. i have to go get it.

NotebookLM is the sharpest version of pull i've found. drop in a changelog or an RFC, get a solid on-demand walkthrough. but it only runs when i initiate it, and the stuff i fall behind on is exactly the stuff i never initiate.

what i started doing instead is push. a thing that takes the last day of commits, merged PRs and closed issues on a repo, turns it into a short audio summary, and drops it into my podcast queue over rss. So vue just shows up in my morning feed next to the normal shows and i hear what moved while walking the dog, no tab opened.

the open question is whether push actually sticks or just turns into another muted feed. my bet is it only survives if each episode stays under five minutes. anything longer and i'm right back to skipping the changelog, just in audio form now. written with ai


r/javascript • • Jun 02 '26

AskJS [AskJS] Why for-loop counting up faster than couting down?

1 Upvotes

I have 2 xor hash functions: almost identical. I thought comparing i>=0 in the for-loop would be faster than comparing i<str.length (since it has to check str.length every time). To my surprise: the quickHash2 function runs slower. Any explain?

function quickHash1(str, hash = 0xab36954dce2) {
  let len = str.length;
  for (let i = 0; i < len; i++) hash = (Math.imul(hash ^ str.charCodeAt(i), 0x100000001b3)) & 0x1fffffffffffff;
  return hash >>> 0;
}

function quickHash2(str, hash = 0xab36954dce2) {
  for (let i = str.length - 1; i >= 0; i--) hash = (Math.imul(hash ^ str.charCodeAt(i), 0x100000001b3)) & 0x1fffffffffffff;
  return hash >>> 0;
}

function randomString(size) {
  return Array.from({ length: size }, (v) => Math.random().toString(16)).join(' ');
}

let sampleSize = 1_000_000;
console.log('Generate random text array of', sampleSize);
console.time('gentext');
let textes = Array.from({ length: sampleSize }, () => randomString(100));
console.timeEnd('gentext');

console.log('Timing quickHash1');
console.time('quickHash1');
textes.map(quickHash1);
console.timeEnd('quickHash1');

console.log('Timing quickHash2');
console.time('quickHash2');
textes.map(quickHash2);
console.timeEnd('quickHash2');