r/typescript • • Apr 03 '26

We rewrote our VIN decoder from SQLite to binary indexes - 100x faster, and our neural net reverse-engineered the VIN spec

51 Upvotes

We built Corgi, an open-source offline VIN decoder. v2 used SQLite which worked fine until we needed to batch decode 1000 VINs and hit 4000 sequential queries.

v3 uses MessagePack-encoded binary indexes with O(log n) lookup:

Cold start: 200ms -> 23ms
Single decode: 30ms -> 0.3ms
Batch 1000: 4 seconds -> 300ms
npm package: 21MB -> 6.5MB (gzip)

The architecture was inspired by @wonderooo's corgi-rs which uses finite-state transducers.

While validating accuracy, we also trained a small transformer (6.6M params) on 50k VIN-vehicle pairs.

It learned the ISO 3779 encoding scheme from data alone - figured out that position 10 encodes model year, that VINs starting with 5YJ are Teslas, etc.

The embeddings cluster vehicles by body type with 0.99 cosine similarity between similar vehicles. All from a 10 digit string.

Blog post with details: https://cardog.app/blog/corgi-v3-binary-indexes


r/typescript • • Apr 03 '26

Multi-LSP support for Astro/Svelte/TS/Vue in Emacs with eglot-typescript-preset

7 Upvotes

eglot-typescript-preset is available, bringing multi-LSP support for TypeScript and web frameworks to Emacs. Using rassumfrassum (rass), an LSP multiplexer by Eglot's author, you can run multiple language servers in one Eglot session.

What you get out of the box:

  • typescript-language-server with ESLint, oxlint, Biome, or oxfmt
  • Astro, Vue, and Svelte support with framework-aware defaults that combine each framework's language server with Tailwind CSS automatically
  • CSS support via vscode-css-language-server + tailwindcss-language-server
  • Executable resolution from project-local node_modules/.bin
  • Per-project config via .dir-locals.el

Setup:

;; Defaults handle CSS, Astro, Vue, Svelte with rass already
(use-package eglot-typescript-preset
  :ensure t)

;; To also add linting for TS/JS files:
(use-package eglot-typescript-preset
  :ensure t
  :custom
  (eglot-typescript-preset-lsp-server 'rass)
  (eglot-typescript-preset-rass-tools
   '(typescript-language-server eslint)))

GitHub: eglot-typescript-preset


r/typescript • • Apr 03 '26

Chronex - an open source tool for automating content scheduling on multiple platforms

Thumbnail
github.com
1 Upvotes

Over the past few weeks, I've been building a platform where users can connect their social accounts and automate content posting.

So I built Chronex, an open-source alternative to paid content schedulers.

Tech Stack

  • Web/Platform: Next.js, tRPC, Drizzle, Better Auth
  • Media Storage: Backblaze B2
  • Scheduling & Posting: Cloudflare Workers & Queues

GitHub

Live


r/typescript • • Apr 02 '26

Bun SQL-agnostic adapter added to UQL v0.7+

2 Upvotes

From u/sooodooo's comment in a past post we did, we got the idea about adding native support for new Bun SQL, so you don't need to install any additional dependencies when using UQL on Bun.

What we shipped:

  • One native Bun path across SQL engines: Bun SQL unifies PostgreSQL/MySQL/SQLite under one API

    • UQL makes it cleaner because we abstract the SQL dialects with our Universal API so your app code stays consistent as you switch engines (Bun SQL docs).
  • Same entity-first API/migrations flow as the rest of UQL
  • No extra pg / mysql2 / better-sqlite3 install for Bun SQL usage
  • Operational simplicity: one runtime, one SQL client model, one ORM API means less cognitive load for full-stack teams.

The hard part wasn't "connecting"; it was making behavior consistent across drivers (JSON, arrays, result normalization, migration safety, etc.) so the apps code stays portable across all the drivers and DBs.

Bun SQL guide: uql-orm.dev/bun-sql
Changelog details: GitHub changelog


r/typescript • • Apr 01 '26

Monthly Hiring Thread Who's hiring Typescript developers April

13 Upvotes

The monthly thread for people to post openings at their companies.

* Please state the job location and include the keywords REMOTE, INTERNS and/or VISA when the corresponding sort of candidate is welcome. When remote work is not an option, include ONSITE.

* Please only post if you personally are part of the hiring company—no recruiting firms or job boards **Please report recruiters or job boards**.

* Only one post per company.

* If it isn't a household name, explain what your company does. Sell it.

* Please add the company email that applications should be sent to, or the companies application web form/job posting (needless to say this should be on the company website, not a third party site).

Commenters: please don't reply to job posts to complain about something. It's off topic here.

Readers: please only email if you are personally interested in the job.

Posting top level comments that aren't job postings, [that's a paddlin](https://i.imgur.com/FxMKfnY.jpg)


r/typescript • • Apr 01 '26

[ haskellish-effect-ts ] -- Haskell-like discipline for TypeScript, enforced by tooling.

0 Upvotes

https://github.com/aiya000/haskellish-effect-ts

This is a set of libraries that, similar to how Haskell enforces I/O types to restrict I/O processing, enforces TypeScript's Effect type (Effect-TS) to restrict I/O (and etc) processing.

We use Devin to such an extent that it could be described as "outsourcing" our operations, but we are feeling limitations in terms of code quality.

Therefore, we devised a structure that uses types to restrict the AI, similar to Haskell.

That's this library set.

---

Overview:

https://x.com/public_ai000ya/status/2038892553563714037?s=20

---

Packages:

- https://www.npmjs.com/package/haskellish-effect

- https://www.npmjs.com/package/eslint-plugin-haskellish-effect

- https://www.npmjs.com/package/haskellish-effect-config


r/typescript • • Apr 01 '26

Why they all use typescript?

0 Upvotes

Why all modern popular cli tools for ai agents (claude code, open code, qwen code, open claw) are written in typescript? Why didn’t they use something like python (also scripting language, popular in ml field), or some statically typed compiled language like go or c#?


r/typescript • • Mar 31 '26

LogicStamp Context: an AST-based context compiler for TypeScript

Thumbnail
github.com
8 Upvotes

I’m building an open-source CLI that compiles TypeScript codebases into deterministic, structured architectural context.

It uses the TypeScript compiler API (via ts-morph) to parse the AST and emit JSON representing components, props, hooks, and dependency relationships in a diffable format.

Key properties: • Deterministic output (same code → same structure) • Strict watch mode + breaking change detection • Diffable architectural contracts • Compact JSON bundles for tooling

Curious how others approach extracting reliable structure from TypeScript - especially for larger codebases.

Repo: https://github.com/LogicStamp/logicstamp-context


r/typescript • • Apr 01 '26

NestflowJS - Decorator-Driven State Machine for NestJS

Thumbnail nestflow.organit.dev
0 Upvotes

Last night I've just released my first NestJS library ever to handle complex state management logic called NestflowJS.

NestflowJS is a decorator-based state machine library for NestJS. Acting as AWS Step Functions alternative but no cloud vendor-lock: define workflows, handle events, and let the orchestrator drive state transitions automatically.

Features:

  1. Tech-stack agnostic: choose your storage, schema validation by extendable builtin class.

  2. No extra library state: only care about your business state and its transition.

  3. Flexible infra: zero runtime dependencies, this can run in any architecture style you can think of thanks to customizable adapter system:

  • Want a strong state machine with no infra overhead? Deploy using Lambda Durable function with prebuilt adapter DurableLambdaEventHandler.

  • Want a high-volume data processing system with full customization of message delivery configs? Create your own Kafka adapter. (Prebuilt adapter coming soon).

-.....A lot more you can think of.

Code example:

import { Workflow, OnEvent, Entity, Payload } from 'nestflow-js/core';

@Workflow({
  name: 'OrderWorkflow',
  states: {
    finals: ['delivered', 'cancelled'],
    idles: ['pending_payment'],
    failed: 'cancelled',
  },
  transitions: [
    { event: 'PAYMENT_RECEIVED', from: ['pending_payment'], to: 'processing' },
    { event: 'SHIP_ORDER', from: ['processing'], to: 'shipped' },
    { event: 'CONFIRM_DELIVERY', from: ['shipped'], to: 'delivered' },
    { event: 'CANCEL', from: ['pending_payment', 'processing'], to: 'cancelled' },
  ],
  entityService: 'entity.order',
})
export class OrderWorkflow {
  @OnEvent('PAYMENT_RECEIVED')
  async onPayment(@Entity() order, @Payload() payload) {
    order.paidAt = new Date();
    return order;
  }
}

Give me a star if you find this helpful!


r/typescript • • Mar 31 '26

Typescript to Silicon - Update

6 Upvotes

A while back I posted my TS-to-SystemVerilog compiler.

Since then I added a bunch of polish and a full end-to-end interactive UART example - you can now control an FPGA-driven WS2812 LED strip in real time from your PC over USB serial, all written in clean TypeScript.

https://github.com/thecharge/sndv-hdl

Would lve feedback, bug reports, or ideas for the next examples.

Have Fun

Demo on r/fpga as here it is forbidden adding images or gif:

https://www.reddit.com/r/FPGA/s/LW9UkzM932


r/typescript • • Mar 30 '26

On Refactoring With Generic Types

Thumbnail radekmie.dev
30 Upvotes

r/typescript • • Mar 30 '26

[Qwen Meetup] TS Function Calling Harness, turning success rate from 6.75% to 100%

Thumbnail
autobe.dev
0 Upvotes

I was personally invited by the Qwen team to speak at Qwen Meetup Korea, and got to present locally here in Korea yesterday — pretty honored to have been reached out to directly.

The talk was about how I got function calling to work reliably on deeply recursive union types — the stuff the industry generally says doesn't work. With qwen3-coder-next, first-try success rate was 6.75%. And the entire Qwen 3.5 model family was hitting 0% on union types due to a consistent double-stringify bug. Both ended up at 100%.

Slides (PPT) are also available in the link — speaker notes are written inside as slide notes if you'd like the full narrative behind each slide.

TL;DR

  1. AutoBe — AI backend auto-generation agent. Not text code, but AST data via function calling. 4 AST types + 4-tier compiler validation + self-healing loops.
  2. Typia — The infrastructure that turns 0% into 100%. A single type automates schema, parser, validator, and feedback generator. Lenient JSON parsing + type coercion + precise validation feedback.
  3. In Praise of Function Calling — Types eliminate ambiguity. Schemas constrain through absence, not prohibition. Model-neutral, mechanically verifiable, deterministically convergent. Applicable to all engineering domains with validators.
  4. Qwen — Small models are the best QA engineers. They expose system vulnerabilities large models silently paper over.
  5. 6.75% is not failure — it's the first input to the loop. If you can verify, you converge.

r/typescript • • Mar 28 '26

Drizzle Resource — type-safe automatic filtering, sorting, pagination and facets for Drizzle ORM

11 Upvotes

Hi everyone, just shipped a query layer for Drizzle that handles filtering, sorting, pagination, search and facets behind one typed contract.

Everything runs automatically with zero SQL to write, but you keep full control over each pipeline stage if you need to plug in optimized queries while the engine handles the rest. Works with any existing schema, no migrations needed.

Core features: 🔍 Full-text search across dot-notation field paths (customer.name, orderLines.product.name) 🔧 AND/OR filter trees with 11 operators 📊 Facets with exclude-self / include-self modes for filter sidebars 🔒 Scope enforcement for multi-tenancy (merged into every request, can't be bypassed) ⚡ Staged pipeline (ids / rows / facets) — each stage replaceable with custom SQL 🔑 All field paths inferred from your schema, typos are compile errors

Quick look:

const result = await ordersResource.query({
  context: { orgId: "acme" },
  request: {
    pagination: { pageIndex: 1, pageSize: 25 },
    sorting: [{ key: "createdAt", dir: "desc" }],
    search: { value: "laptop" },
    filters: {
      type: "group", combinator: "and",
      children: [{ type: "condition", key: "status", operator: "isAnyOf", value: ["pending"] }],
    },
    facets: [{ key: "status", mode: "exclude-self" }],
  },
});
// result.rows / result.rowCount / result.facets

Already pretty performant out of the box, and each pipeline stage is replaceable with custom SQL if you need to push further. Full perf benchmarks in the docs.

Looking for feedback on the API design mostly, and whether the filter/facet shape maps well to what you'd actually send from a table component

Docs: https://drizzle-resource.vercel.app | GitHub: https://github.com/ChronicStone/drizzle-resource


r/typescript • • Mar 27 '26

numpy-ts 1.2.0: float16 support, RNG matching NumPy bit-for-bit, and Bun/Deno/Node/Browser cross-testing

48 Upvotes

Just tagged numpy-ts v1.2.0, which adds float16 support and has a rewritten random module that produces RNG sequences that are bit-for-bit identical to Python NumPy. This was one of the last remaining functional gap compared to NumPy, and random is now ~6x faster as well.

Deno/Bun support is also now first-class with automatic I/O detection (instead of a separate numpy-ts/node entrypoint). And CI/CD now cross-tests Node/Deno/Bun/Chromium.

numpy-ts is now on average just 2x slower than native NumPy, with worst-case performance 14x slower (sin float32) and best-case 50x faster (polydiv float64). Most of the low-hanging fruit for performance has been addressed, so the remaining 2x gap will need memory layout optimization (letting NDArray live in WASM linear memory) and WASM parallel workers (similar to multithreaded BLAS).

Lmk what you think of this update! Contributions are welcome. And as always, here's my AI disclosure.


r/typescript • • Mar 27 '26

A dirty (but incredibly fast) refactoring trick to move properties down the chain

11 Upvotes

Working on a command palette tool recently, I realized my architecture was getting a bit messy. I had a Screen class holding a commandPalette property, but it really belonged in the main App class. Since Screen already had a reference to App, I needed to update all my calls from screen.commandPalette to screen.app.commandPalette.

Instead of writing a complex regex or doing a global find/replace (which we all know is a gamble), I just abused the TS language server.

I went to the commandPalette property definition in the Screen class, hit F2 (Rename Symbol), and literally typed app.commandPalette.

Obviously, TS throws a fit for a split second because app.commandPalette: CommandPaletteType is invalid syntax for a class property declaration. But the language server doesn't care—it still traverses the AST and dutifully updates every single reference across the entire codebase perfectly.

Then I just deleted that broken declaration line in Screen. Done. Whole project refactored in three seconds.

It feels highly illegal, but because TS is actually checking references instead of dumb strings, it's way safer than a global find/replace. Anyone else do this, or am I going to programming jail?


r/typescript • • Mar 28 '26

TypeScript becoming unavoidable

0 Upvotes

At what point did Type Script stop being a major choice and become an ecpectation?A couple years ago it felt optiona but now i see job posts that treat plain JavaScript like a red flag.Junior devs learning JS are basicallty learning a legaccy skill bedore they even start. is this a good thing or are we just complicating things that smaller teams dont actually need?


r/typescript • • Mar 27 '26

open source TS CLI to auto-generate AI helper configs for your projects (13k installs)

0 Upvotes

hey folks, just wanted to share a side project i've been building in node + typescript. it's a cli called calibre (caliber) that scans your typescript project (and any other languages in the repo), figures out your dependencies and frameworks, and auto-generates prompt/config files for ai coding assistants like claude code, cursor and codex. the idea is to keep your ai helper configs up to date as your code evolves. everything runs locally and you plug in your own api keys; nothing leaves your machine. the project is free / mit licensed, has around 13k installs on npm and i'm always looking for feedback or contributions. if you'd like to try it or open issues/prs, the repo is here: https://github.com/caliber-ai-org/ai-setup . cheers!


r/typescript • • Mar 26 '26

Can I apply a decorator to a class to modify all methods in that class?

11 Upvotes

I need to add new functionality to a bunch of methods in a class. Is it possible to just decorate a class to inject that functionality into all methods? The thing is the new functionality is also part of the class itself. Is anything like this possible in TypeScript?


r/typescript • • Mar 26 '26

Generic, Recursive Self Referencing Interface

3 Upvotes

I'm trying to create a generic component in Vue, so I'm trying to understand how to make the generic interface. It's a kind of TreeView component that can recursively reference itself and a generic type that can be passed in for the actual node record. The issue I'm having is if I extend my generic interface, I start getting errors around the canExpand function because I'm not actually referencing the new MyNav interface. Obviously I'd like this to work for any interface that extends from TreeNav, not just MyNav. So let's say I have the following code (fiddle):

interface TreeNav<T = unknown> {
  id: string;
  text: string;
  record?: T;
  parent?: this;
  canExpand?: ((item: this) => boolean) | boolean;
}

interface TreeViewProps<T> {
    // This is wrong, it should be the actual interface, not specifically TreeNav, but how would I access that here?
    items: TreeNav<T>[];
}

interface MyRecord {
    id: string;
}

interface MyNav extends TreeNav<MyRecord> {
    required: boolean;
}

function createTreeNav<T>(nav: TreeViewProps<T>) {

}

const nav: MyNav = {
    id: crypto.randomUUID(),
    text: "Nav",
    required: true,
    record: {
        id: crypto.randomUUID(),
    },
    parent: {
        id: crypto.randomUUID(),
        text: "Parent",
        required: true,
    },
    canExpand(item) {
        console.log(item.required);
        return true;
    }
}

const nav2: TreeNav<MyRecord> = {
    id: crypto.randomUUID(),
    text: "Nav2",
    record: {
        id: crypto.randomUUID(),
    }
}

// Type 'MyNav' is not assignable to type 'TreeNav<MyRecord>'.
createTreeNav({
    items: [nav]
});

createTreeNav({
    items: [nav2]
});

How would I go about fixing this? I'm not sure I'm using the polymorphic this type properly either, but I'd love to hear any suggestions.


r/typescript • • Mar 26 '26

Building a plugin system for a Tauri app where plugins can inject React components into the host UI, would love eyes on the architecture

Thumbnail
github.com
4 Upvotes

I've been working on Tabularis, an open-source database client (Tauri 2 + React + TypeScript). It already has a plugin system for database drivers, they run as separate processes talking JSON-RPC over stdin/stdout. DuckDB, ClickHouse, Redis all work this way. Language-agnostic, process-isolated, nothing fancy.

The problem was: drivers can talk to databases but they can't touch the UI. A PostGIS plugin can't render a map preview of a geometry column. A JSON plugin can't show a syntax tree in the row editor. You're stuck with raw text.

So I've been working on a slot-based UI extension system. Basically 7 named slots across the app: row editor fields, toolbar, context menu, sidebar, etc. Plugins declare which slot they target in their manifest and provide a React component. The host controls layout, the plugin controls content.

I looked at iframes, WASM, and Lua before settling on IIFE bundles loaded from disk. Reasons:

  • manifest controls exactly what gets loaded and where
  • no eval()
  • no raw Tauri access — plugins go through a tabularis/plugin-api typescript package for queries, toasts, settings, theme detection
  • each slot has its own error boundary, 3 crashes in a minute and the plugin gets disabled for the session
  • lazy loaded, zero overhead when no plugins are installed

It's not sandboxed in the iframe sense: plugins run in the same React tree. Tradeoff was: seamless styling and context passing vs full isolation. For a desktop app where you install plugins yourself, felt like the right call. Still not 100% sure tbh.

The whole thing is optional and backwards compatible, existing driver plugins don't need to change anything.

I wrote up the full architecture here if you want the details:

Plugin UI Extensions — Architecture Deep Dive

Still WIP, testing with two plugins right now. If you've built extensibility into a Tauri or Electron app I'd really like to hear how you handled the trust/isolation tradeoff.

And if the architecture looks interesting and you want to contribute: the repo is open, tons of slots to fill and the plugin API is still taking shape.

https://github.com/debba/tabularis


r/typescript • • Mar 25 '26

temporal-style durable workflows in Node + TS

15 Upvotes

I want to share a TypeScript solution for durable workflows:

https://runner.bluelibs.com/guide/durable-workflows

It is part of Runner, but the nice part is you do not need to port your whole app to Runner to use it. You can add the durable workflow capability as an extra piece in an existing system.

The goal is pretty simple: let you write long-running workflows that can survive real production conditions.

It supports:

  • idempotent steps
  • execution-level idempotency keys
  • sleep()
  • starting sub-workflows and waiting for them
  • tracked parent/child execution relationships
  • waiting for outside signals like approvals
  • buffered typed signals
  • timeouts on waits
  • outside cancellation
  • AbortSignal support inside execution
  • compensation / rollback with up() / down() steps
  • recovery on startup
  • durable notes / audit trail
  • execution query / repository APIs
  • operator/admin controls for stuck or failed executions
  • scheduling workflows in the future
  • recurring schedules
  • pause / resume / update / remove schedules
  • serializer support for richer objects, DTOs, references, and circular structures

So you can model flows like:

  1. do some work
  2. wait for approval
  3. sleep until later
  4. kick off another workflow
  5. resume safely
  6. cancel if needed

There are currently 2 built-in durable strategies which can be interchanged:

  • in-memory, with optional file persistence
  • Redis, with optional AMQP queue support for better scaling

The in-memory one is good for playing with it, local development, and tests.

The Redis one is the real distributed setup. The optional queue layer is not required, but it is the recommended direction once you are operating at higher scale.

Another thing I like about the design is that instances can take on different roles:

  • workflow kickstarters
  • workflow consumers/processors
  • workflow schedulers

So you do not have to think in terms of one giant node doing everything. It is meant to work in distributed systems and under high concurrency, with Redis coordinating the durable state, while taking into account race-conditions (recovery, scheduling, execution) and all the fun that comes with it.

The mental model is also pretty approachable:

  • put side effects in durable steps
  • waits and sleeps are persisted
  • recovery happens from stored workflow state
  • signals and cancellation are first-class

And on the ops side, it is not just "can it run?" It also gives you the things you usually end up needing later: inspection, recovery, schedule management, and ways to deal with stuck executions without inventing your own admin layer from scratch.

Anyway, sharing in case this is useful to anyone building long-running backend flows in TypeScript.

An example can be seen here, the system runs decently well under bursts of 1000+ concurrent workflows.

https://github.com/bluelibs/runner/tree/main/examples/agent-orchestration


r/typescript • • Mar 23 '26

Announcing TypeScript 6.0

Thumbnail
devblogs.microsoft.com
341 Upvotes

r/typescript • • Mar 20 '26

numpy-ts is now 8-10x faster with WASM

134 Upvotes

I’ve been working on numpy-ts for the past ~5 months as a way to bring numerical computing to the JS/TS ecosystem. It became functionally complete a month ago, but I frequently heard concerns that it will never perform as well as NumPy’s BLAS and C backend. 

So I’ve spent the past several weeks working on changing that. By writing numerical kernels in Zig, compiling them to WASM, and inlining them in TS source files, I’ve been able to speed up numpy-ts by 8-10x, and it’s now on average only 2.5x slower than native NumPy. It’s still early days and I’m confident that gap can go down. You can check out the benchmarks here. 

The worst performers right now are FFT and complex linalg (around 15x slower than native) while other functions like integer matrix multiplication are 12x faster than native!

I decided on a microkernel architecture to keep numpy-ts completely tree-shakeable. This makes it super portable and keeps the library light. Even with the all kernels and no tree-shaking, it’s under 200kB gzipped. 

This was written by a software engineer with AI assistance. Read my AI disclosure for more info. 


r/typescript • • Mar 20 '26

Question about static properties sharing names with those from the Function prototype

4 Upvotes

The TypeScript Handbook warns that it's generally not safe to overwrite properties from the Function prototype, so certain static names can't be used on classes, such as name, length, and call.

As far as I can tell, the TypeScript compiler no longer surfaces an error or even warning for this if targeting ES2022 or later (still does for ES2021 and prior). Did something change with the spec around either Function or the way static members work around then?