@vertz/ui-server 0.2.13 → 0.2.15
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/bun-dev-server.d.ts +8 -1
- package/dist/bun-dev-server.js +10 -14
- package/package.json +4 -4
package/dist/bun-dev-server.d.ts
CHANGED
|
@@ -130,9 +130,16 @@ declare function createFetchInterceptor({ apiHandler, origin, skipSSRPaths, orig
|
|
|
130
130
|
*/
|
|
131
131
|
declare function buildScriptTag(bundledScriptUrl: string | null, hmrBootstrapScript: string | null, clientSrc: string): string;
|
|
132
132
|
/**
|
|
133
|
+
* Clear the entire require.cache so SSR module re-import picks up all changes,
|
|
134
|
+
* including files outside src/ (e.g., generated files, shared libs).
|
|
135
|
+
*
|
|
136
|
+
* Returns the number of cache entries cleared.
|
|
137
|
+
*/
|
|
138
|
+
declare function clearSSRRequireCache(): number;
|
|
139
|
+
/**
|
|
133
140
|
* Create a unified Bun dev server with SSR + HMR.
|
|
134
141
|
*
|
|
135
142
|
* SSR is always on. HMR always works. No mode toggle needed.
|
|
136
143
|
*/
|
|
137
144
|
declare function createBunDevServer(options: BunDevServerOptions): BunDevServer;
|
|
138
|
-
export { parseHMRAssets, generateSSRPageHtml, formatTerminalRuntimeError, createRuntimeErrorDeduplicator, createFetchInterceptor, createBunDevServer, buildScriptTag, SSRPageHtmlOptions, HMRAssets, FetchInterceptorOptions, ErrorDetail, ErrorCategory, BunDevServerOptions, BunDevServer };
|
|
145
|
+
export { parseHMRAssets, generateSSRPageHtml, formatTerminalRuntimeError, createRuntimeErrorDeduplicator, createFetchInterceptor, createBunDevServer, clearSSRRequireCache, buildScriptTag, SSRPageHtmlOptions, HMRAssets, FetchInterceptorOptions, ErrorDetail, ErrorCategory, BunDevServerOptions, BunDevServer };
|
package/dist/bun-dev-server.js
CHANGED
|
@@ -1509,6 +1509,13 @@ function buildScriptTag(bundledScriptUrl, hmrBootstrapScript, clientSrc) {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
return `<script type="module" src="${clientSrc}"></script>`;
|
|
1511
1511
|
}
|
|
1512
|
+
function clearSSRRequireCache() {
|
|
1513
|
+
const keys = Object.keys(__require.cache);
|
|
1514
|
+
for (const key of keys) {
|
|
1515
|
+
delete __require.cache[key];
|
|
1516
|
+
}
|
|
1517
|
+
return keys.length;
|
|
1518
|
+
}
|
|
1512
1519
|
function createBunDevServer(options) {
|
|
1513
1520
|
const {
|
|
1514
1521
|
entry,
|
|
@@ -2188,14 +2195,7 @@ data: {}
|
|
|
2188
2195
|
} catch {}
|
|
2189
2196
|
if (stopped)
|
|
2190
2197
|
return;
|
|
2191
|
-
const
|
|
2192
|
-
let cacheCleared = 0;
|
|
2193
|
-
for (const key of cacheKeys) {
|
|
2194
|
-
if (key.startsWith(srcDir) || key.startsWith(entryPath)) {
|
|
2195
|
-
delete __require.cache[key];
|
|
2196
|
-
cacheCleared++;
|
|
2197
|
-
}
|
|
2198
|
-
}
|
|
2198
|
+
const cacheCleared = clearSSRRequireCache();
|
|
2199
2199
|
logger.log("watcher", "cache-cleared", { entries: cacheCleared });
|
|
2200
2200
|
const ssrWrapperPath = resolve(devDir, "ssr-reload-entry.ts");
|
|
2201
2201
|
mkdirSync(devDir, { recursive: true });
|
|
@@ -2218,12 +2218,7 @@ data: {}
|
|
|
2218
2218
|
await new Promise((r) => setTimeout(r, 500));
|
|
2219
2219
|
if (stopped)
|
|
2220
2220
|
return;
|
|
2221
|
-
|
|
2222
|
-
for (const key of retryKeys) {
|
|
2223
|
-
if (key.startsWith(srcDir) || key.startsWith(entryPath)) {
|
|
2224
|
-
delete __require.cache[key];
|
|
2225
|
-
}
|
|
2226
|
-
}
|
|
2221
|
+
clearSSRRequireCache();
|
|
2227
2222
|
mkdirSync(devDir, { recursive: true });
|
|
2228
2223
|
writeFileSync2(ssrWrapperPath, `export * from '${entryPath}';
|
|
2229
2224
|
`);
|
|
@@ -2287,5 +2282,6 @@ export {
|
|
|
2287
2282
|
createRuntimeErrorDeduplicator,
|
|
2288
2283
|
createFetchInterceptor,
|
|
2289
2284
|
createBunDevServer,
|
|
2285
|
+
clearSSRRequireCache,
|
|
2290
2286
|
buildScriptTag
|
|
2291
2287
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertz/ui-server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Vertz UI server-side rendering runtime",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@ampproject/remapping": "^2.3.0",
|
|
59
59
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
60
|
-
"@vertz/core": "^0.2.
|
|
61
|
-
"@vertz/ui": "^0.2.
|
|
62
|
-
"@vertz/ui-compiler": "^0.2.
|
|
60
|
+
"@vertz/core": "^0.2.14",
|
|
61
|
+
"@vertz/ui": "^0.2.14",
|
|
62
|
+
"@vertz/ui-compiler": "^0.2.14",
|
|
63
63
|
"magic-string": "^0.30.0",
|
|
64
64
|
"ts-morph": "^27.0.2"
|
|
65
65
|
},
|