@rsc-kit/mcp 0.37.0 → 0.38.0

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/recipes.js CHANGED
@@ -697,8 +697,8 @@ cache(fn, { tags }) answer it used go out as Cache-Tag: posts,post:1, for a
697
697
  CDN that purges by tag. changed(tag) calls the purge installed with
698
698
  installPurge(async ({ tags }) => ...) from @rsc-kit/core/purge, after the
699
699
  answer has gone - one hook, any CDN's API; a failure is logged, never fails
700
- the change. With RSC_PURGE_URL set it is homeportPurge() with nothing to install; on
701
- Homeport, which sets HOMEPORT_PURGE_URL, that is read when RSC_PURGE_URL is not. Rsc::changed() and reg.Changed() post their own purge
700
+ the change. With CDN_PURGE_URL set it is cdnPurge() with nothing to install;
701
+ CDN_PURGE_URL is the ONLY name read (RSC_PURGE_URL and HOMEPORT_PURGE_URL no longer are; homeportPurge() is now cdnPurge(), no alias). Rsc::changed() and reg.Changed() post their own purge
702
702
  there, since a backend's change never passes through the engine. The host also keeps the page itself - ISR on every host: a
703
703
  repeat request is answered from the kept copy (X-RSC-Kit: cached, Age); past
704
704
  revalidate the stale copy goes out at once while one render replaces it;
@@ -1687,6 +1687,15 @@ kept; with none named a folder's url is its path. Same string on server and
1687
1687
  browser; works in <Link>, visit() and redirect(). Do NOT build
1688
1688
  \`//\${slug}.\${host}\` by hand or read the request host for links.
1689
1689
 
1690
+ A folder only ever seen on its subdomain: rscKit({ hosts: [...], subdomains:
1691
+ ['merchant'] }). Then example.com/merchant/orders is a 301 to
1692
+ merchant.example.com/orders (not on localhost); <Link href="/merchant/orders">,
1693
+ visit() and redirect() go to the subdomain with no hostUrl; on the subdomain
1694
+ href="/pricing" goes to the site; Laravel's route('merchant.orders') is the
1695
+ subdomain url. example.com/merchant is then the subdomain's home - a landing
1696
+ page goes in its own folder (app/sell/). Needs hosts and app/merchant/, or dev
1697
+ and the build stop.
1698
+
1690
1699
  \`\`\`tsx
1691
1700
  // src/app/[domain]/layout.tsx
1692
1701
  export default async function TenantLayout({ params, children }) {
@@ -1892,8 +1901,16 @@ when the renderer is in front. Name the backend's prefixes, and they are
1892
1901
  forwarded BEFORE any page is asked: rscKit({ backendPaths: ['/auth', '/github',
1893
1902
  '/gitlab'] }). A prefix at a segment boundary (/auth, not /authors), every
1894
1903
  method; '/', /_rsc and the host-call endpoint (/__rsc/host-call) are refused; a
1895
- team called auth is then unreachable. The build lists them as backendPaths in
1896
- .output/rsc-kit.json ([] when none), so a proxy in front sends them straight to
1904
+ team called auth is then unreachable. A whole segment in brackets is any one
1905
+ segment: backendPaths: ['/login/[provider]'] is /login/google and what is under
1906
+ it, NOT /login, which stays the page - for a backend route with a parameter
1907
+ under a url that is a page. A page it would cover (login/forgot/page.tsx) stops
1908
+ dev and the build, since it would never render; a dynamic FIRST segment and a
1909
+ catch-all are refused; nothing is checked per request. Prefer a prefix of the
1910
+ backend's own ('/auth') when the urls can move. The build lists the plain
1911
+ prefixes as backendPaths in
1912
+ .output/rsc-kit.json ([] when none; a dynamic one is left out and goes through
1913
+ the renderer), so a proxy in front sends them straight to
1897
1914
  the backend instead of through the renderer. The renderer never forwards a
1898
1915
  browser's request for the host-call endpoint: it answers with its not-found page. Do NOT
1899
1916
  write catch-all route.ts files that forward by hand: that copies the forwarding.
@@ -1954,6 +1971,10 @@ Billing/Invoices). Do NOT hand-write the attributes from memory; the command
1954
1971
  writes the ones the registry reads, and it writes the manifest
1955
1972
  (rsc-host.json) too - a running dev server restarts on its own when it
1956
1973
  changes, so the export is importable when the command returns.
1974
+ One dev server per app: a second vite names the one already running (composer
1975
+ dev, Herd's artisan dev or an editor may have started it) - use that one. In a
1976
+ terminal the second exits, naming the pid to stop; under a runner it waits and
1977
+ starts when the first stops. A vite that sits waiting is not hung.
1957
1978
  Server actions are classes in app/Rsc/Actions, found by reflection in PHP;
1958
1979
  \`php artisan rsc:host-manifest\` writes rsc-host.json - { actions,
1959
1980
  functions } - and vite.config.ts runs it as dev and every build start: