Hacker Newsnew | past | comments | ask | show | jobs | submit | gkoos's commentslogin

I got tired of reimplementing timeout/retry logic, so I built a thin fetch() wrapper.

const client = createClient({ timeout: 5000, retries: 3, circuit: { threshold: 5, reset: 30000 } }) const response = await client('/api/data') // exactly like fetch()

Drop-in replacement, zero deps, ~2KB. Has lifecycle hooks for auth/logging, exponential backoff with jitter, respects Retry-After headers, and proper AbortSignal composition. Preserves all native fetch behavior.

https://github.com/gkoos/ffetch

Thoughts?


Hey, I write a tech blog and I need to create lots of diagrams for it. I like using Mermaid, but I quickly ran into the same frustrating pattern with most of the existing editors and renderers: the free options were either too limited or came with barriers that slowed me down. I wanted something simple: just open the page, paste/type in Mermaid code, preview the diagram, and export it without worrying about limits or accounts. Here are some concrete problems I ran into with other tools: - Mermaid Live Editor (the official one): Great for quick editing, but exporting diagrams is capped by a rate limit on their free tier. After a handful of exports, I’d get the dreaded “free tier limit exceeded” message. Kroki.io: Supports rendering, but running it online requires trusting a shared service with my diagrams. Hosting it myself means extra setup, Docker, and server resources — not ideal if I just want to save a few diagrams. - Excalidraw & Lucidchart: Both have nice UIs, but they’re general diagramming tools, not native Mermaid editors. Lucidchart especially locks useful features (like unlimited diagrams or high-quality export) behind a paid plan. - Other browser-based tools Almost all I tried had some kind of paywall, signup requirement, or watermark on exports. For something as text-based and simple as Mermaid, that felt unnecessary. So I built my own tool with a few core principles: - No limits: you can create, edit, and export as many diagrams as you want. - No signup: the tool works straight from the browser, nothing to install. - No tracking: privacy-friendly, just you and your diagrams. - Open source: https://github.com/gkoos/mermaid-editor Now this is a very simple v0.0.1 and needs a lot of refinement, but hopefully it can be useful to some even in its current state.


Some legal departments are against AGPL and that might affect adoption.


Looks neat. A few things though: 1. Deep equality checks on every dispatch may become expensive for large, deeply nested objects. 2. Auto-generated partial dispatchers can obscure what actually happens in updates. 3. Middleware API is Redux-like, but can't see support for async flows (like thunks or sagas).


These rules were developed in 2006 to strengthen static analysis of C code in high-stakes environments. I don't think they apply to many here.


Good start, covers the big GitLab pitfalls (auth, runners, vars, project config). The the fun part to be added: runner isolation/cleanup, built-in scans (SAST/dep/secret), logging/audit trails, push-rules (signed commits), and secret management practices. Solid so far tho.


Agreed! Those are indeed some nice pointers to add.


Paywall saved me from a read rage but even the first couple of lines made me wanna do things to the author :D


Nothing you could do to him is worse than what he's doing to himself.


In every JS/TS project, be it frontend or backend, you usually have to fetch some data. And when you go into production, you realise you need something more resilient than the native fetch.

There are some libraries on npm, but I found them either too dumb or doing too much, so I built my own.

- Timeouts - per-request or global - Retries - user-defined, defaults to exponential back-off + jitter - Circuit breaker - trip after N failures - Hooks - logging, auth, metrics, request/response transformation - Per-request overrides - customize behavior on a per-request basis - Universal - Node, Browser, Cloudflare Workers, React Native - Zero runtime deps - ships as dual ESM/CJS - Written in TypeScript

Any feedback is welcome, here or in the github repo (https://github.com/gkoos/ffetch).


Looks neat. When you detect anomalies, how can you tell whether it's the cloud provider or the public internet or a transient peer tho?


For data and control plane I can determine the issue from the API request/response logs (i.e., network timeout, 5xx, etc.). Network tests are trickier and we don't have a great way to validate failure cause each of those events (i.e., we don't capture a traceroute on failure), other than to evaluate results from multiple endpoint combinations (e.g., AWS us-east-1 to us-west-1 fails while us-east-2 to us-west-1 succeeds).


For networking, the site only reports uptime % for zonal, regional, cross-region or cross-cloud tests. It excludes last mile network tests as those fail frequently due to many hops and endpoint unreliability (we use Ripe Atlas and Globalping.io endpoints which are not always reliable even with redundant probes per test).


In Guix, packages are typically dynamically linked against libraries in the store. Static linking changes not just the configure flags, but also how dependencies are pulled in - you'd have to make sure every dependency is available as a static .a library for the target platform and many Guix packages aren't built with static artifacts at all.


So I can understand needing to modify the build flags for all dependencies to generate static artefacts for the final binary, and regenerating these from scratch... but still, isn't that just a single extra parameter in their compile args?


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: