Skip to content

docs(webviewer): add Initial Props page#278

Merged
toddgeist merged 2 commits into
mainfrom
docs/webviewer-initial-props
May 21, 2026
Merged

docs(webviewer): add Initial Props page#278
toddgeist merged 2 commits into
mainfrom
docs/webviewer-initial-props

Conversation

@eluce2
Copy link
Copy Markdown
Collaborator

@eluce2 eluce2 commented May 20, 2026

Summary

  • New docs page at /docs/webviewer/initial-props covering the pull-not-push pattern for bootstrap data.
  • Emphasizes that the web viewer should call fmFetch to ask for props once loaded, rather than FileMaker pushing them in via HTML substitution or FileMaker.PerformJavaScriptInWebViewer (both race the bundle load).
  • Notes that in the ProofKit template the fetch runs before the router mounts, so the first render can already depend on FileMaker state.
  • Two examples: initial route (TanStack hash router) and current user (zod-validated identity object).
  • Sidebar entry added to meta.json under Concepts, between commands and platform-notes.

Test plan

  • pnpm run ci passes
  • Page renders in local docs dev server with correct TOC, sidebar placement, callouts, and code blocks

Summary by CodeRabbit

  • Documentation
    • Added a new doc page describing the initial-props bootstrap pattern for the Web Viewer with copy-ready examples and guidance.
    • Updated Web Viewer docs navigation to include the new "initial-props" page in the Concepts section.

Review Change Stack

Document the pull-not-push pattern for bootstrap data: web viewer
fetches initial props via fmFetch once mounted, rather than FileMaker
pushing via HTML substitution or PerformJavaScriptInWebViewer (which
races the bundle load). Includes initial-route and current-user
examples.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

⚠️ No Changeset found

Latest commit: e56512d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
proofkit-docs Ready Ready Preview, Comment May 21, 2026 5:30pm

Request Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 20, 2026

Open in StackBlitz

@proofkit/better-auth

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/better-auth@278

@proofkit/cli

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/cli@278

create-proofkit

pnpm add https://pkg.pr.new/proofsh/proofkit/create-proofkit@278

@proofkit/fmdapi

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/fmdapi@278

@proofkit/fmodata

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/fmodata@278

@proofkit/typegen

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/typegen@278

@proofkit/webviewer

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/webviewer@278

commit: e56512d

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 447bdc4b-5f2e-43c3-a4b9-65bd7b19aee5

📥 Commits

Reviewing files that changed from the base of the PR and between 5cb5d3a and e56512d.

📒 Files selected for processing (1)
  • apps/docs/content/docs/webviewer/initial-props.mdx

📝 Walkthrough

Walkthrough

Adds a new Web Viewer docs page describing a pull-based initial props bootstrap using fmFetch with zod validation, examples for initial routing and current-user bootstrapping, React startup gating, and a navigation entry for the page.

Changes

Initial Props Documentation

Layer / File(s) Summary
Concept and foundation
apps/docs/content/docs/webviewer/initial-props.mdx, apps/docs/content/docs/webviewer/meta.json
Introduces initial props as a pull-based startup pattern, explains timing/race cautions, shows the basic zod-validated getInitialProps shape, and adds the page slug to the navigation metadata.
Initial route example
apps/docs/content/docs/webviewer/initial-props.mdx
Router factory example that reads initialRoute from GetInitialProps, validates it with zod, and conditionally sets window.location.hash; includes the FileMaker callback payload shape.
Current user example
apps/docs/content/docs/webviewer/initial-props.mdx
Shows fetching current user via GetInitialProps with a zod schema and gating React boot by awaiting a props promise using React.use inside a Suspense boundary.
Alternatives and guidance
apps/docs/content/docs/webviewer/initial-props.mdx
Documents when not to use initial props and recommends explicit fmFetch refreshes or FileMaker-initiated PerformJavaScriptInWebViewer pushes after the handshake for mutable values.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a new documentation page about Initial Props for the WebViewer component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/webviewer-initial-props

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

@toddgeist toddgeist merged commit c694a8a into main May 21, 2026
20 checks passed
@toddgeist toddgeist deleted the docs/webviewer-initial-props branch May 21, 2026 17:32
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