# youtube/spfjs

A lightweight JS framework for fast navigation and page updates from YouTube

Repository: https://github.com/youtube/spfjs
Canonical: https://ross.abutalabs.com/products/spfjs
Homepage: https://youtube.github.io/spfjs/
Language: JavaScript
License: MIT
License Family: permissive
Archived: true
Last push: 2024-10-09T18:58:17+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4506, "days_push": 693, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2276, forks 159 (observed 2026-08-28T04:06:33.447631+00:00)

## What it is
SPF (Structured Page Fragments) is a lightweight JavaScript framework from YouTube for fast navigation and partial page updates. It uses progressive enhancement and HTML5 to update only changed page sections during navigation, with fragment responses, script/style management, and an in-memory cache.

## Use cases
- speed up navigation on a multi-page site without a full SPA rewrite
- update only parts of a page that change between navigations
- keep a persistent responsive UI during page transitions
- serve document fragments as JSON from any server-side language
- cache responses in memory for instant back/forward navigation
- stream multipart responses to start rendering early

## When to choose
- you have a server-rendered site and want SPA-like navigation with minimal changes
- you want a tiny (~10K) dependency-free client library
- you need progressive enhancement where links still work without JS
- you want to reuse the same templates for static and dynamic rendering

## When to avoid
- you are starting a new project - modern SPA frameworks or View Transitions API are better supported
- you need a full component-based frontend framework
- your site is already a single-page application
- you need active community development - the project is in maintenance mode

## Facets
- artifact type: framework
- maturity: maintenance
- function: web-framework, caching, templating, http-client
- domain: web-development, frontend, performance
- platform: browser
- tags: progressive-enhancement, page-fragments, single-page-navigation, youtube, html5-history, javascript, nodejs

## Member repositories
- youtube/spfjs (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:33.447631+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:41:28.219167+00:00, confidence not recorded.
  - readme: https://github.com/youtube/spfjs (fetched 2026-08-28T04:06:33.447631+00:00, sha aac431c7b37d)
  - homepage: https://youtube.github.io/spfjs/ (fetched 2026-08-29T10:22:13.728540+00:00, sha 122f0e177647)
- Data as of 2026-08-30T08:39:29.467469+00:00.
