create-rsc-kit 0.30.17 → 0.30.18
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 +11 -2
- package/package.json +1 -1
package/dist/templates.js
CHANGED
|
@@ -108,12 +108,18 @@ export function scripts(o) {
|
|
|
108
108
|
// imported by name, which a compile embeds, where the server's own
|
|
109
109
|
// computed import is invisible to it.
|
|
110
110
|
//
|
|
111
|
+
// --splitting makes compile.mjs its own chunk. Bun parses every module
|
|
112
|
+
// in a binary before it runs the first line of any, and a stop that
|
|
113
|
+
// arrives in that time is the default action: a worker told to stop
|
|
114
|
+
// while a large app is being parsed exits 143. The chunk that holds
|
|
115
|
+
// the signal runs first. A no-op until src/commands has a file.
|
|
116
|
+
//
|
|
111
117
|
// Into dist/, which is already ignored. Named after the project it
|
|
112
118
|
// landed a 63MB binary in the root of, next to the source, with
|
|
113
119
|
// nothing in .gitignore covering it.
|
|
114
120
|
...(o.host === 'bun'
|
|
115
121
|
? {
|
|
116
|
-
compile: `${vite} build && bun build --compile .output/server/compile.mjs --outfile dist/app`,
|
|
122
|
+
compile: `${vite} build && bun build --compile --splitting .output/server/compile.mjs --outfile dist/app`,
|
|
117
123
|
}
|
|
118
124
|
: {}),
|
|
119
125
|
}),
|
|
@@ -782,7 +788,10 @@ export — \`export default async (args: string[]) => 0\` — run as \`./app mig
|
|
|
782
788
|
from the compiled binary or \`node .output/server/commands.mjs migrate\` from a
|
|
783
789
|
plain build. It shares the app's code, so there is no second entry point or
|
|
784
790
|
binary to write. The return value is the exit code, and \`register()\` runs for a
|
|
785
|
-
command only if it exports \`register = true\`.
|
|
791
|
+
command only if it exports \`register = true\`. A worker's second argument is
|
|
792
|
+
\`{ signal, deadline }\` (\`CommandContext\`, from \`@rsc-kit/core/commands\`): loop on
|
|
793
|
+
\`signal.aborted\`, and read \`context.deadline\` when needed, never destructure it.
|
|
794
|
+
Keep \`--splitting\` in the \`compile\` script: it is what lets a worker hold a stop that arrives while Bun parses the binary. Never run a command as
|
|
786
795
|
\`node .output/server/index.mjs migrate\`: that is the server, and it starts.
|
|
787
796
|
|
|
788
797
|
${o.pwa ? `## Installable
|