r/javascript • u/yettezxc • 9h ago
r/javascript • u/AutoModerator • 6d ago
Showoff Saturday Showoff Saturday (November 28, 2026)
Did you find or create something cool this week in javascript?
Show us here!
r/javascript • u/subredditsummarybot • 3d ago
Subreddit Stats Your /r/javascript recap for the week of November 23 - November 29, 2026
Monday, November 23 - Sunday, November 29, 2026
Top Posts
| score | comments | title & link |
|---|---|---|
| 61 | 3 comments | Things you can do with a browser in 2027 |
| 30 | 8 comments | The V8 JavaScript Runtime Undermined My Constant-Time JavaScript Library |
| 8 | 8 comments | Isoloop: event-loop isolation for JavaScript apps (0.1, open source) |
| 6 | 5 comments | Introducing the KernelPlay Web Scene Editor â Coming with KernelPlay JS v0.9.0 |
| 4 | 9 comments | [Showoff Saturday] Showoff Saturday (November 28, 2026) |
| 4 | 6 comments | [AskJS] [AskJS] Good resources for using JS/TS for simple real-time multiplayer games/interfaces, web-based? |
| 4 | 6 comments | Template engine EJS vs Eta for a new Node.js project with SSR(don't want to use NextJS), which to choose? |
| 3 | 0 comments | Diary Dev: Staxis Platform - Funds page and Documentation was improved |
| 2 | 0 comments | Your remark/rehype plugins don't run on Astro 7's Sätteri â drop-in ports |
| 2 | 3 comments | KernelPlay JS v0.6.0 Released â Modular Architecture, Universal Renderer Cores & Decoupled Physics! |
Â
Most Commented Posts
| score | comments | title & link |
|---|---|---|
| 0 | 15 comments | Unframework - The compiler that speaks seven UI frameworks |
| 0 | 11 comments | Hot take: Sometimes three boring statements beats one clever expression |
| 0 | 10 comments | Agents do NOT do better with types |
| 0 | 8 comments | [AskJS] [AskJS] Utility functions named like verbs are the worst API design in JS libraries |
| 0 | 8 comments | [AskJS] [AskJS] I tested concurrent download limits in PostgreSQL. Here's what happened. |
Â
Top Ask JS
| score | comments | title & link |
|---|---|---|
| 0 | 4 comments | [AskJS] [AskJS] Try this new JSON explorer and let me know what else can i make in changes in it |
Â
Top Showoffs
Â
Top Comments
Â
r/javascript • u/ssalbdivad • 16h ago
ArkType 3.0: TypeScript's smallest, fastest validator
arktype.ior/javascript • u/QuarterSilver5245 • 3h ago
Keeping Your JavaScript Objects FAST: a Study Of V8's "Fast Properties Mode" <-> "Slow Properties/Dictionary Mode" Switch
yuval.hashnode.devThis is a follow-up to my study of JavaScript objects transitioning from âFast Modeâ to âSlow Modeâ in V8;
It explores 4 different JavaScript scenarios, that will trigger a JavaScript object to be switched from the normal "fast properties" mode, to "Dictionary" (a.k.a "slow") mode. The fourth one is a substantial finding that was not shown in previous prelimenary results.
The goal is to find deterministic or "mostly deterministic" scenarios that trigger a switch from fast mode to slow mode - a "mostly deterministic" scenario is a kind of operation (usually an object mutation, creation, property addition or property redefiniton) - that, except uncommon exceptions - given a "fast mode" object - will trigger a switch to "slow mode", under the same conditions.
The background story is that, while benchmarking a client-side state-management library I've been developing, I encountered an unexpected performance bottleneck: changing the enumerable attribute of certain properties affected subsequent property-access performance. Investigating this has led me to take a step - crossing between the abstraction boundaries - from the JavaScript realm, to its underlying runtime engine, V8, and the specifics of the implementations of "Fast Properties" and "Dictionary/Slow properties".
I initially wrote an article explaining why "Fast Mode" is "fast" and why "Slow Mode" is "slow", from a data-storage design perspective, tying it loosely to V8's implementation (which I was not deeply familiar with at that time). That article now serves as an introduction to this study.
This series documents that investigation through reproducible experiments and references to V8's source code. The goal of the study is to identify deterministic or "mostly deterministic" scenarios that trigger a switch from âfastâ to âslowâ - a "mostly deterministic" scenario is an operation - typically an object mutation, or creation, that triggers a switch under specific, predictable conditions. Paths that are very narrow or very circumstantial - are outside the scope - and I intentionally do not pursue them.
Note, that what's known in V8 as "Elements" (a separate storage of array-indexed properties) - is outside the scope of this study as well. (Fun fact: Elements are not exclusive to âactual arraysâ, ordinary objects also come with a built-in empty, but ready, Elements storage, which is used if you assign properties to numerical-indexes. It's what enables Array.from to work seamlessly with an object with number-keys and a length property).
I have decided to split this into several parts:
- General deterministic operations; things that trigger a switch - with few or no additional conditions. This is this part.
- Maps-transition-based triggers; Switch scenarios occurring as part of the Map transitions check âcrossroadsâ: Initializing an object, adding properties, and changing aspects of existing properties - can all bring an object to this crossroads - where V8 tries to figure out whether to keep its current associated Map/Shape, transition to another existing one, create a new one, OR, a fourth option, switch the object (if itâs still in Fast mode) - into âDictionary/Slow modeâ - that fourth option is what the study investigates.
- Operations on Prototype objects. Objects defined as a Prototype goes through different paths/branches/conditions - so they deserve their own separate part.
The motivation and perspective is that of a veteran JavaScript engineer investigating the implementation details of an underlying abstraction after encountering limitations originating from its design decisions, while not being a member of the developers/maintainers of V8 - the series documents an active investigation - discoveries, experiments and limitations.
I consider this information important, especially since not all scenarios that switch are intuitively apparent (you will see that especially in part 2).
My previous post revealed that the community sees value in actual âDoâs and Donâtsâ on this matter - which encouraged me to conduct a more thorough, systematic study, grounded on resources such as V8 source-code, both current and historical, and specific, dedicated, reproducible tests and code examples;
The linked article elaborates on each finding, with source-code references and reproducible examples. Here, I'll provide a condensed version;
This is an ongoing study; I encourage discussions around the scenarios presented here, if you mention related scenarios outside of the scope here and have interesting findings - Iâd be happy to see them contributed. Please maintain respectful communication; Constructive remarks are welcomed;
---
This part has 4 findings:
1. Creating an object with null Prototype; This might be the most explicit, deterministic way to have a dictionary-mode object, from JavaScript syntax. V8 source code actually has specific conditions for this (a literal âis_null_prototypeâ const). In practicality - this is essentially a âJavaScript API for intentionally creating a Dictionary objectâ. Also, there is no âswitchâ - the object is initialized as âdictionary modeâ from the get-go. It works with Object.create(null), as well as with { __proto__: null }, but, NOT when using Object.setPrototypeOf(object, null).
2. Having too many properties; Although this is triggered as part of the Maps transitions flow - I decided itâs generic enough to include it in the first part (and not the second); There are two limits:
- A âsoft-limitâ: this is the Max of a V8 configuration flag vs. the in-object property storage capacity, compared against the number of external property fields (named properties storages for 'fast properties' can be a "in-object" storage, or an external storage (the first is slightly faster as it skips an additional lookup step)); I have found this limit is applied when you assign properties using âdynamic keysâ (e.g.
object[key] = âvalueâ). Donât count this number as an absolute - but on my test environment - adding dynamic keys until it switches consistently occur on the 21st addition. - A âhard limitâ: this is a hard coded cap on the maximum number of total fast property descriptors an object can have. The limit is written as:
(1 << kDescriptorIndexBitCount) - 4;kDescriptorIndexBitCounthas been hard-coded to 10, with no change since 2013; The shift-left is equivalent to 2 to the power of 10, === 1024. So minus 4 is 1020; Tests of adding direct named properties to an object until a switch is triggered - show a switch on the 1021st property, consistently.
3. Deleting a configurable named property; You might of seen this come up on the first post; There arenât a lot of optimization attempts to âpreserve fast modeâ after delete (the article explores reasons why); There was a now-obsolete optimization that sustained fast mode when deleting the last named property - but currently - for NON-PROTOTYPE objects, this seems like a mostly deterministic switch trigger.
4. Defining a literal getter/setter on an object; I think this is a substantial, important finding; Defining a âliteral getterâ or âliteral setterâ on an object - snaps it to dictionary mode.
By âliteralâ, I mean, this syntax:
const object = {
get someValue() { return 10; }
}As opposed to passing a descriptor to Object.defineProperty(/ies), with get() {...} and/or set(value) {...} - the de-facto way of defining an âaccessor propertyâ (the other kind, being a âdata propertyâ - where you put a direct { value: ... } in the descriptor. That distinction is going to be very relevant in part 2 - as most scenarios in that part are mutations related to accessor properties).
This syntax, also triggers a switch:
const object = {
get [âsomeValueâ]() { return 10; }
} This, though, doesnât:
const key = "someValue";
const object = {
get [key]() { return 10; }
}An important thing to mention is, that both syntax forms (literal vs. Object.defineProperty) - leads to the creation of an accessor property (if you define both a setter and a getter for the same name in the literal variation - it's still the same one accessor property) - but, exploring the source code paths, reveals different initial execution points (they converge later-on) - the literal syntax path initially goes through a "Runtime Function" (one form of JS-to-C++ bindings they use within V8 to implement JavaScript functionality in the "C++ level". It's one of the "older" binding mechanisms, newer have been added - it's still in use - but it can hint about a specific's path "age"), the Object.defineProperty syntax initially follows a path that goes through methods that correlates to abstract operations mentioned in the ECMAScript specs under the same names;
My hypothesis - is, that specs came later (I mean, some specifics regarding "define property" was added in later specs' versions) - and defineProperty was adjusted to align, while the literal syntax remained in the older path.
Stay tuned for the next part, which is called:
"Accessor Properties - and why you shouldn't be messing with them - too much".
r/javascript • u/jomi-se • 17h ago
Node.js' Event Loop Delay monitor has been lying to you (for years)
jomi-se.comIn Node.js, if your event loop blocks for 30 seconds with a monitor that has a 60-second window and 50 milliseconds resolution, you'll get a p99 event loop delay of 52 milliseconds. And if you're lucky, the 30-second delay might show up in the max of the event loop delay monitor.
I wrote a blog post about it. The twist at the end was a bit funny (the fix has been sitting in the codebase since 2019). It almost features no AI.
It turns out this problem was given a name more than a decade ago by Gil Tene: Coordinated Omission. Where latency in your system skews your latency measurements and makes your percentile metrics lie to you. (awesome talk by Gil Tene on youtube "How NOT to measure Latency". Can't link video or post gets autoremoved)
In simpler terms: If your measurement system has this issue, when your system stalls for 10s, your p99 metrics happily report something like 5ms. If you measure latency from inside your code, you have this issue.
r/javascript • u/JadeLuxe • 20h ago
Test Local Apps on a Real Phone Over Cellular Data
instawormhole.comr/javascript • u/refql • 1d ago
HinMil: type check Hindley Milner signatures in comments
github.comr/javascript • u/APTman1010 • 1d ago
KernelPlay JS v0.6.1 â Introducing the Time System!
github.comI'm excited to share another update to KernelPlay JS!
KernelPlay JS v0.6.1 introduces a dedicated Time System, giving developers more control over game timing, frame updates, and gameplay speed.
What's new?
The Time System provides several useful properties:
Time.deltaTimeâ Scaled delta time. Becomes 0 when the game is paused.Time.unscaledDeltaTimeâ Raw delta time, which continues advancing regardless of time scale.Time.fixedDeltaTimeâ Base fixed-step interval in seconds.Time.timeâ Total scaled elapsed time.Time.unscaledTimeâ Total unscaled elapsed time.Time.timeScaleâ Controls the speed of gameplay.Time.fpsâ Current frames per second.
Time Scale Control
You can now control gameplay speed directly through the Game instance:
game.; // Slow motion
game.; // Pause gameplay/physics
game.; // Normal speed
For example:
1.0= Normal speed0.25= Slow motion0= Paused
The distinction between scaled and unscaled time is especially useful when creating pause menus, slow-motion effects, and gameplay systems that need to keep running independently of the game time scale.
This is another step toward making KernelPlay JS a more complete and flexible game development framework.
More improvements are coming!
What would you build with the new Time System?
r/javascript • u/chsotelogut • 2d ago
I built a per-file result cache for Vitest (like go test's): a 1,248-file suite reruns in 19 s after an edit
github.comr/javascript • u/Thick_Jeweler_4018 • 4d ago
Your remark/rehype plugins don't run on Astro 7's Sätteri â drop-in ports
github.comAstro 7 moved to Sätteri, a Rust Markdown engine. It's fast, but it has its own AST, so rehype-katex, rehype-slug, rehype-sanitize etc. stop working.
I ported the 10 most-used ones. Each is tested against the original plugin's output, so it's a swap, not a rewrite: slug, autolink-headings, katex, mathjax, sanitize, breaks, github, mdx-frontmatter, validate-links, citation.
The README also has a table of plugins you can just delete, because Sätteri has them built in (gfm, frontmatter, smartypants, directiveâŚ).
Live demo: https://satteri-plugins.js.org Repo: https://github.com/Ashish-CodeJourney/satteri-plugins
Which plugin is blocking your upgrade? I'll port the next most-requested one.
r/javascript • u/big_hole_energy • 4d ago
JS Arithmetic Coding Playground to test your prediction models for text compression
theabbie.github.ior/javascript • u/nejcar20 • 4d ago
pictoqr: I made QR codes draw pictures. They still do their one job.
github.comr/javascript • u/Visible_Head_6828 • 4d ago
MatFrame: a drop-in <iframe> replacement that resizes itself, talks with Promises and shows a fallback when blocked
github.comr/javascript • u/alexgrozav • 4d ago
Unframework - The compiler that speaks seven UI frameworks
unframework.devr/javascript • u/al3x_7788 • 6d ago
AskJS [AskJS] Good resources for using JS/TS for simple real-time multiplayer games/interfaces, web-based?
I have designed a game in real life and thought of creating a very simple online version of it so I can play it with more people at any time. I don't have much experience with JS, just basic webpage functionality, though I have a lot of experience with programming in general.
The game is not very complicated in terms of mechanics, just turn-based in a real-time updating board and I'd probably be looking to something similar to what chess websites implement, if not an identical implementation. I'd just like resources related to designs I could get "inspiration" from and how the web clients would communicate with the server. I do not want to use automated assistance.
r/javascript • u/wasitshafi • 6d ago
Template engine EJS vs Eta for a new Node.js project with SSR(don't want to use NextJS), which to choose?
npm-compare.comHi,
I am about to start a new project with SSR (Node.js); previously, I have used ejs/handlebars. Currently, I am not very familiar much eta.
eta claims to be faster than ejs, anyone worked with both?
Highly appreciate your suggestions/comments.
ejs: https://www.npmjs.com/package/ejs
eta: https://www.npmjs.com/package/eta
Thanks
r/javascript • u/Content-Set-1356 • 6d ago
LazyPromise: an async primitive that has familiar semantics of a native promise, but supports auto-propagating cancellation, type-safe errors, and dependency injection
lazypromise.comr/javascript • u/APTman1010 • 6d ago
KernelPlay JS v0.6.0 Released â Modular Architecture, Universal Renderer Cores & Decoupled Physics!
github.comI'm excited to announce that KernelPlay JS v0.6.0 is officially released!
This update introduces an important architectural shift toward a more modular engine, focusing on decoupling the Renderer and Physics systems.
Here's what's new:
1. Universal Renderer Architecture
Previously, switching rendering pipelines could require developers to replace generic components such as `BoxRenderer` with pipeline-specific components like `PixiBoxRenderer`.
With the new architecture, universal components can work across all supported rendering pipelines without requiring developers to manually switch rendering components.
This makes changing renderers much easier and keeps game logic independent of the rendering pipeline.
2. Decoupled Physics Engine Core
Physics logic has now been moved into a separate Physics Engine Core.
The default physics engine remains integrated and ready to use, but the new structure makes it possible to plug in custom physics engines.
This gives developers more flexibility over how physics is handled in their projects.
3. Future Physics Plugins
We're also planning to expand the plugin ecosystem.
High-end physics engines such as Matter.js will be available as separate plugins in the future. They won't be bundled into the core engine, helping keep KernelPlay JS lightweight.
4. Official TypeScript Support
This release also introduces official TypeScript support through `.d.ts` declaration files.
Developers can now benefit from type information, better editor support, and autocomplete when working with KernelPlay JS in TypeScript projects.
---
This architectural change is a major step toward making KernelPlay JS more flexible, modular, and lightweight.
There's still a lot planned for the project, and I'd love to hear your thoughts.
What do you think about this new modular architecture? Would you be interested in building custom renderer or physics cores?
Thank you to everyone following and supporting KernelPlay JS!
r/javascript • u/Browhair3834 • 7d ago
Remote procedure calls for interactive applications
willybrauner.comr/javascript • u/sa2bin • 7d ago
Isoloop: event-loop isolation for JavaScript apps (0.1, open source)
isoloop.devIsoloop is a toolkit that helps you separate your app's UI from the work behind it, and you install only what you need. Each part, UI or headless, runs on its own worker or in a shared pool. How you split your app is your call.
Why it exists
In most apps, the UI and everything behind it (state, sync, search, data processing) share one main thread, one heap and one event loop. One slow or broken part makes the whole app janky or blank. A plain worker isolates CPU time, but leaves you to wire up how parts share data, and what happens when one fails.
Isoloop helps you separate them and run them together. Each part can get its own loop, a supervisor restarts it when it fails, and parts can share state through the bus. The UI stays responsive, a block or a crash stays in its part, and the work can run where it fits best.
â Kernel: starts, stops and connects the parts
â Workers: each part on its own thread, or sharing one in a pool
â Supervisor: detects what hangs or crashes and restarts it
â Message bus, optional: typed topics, per-part permissions, replay, history that can survive a reload
â Adapters: React, Preact, or plain DOM and headless with no framework
â Vite plugin: builds and wires up the workers
Still experimental: a balancer that moves parts between workers by measured load, devtools, and tools that let AI agents call the actions your app exposes.
It isn't free. The workers, the bus and the kernel cost extra CPU, memory and start-up time. In return, one bad component or one bad record doesn't have to take the whole app with it.
On the roadmap, not shipped yet: moving the work further from the UI, into a WASM component or a native process, with the bus as the model the UI and the work share.
Open source, MIT. Feedback is very welcome.
r/javascript • u/ClickOk5811 • 6d ago
AskJS [AskJS] Utility functions named like verbs are the worst API design in JS libraries
I keep running into the same API design pattern in JS and TS libraries, and it quietly causes production bugs:
import { format, parse, validate } from 'some-lib'
format(date) // "2026-11-27" or "11/27/2026" depending on locale?
parse(input) // throws? returns null? returns the input unchanged?
validate(email) // true/false? or throws a ValidationError?The function names are verbs. They sound obvious. But the contract is anything but obvious.
format might respect the system locale, or it might not. It might throw on invalid input, or return null, or return the input unchanged. parse might be strict, lenient, or silently coerce. validate might return a boolean or throw.
The problem isn't any single library. It's that the ecosystem has converged on verb-named utilities without a shared contract. So every time I switch libraries, I re-learn whether parse throws on garbage input or swallows it.
Compare that to something like Date.prototype.toISOString(). The name is boring, but the behavior is exact. No locale surprises, no silent coercion, no guessing.
I'm starting to think libraries should name these functions after what they actually do, not after the general idea:
formatDateToISO(date) // exact contract
parseEmailStrict(input) // throws on invalid
isValidEmail(email) // boolean, never throwsMore verbose, yes. But you can read the call site and know what happens without checking docs.
What's your take? Do you prefer short verb names with documented behavior, or longer names that encode the contract? And have you ever been burned by a parse or validate that behaved differently than you expected?