@pyreon/runtime-server 0.23.0 → 0.24.0
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/lib/analysis/index.js.html +1 -1
- package/lib/index.js +5 -5
- package/package.json +3 -3
- package/src/index.ts +5 -5
|
@@ -5386,7 +5386,7 @@ var drawChart = (function (exports) {
|
|
|
5386
5386
|
</script>
|
|
5387
5387
|
<script>
|
|
5388
5388
|
/*<!--*/
|
|
5389
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src/index.ts","uid":"
|
|
5389
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src/index.ts","uid":"7e676d25-1"}]}],"isRoot":true},"nodeParts":{"7e676d25-1":{"renderedLength":17671,"gzipLength":5697,"brotliLength":0,"metaUid":"7e676d25-0"}},"nodeMetas":{"7e676d25-0":{"id":"/src/index.ts","moduleParts":{"index.js":"7e676d25-1"},"imported":[{"uid":"7e676d25-2"},{"uid":"7e676d25-3"}],"importedBy":[],"isEntry":true},"7e676d25-2":{"id":"node:async_hooks","moduleParts":{},"imported":[],"importedBy":[{"uid":"7e676d25-0"}]},"7e676d25-3":{"id":"@pyreon/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"7e676d25-0"}]}},"env":{"rollup":"4.23.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
5390
5390
|
|
|
5391
5391
|
const run = () => {
|
|
5392
5392
|
const width = window.innerWidth;
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
-
import { ForSymbol, Fragment, Suspense,
|
|
2
|
+
import { ForSymbol, Fragment, Suspense, cx, getContextStackLength, makeReactiveProps, normalizeStyleValue, popContext, runWithHooks, setContextStackProvider } from "@pyreon/core";
|
|
3
3
|
|
|
4
4
|
//#region src/index.ts
|
|
5
5
|
/**
|
|
@@ -136,7 +136,7 @@ async function streamComponentNode(vnode, enqueue) {
|
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
if (__DEV__) _countSink.__pyreon_count__?.("runtime-server.component");
|
|
139
|
-
const stackLenBefore =
|
|
139
|
+
const stackLenBefore = getContextStackLength();
|
|
140
140
|
try {
|
|
141
141
|
const { vnode: output } = runWithHooks(vnode.type, mergeChildrenIntoProps(vnode));
|
|
142
142
|
const resolved = output instanceof Promise ? await output : output;
|
|
@@ -207,7 +207,7 @@ async function streamSuspenseBoundary(vnode, enqueue) {
|
|
|
207
207
|
const { fallback, children } = vnode.props;
|
|
208
208
|
/* c8 ignore start */
|
|
209
209
|
if (!ctx) {
|
|
210
|
-
const stackLenBefore =
|
|
210
|
+
const stackLenBefore = getContextStackLength();
|
|
211
211
|
const { vnode: output } = runWithHooks(Suspense, vnode.props);
|
|
212
212
|
try {
|
|
213
213
|
if (output !== null) await streamNode(output, enqueue);
|
|
@@ -295,7 +295,7 @@ async function renderChildren(children) {
|
|
|
295
295
|
}
|
|
296
296
|
async function renderComponent(vnode) {
|
|
297
297
|
if (__DEV__) _countSink.__pyreon_count__?.("runtime-server.component");
|
|
298
|
-
const stackLenBefore =
|
|
298
|
+
const stackLenBefore = getContextStackLength();
|
|
299
299
|
const { vnode: output } = runWithHooks(vnode.type, mergeChildrenIntoProps(vnode));
|
|
300
300
|
let html;
|
|
301
301
|
try {
|
|
@@ -323,7 +323,7 @@ async function renderComponent(vnode) {
|
|
|
323
323
|
* effect of `provide()` (its context frame) without firing other hooks.
|
|
324
324
|
*/
|
|
325
325
|
function trimContextStack(targetLen) {
|
|
326
|
-
let current =
|
|
326
|
+
let current = getContextStackLength();
|
|
327
327
|
while (current > targetLen) {
|
|
328
328
|
popContext();
|
|
329
329
|
current--;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pyreon/runtime-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "SSR/SSG renderer for Pyreon — streaming HTML + static generation",
|
|
5
5
|
"homepage": "https://github.com/pyreon/pyreon/tree/main/packages/runtime-server#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"prepublishOnly": "bun run build"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@pyreon/core": "^0.
|
|
47
|
-
"@pyreon/reactivity": "^0.
|
|
46
|
+
"@pyreon/core": "^0.24.0",
|
|
47
|
+
"@pyreon/reactivity": "^0.24.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@pyreon/manifest": "0.13.1"
|
package/src/index.ts
CHANGED
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
import { AsyncLocalStorage } from 'node:async_hooks'
|
|
17
17
|
import type { ClassValue, ComponentFn, ForProps, VNode, VNodeChild } from '@pyreon/core'
|
|
18
18
|
import {
|
|
19
|
-
captureContextStack,
|
|
20
19
|
cx,
|
|
21
20
|
ForSymbol,
|
|
22
21
|
Fragment,
|
|
22
|
+
getContextStackLength,
|
|
23
23
|
makeReactiveProps,
|
|
24
24
|
normalizeStyleValue,
|
|
25
25
|
popContext,
|
|
@@ -319,7 +319,7 @@ async function streamComponentNode(vnode: VNode, enqueue: (s: string) => void):
|
|
|
319
319
|
// remove its registered tags from the head store; running it during SSR
|
|
320
320
|
// wipes the entries before `renderWithHead` reads them). See `renderComponent`
|
|
321
321
|
// for the full architectural rationale.
|
|
322
|
-
const stackLenBefore =
|
|
322
|
+
const stackLenBefore = getContextStackLength()
|
|
323
323
|
try {
|
|
324
324
|
const { vnode: output } = runWithHooks(
|
|
325
325
|
vnode.type as ComponentFn,
|
|
@@ -432,7 +432,7 @@ async function streamSuspenseBoundary(vnode: VNode, enqueue: (s: string) => void
|
|
|
432
432
|
// signal).
|
|
433
433
|
/* c8 ignore start */
|
|
434
434
|
if (!ctx) {
|
|
435
|
-
const stackLenBefore =
|
|
435
|
+
const stackLenBefore = getContextStackLength()
|
|
436
436
|
const { vnode: output } = runWithHooks(Suspense as ComponentFn, vnode.props)
|
|
437
437
|
try {
|
|
438
438
|
if (output !== null) await streamNode(output, enqueue)
|
|
@@ -608,7 +608,7 @@ async function renderComponent(vnode: VNode & { type: ComponentFn }): Promise<st
|
|
|
608
608
|
// (the response ships, the process moves on); user-registered cleanup
|
|
609
609
|
// is for the CSR lifecycle. `provide()`'s frame cleanup is the only
|
|
610
610
|
// SSR-visible side effect and we handle it structurally below.
|
|
611
|
-
const stackLenBefore =
|
|
611
|
+
const stackLenBefore = getContextStackLength()
|
|
612
612
|
const { vnode: output } = runWithHooks(vnode.type, mergeChildrenIntoProps(vnode))
|
|
613
613
|
|
|
614
614
|
// Async component function (async function Component()) — await the promise
|
|
@@ -642,7 +642,7 @@ async function renderComponent(vnode: VNode & { type: ComponentFn }): Promise<st
|
|
|
642
642
|
* effect of `provide()` (its context frame) without firing other hooks.
|
|
643
643
|
*/
|
|
644
644
|
function trimContextStack(targetLen: number): void {
|
|
645
|
-
let current =
|
|
645
|
+
let current = getContextStackLength()
|
|
646
646
|
while (current > targetLen) {
|
|
647
647
|
popContext()
|
|
648
648
|
current--
|