@mandujs/core 0.18.3 → 0.18.6
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/package.json +8 -2
- package/src/bundler/build.ts +53 -16
- package/src/bundler/css.ts +337 -302
- package/src/bundler/dev.ts +63 -6
- package/src/bundler/types.ts +6 -0
- package/src/config/mandu.ts +1 -1
- package/src/config/validate.ts +1 -1
- package/src/contract/registry.ts +591 -568
- package/src/resource/generator.ts +5 -4
- package/src/router/fs-scanner.ts +4 -4
- package/src/runtime/escape.ts +12 -0
- package/src/runtime/server.ts +1 -1
- package/src/runtime/ssr.ts +27 -10
- package/src/runtime/streaming-ssr.ts +34 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mandujs/core",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.6",
|
|
4
4
|
"description": "Mandu Framework Core - Spec, Generator, Guard, Runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -44,7 +44,13 @@
|
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": "^19.0.0",
|
|
47
|
-
"react-dom": "^19.0.0"
|
|
47
|
+
"react-dom": "^19.0.0",
|
|
48
|
+
"@tailwindcss/cli": ">=4.0.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependenciesMeta": {
|
|
51
|
+
"@tailwindcss/cli": {
|
|
52
|
+
"optional": true
|
|
53
|
+
}
|
|
48
54
|
},
|
|
49
55
|
"dependencies": {
|
|
50
56
|
"chokidar": "^5.0.0",
|
package/src/bundler/build.ts
CHANGED
|
@@ -482,10 +482,6 @@ function generateReactDOMShimSource(): string {
|
|
|
482
482
|
import ReactDOM, {
|
|
483
483
|
createPortal,
|
|
484
484
|
flushSync,
|
|
485
|
-
render,
|
|
486
|
-
unmountComponentAtNode,
|
|
487
|
-
findDOMNode,
|
|
488
|
-
hydrate,
|
|
489
485
|
version,
|
|
490
486
|
} from 'react-dom';
|
|
491
487
|
|
|
@@ -493,10 +489,6 @@ import ReactDOM, {
|
|
|
493
489
|
export {
|
|
494
490
|
createPortal,
|
|
495
491
|
flushSync,
|
|
496
|
-
render,
|
|
497
|
-
unmountComponentAtNode,
|
|
498
|
-
findDOMNode,
|
|
499
|
-
hydrate,
|
|
500
492
|
version,
|
|
501
493
|
};
|
|
502
494
|
|
|
@@ -1213,20 +1205,65 @@ export async function buildClientBundles(
|
|
|
1213
1205
|
};
|
|
1214
1206
|
}
|
|
1215
1207
|
|
|
1216
|
-
//
|
|
1217
|
-
|
|
1208
|
+
// 부분 빌드 모드: targetRouteIds가 지정되면 해당 Island만 재빌드 (#122)
|
|
1209
|
+
if (options.targetRouteIds && options.targetRouteIds.length > 0) {
|
|
1210
|
+
const targetRoutes = hydratedRoutes.filter((r) => options.targetRouteIds!.includes(r.id));
|
|
1211
|
+
|
|
1212
|
+
for (const route of targetRoutes) {
|
|
1213
|
+
try {
|
|
1214
|
+
const result = await buildIsland(route, rootDir, outDir, options);
|
|
1215
|
+
outputs.push(result);
|
|
1216
|
+
} catch (error) {
|
|
1217
|
+
errors.push(`[${route.id}] ${String(error)}`);
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
// 기존 매니페스트를 읽어 변경된 Island만 갱신
|
|
1222
|
+
let existingManifest: BundleManifest;
|
|
1223
|
+
try {
|
|
1224
|
+
const manifestData = await fs.readFile(path.join(rootDir, ".mandu/manifest.json"), "utf-8");
|
|
1225
|
+
existingManifest = JSON.parse(manifestData) as BundleManifest;
|
|
1226
|
+
} catch {
|
|
1227
|
+
// 기존 매니페스트 없으면 전체 빌드로 재시도 (targetRouteIds 제거)
|
|
1228
|
+
return buildClientBundles(manifest, rootDir, { ...options, targetRouteIds: undefined });
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
for (const output of outputs) {
|
|
1232
|
+
if (existingManifest.bundles[output.routeId]) {
|
|
1233
|
+
existingManifest.bundles[output.routeId].js = output.outputPath;
|
|
1234
|
+
} else {
|
|
1235
|
+
const route = targetRoutes.find((r) => r.id === output.routeId);
|
|
1236
|
+
const hydration = route ? getRouteHydration(route) : null;
|
|
1237
|
+
existingManifest.bundles[output.routeId] = {
|
|
1238
|
+
js: output.outputPath,
|
|
1239
|
+
dependencies: ["_runtime", "_react"],
|
|
1240
|
+
priority: hydration?.priority || HYDRATION.DEFAULT_PRIORITY,
|
|
1241
|
+
};
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
await fs.writeFile(
|
|
1246
|
+
path.join(rootDir, ".mandu/manifest.json"),
|
|
1247
|
+
JSON.stringify(existingManifest, null, 2)
|
|
1248
|
+
);
|
|
1249
|
+
|
|
1250
|
+
const stats = calculateStats(outputs, startTime);
|
|
1251
|
+
return { success: errors.length === 0, outputs, errors, manifest: existingManifest, stats };
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
// 3-4. Runtime, Router, Vendor 번들 병렬 빌드 (서로 독립적)
|
|
1255
|
+
const [runtimeResult, routerResult, vendorResult] = await Promise.all([
|
|
1256
|
+
buildRuntime(outDir, options),
|
|
1257
|
+
buildRouterRuntime(outDir, options),
|
|
1258
|
+
buildVendorShims(outDir, options),
|
|
1259
|
+
]);
|
|
1260
|
+
|
|
1218
1261
|
if (!runtimeResult.success) {
|
|
1219
1262
|
errors.push(...runtimeResult.errors.map((e) => `[Runtime] ${e}`));
|
|
1220
1263
|
}
|
|
1221
|
-
|
|
1222
|
-
// 3.5. Client-side Router 런타임 빌드
|
|
1223
|
-
const routerResult = await buildRouterRuntime(outDir, options);
|
|
1224
1264
|
if (!routerResult.success) {
|
|
1225
1265
|
errors.push(...routerResult.errors.map((e) => `[Router] ${e}`));
|
|
1226
1266
|
}
|
|
1227
|
-
|
|
1228
|
-
// 4. Vendor shim 번들 빌드 (React, ReactDOM, ReactDOMClient)
|
|
1229
|
-
const vendorResult = await buildVendorShims(outDir, options);
|
|
1230
1267
|
if (!vendorResult.success) {
|
|
1231
1268
|
errors.push(...vendorResult.errors);
|
|
1232
1269
|
}
|