r/javascript • u/saimonR • Mar 04 '23
r/javascript • u/[deleted] • Oct 30 '11
LungoJS - HTML5 Mobile Framework... and stuff.
r/javascript • u/GeZe8 • Oct 29 '12
LiveScript - a language which compiles to JavaScript - 1.1.0 has been released!
livescript.netr/javascript • u/varun_raj • Aug 08 '16
A collection of most commonly used functions in modern webapps
r/javascript • u/zoro1983 • Aug 26 '20
Functional typescript and open close principles.
r/javascript • u/Dereference_operator • Jan 06 '20
AskJS [AskJS] Why Javascript is your favorite language ?
A) What are the strength of Javascript over C#, Java, Python or Php and is it the best programming language to learn in 2020 for webdev ? Do you feel the others are getting outdated or less popular ?
B) How's JS performance today compare to the others tech stack ? (interpreted vs compiled, single thread vs multi-threads etc) Are you guys worried about Web Assembly and the performance of C/C++ coming to webdev ?
C) Why there is so much hate/disdain toward Javascript from programmer of other tech stack like C# / Java for example ? is it because they are stuck with their old 80’s concept and OO mentality and they have trouble with functional programming and the new stuffs ?
r/javascript • u/magenta_placenta • Sep 09 '22
CO2.js - a JavaScript library that allows developers to estimate the emissions associated with their apps, websites and software
r/javascript • u/alhso • Oct 05 '24
AskJS [AskJS] Looking for a service where I can just upload my code and everything else is handled automatically
Hi, all!
I want a cloud hosting service so as to make the experience completely hands-off. More precisely, I want to simply upload my code and do nothing thereafter: no server management, scaling, or security configurations whatsoever. I want to focus on development alone and would require a service that takes care of everything else, scaling, security, database management, among others, with minimal configuration.
I've tried solutions like Heroku, Fly.io, and Vercel, but still find myself having to deal with infrastructure tasks that I don't want to bother with. I'm looking for something that would have default best practices out of the box for:
Autoscale load, but with bounds so it doesn't scale out of control
Anti-DDoS protection included
Setup of light database e.g. SQL Automatic backups and updates
Is there something like this, or am I just dreaming about something which doesn't exist yet? I wouldn't want to fiddle around with any kind of manual intervention once the code gets uploaded. Any suggestions are greatly appreciated!
r/javascript • u/Bewinxed • Jun 09 '24
I made River.ts, a Declarative library for defining, emitting & consuming SSE Events in client & server.
r/javascript • u/AshishKhuraishy • Nov 16 '18
What are the benefits of using Node.js?
r/javascript • u/mrv1234 • Feb 11 '17
Angular 2 + and React - Why Use Angular to Build Applications ? The Biggest Reason is Not Technical
r/javascript • u/[deleted] • Jan 22 '24
Days Since Last JavaScript Framework
dayssincelastjavascriptframework.comr/javascript • u/enador • May 10 '26
Wraplet: TypeScript, OOP, and the DOM — finally in one working model.
This is a passion project I was theorycrafting and implementing for the last two years.
https://github.com/wraplet/wraplet
The goal was to make a low-footprint framework that would:
Take full advantage of OOP with declarative dependency structures, where objects' implementations can be freely switched out.
Take full advantage of TypeScript, which infers types based on these structures.
Could work with **any** DOM structure (elements, classes, attributes, etc.: you should be able to bind your behaviors to anything that is out there).
Removes the hassle of lifecycle management.
I wanted to have the flexibility of writing vanilla JS but in an environment of the best programming patterns that would prevent the code from becoming a mess over the long term.
This is not an alternative for React but rather for jQuery. According to w3techs market share of jQuery is still significant: https://w3techs.com/technologies/details/js-jquery
Wraplet allows for a gradual migration to a much more maintainable structure, but it also works for new projects that render HTML server-side (I think Wraplet fits popular CMSes especially well).
I think there was an uncovered middle ground between imperative jQuery code and full SPA solutions. This is what Wraplet covers.
The docs have many interactive examples.
Actually, I made a separate library: `exhibitionjs` just to showcase `wraplet`.
If you also develop online docs and don't like dependency on external sandbox providers, you can look it up at: https://exhibitionjs.wraplet.dev/ Of course, it's wraplet-powered.
Ok, that was me; now it's time for an AI slop, because it's actually pretty decent at readable descriptions, or at least better than me :)
AI SLOP STARTS
1. Overview
wraplet is a small JavaScript/TypeScript framework for projects that still work directly with the actual DOM (server-rendered apps, jQuery legacy, multipage sites, plain HTML, libraries shipping DOM components, etc.).
Instead of replacing the DOM with a virtual rendering layer, wraplet lets you bind class instances ("wraplets") to real DOM nodes and gives you:
a predictable lifecycle (construct -> initialize -> destroy),
a typed, declarative dependency system between components (required/optional, single/multiple),
automatic event listener cleanup via NodeManager,
automatic wraplet creation/destruction when DOM nodes appear/disappear (NodeTreeManager),
components that are trivial to unit test - each wraplet is just a class around a node.
Pros:
Plays well with backend-rendered HTML. No "the framework owns the page" mindset.
TypeScript-first. Types describe component structure, not just APIs.
Tests are boring (in a good way). A wraplet is a class with a node. new MyWraplet(element), call methods, assert. No JSDOM-heavy framework setup.
Encapsulation by default. Parents talk to children through methods like setError("..."), not by reaching into their internal nodes.
Gradual adoption. You can migrate a single jQuery-based widget without touching the rest of the app.
Where it's a good fit:
progressive modernization of legacy jQuery / server-rendered UIs (PHP, Rails, Django, Laravel, etc.),
libraries that ship reusable DOM-bound components,
projects where a full SPA would be overkill,
teams that prefer classes, encapsulation, and explicit relationships.
Where it's not a good fit:
Apps already happily built on React/Vue/Svelte - wraplet is not competing with them; it's solving a different problem.
2. Technical overview:
2.1. TypeScript as a first class citizen
Most "DOM-binding" libraries treat TypeScript as a coat of paint on top of a runtime API. Wraplet tries to use TypeScript as the actual architecture layer - the place where you express what a component is, what it depends on, and what shape those dependencies have. The runtime then derives behavior from that.
2.2. The component is a generic class parameterized by the wrapped DOM node
In the simplest case, the type describes what type of node is wrapped by the wraplet:
import { AbstractWraplet } from "wraplet";
class Button extends AbstractWraplet<HTMLButtonElement> {
protected async onInitialize() {
// `this.node` is HTMLButtonElement, not Element, not unknown.
this.node.disabled = false;
this.nodeManager.addListener("click", (e) => {
// `e` is properly typed as MouseEvent.
});
}
}But the real fun begins when we introduce dependencies with the `AbstractDependentWraplet`.
2.3 The dependency map is the type
A wraplet that has children declares them through a plain object that is also a literal type:
import {
AbstractDependentWraplet,
type WrapletDependencyMap,
type DependencyManager,
} from "wraplet";
const map = {
submit: {
selector: "[data-js-form__submit]",
Class: SubmitButton,
required: true,
multiple: false,
},
fields: {
selector: "[data-js-form__field]",
Class: Field,
required: true,
multiple: true,
},
errorBox: {
selector: "[data-js-form__error]",
Class: ErrorBox,
required: false,
multiple: false,
},
} satisfies WrapletDependencyMap;
class Form extends AbstractDependentWraplet<HTMLFormElement, typeof map> {
protected async onInitialize() {
this.d.submit; // SubmitButton (required + single)
this.d.fields; // WrapletSet<Field> (required + multiple)
this.d.errorBox; // ErrorBox | null (optional + single)
}
}A few things worth highlighting from a TS perspective:
satisfies WrapletDependencyMapkeeps the literal types (concreteClassreferences, concreterequired/multiplebooleans) while still validating the object against the framework's contract.typeof mapis then passed as a generic parameter toAbstractDependentWraplet, so the framework can compute the type ofthis.dper-key:required: true, multiple: false-Trequired: false, multiple: false-T | nullrequired: true, multiple: true-WrapletSet<T>required: false, multiple: true-WrapletSet<T> (possibly empty)
Renaming a key in the map updates the type of
this.d.<key>everywhere. Renaming a child wraplet class propagates through the parent's type. "Find usages" actually finds usages.
The dependency map effectively becomes a typed schema of your component tree. The runtime DependencyManager queries the DOM, instantiates the right classes, and hands them back to you typed exactly as the map describes.
2.4 Async lifecycle with typed extension points
onInitialize and onDestroy are well-defined hooks; listeners and child wraplets are tied to that lifecycle, so cleanup is automatic. Lifecycle listeners on dependencies are also typed to the dependency they are attached to:
dm.addDependencyInitializedListener("fields", async (field) => {
// `field` is `Field`, inferred from the map key "fields".
});2.5 Custom injectors - typed too
If for some reason a child shouldn't receive its own DOM node directly (e.g. you want to wrap it in something), you can declare a custom injector on a dependency. The injector's callback is typed against the wraplet's expected constructor input, so a mismatch is a compile error rather than a runtime surprise.
2.6 What this enables practically
Refactoring with confidence: changing the structure of a component (adding/removing a child, switching from single to multiple, making something optional) is a typed change. The compiler walks you through the consequences.
Encapsulation by types, not by convention: parents only see the public methods of their children. There's no implicit "reach into the inner DOM of my child" ? you'd have to add a public method on the child wraplet, which is exactly what you want.
Tests are just
new MyWraplet(node): no framework runtime to boot, no JSX renderer, no JSDOM gymnastics beyond having a node. Types make sure the test is constructing the component correctly.
AI SLOP ENDS
I hope it will be useful for some of you. If you are still reading this, thanks for sticking with me. 😄
r/javascript • u/hongminhee • 5d ago
Optique 1.4.0: Default commands, Markdown references, and more focused help
r/javascript • u/gabrielmfern • Oct 14 '26
I embedded Node.js in a native program to render JSX without a browser and without React
I'm building a UI library in Jai, and this is an experiment with rendering its UI from JavaScript. Node.js is embedded into the program, so the native side reads the JSX objects straight out of V8, with no IPC and no JSON. It then lays out and draws the whole UI from scratch every frame, at 240 Hz on my Linux computer.
Async isn't supported on it yet, and I've only started implementing some event handling. Here's the source code: https://github.com/gabrielmfern/forbear
Has anyone built something like this? If so, I'd love some advice on how I can reduce the C++ layer and have more of it in Jai instead.
r/javascript • u/OtherwisePush6424 • Sep 13 '26
How to Implement a Distributed Circuit Breaker
A circuit breaker in a single Node process is a ring buffer, a threshold and a timestamp. Run the same service on twenty replicas and each one keeps its own, so the failing dependency takes twenty times the damage before anything trips.
Moving the window into Redis fixes that and breaks most of the assumptions the in-process version relies on. Post walks through each one and how to deal with it.
r/javascript • u/bstachenfeld • Feb 10 '17
Generate a Zip File Programmatically with Javascript & React
r/javascript • u/rammysam • Feb 19 '14
JavaScript Frameworks Worth Checking Out
r/javascript • u/Slashy96 • Jul 20 '19
AskJS [AskJS] Are frameworks and libraries going to be completely replaced by plain Javascript?
I recently read about mainstream tech companies replacing their older codes which were using frameworks/libraries with plain/vanilla JS. As far as I understand, the dependencies make development faster and easier. But would the above-mentioned trend spread and would a world come where there just pure javascript exists? As a newbie developer, this thought drives me crazy tbh. lol.
r/javascript • u/desnoth • Jun 23 '17
help Unpopular opinion: I'm still developping with Angular 1.6 and I love it
I choose Angular 1.6 over angular2 or react for my group project because it is much more convenient with Symfony or Laravel back framworks. I don't understand the hate for Angular, without it there will be no React or Vuejs etc.. And i find it very convenient to work with