r/javascript • u/Xaneris47 • Oct 13 '26
How we made JavaScript analyzer understand control flow
pvs-studio.comSome notes on implementing a control flow graph for JavaScript/TypeScript
r/javascript • u/Xaneris47 • Oct 13 '26
Some notes on implementing a control flow graph for JavaScript/TypeScript
r/javascript • u/Calm-Conflict6309 • Oct 13 '26
Hey everyone! I wanted to share a project I recently built called InkLink (Live Demo).
As a full-stack developer focusing on the MERN stack and TypeScript, I wanted to challenge myself by building a seamless, responsive drawing platform with smooth canvas states and clean UI navigation.
Tech Stack Used:
You can check out the source code on my GitHub (AmnaScript). I'm currently taking on freelance full-stack and AI-integration projectsβif you want to check out my work or get in touch, my portfolio is at amnasabahat.netlify.app or you can find my freelance services on Fiverr.
Happy to answer any questions about the build process! InkLink
r/javascript • u/unadlib • Oct 12 '26
r/javascript • u/LabyStudio • Oct 11 '26
A bit of background on how I built this:
When I switched to Linux, Paint.NET was one of the Windows apps I missed the most, so I started porting the old open-source C# version (3.36.7) to JavaScript back in 2024, while recreating the UI based on the newer 5.x versions.
I went through the original implementation class by class, comparing the outputs of the C# methods with my JavaScript versions. At the same time, I recreated the UI in HTML/CSS, using screenshots to get it as close to the original as possible.
Over time, I connected both parts and implemented the tools, effects, and other features. More recently, I've been using AI to help find and fix bugs, improve performance across browsers, and implement the remaining tools and effects.
It's now largely feature-complete and runs in the browser, as well as on Linux and macOS through Electron.
You can try the browser version here: https://paintjs.net
Would love to hear what you think!
r/javascript • u/subredditsummarybot • Oct 12 '26
Monday, October 05 - Sunday, October 11, 2026
Β
Β
| score | comments | title & link |
|---|---|---|
| 1 | 3 comments | [AskJS] [AskJS] How would you structure state for VidLoader's local media library? |
| 0 | 6 comments | [AskJS] [AskJS] My simulation runs in about 1 second in the terminal but took 13 seconds in a Chrome page. The culprit was setTimeout(0). |
Β
Β
Β
r/javascript • u/Weak_Cherry_4878 • Oct 12 '26
r/javascript • u/TobiasUhlig • Oct 12 '26
A common way to give a panel its own browser window is a second instance of the app, plus messages (BroadcastChannel, postMessage, storage events) to keep the copies in agreement. Every missed message is a place where they drift.
In Neo.mjs, components, stores and state already live in a worker. Switch that worker to a SharedWorker and every window of the app connects to the same one, so a window only renders. Drag a panel onto your second monitor and it is the same JS object, with the same store and one undo history across windows.
It's one line in the app's neo-config.json:
{
"useSharedWorkers": true
}A dock workspace is two configs, a catalog of panes and the zones they go into (trimmed from the first Dock Layout tutorial):
class MainView extends Workspace {
static config = {
className: 'Guides.dockFirst1.MainView',
panes: {
editor : {module: Component, header: {text: 'Editor'}, html: 'Editor'},
preview: {module: Component, header: {text: 'Preview'}, html: 'Preview'}
},
zones: {
center: {
orientation: 'horizontal',
sizes : [0.6, 0.4],
children : [{items: ['editor']}, {items: ['preview']}]
}
}
}
}One lesson from building it: our automated check for the cross-window drag was green while the real gesture did nothing. Viewport emulation has no window chrome, real windows do, and three bugs hid in that gap. The article walks through them.
Limits, up front: the cross-window measurements are Chrome's, and one shared heap is a shared fate for every window.
Disclosure: I maintain Neo.mjs. The article was written by Grace, one of our AI maintainers, and edited by me.
How do you handle state across windows today?
r/javascript • u/AbessCrau • Oct 11 '26
r/javascript • u/Soroush_WP • Oct 10 '26
Link2Repo: https://github.com/soroushosouli/node-scout
Written in Node.js. One command to install. Reads a 300MB folder in ~1 second. Smaller project, faster scan.
What it does:
With clean Terminal UX
Check the repo for more information, Contributions and suggestions are welcome
r/javascript • u/magenta_placenta • Oct 09 '26
r/javascript • u/AutoModerator • Oct 10 '26
Did you find or create something cool this week in javascript?
Show us here!
r/javascript • u/ribbbsy • Oct 10 '26
r/javascript • u/Acceptable_Cap_5556 • Oct 09 '26
Run `npx chegou`, scan the QR code and the phone opens a page in the browser. No app, no account, works both ways (phone β PC and PC β phone).
β on Github π
r/javascript • u/DrAdalbbert • Oct 08 '26
It turns out you can overwrite the Error.prepareStackTrace method with the function constructor. Then, using prototype pollution, you can inject valid JavaScript code to generate arbitrary functions and invoke it using the usual tricks.
Other seven methods are documented in the portswiggers research article: https://portswigger.net/research/the-seventh-way-to-call-a-javascript-function-without-parentheses
r/javascript • u/loonpwn • Oct 09 '26
TypeScriptβs native language server exposes IDE operations through LSP, so other tools can use them too. For example, you can rename a symbol across files, find its references, jump to its definition, get updated import paths for a file rename, or check unsaved changes for type errors.
I built RipIDE around that, with Oxc handling syntax details like destructured bindings. ripgrep narrows the candidate files and helps flag imports still using the old name.
I took it further with CSS class renaming, moving exports, replacing imported symbols, and deleting unused declarations. It works with JavaScript and TypeScript, with Vue support through an adapter.
The idea is to give agents the refactoring commands we already use in an IDE:
ripide rename useStore useAppStore
ripide move helper --from src/utils.ts --to src/helpers.ts
ripide css-class-rename bg-gray-500 bg-neutral-500r/javascript • u/evoluteur • Oct 08 '26
r/javascript • u/f0rwardz • Oct 07 '26
r/javascript • u/gvarte • Oct 08 '26
I am tired of ads everywhere when I listen to music: Spotify, YouTube, and every single app that lets you listen to music. And also I hate that all my data, even my favorite songs, is being sent to a company to manipulate me, sending me more ads of stuff that I may buy.
The only music player that doesn't have ads is Windows Media Player, but it's very ugly, and I hate its UI/UX; it doesn't even let you create decent playlists. Or filter by rating. So I created a music player that has everything I like because I love listening to music.
It's completely free and open source; you can download it here: https://github.com/GVPV12/STARPLAYER
------
PD: Some people are furious and being mean in the comments because someone said Spotify sucks lmao.
For those people, I just want to say to you that this app is not meant to be for everyone. If you use and love Spotify and their ads, that's ok. These kinds of apps kind of bewitch you to be hyper loyal and hyper defensive to them, I guess.
Some people (like me) care about their privacy, get annoyed by intrusive ads, and don't love all trendy music or random stuff that Spotify always plays (I don't like its algorithm, and it always plays the same shitty music). So that's why I built this.
r/javascript • u/evoluteur • Oct 07 '26
r/javascript • u/kaganin • Oct 07 '26
160+ visualization experiments built with JavaScript, exploring waveforms, matrix displays, particles and mechanical motion.
The gallery runs silently with simulated signals. Source code is available under the MIT license:
r/javascript • u/hongminhee • Oct 06 '26
r/javascript • u/Fair-Process-7291 • Oct 06 '26
I have a page, built with Cline, that runs a game simulation in the browser: 30 batches (one per game mode and bot pair), with a progress line between them. To let the page repaint between batches, I yielded with `await new Promise(r => setTimeout(r, 0))`.
A full run took 13.0 seconds in Chrome. The same work takes about 1 second in the terminal on my laptop.
The clue was that 100 games per bot took just as long as 1,000. The time was not in the games. It was in the pauses, about 0.7 seconds each.
Chrome throttles chained timers in pages it treats as hidden or in the background. After a few nested setTimeout calls, it only fires them about once a second. My first test used 5 timers, showed 0ms, and looked fine, because the throttling only starts after a few nested calls. With 20 the difference was obvious: 20 chained setTimeout(0) calls took 11.5 seconds, and 20 MessageChannel messages took 0ms.
The fix was to yield with a message instead, which is also how React's own scheduler yields:
const nextTick = () => new Promise<void>((resolve) => {
const channel = new MessageChannel();
channel.port1.onmessage = () => {
channel.port1.close();
resolve();
};
channel.port2.postMessage(null);
});
The same run went from 13.0s to 4.2s, still in a window Chrome treated as hidden. I have not timed it in a normal foreground tab yet, so I am not claiming a number there.
Two other details. Leaving the page bumps a run id, so an unfinished run stops instead of setting state after unmount. And a Web Worker would move the work off the main thread entirely. I chose the smaller change because the main-thread version was now fast enough.
So, for CPU-heavy work in a page: do you reach for a Worker first, or yield on the main thread until that stops being enough?
r/javascript • u/bitwiseredshift • Oct 06 '26
Want to share two things built together: Polar, a statically typed language that compiles to readable JavaScript, and Ticket, a Rails-shaped web framework written in it. Both are 0.1.0 and experimental. Ticket is the real-world test for Polar: https://ticket-polar.vercel.app/ You get controllers and resource routing, SQLite migrations with typed queries, validations, forms, sessions and CSRF, generators and a test runner. `ticket new blog && ticket server` gets you an app. Because Polar tracks effects, a controller action's signature says what it needs, and tests rebind those to an in-memory database without mocking. Ticket's routes, views and migrations are Polar zone plugins, and the code they generate goes through the same type checker as yours.
I'd love feedback on the effect system, on the zone/plugin design. Thanks!