Skip to content

chore: Rename layout() -> document() #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 27, 2025
Merged

chore: Rename layout() -> document() #193

merged 10 commits into from
Mar 27, 2025

Conversation

justinvdm
Copy link
Collaborator

@justinvdm justinvdm commented Mar 27, 2025

We currently have a layout() API method, which lets the user define the "shell" of their application's html: the stuff that goes in their <head> and <body>, and where the actual page fits into the body.

The document content itself is server-side rendered and served to the user's browser. Within this html, the user chooses the mount point where their actual page content will be situated. This page content is the "dynamic" stuff which updates using React RSC.

Behaviour wise, this is different to layout() as a concept as it is defined in React Router.

To avoid confusing users familiar with React Router, we're renaming layout() to document().

Copy link

cloudflare-workers-and-pages bot commented Mar 27, 2025

Deploying redwood-sdk-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 89b137b
Status: ✅  Deploy successful!
Preview URL: https://78ee80ed.redwood-sdk-docs.pages.dev
Branch Preview URL: https://layout-to-document.redwood-sdk-docs.pages.dev

View logs

@justinvdm justinvdm merged commit 5b92b55 into main Mar 27, 2025
3 checks passed
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