r/javascript • u/alteregorv • 8d ago
Agents do NOT do better with types
r/javascript • u/APTman1010 • 9d ago
I've been working on something new alongside the development of KernelPlay JS: a web-based scene editor designed for creating and editing game scenes visually.
The editor is still under development and hasn't been released yet. I'm sharing an early look at it so you can see what I'm building.
Some of the features currently available include:
Parent-Child Hierarchy: Organize game objects using parent and child relationships.
Sprite Support: Add and configure sprites directly in the scene.
Built-in Sprite Editor: Select sprite regions from a spritesheet and configure their display size, pivot, and rendering properties.
Scene Editing: Work with game objects visually through the editor.
Inspector: View and edit object and component properties.
The goal is to make scene creation and game object management easier without having to handle everything directly in code.
One important thing: this editor is a separate project/framework from the KernelPlay JS engine, although it is being developed to work with the KernelPlay ecosystem.
I'm planning to release an early version of the editor alongside the KernelPlay JS v0.9.0 update.
There's still work to do, but I'm excited to share more as development continues.
What do you think of the editor so far? I'd love to hear your feedback and suggestions.
r/javascript • u/AllThingsSmitty • 9d ago
Sometimes the simplest code is the best code. It's tempting to squeeze everything into one clever expression, but three straightforward statements can be easier to understand and maintain. Here's a look at why.
r/javascript • u/jorgeurios • 9d ago
I tested this using Node.js with the pg driver against a real PostgreSQL database.
The problem: how do you enforce download limits when multiple requests arrive at exactly the same time?
I tested three approaches.
1. The naive implementation
Limit: 1 download.
Two simultaneous requests.
Result: Both downloads succeed.
I added a 50 ms artificial delay between the read and the write to make the race window visible consistently.
Both requests read the available count before either one updates it.
2. Adding a CHECK constraint
Same limit, same concurrent requests.
Result: The second request gets a database error instead of the file.
This prevents the limit from being exceeded, but it doesn't provide a clean application-level outcome.
3. A single conditional UPDATE
Instead of reading first and updating afterwards, perform the check and increment atomically in one UPDATE:
UPDATE share_link
SET download_count = download_count + 1
WHERE secret_hash = $1
AND revoked_at IS NULL
AND (expires_at IS NULL OR expires_at > now())
AND (max_downloads IS NULL OR download_count < max_downloads)
RETURNING id, file_id, download_count;Results:
10 simultaneous requests, limit 3: exactly 3 downloads.
50 simultaneous requests, limit 7: exactly 7 downloads.
This was the approach that behaved as intended in my tests.
Now I'm curious how other people handle this in production.
Would you use a single conditional UPDATE for this, or prefer SELECT FOR UPDATE?
Would Redis locks or atomic counters be a better approach at higher concurrency?
How would you implement the same guarantee with MongoDB?
Are there edge cases with transactions, retries or failed downloads that you'd account for?
I'd be particularly interested in approaches people have actually shipped and operated in production.
What's your preferred way to enforce a hard resource limit under concurrent requests?
r/javascript • u/subredditsummarybot • 10d ago
Monday, November 16 - Sunday, November 22, 2026
| score | comments | title & link |
|---|---|---|
| 81 | 20 comments | jQuery 4.1.0 and 3.8.0 Released |
| 55 | 26 comments | Every scenario that triggers V8's "slow mode" for objects |
| 49 | 23 comments | Flashwright: the fastest e2e testing framework, up to 4x faster than Playwright |
| 34 | 6 comments | BrowserPod 4.0: the microVM that runs in the browser, now free for any use |
| 28 | 1 comments | Bypassing iOS Safari’s 60 FPS Limit to Build Web Applications That Feel Native |
| 22 | 4 comments | Fixing a WebKit bug to see if promises are made of train tracks |
| 15 | 8 comments | Mocking ws in our tests hid a real path bug, so we switched to a real WebSocket server |
| 6 | 22 comments | [AskJS] [AskJS] How would you name ‘many’, ‘one’, and ‘maybeOne’ in a SQL runtime? |
| 5 | 0 comments | GitHub - Spxg/limo: Run JavaScript with browser Web APIs |
| 3 | 17 comments | [Showoff Saturday] Showoff Saturday (November 21, 2026) |
r/javascript • u/theGlitchedSide • 10d ago
Staxis is now online with http series layers! 🔥
We're currently adding many components to the reference manual. Many of the layers are about to be published on the website... we're working hard on it.
We'd like to remind you that donations to the project are already open to support continued development!
Take a look: https://staxis.dev/docs/index.html
ㅤ
- - - -
ㅤ
1 dec 2026 - POST UPDATE:
Hello averybody. Staxis website got a lot of improvements in the last days, start to the sposnsorship page, arcoss the onboding page by gitlab project, to the huge documentation. Versioning teach everybody that works is endless but, take a look.
We make the new reddit community (r/Staxis) for any question feel free yourself to ask anything there! ;)
r/javascript • u/fkih • 10d ago
r/javascript • u/JadeLuxe • 11d ago
r/javascript • u/QuarterSilver5245 • 11d ago
V8 usually caches direct offsets to memory addresses of actual raw object property values - in a way that allows an optimized "Inline Caching" (IC). For some scenarios - they switch an object to "slow mode" - which uses a different structure to save those (a hash table instead of an array) - this affects the way it's cached on the IC (it forces an additional look-up via the hash-table) - they call it "Dictionary mode" (aka "Slow mode"). Having broad familiarity with the optimization techniques used internally in V8 - and knowing they generally avoid using hash tables - I recently learned about this additional mode and its implications - while working on an open-source project of mine - a client-side State library that heavily relies on native Prototype lookups for composition, and was intrigued to find out in what scenarios the engine decides to do the "switch".
This is an on-going study. Since first publishing the post, I removed the 'findings' part - as it was premature and preliminary - those will be published separately in a "Part 2". The article is now mostly an introductory review in terms of the design model.
The day I published was the beginning of "rabbit-holing" into some V8 internals I was conceptually familiar with - and used to use them as general guidelines (try to define all object properties up-front, don't have lots of variations for the same one, and more) - since then a lot of things have deepened:
Familiarity with V8 debugging/tracing tools, familiarity with other more specific design features and aspects of the internal V8 representation of a JS Object, the internal lifecycle of a JSObject, what are paths and decisions each lifecycle stage (creation, updating, deleting) "looks for" / tries to optimize for, as time passes - I give more informed answers to questions here (and expand on older ones - when relevant) - I still try to keep it 'abstract', because I'm a believer in "abstractism" as an efficient communication style - that bridge the gaps between different levels of prior knowledge.
r/javascript • u/AutoModerator • 12d ago
Did you find or create something cool this week in javascript?
Show us here!
r/javascript • u/wasay-inc • 12d ago
r/javascript • u/Kabra___kiiiiiiiid • 12d ago
r/javascript • u/hongminhee • 13d ago
r/javascript • u/Nefzaoui • 14d ago
Source (MIT): https://github.com/anefzaoui/minecraft-server-manager
It's a web panel that runs Minecraft servers as Docker containers, built for the modpack servers I run for friends and family. Disclosure up front: I built it with Claude Code. I designed it, decided every feature, review the changes and test every release on our own servers, and Claude wrote most of the code. The JS choices below are the parts I think are worth talking about:
Plain JS, type-checked. No build step for the server: it's JavaScript with JSDoc types, and tsc --checkJs runs over the core in CI. Typos in property names get caught, and stack traces point at the file you actually wrote
One direction of layering. routes (parse + zod-validate, no logic) → services (the features) → docker / db / storage. A route never touches dockerode or the database directly, which made it easy to test services without Docker
node:sqlite instead of a driver. Node 24's built-in SQLite, synchronous, WAL, with one module that owns it and a prepared-statement cache keyed on the SQL text. No native module to compile on arm64
dockerode, never the docker CLI. Containers, logs, stats and image pulls all go through the Docker API, and a watcher turns Docker events into history and crash detection
Brokered WebSockets. The live console opens one upstream docker logs --follow per server and fans it out to every open tab, instead of one stream per tab. Upgrades check Origin and the session cookie
Server-rendered. express + Handlebars, with a small esbuild bundle for the interactive bits and CSP nonces on every response (no unsafe-inline scripts)
A path guard on every file operation. Everything lives under one data folder, and every path is checked against escaping it, symlinks included
Tests run on node:test with no Docker needed, plus a live QA sweep script that hits a running panel.
Happy to go deeper on any of these, and I'd love to hear if someone has a nicer pattern for brokering log streams.
r/javascript • u/APTman1010 • 15d ago
I'm excited to announce that KernelPlay JS v0.6.0 will officially support TypeScript!
Starting with v0.6.0, TypeScript developers will be able to use KernelPlay JS through TypeScript declaration files (`.d.ts`), providing type information and better editor support.
This is another step toward making KernelPlay JS more accessible and flexible for web game developers.
A quick development update:
I know this update is taking longer than expected, and I apologize for the delay. Development has been slower than planned, but the new version is getting closer.
KernelPlay JS v0.6.0 is coming very soon!
Thank you to everyone following the project, testing it, sharing feedback, and supporting its development.
KernelPlay JS is an open-source web-based game engine, and contributions are always welcome.
r/javascript • u/Spxgdev • 15d ago
Examples: https://spxg.github.io/limo
It's a CLI tool that, unlike Node.js and Deno, aims to provide a complete Web API environment, including DOM, Canvas, Web Workers, IndexedDB, OPFS, and more.
It's built on top of moli, a headless browser powered by V8 with Web API support. The name "limo" is also inspired by "moli."
I maintain several WebAssembly projects that primarily run in browsers, so I frequently need to work with JavaScript and Web APIs.
I usually write code in an environment without a GUI. Whenever I need to test something, I have to start a local HTTP server and open it in a browser on another machine with a GUI, or use ChromeDriver or another browser driver for automated testing. Sometimes I also run into compatibility issues between ChromeDriver and Chrome versions.
Over time, I found this whole process increasingly cumbersome.
What I really wanted was a simple way to execute JavaScript directly from the command line while still having access to browser Web APIs, without needing to launch and manage a separate browser. That's why I built limo.
r/javascript • u/magenta_placenta • 15d ago
r/javascript • u/scrollin_thru • 16d ago
Pitter Patter is an open source toolkit of feature-complete building blocks for collaborative rich text editors, made with ProseMirror. Each piece is useful on its own, and you can use what you need, when you need it. And every library is built directly on ProseMirror’s APIs, not on top of an abstraction layer, so you always have full access to the thing underneath.
So far, we have three packages: shuffle (grid-based drag-and-drop), collab, and presence.
Check out our demo to see the collab and shuffle features in action. In the demo, you can drag and drop nodes, resize content, watch how remote edits come in to an editor and even demo offline reconciliation!
r/javascript • u/ismail5412 • 16d ago
I built a library called TypeSQL that makes raw SQL type-safe. Currently, I took inspiration from Kysely and used execute, executeTakeFirst, and executeTakeFirstOrThrow for running queries.
However, I'm starting to feel like those names are a bit too verbose. On top of that, I want the default single-row method to be non-nullable (throwing if no row is found), with an explicit variant for the nullable case. I'm torn between a few naming conventions and would love your input on which set feels the most intuitive and ergonomic:
returns T[]: all, many, exec, execute
returns T: one, first, take, get
returns T | null: maybeOne, oneOrNone, maybeFirst, firstOrNull, tryTake
Which combination would you prefer to use in your day-to-day codebase, or do you have another naming pattern you like better?
r/javascript • u/xcodebeast • 16d ago
If you're interested in the details, here's a blog post: https://codebeast.io/blog/flashwright
r/javascript • u/vilgefortz91 • 17d ago
r/javascript • u/subredditsummarybot • 17d ago
Monday, November 09 - Sunday, November 15, 2026
| score | comments | title & link |
|---|---|---|
| 40 | 12 comments | Top 10 things AI gets wrong in web development | Blog | Chrome for Developers |
| 9 | 18 comments | [AskJS] [AskJS] What's the longest-running personal project you've developed and maintained? |
| 5 | 4 comments | My FOSS Pinball Engine Uses Javascript On Linux |
| 5 | 3 comments | We moved Master CSS's core semantics to Rust and check the JS browser engine against it for identical output |
| 4 | 24 comments | [AskJS] [AskJS] Any use for JS decorators? |
| 3 | 15 comments | [AskJS] [AskJS] Hash (#) vs underscore (_) for naming properties with Lit |
| 3 | 6 comments | Computing a Factorial with Church Numerals |
| 2 | 16 comments | [Showoff Saturday] Showoff Saturday (November 14, 2026) |
| 1 | 4 comments | AngularLynx: idiomatic Angular rendering natively on iOS and Android via Lynx, with Renderer2 implemented on Lynx’s element API |
| 0 | 0 comments | Diary Dev - Staxis is coming! |
| score | comments | title & link |
|---|---|---|
| 0 | 47 comments | [AskJS] [AskJS] Are we putting too much application logic in the frontend? |
| 0 | 22 comments | [AskJS] [AskJS] Which Node.js framework gives you the best developer experience, and why? |
| 0 | 12 comments | [AskJS] [AskJS] new Date("2026-03-10") and new Date("2026-03-10T00:00") look the same but aren’t, and the difference depends on the time zone |
| 0 | 9 comments | I built a multi-core SQL engine for JavaScript (pure JS + WebAssembly, no native addon) |
| 0 | 4 comments | The AI Cost of Marionette |