diff --git a/.changeset/pre.json b/.changeset/pre.json index 83e12f3..0d1be23 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -12,6 +12,7 @@ "bump-solid-beta-26", "bump-solid-beta-28", "clean-lazy-entries", + "client-build-first-normal-order", "client-manifest-outdir", "compiler-package-rename", "dev-css-and-client-manifest", @@ -28,6 +29,7 @@ "native-babel-free-refresh", "native-compiler-option", "native-server-function-transform", + "root-relative-filter-globs", "sc-bootstrap-before-hydration-data", "scoped-server-function-dce", "server-components-option", diff --git a/CHANGELOG.md b/CHANGELOG.md index a703c11..33669ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,50 @@ # Changelog +## 3.0.0-next.20 + +### Patch Changes + +- 528a7bb: Move the `solid:client-build-first` buildApp hook from `pre` to normal + order, and make its post-order `/complete` companion defer to any other + plugin that declares a non-pre `buildApp` hook of its own. + + Pre-order `buildApp` hooks are where host plugins do destructive + preparation: nitro v3's `nitro:prepare` rm -rf's the output directory from + a pre-order hook. Sorted at `pre`, our client build could run before that + cleanup (hook order within `pre` follows plugin registration), so the + client bundle and manifest it had just emitted were wiped, the subsequent + server build baked in the manifest-less fallback, and the production build + served 500s with no client assets — the `solid({ ssr })` + `nitro()` + composition was broken out of the box. + + Normal order still satisfies the hook's original purpose (client before + any server-first orchestrator): config-level `builder.buildApp` + orchestrators (@cloudflare/vite-plugin builds workers before the client) + are invoked by Vite only after all pre- and normal-order plugin hooks, and + hook-based orchestrators (nitro's `nitro:main`, cloudflare's companion + hook) declare post order. The `/complete` hook now also treats another + plugin's non-pre `buildApp` hook as a claim on the app build even before + it runs, instead of preempting a post-order orchestrator's staged build + (nitro prerenders and copies public assets before its final server bundle, + and knows which environments to skip). Plain `builder: {}` setups keep the + reinstated build-everything fallback, unchanged. + + Covered by a new turnkey e2e mode (builder-prepare) that builds against a + nitro-shaped host: a pre-order output-wiping hook plus a post-order + ssr-building orchestrator that skips already-built environments. + +- 60ba309: Resolve relative filter globs against the Vite root instead of `process.cwd()`. + + The server-functions plugin's default include glob + (`src/**/*.{jsx,tsx,ts,js,mjs,cjs}`) is relative, and `createFilter` resolved + it against the invocation directory — so running `vite` from anywhere other + than the project root silently skipped server-function compilation entirely + (no transform, no registration). Both filters (the main plugin's + `include`/`exclude` and `serverFunctions.filter`) are now created in + `configResolved` with patterns resolved against `config.root`; user-provided + relative patterns become root-relative too, and absolute patterns are + unaffected. + ## 3.0.0-next.19 ### Patch Changes diff --git a/package.json b/package.json index 16d2435..4eb1544 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vite-plugin-solid", - "version": "3.0.0-next.19", + "version": "3.0.0-next.20", "description": "solid-js integration plugin for vite 6/7/8", "type": "module", "files": [