Skip to content

docs: surface progressive enhancement + SSR-safe component patterns#3

Merged
vivek7405 merged 1 commit into
mainfrom
docs/progressive-enhancement
May 17, 2026
Merged

docs: surface progressive enhancement + SSR-safe component patterns#3
vivek7405 merged 1 commit into
mainfrom
docs/progressive-enhancement

Conversation

@vivek7405

Copy link
Copy Markdown
Collaborator

Summary

  • Makes the progressive-enhancement story first-class across every surface AI agents and users encounter (README, AGENTS.md, website landing card, dedicated docs page + sidenav entry, getting-started, architecture, components, lifecycle)
  • Bakes the SSR constructor-state rule into the scaffolded AGENTS.md Component pattern and CONVENTIONS.md template — agents writing apps will set defaults in the constructor, not connectedCallback
  • Adds a "Client navigation patterns" section to the scaffolded AGENTS.md covering layout persistence, the 4xx-HTML-render-in-place validation pattern, <webjs-frame>, loading.ts/error.ts, and what you do NOT need to write
  • Bridges the Tier-1 UI helpers section to the new client-navigation section

No framework code changed — docs and scaffold templates only.

Test plan

  • All touched docs pages return HTTP 200 locally (verified during development)
  • No unescaped backticks inside html\...`` template bodies (would 500 prod)
  • Sidenav entry for /docs/progressive-enhancement appears under Core Concepts

🤖 Generated with Claude Code

webjs SSRs pages AND every web component to real HTML, so first paint
is the right content with JS disabled. This was the existing
architecture but wasn't documented or marketed as such. This commit
makes the story first-class across every surface AI agents and users
encounter.

Framework-facing:
- README.md: new "Progressive enhancement, built in." bullet in Why webjs
- AGENTS.md: new "SSR-safe state defaults" subsection clarifying which
  lifecycle hooks run server-side (constructor + render) vs browser-only
- website landing: new "Progressive Enhancement by Default" feature card

Docs site:
- New /docs/progressive-enhancement page with full design rationale,
  6 design rules, browser-only data patterns, JS-disabled testing
  checklist
- /docs/components: new "SSR and the first paint" section with bad/good
  code pair and a data-source-routing table
- /docs/lifecycle: new "SSR vs Browser: which hooks run where" table
- /docs/getting-started + /docs/architecture: PE bullets/sections
- Sidenav entry added under Core Concepts

Scaffolded app guidance (what AI agents see when writing apps):
- packages/cli/templates/AGENTS.md: constructor-state rule baked into
  the Component pattern example; new Invariant #7; new "Client
  navigation patterns" section covering layout persistence, form +
  4xx-HTML render-in-place validation, <webjs-frame> escape hatch,
  loading.ts / error.ts, the "what you do NOT need to write" list;
  bridge sentence linking Tier-1 UI helpers to partial-swap submission
- packages/cli/templates/CONVENTIONS.md: new "Progressive enhancement
  (write HTML-first)" section + data-source-routing table
- .cursorrules, .windsurfrules: one-liner each pointing into AGENTS.md
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.

1 participant