Back to browse
GitHub Repository

A ponyfill (polyfill) for the browser Navigation API

12 starsTypeScript

I made a polyfill for the browser Navigation API

by kcrwfrd_·Feb 18, 2026·3 points·0 comments

AI Analysis

●●SolidNiche GemWizardry
The Take

The author has done the annoying work most teams avoid: reproducing enough of the Navigation API to reliably detect back/forward availability and current entries, while deferring to native window.navigation when present and keeping the bundle under ~3KB gzipped. It ships with a side-effect-free core, a pragmatic default that patches history for apps that need it, tests and a Next.js example — the missing bits (navigate lifecycle/interceptors) are called out as the next work, so this feels like a practical, well-scoped tool rather than vaporware.

Target Audience

Frontend developers building single-page applications (Next.js/Vite/etc.), engineers who need reliable back-button and history handling

Post Description

Hi HN, I'm excited to share my polyfill for the Navigation API that I've been working on for the past couple of months.

The Navigation API has landed in the newest versions of all the modern browsers, and supersedes the older History API with some much-needed improvements for developing single-page applications. I've been chomping at the bit to use it in prod, and I created this polyfill so I could do so.

As it stands, I feel really good about its support for currentEntry, entries(), canGoBack/canGoForward, and the currententrychange event.

Where the Navigation API gets really interesting is in its navigation transition lifecycle management with the navigate event, navigation interceptors, and so on--which I plan on tackling next.

It has zero runtime dependencies, and bundlejs.com reports it weighing in at 2.95 kB after bundling and gzip.

I'm hoping to get any feedback and gauge interest as I think about how to approach polyfilling the rest of the API. Thank you for taking a look!

Similar Projects

AI/MLMid

PicoGPT – GPT in a QR Code

The author minified Karpathy’s MicroGPT, ported it to 39 lines of JS (including a tiny autograd, MHA, AdamW and training loop) and shoehorned the whole gzipped HTML into a version-40 QR code that the browser decompresses and runs. It's clearly a stunt — the model is toy-scale (≈4k params, 8-token context) — but the compression trick, browser-native DecompressionStream use, and runnable-in-QR delivery are a delightful technical flex.

WizardryCrowd Pleaser
kuberwastaken
104mo ago
Open Source●●Solid

Rethinking the UI = F(State) Model

Targets fuse data and behavior into ordered, self-contained blocks so your code reads like a sequence (width animates, then color, then fetch) instead of juggling promises and external animation libs. The built-in Web Animations usage and the $$ wait-syntax are neat, opinionated moves — but it's still a bold, niche bet against mature motion ecosystems and will need strong integration stories to win broad adoption.

Big BrainBold Bet
ahmadwasfi
103mo ago
Developer Tools●●Solid

Python UI-Me – Turn functions into web forms with one decorator

Drop @ui_enabled on a function and you get an instant Flask-backed web form with inputs inferred from type hints, a sidebar for global variables, and a searchable collapsible JSON result viewer. It's a deliberate tiny alternative to Streamlit/Gradio — no React or npm, just vanilla HTML/JS with grouping and theming; excellent for converting one-off scripts into a control panel, but expect limited auth, validation, and scaling features.

Niche GemShip It
tusharnaik
103mo ago