Document layout composition pitfalls#246
Conversation
Coverage Report for CI Build 28264718223Coverage decreased (-1.2%) to 91.469%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions183 previously-covered lines in 7 files lost coverage.
Coverage Stats
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
Adds a new “Layout composition pitfalls” subsection to the README to warn about common silent failure modes when composing nested layouts.
Changes:
- Documented the need to explicitly forward
scriptsandstylesto avoid silently dropping CSS/JS bundles. - Added an example showing how to extend/modify
varsbefore forwarding to a base layout. - Added a checklist-style example calling out forwarding
page,pages, andworkerswhen the base layout relies on them.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I wonder if when rendering pages we should do a simple check for styles and clients to make sure those strings made it in the output and if not emit a warning. |
|
This is mostly good I just want to take one more full pass in an ide before landing. |
f1a8e58 to
af61845
Compare
Add README guidance for common nested layout composition pitfalls, including explicit forwarding of scripts/styles and page-related params, extending vars before forwarding, and pointing to the nested layout asset import docs.
af61845 to
85fa284
Compare
Closes #232
The nested layouts section shows the correct pattern but does not warn about the ways it can silently go wrong. Four pitfalls trip up most users composing layouts for the first time:
scriptsandstylesto the base layout drops all CSS and JS bundles from the page with no error message.page,pages, orworkers, those params must also be forwarded explicitly.This adds a "Layout composition pitfalls" subsection with concrete right/wrong examples for the forwarding cases, plus a pointer to the existing nested layout asset-import documentation for the required
@import/importpattern.