create-rsc-kit 0.30.19 → 0.30.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/templates.js +7 -1
- package/package.json +1 -1
package/dist/templates.js
CHANGED
|
@@ -677,6 +677,10 @@ ${o.host === 'laravel'
|
|
|
677
677
|
- **Live data**: \`refreshOn\` on the section and \`changed()\` where the data
|
|
678
678
|
changes. \`usePolling\` only for data nothing can announce. Never
|
|
679
679
|
\`setInterval\` with \`refresh()\`.
|
|
680
|
+
- **What every tab shares** (a header, a status) lives in the layout, as a
|
|
681
|
+
section in its own \`<Suspense>\` when it shows data that changes - never drawn
|
|
682
|
+
again in each tab's page, where a tab switch replaces it with the page's
|
|
683
|
+
fallback. Any page under the layout can refresh it by name.
|
|
680
684
|
${o.host === 'laravel' || o.backend
|
|
681
685
|
? `- **Authorisation lives in the backend**, in the function the call reaches${o.host === 'laravel' ? ' - \`#[Authenticated]\`, \`#[Can]\`, a policy' : ' - its guard or the handler'} - never only in the component that shows the button.`
|
|
682
686
|
: `- **Every action and query is built from the client in \`${o.sourceDir}/server/client.ts\`**,
|
|
@@ -897,7 +901,9 @@ A section that names what it depends on refreshes in every open tab when
|
|
|
897
901
|
something says that changed - a webhook, a job, another visitor:
|
|
898
902
|
|
|
899
903
|
\`\`\`tsx
|
|
900
|
-
|
|
904
|
+
const ReposSection = section('repos', Repos, { refreshOn: ({ params }) => [\`team:\${params.team}:repos\`] })
|
|
905
|
+
|
|
906
|
+
export default ReposSection // named: an editor offers a call's default export as reposSection
|
|
901
907
|
\`\`\`
|
|
902
908
|
|
|
903
909
|
\`\`\`ts
|