Skip to content

Reframe front.js as an educational reference implementation - #1

Open
watthem wants to merge 5 commits into
mainfrom
claude/browser-reactivity-eval-s27fr4
Open

Reframe front.js as an educational reference implementation#1
watthem wants to merge 5 commits into
mainfrom
claude/browser-reactivity-eval-s27fr4

Conversation

@watthem

@watthem watthem commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Description

Repositions front.js from an abandoned-looking prototype into a deliberate educational reference implementation and portfolio piece: a small, tested, readable exploration of how modern front-end frameworks actually work (fine-grained reactivity/signals, Islands Architecture, secure-by-default hydration). The framework code is unchanged — this PR is about positioning, honest docs, cleanup, and two interactive teaching demos.

The work lands in four coherent steps (one commit each):

  1. Reframe + cleanup. Reference-implementation framing in the README; a guided walkthrough of the ~150-line reactivity engine (docswebsite/docs/guides/how-reactivity-works.md) that ends with the one limitation a production signals library solves and this one deliberately doesn't. Removed mid-refactor debris: byte-identical duplicate root src/+tests/, stale build.config.js, package.json.old. Fixed the invalid npm scope @front.js/*@frontjs/* (dots aren't legal in npm scopes — it could not have published). Fixed a watch-mode test script that hung CI (vitestvitest run).
  2. Learning path. An audience-defined curriculum (website/docs/guides/README.md) that sequences the guides, plus a content north-star (docs/strategy/AUDIENCE.md) and a fact-checked "Platform First" guide on the new HTTP QUERY method (RFC 10008).
  3. Live QUERY demo. A front.js island that fetches with method: 'QUERY' (query in the body), answered by a Service Worker so it's a real request on the wire with no backend.
  4. Live Signal Graph demo. A reactive dependency-graph visualization built from real val/run primitives — change a value, watch exactly which derived values and effects recompute (and which don't).

Related Issue

N/A — positioning/documentation initiative.

Type of Change

  • New feature (non-breaking change which adds functionality) — two interactive examples
  • Documentation update
  • Code refactoring — removed legacy duplication, fixed packaging/test-script issues
  • Breaking change
  • Bug fix
  • Performance improvement
  • Test addition or update

Checklist

Code Quality

  • Follows the project's code style guidelines
  • JSDoc on the new example components
  • Functions kept small and focused
  • Error handling is graceful and non-fatal (the QUERY demo degrades without a Service Worker; islands isolate failures)

Testing

  • npm test passes (79 tests across @frontjs/core and @frontjs/actions)
  • Tested manually with the examples; both new demos verified end-to-end with Playwright + Chromium
  • No framework runtime changed, so no core test changes were required
  • XSS protection unaffected (rendering still via uhtml)

Bundle Size

  • npm run size-check passes — runtime holds at 1.43 KB gzipped (budget 5 KB). No runtime code changed.

Documentation

  • Updated the README (reference-implementation framing, guided Learn path, repointed stale links)
  • API/engine internals documented in docs/architecture/ENGINE.md and the new reactivity walkthrough (the template's wiki/API.md path predates the docs move)
  • docs/architecture/BLUEPRINT.md reviewed — no architectural change (framework code untouched)
  • Verified alignment with docs/architecture/STANDARDS.md (Headless Reactivity, Platform First)

Security

  • No eval() or new Function()
  • Input validated; the QUERY Service Worker rejects non-QUERY verbs
  • User content escaped via uhtml
  • No server closures or function serialization

Deployment

  • Works on root and sub-path deployments (relative paths throughout)
  • Tested locally over http (Service Workers require a secure context; the demo shows a fallback notice on file://)
  • No hardcoded absolute paths

Verification (Playwright + Chromium)

Both interactive demos were driven headless and asserted, not eyeballed:

  • QUERY demo — the request goes out as QUERY and the Service Worker observes request.method === 'QUERY' verbatim (no normalization), on both initial load and a reactive re-query. HTTP 200, zero console errors.
  • Signal Graph — changing a recomputes only the a + b → × 2 → log₁ chain and never the branch (and vice-versa), confirming fine-grained isolation. 8 nodes render, zero console errors.

Additional Notes

  • The claims in the QUERY and reactivity guides are fact-checked against primary sources (RFC 10008, the WHATWG Fetch Standard, and the framework's own source), with sources linked inline.
  • A private, git-ignored fact-check vault backs those claims; it is intentionally not part of this PR (.gitignore reserves vault/, Vaults/, *.private.md so it can't leak).
  • Note: the PR template's checklist references some pre-move doc paths (wiki/API.md, docs/BLUEPRINT.md); those live under docs/architecture/ now, and the checklist above reflects the real locations.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CJcGUWDv2fo2sTwKqC5nBG


Generated by Claude Code

claude added 5 commits July 25, 2026 19:46
…egacy duplication

Repositions front.js as a readable, tested reference implementation of
browser reactivity + Islands Architecture (portfolio piece) rather than a
production framework, and clears the mid-refactor debris that made it read
as abandoned.

- Add website/docs/guides/how-reactivity-works.md: a guided walkthrough of
  the ~150-line reactivity engine (val/run/calc, currentRun tracking, error
  isolation), including an honest write-up of the dependency-cleanup
  limitation that a production signals library solves and this one omits.
- Reframe README with a reference-implementation banner and repoint all
  stale links (wiki/*, docs/BLUEPRINT.md, examples/, CDN) to their real
  relocated targets under docs/architecture, docs/strategy, website/.
- Fix invalid npm scope @front.js/* -> @frontjs/* (dots are not allowed in
  npm scope names; the packages could not have published as-is).
- Fix watch-mode test hang: package `test` scripts now use `vitest run`,
  with `test:watch` for the watch workflow.
- Remove legacy single-package duplication now superseded by the monorepo:
  root src/, tests/ (byte-identical to packages/core/tests/), build.config.js,
  and package.json.old. Point tsconfig include at packages/*/src.
- Update CLAUDE.md to describe the actual monorepo layout and repoint its
  doc references.

All 79 tests pass; bundle holds at 1.43 KB gzipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CJcGUWDv2fo2sTwKqC5nBG
Leans into the reference-implementation positioning: turn the docs into a
teaching resource organized around who the site is for, and add a
fact-checked "Platform First" guide on the new HTTP QUERY method.

- website/docs/guides/README.md: an audience-defined learning path that
  sequences the existing guides into a curriculum (Orientation → Reactivity
  → Platform → Integrating → Edges), each step stating prerequisites.
- website/docs/guides/query-method.md: teaches the HTTP QUERY method
  (RFC 10008, Proposed Standard, June 2026) — the read-with-a-body verb —
  and how a front.js island fetches with it. Includes the real fetch()
  gotchas (uppercase method token, cross-origin preflight, server support),
  each checked against the WHATWG Fetch Standard, with sources linked inline.
- docs/strategy/AUDIENCE.md: content north-star — primary audiences, what
  each needs, and the principle that every load-bearing fact is verified
  against a primary source before publishing.
- README: link the guided Learn path from the front door; add an author's
  note framing the project as a public learning space.
- .gitignore: reserve vault/, Vaults/, and *.private.md so the private
  fact-check knowledge base can never leak into the public repo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CJcGUWDv2fo2sTwKqC5nBG
…0008)

A working, in-page demonstration of the QUERY verb — dogfooded as a front.js
island — that runs on a static host with no backend.

- website/examples/query-method.html/.js: a search island that fetches with
  `method: 'QUERY'`, putting the query in the request body. Includes an
  "On the wire" inspector showing the method sent, the method the server
  received (proving it arrives verbatim), the HTTP status, and the JSON body.
- website/examples/query-sw.js: a Service Worker that intercepts the request,
  reads the method exactly as it arrived, and answers from a client-side
  catalog — so it's a real QUERY request observable in DevTools → Network,
  with no origin server. Rejects non-QUERY verbs with 405 to teach semantics.
- Verified end-to-end with Playwright + Chromium: the request goes out as
  QUERY and the worker observes `request.method === 'QUERY'` (no
  normalization), on both the initial load and a reactive re-query.
- Registered in examples.json (tested: true) and featured on the examples
  index; the QUERY guide now links the live demo.
- Fix a dangling import in the disabled github-user.js example that pointed at
  the removed root src/ (now uses ../front.esm.js like the other examples).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CJcGUWDv2fo2sTwKqC5nBG
…ivity

An interactive dependency-graph visualization, dogfooded as a front.js island
and rendered reactively with uhtml's svg tag.

- website/examples/signal-graph.html/.js: two independent reactive chains
  (a,b → a+b → ×2 → log₁ and c → c² → log₂) built from real val + run
  primitives. Each derived node is an actual run, so the highlight you see is
  genuine re-execution, not an animation. Nudging a value lights up only the
  branch that depends on it and shows per-node recompute counts, making the
  core lesson — work is proportional to the dependency graph — visible.
- Verified with Playwright + Chromium: changing `a` recomputes only the a/b
  chain and never the c branch (and vice-versa); 8 nodes render, no console
  errors.
- Registered in examples.json (tested: true), featured on the examples index,
  and linked from the "How the Reactivity Works" guide as a see-it-first entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CJcGUWDv2fo2sTwKqC5nBG
Add "How the Reactivity Works" and "The QUERY Method" to the docs app's
navigation registry so they appear in the site's Guides sidebar, not just from
GitHub and the README. Both follow the same guides/*.md pattern as the existing
entries and are fetched relative to /docs/.

The Learn-path README landing is intentionally left out of the SPA nav: its body
is a list of .md cross-links, which the docs app's link handler doesn't route
(a pre-existing quirk). It remains the front door on GitHub, where those links
resolve correctly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CJcGUWDv2fo2sTwKqC5nBG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants