theokit 0.48.9 → 0.48.10
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/{agent-SK4TOO6M.js → agent-QMVAEQ7I.js} +2 -2
- package/dist/{build-FMRO4W4Q.js → build-GYRWWCLA.js} +2 -2
- package/dist/{chunk-YML4ZDFA.js → chunk-7BCC4BCR.js} +85 -5
- package/dist/{chunk-YML4ZDFA.js.map → chunk-7BCC4BCR.js.map} +1 -1
- package/dist/{chunk-Q2S2IGSM.js → chunk-7UMA5DY4.js} +85 -5
- package/dist/{chunk-Q2S2IGSM.js.map → chunk-7UMA5DY4.js.map} +1 -1
- package/dist/{chunk-SO64VQOD.js → chunk-NGE76BEX.js} +2 -2
- package/dist/cli/index.js +4 -4
- package/dist/{dev-P2MODWTG.js → dev-K27SUPJD.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{mcp-EQHTPQ2L.js → mcp-3JORKAFI.js} +2 -2
- package/dist/vite-plugin/index.js +1 -1
- package/dist/{vite-plugin-EQMDMDXV.js → vite-plugin-SM5MHOJZ.js} +2 -2
- package/package.json +3 -3
- /package/dist/{agent-SK4TOO6M.js.map → agent-QMVAEQ7I.js.map} +0 -0
- /package/dist/{build-FMRO4W4Q.js.map → build-GYRWWCLA.js.map} +0 -0
- /package/dist/{chunk-SO64VQOD.js.map → chunk-NGE76BEX.js.map} +0 -0
- /package/dist/{dev-P2MODWTG.js.map → dev-K27SUPJD.js.map} +0 -0
- /package/dist/{mcp-EQHTPQ2L.js.map → mcp-3JORKAFI.js.map} +0 -0
- /package/dist/{vite-plugin-EQMDMDXV.js.map → vite-plugin-SM5MHOJZ.js.map} +0 -0
|
@@ -1380,11 +1380,31 @@ function generateSingleShotEntry(options) {
|
|
|
1380
1380
|
return [
|
|
1381
1381
|
`import React, { Suspense } from 'react'`,
|
|
1382
1382
|
`import { renderToPipeableStream } from 'react-dom/server'`,
|
|
1383
|
-
`import { createStaticHandler, createStaticRouter, StaticRouterProvider } from 'react-router'`,
|
|
1383
|
+
`import { createStaticHandler, createStaticRouter, StaticRouterProvider, matchRoutes } from 'react-router'`,
|
|
1384
1384
|
`import { PassThrough } from 'node:stream'`,
|
|
1385
|
-
`import { routes } from '/@theo/route-manifest'`,
|
|
1385
|
+
`import { routes, __theoPreloadMap } from '/@theo/route-manifest'`,
|
|
1386
1386
|
theoUiImport,
|
|
1387
1387
|
`export async function render(url, options = {}) {`,
|
|
1388
|
+
// Resolve the matched pages BEFORE rendering.
|
|
1389
|
+
//
|
|
1390
|
+
// Pages are React.lazy() in the route manifest, which is right for the browser and pure loss
|
|
1391
|
+
// here: the server already has every chunk on local disk. Rendering without this makes React
|
|
1392
|
+
// suspend on the page component, so \`onShellReady\` fires with the layout alone and the actual
|
|
1393
|
+
// page streams afterwards inside a hidden div. The reader gets an empty frame that fills in --
|
|
1394
|
+
// measured at CLS 1.12 and an article absent from the DOM for ~700ms on a real site.
|
|
1395
|
+
//
|
|
1396
|
+
// This mirrors what entry.ts already does before hydrateRoot, using the same preload map.
|
|
1397
|
+
// Streaming still applies to genuine data-fetching Suspense, which is where it earns its keep.
|
|
1398
|
+
// A failed import is swallowed on purpose: React.lazy will retry and suspend as before, which
|
|
1399
|
+
// is strictly no worse than not having preloaded at all.
|
|
1400
|
+
` const __theoMatches = matchRoutes(routes, url.split('?')[0]) ?? []`,
|
|
1401
|
+
` await Promise.all(`,
|
|
1402
|
+
` __theoMatches`,
|
|
1403
|
+
` .map((m) => m.route && m.route.path)`,
|
|
1404
|
+
` .filter((p) => typeof p === 'string' && p in __theoPreloadMap)`,
|
|
1405
|
+
` .map((p) => __theoPreloadMap[p]().catch(() => null)),`,
|
|
1406
|
+
` )`,
|
|
1407
|
+
``,
|
|
1388
1408
|
` const handler = createStaticHandler(routes)`,
|
|
1389
1409
|
` const request = new Request('http://localhost' + url)`,
|
|
1390
1410
|
` const context = await handler.query(request)`,
|
|
@@ -1429,6 +1449,26 @@ function streamingWebRenderer(appTree) {
|
|
|
1429
1449
|
`// Response with the stream as body. Honors request.signal for client`,
|
|
1430
1450
|
`// disconnect cleanup.`,
|
|
1431
1451
|
`export async function renderStreamingWeb(request, options = {}) {`,
|
|
1452
|
+
// Resolve the matched pages BEFORE rendering.
|
|
1453
|
+
//
|
|
1454
|
+
// Pages are React.lazy() in the route manifest, which is right for the browser and pure loss
|
|
1455
|
+
// here: the server already has every chunk on local disk. Rendering without this makes React
|
|
1456
|
+
// suspend on the page component, so \`onShellReady\` fires with the layout alone and the actual
|
|
1457
|
+
// page streams afterwards inside a hidden div. The reader gets an empty frame that fills in --
|
|
1458
|
+
// measured at CLS 1.12 and an article absent from the DOM for ~700ms on a real site.
|
|
1459
|
+
//
|
|
1460
|
+
// This mirrors what entry.ts already does before hydrateRoot, using the same preload map.
|
|
1461
|
+
// Streaming still applies to genuine data-fetching Suspense, which is where it earns its keep.
|
|
1462
|
+
// A failed import is swallowed on purpose: React.lazy will retry and suspend as before, which
|
|
1463
|
+
// is strictly no worse than not having preloaded at all.
|
|
1464
|
+
` const __theoMatches = matchRoutes(routes, url.split('?')[0]) ?? []`,
|
|
1465
|
+
` await Promise.all(`,
|
|
1466
|
+
` __theoMatches`,
|
|
1467
|
+
` .map((m) => m.route && m.route.path)`,
|
|
1468
|
+
` .filter((p) => typeof p === 'string' && p in __theoPreloadMap)`,
|
|
1469
|
+
` .map((p) => __theoPreloadMap[p]().catch(() => null)),`,
|
|
1470
|
+
` )`,
|
|
1471
|
+
``,
|
|
1432
1472
|
` const handler = createStaticHandler(routes)`,
|
|
1433
1473
|
` const url = new URL(request.url)`,
|
|
1434
1474
|
` const context = await handler.query(request)`,
|
|
@@ -1461,6 +1501,26 @@ function streamingNodeRenderer(appTree) {
|
|
|
1461
1501
|
`// Flushes the shell as soon as it's ready, then streams Suspense boundaries.`,
|
|
1462
1502
|
`// EC-11: respects request.signal for client-disconnect cleanup.`,
|
|
1463
1503
|
`export async function renderStreaming(url, response, options = {}) {`,
|
|
1504
|
+
// Resolve the matched pages BEFORE rendering.
|
|
1505
|
+
//
|
|
1506
|
+
// Pages are React.lazy() in the route manifest, which is right for the browser and pure loss
|
|
1507
|
+
// here: the server already has every chunk on local disk. Rendering without this makes React
|
|
1508
|
+
// suspend on the page component, so \`onShellReady\` fires with the layout alone and the actual
|
|
1509
|
+
// page streams afterwards inside a hidden div. The reader gets an empty frame that fills in --
|
|
1510
|
+
// measured at CLS 1.12 and an article absent from the DOM for ~700ms on a real site.
|
|
1511
|
+
//
|
|
1512
|
+
// This mirrors what entry.ts already does before hydrateRoot, using the same preload map.
|
|
1513
|
+
// Streaming still applies to genuine data-fetching Suspense, which is where it earns its keep.
|
|
1514
|
+
// A failed import is swallowed on purpose: React.lazy will retry and suspend as before, which
|
|
1515
|
+
// is strictly no worse than not having preloaded at all.
|
|
1516
|
+
` const __theoMatches = matchRoutes(routes, url.split('?')[0]) ?? []`,
|
|
1517
|
+
` await Promise.all(`,
|
|
1518
|
+
` __theoMatches`,
|
|
1519
|
+
` .map((m) => m.route && m.route.path)`,
|
|
1520
|
+
` .filter((p) => typeof p === 'string' && p in __theoPreloadMap)`,
|
|
1521
|
+
` .map((p) => __theoPreloadMap[p]().catch(() => null)),`,
|
|
1522
|
+
` )`,
|
|
1523
|
+
``,
|
|
1464
1524
|
` const handler = createStaticHandler(routes)`,
|
|
1465
1525
|
` const request = new Request('http://localhost' + url, { signal: options.signal })`,
|
|
1466
1526
|
` const context = await handler.query(request)`,
|
|
@@ -1503,6 +1563,26 @@ function backCompatRenderer(appTree) {
|
|
|
1503
1563
|
`// Backward compatibility: keep the single-shot render export available so`,
|
|
1504
1564
|
`// callers that always used 'render()' don't break when streaming is on.`,
|
|
1505
1565
|
`export async function render(url, options = {}) {`,
|
|
1566
|
+
// Resolve the matched pages BEFORE rendering.
|
|
1567
|
+
//
|
|
1568
|
+
// Pages are React.lazy() in the route manifest, which is right for the browser and pure loss
|
|
1569
|
+
// here: the server already has every chunk on local disk. Rendering without this makes React
|
|
1570
|
+
// suspend on the page component, so \`onShellReady\` fires with the layout alone and the actual
|
|
1571
|
+
// page streams afterwards inside a hidden div. The reader gets an empty frame that fills in --
|
|
1572
|
+
// measured at CLS 1.12 and an article absent from the DOM for ~700ms on a real site.
|
|
1573
|
+
//
|
|
1574
|
+
// This mirrors what entry.ts already does before hydrateRoot, using the same preload map.
|
|
1575
|
+
// Streaming still applies to genuine data-fetching Suspense, which is where it earns its keep.
|
|
1576
|
+
// A failed import is swallowed on purpose: React.lazy will retry and suspend as before, which
|
|
1577
|
+
// is strictly no worse than not having preloaded at all.
|
|
1578
|
+
` const __theoMatches = matchRoutes(routes, url.split('?')[0]) ?? []`,
|
|
1579
|
+
` await Promise.all(`,
|
|
1580
|
+
` __theoMatches`,
|
|
1581
|
+
` .map((m) => m.route && m.route.path)`,
|
|
1582
|
+
` .filter((p) => typeof p === 'string' && p in __theoPreloadMap)`,
|
|
1583
|
+
` .map((p) => __theoPreloadMap[p]().catch(() => null)),`,
|
|
1584
|
+
` )`,
|
|
1585
|
+
``,
|
|
1506
1586
|
` const handler = createStaticHandler(routes)`,
|
|
1507
1587
|
` const request = new Request('http://localhost' + url)`,
|
|
1508
1588
|
` const context = await handler.query(request)`,
|
|
@@ -1543,8 +1623,8 @@ function generateStreamingEntry(options) {
|
|
|
1543
1623
|
return [
|
|
1544
1624
|
`import React, { Suspense } from 'react'`,
|
|
1545
1625
|
`import { renderToPipeableStream, renderToReadableStream } from 'react-dom/server'`,
|
|
1546
|
-
`import { createStaticHandler, createStaticRouter, StaticRouterProvider } from 'react-router'`,
|
|
1547
|
-
`import { routes } from '/@theo/route-manifest'`,
|
|
1626
|
+
`import { createStaticHandler, createStaticRouter, StaticRouterProvider, matchRoutes } from 'react-router'`,
|
|
1627
|
+
`import { routes, __theoPreloadMap } from '/@theo/route-manifest'`,
|
|
1548
1628
|
theoUiImport,
|
|
1549
1629
|
``,
|
|
1550
1630
|
...streamingWebRenderer(appTree),
|
|
@@ -2121,4 +2201,4 @@ export {
|
|
|
2121
2201
|
theoPluginAsync,
|
|
2122
2202
|
theoPlugin
|
|
2123
2203
|
};
|
|
2124
|
-
//# sourceMappingURL=chunk-
|
|
2204
|
+
//# sourceMappingURL=chunk-7UMA5DY4.js.map
|