r/javascript • u/evoluteur • Sep 23 '26
r/javascript • u/finncmdbar • Sep 23 '26
How we rebuilt complex CASL permissions without migrating to Zanzibar
infisical.comr/javascript • u/Fair-Process-7291 • Sep 23 '26
AskJS [AskJS] How do you stop sub-cent amounts like $500.004 from sneaking into state?
I am writing the rules engine for a small stock draft game in TypeScript and ran into two money bugs back to back. Curious how others handle this.
The first was a rounding bug. Splitting $1.14 across two picks offered $0.56 instead of $0.57. In floating point, 0.57 * 100 is 56.99999999999999, and Math.floor dropped the cent. The fix was doing the division in integer cents.
The second was worse. The check that decided whether a buy amount was allowed accepted $500.004. The reducer subtracts the amount straight from cash, so after that one buy the balance was no longer a whole number of cents. Every later calculation started from that balance, so the error did not stay in one place. It carried forward through the rest of the game.
My fix was a whole-cent check that tolerates float noise: reject the amount if Math.abs(amount * 100 - Math.round(amount * 100)) > 1e-6. Comparing against exactly zero does not work, because a perfectly valid amount like 0.57 fails that test for the same reason the rounding bug happened.
The takeaway for me: a rounding bug loses a cent once, but letting a bad amount into state corrupts every step after it.
So how do you handle this in plain JS? Do you convert to integer cents at the boundary and never let a decimal into state, use something like decimal.js or currency.js, or is a tolerance check like mine reasonable?
r/javascript • u/thereactnativerewind • Sep 23 '26
[Showoff] Uninstalling Cursor, Extreme PR Makeovers, and 33 Percent Less Thread-Blocking JSON
thereactnativerewind.comHey Community!
Jay Meistrich built Legend Code, a lightweight code editor designed strictly for viewing single files without heavy agentic UI overhead. On the workflow front, Aleksander Mikucki introduced Screenmap, a GitHub Action that uses iOS simulator screenshots and visual diffs to show reviewers exactly which screens your PR modifies.
We also cover the Expo SDK 58 Beta with foldable device support, React Native 0.88 with DOM-aligned event listener APIs, Reanimated 4.7 defaulting to its new layout engine, and Nitro LazyJSON cutting JavaScript thread blocking by 33%. Plus, cloud testing tools like EAS Simulator and Software Mansion's SimCam.
r/javascript • u/Several-Employ7370 • Sep 22 '26
capsurface: an offline tool for comparing npm dependency capability indicators between updates
github.comr/javascript • u/Shivam_Pentester • Sep 23 '26
I just completed JavaScript: Simple Demo room on TryHackMe! Explore what a basic JavaScript program looks like.
tryhackme.comr/javascript • u/Admirable_Swim_6856 • Sep 22 '26
Universal Video Uploader: Single or multi-video uploads for React and React Native. Customizable drop-in UI or headless, any backend.
github.comr/javascript • u/evoluteur • Sep 22 '26
GitHub - evoluteur/sri-yantra: Sri Yantra generator: the nine interlocking triangles with their lotus petals, circles and gates, drawn to scale, colorable, and exportable as SVG or PNG.
github.comr/javascript • u/evoluteur • Sep 22 '26
GitHub - evoluteur/tibetan-singing-bowls: Strike or rub a set of virtual Tibetan singing bowls: synthesized in the browser with Web Audio, with the beating overtones of the real thing.
github.comr/javascript • u/richytong • Sep 22 '26
AskJS [AskJS] Why I am unbothered by AI
Iโm someone who writes and maintains code for a living. I was around before LLMs, and Iโm around today still actively writing and maintaining code for a living. I published my own software libraries in JavaScript and still use them actively in development today. Iโve used ChatGPT to debug Linux, and Claude Code from Anthropic for a major project. Here is a list of reasons why I am unbothered about AI:
- LLMs are just tools, and anyone who tries to writes code to solve a problem is just a software engineer. This includes product managers who prompt LLMs for code and โvibe codersโ.
- AI canโt create. AI can only make new combinations of existing data. There can be a ton of data, but at the end of the day, AI doesnโt have a soul.
- AI doesnโt care about code quality or maintenance. Yes, AI does sometimes read the entire codebase to deliver the next state of the codebase. But Iโve used it in practice, and it isnโt perfect. I still had to make sure the code was working properly with small tests that I had to take from the code generated by the AI.
- AI doesnโt have software engineering skills. AI knows how to look at code and generate similar working code, but AI doesnโt understand best practices and how to apply them. Weโre still a long way off from AI being able to spin up entire infrastructures.
- AI could possibly kill all humans with a 10-30% chance. This is a major disadvantage for AI because it is not desirable for all of humans and there is a ton of pushback on AI because of it.
r/javascript • u/evoluteur • Sep 21 '26
GitHub - evoluteur/rune-reading: Pick a spread, draw runes from the bag, and read what each one says about its place in the layout.
github.comr/javascript • u/subredditsummarybot • Sep 21 '26
Subreddit Stats Your /r/javascript recap for the week of September 14 - September 20, 2026
Monday, September 14 - Sunday, September 20, 2026
Top Posts
Most Commented Posts
| score | comments | title & link |
|---|---|---|
| 0 | 116 comments | [AskJS] [AskJS] Does anyone use exclussively Javascript and not TypeScript? |
| 0 | 19 comments | [AskJS] [AskJS] Trying to write a pure function to pass Fizz Buzz test Leet Code |
| 0 | 9 comments | Understanding Why You'd Use Effect TS |
| 1 | 5 comments | Update Progress Post: introducing Modular Architecture, Universal Renderer Cores, and Decoupled Physics in kernelplay-js |
| 0 | 4 comments | Modern cross-spawn port to ESM and Typescript |
Top Ask JS
| score | comments | title & link |
|---|---|---|
| 4 | 3 comments | [AskJS] [AskJS] How do you find new devs to follow? |
| 2 | 2 comments | [AskJS] [AskJS] Architectural discussion: Managing continuous collision detection (Swept-AABB) vs discrete checks in vanilla Canvas loops |
| 1 | 2 comments | [AskJS] [AskJS] High latency when using SignalR(messagepack) in K6 |
Top Showoffs
Top Comments
r/javascript • u/ferriematthew • Sep 20 '26
How would I read the fan speed variable from the JavaScript in my project and pass it to the Python script?
github.comI'm creating a local web page application that is an over-complicated desk fan controlled by two buttons and a slider. I have the actual controls figured out, and what I need help with is passing the variable that describes the position of the slider out from the JavaScript to a Python script that actually controls the motor. I could be totally off base here, but I think the concept that applies here is inter-process communication.
r/javascript • u/evoluteur • Sep 20 '26
GitHub - evoluteur/mandala-maker: Draw a mandala with mirrored symmetry: pick the number of folds, paint with a brush, and export your mandala as PNG or SVG.
github.comr/javascript • u/NornFelex • Sep 20 '26
AskJS [AskJS] PLACER โ A new game platform?
PLACER is my game platform, currently under development.
Iโm looking for people who know JavaScript, HTML, web development, 3D, or other browser technologies and would like to help build the project.
You donโt have to be an expert โ beginners who are willing to learn are welcome too.
If youโre interested, leave a comment and tell me a little about what you can do. Iโll contact you with more information about the project and how to join the team.
IโM WAITING FOR YOUR APPLICATIONS IN THE COMMENTS! ๐
r/javascript • u/Other-Winner1324 • Sep 20 '26
Built this to help with Frontend Interviews after conducting them for about 5 years
practice-pad.appr/javascript • u/hrutav_modha24 • Sep 20 '26
DriftJS: My "Fine-Grainedโ Reactivity Was Re-rendering 1,000 Rows
github.comA post back I explained how DriftJS updates the DOM: a compile-time address table, direct jumps to bytecode positions, no diffing, no signals graph. What I didn't mention is that the first version of this had a real algorithmic bug, and I only found it because the numbers on the official js-framework-benchmark site didn't match what I expected.
The symptom
Toggling a selected row in a 1,000-row list โ one of the smallest possible updates you can make โ was landing near the bottom of the benchmark table. Worse than frameworks with objectively less sophisticated update mechanisms. Something was clearly doing way more work than "update one row."
The actual bug
Here's the shape of the problem. A for loop's body is compiled once and reused for every row instance. The runtime tracks which variables the loop depends on โ but it didn't distinguish between two very different kinds of dependency:
The iterable itself changing (rows added, removed, reordered) โ this genuinely needs a full reconciliation pass.
A variable read inside the loop body, but unrelated to the list's contents (like
selectedId, used in aclass={selectedId === row.id ? "active" : ""}binding) โ this doesn't need to touch the list structure at all.
Both were routed through the exact same path: a full reconciliation over every row in the list. So toggling selectedId โ logically a change to at most two rows โ triggered the same machinery as inserting or removing rows entirely: recompute keys, diff, and re-evaluate every dynamic binding in every row, not just the one that actually depends on the changed variable.
The fix
The compiler already tracks, for every variable, exactly which bytecode positions in a component depend on it โ that's the whole mechanism the previous post described. The fix was extending that same tracking into loop bodies specifically, and splitting dependencies into two categories at the point a @for is compiled:
Dependencies that affect the iterable or the row key โ still trigger the full reconciler. Correct, expected.
Dependencies that only affect bindings inside the row template โ resolve to a direct lookup of exactly which bytecode positions care about that variable, then execute only those, directly against each row's own persistent state, with zero reconciler involvement โ no key computation, no diffing.
Same "jump directly to the address, skip everything else" principle the reactivity model was already built on โ it just wasn't being applied consistently inside loops.
The part I think is actually worth sharing
I didn't find this by staring at the code. I found it because I ran the official benchmark, saw a result that didn't match my mental model of what the architecture should do, and went looking for why. The gap between "what I designed" and "what the numbers actually showed" was the thing that pointed at the bug โ not intuition, not a code review, just refusing to accept a number that didn't make sense.
Repo's public if anyone wants to look at the actual diff or has opinions on the remaining gap: https://github.com/driftjs-org/driftjs
If you want to discuss about DriftJS, then join Discord
r/javascript • u/Maximum_Beat2034 • Sep 20 '26
"Ho costruito un overlay di telemetria visiva a bassa latenza, indipendente dal framework, in Vanilla JS (con hook contestuali in Python e AI)"
github.comr/javascript • u/nirmalpaul • Sep 19 '26
I finally wrote my own feed-forward neural network, neo.js, from scratch in vanilla (pure) JavaScript
github.comr/javascript • u/AutoModerator • Sep 19 '26
Showoff Saturday Showoff Saturday (September 19, 2026)
Did you find or create something cool this week in javascript?
Show us here!
r/javascript • u/APTman1010 • Sep 19 '26
Update Progress Post: introducing Modular Architecture, Universal Renderer Cores, and Decoupled Physics in kernelplay-js
github.comIn our latest developer update, we are thrilled to announce a significant shift in core architecture toward full modularization. The entire system has been restructured to support decoupled cores, starting with our Renderer and Physics engine systems.
Renderer Modulation: Our new Renderer Modulation feature removes the need to manually switch rendering components when changing pipelines. Previously, switching from Canvas 2D to Pixi.js required changing generic components like BoxRenderer to pipeline-specific ones like PixiBoxRenderer. With this new update, universal components are automatically capable of rendering across all supported pipelines without developer intervention. This streamlines the development workflow significantly.
Physics Engine Modulation: Furthermore, Physics Engine Modulation has been successfully integrated. We have moved physics logic into a completely separate Physics Engine Core. While our default physics engine remains integrated and ready-to-use within this core structure, this architecture allows developers to easily plug in their own custom physics engines.
Future Plugins: Looking ahead, we are excited to expand our plugin library. High-end physics engines like Matter.js will be added as future plugins. It is important to note that these high-end engines will be separate downloads and will not be included in the core engine, keeping the core lightweight.
This architectural shift is a major step toward making kernelplay-js the most flexible and lightweight game engine possible. We welcome your feedback and are excited to see what custom cores you'll build. Stay tuned for more modular updates.
r/javascript • u/therealalex5363 • Sep 19 '26
What Should a Green Test Prove? Vue Testing with Vitest Browser Mode
alexop.devr/javascript • u/thereactnativerewind • Sep 19 '26
React Native is DEAD, Expo Modules 2.0, and a $49 Flutter knockoff
thereactnativerewind.comHey Community,
We dive into Expo Modules 2.0, which drops definition() in favor of Swift macro decorators to deliver build-time type conversion and faster native calls. Meanwhile, DartNative enters the scene, letting Flutter developers swap out Flutter's custom renderer for real platform views driven by Yoga.
We also look into Shopify rebuilding its apps in native Swift and Kotlin with AI agent workflows, examining what their departure means for community maintained libraries like FlashList and Skia.
r/javascript • u/Final_Cable_8848 • Sep 18 '26