@askrjs/askr 0.0.28 → 0.0.29
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/README.md +44 -172
- package/dist/_virtual/_rolldown/runtime.js +7 -0
- package/dist/bench/components/benchmark-row.d.ts +20 -0
- package/dist/bench/components/benchmark-row.d.ts.map +1 -0
- package/dist/bench/components/benchmark-row.js +42 -0
- package/dist/bench/components/benchmark-row.js.map +1 -0
- package/dist/bench/components/benchmark-table.js +25 -0
- package/dist/bench/components/benchmark-table.js.map +1 -0
- package/dist/benchmark.d.ts +22 -0
- package/dist/benchmark.d.ts.map +1 -0
- package/dist/benchmark.js +64 -1
- package/dist/benchmark.js.map +1 -0
- package/dist/bin/askr-ssg.d.ts +22 -26
- package/dist/bin/askr-ssg.d.ts.map +1 -1
- package/dist/bin/askr-ssg.js +149 -2
- package/dist/bin/askr-ssg.js.map +1 -0
- package/dist/boot/index.d.ts +64 -42
- package/dist/boot/index.d.ts.map +1 -1
- package/dist/boot/index.js +416 -2
- package/dist/boot/index.js.map +1 -0
- package/dist/common/component.d.ts +14 -13
- package/dist/common/component.d.ts.map +1 -1
- package/dist/common/control.d.ts +13 -0
- package/dist/common/control.d.ts.map +1 -0
- package/dist/common/control.js +14 -0
- package/dist/common/control.js.map +1 -0
- package/dist/common/env.js +47 -0
- package/dist/common/env.js.map +1 -0
- package/dist/common/jsx.d.ts +17 -15
- package/dist/common/jsx.d.ts.map +1 -1
- package/dist/common/jsx.js +8 -1
- package/dist/common/jsx.js.map +1 -0
- package/dist/common/props.d.ts +14 -11
- package/dist/common/props.d.ts.map +1 -1
- package/dist/common/router.d.ts +190 -32
- package/dist/common/router.d.ts.map +1 -1
- package/dist/common/ssr-errors.d.ts +6 -3
- package/dist/common/ssr-errors.d.ts.map +1 -1
- package/dist/common/ssr-errors.js +16 -1
- package/dist/common/ssr-errors.js.map +1 -0
- package/dist/common/ssr.d.ts +12 -9
- package/dist/common/ssr.d.ts.map +1 -1
- package/dist/common/vnode.d.ts +17 -15
- package/dist/common/vnode.d.ts.map +1 -1
- package/dist/common/vnode.js +10 -1
- package/dist/common/vnode.js.map +1 -0
- package/dist/components/link.d.ts +37 -25
- package/dist/components/link.d.ts.map +1 -1
- package/dist/components/link.js +64 -1
- package/dist/components/link.js.map +1 -0
- package/dist/control/case.d.ts +17 -0
- package/dist/control/case.d.ts.map +1 -0
- package/dist/control/case.js +69 -0
- package/dist/control/case.js.map +1 -0
- package/dist/control/for.d.ts +23 -0
- package/dist/control/for.d.ts.map +1 -0
- package/dist/control/for.js +62 -0
- package/dist/control/for.js.map +1 -0
- package/dist/control/index.d.ts +4 -0
- package/dist/control/index.js +4 -0
- package/dist/control/shared.js +20 -0
- package/dist/control/shared.js.map +1 -0
- package/dist/control/show.d.ts +14 -0
- package/dist/control/show.d.ts.map +1 -0
- package/dist/control/show.js +33 -0
- package/dist/control/show.js.map +1 -0
- package/dist/dev/invariant.js +29 -2
- package/dist/dev/invariant.js.map +1 -0
- package/dist/dev/logger.js +37 -1
- package/dist/dev/logger.js.map +1 -0
- package/dist/foundations/icon/icon.d.ts +53 -0
- package/dist/foundations/icon/icon.d.ts.map +1 -0
- package/dist/foundations/icon/icon.js +88 -0
- package/dist/foundations/icon/icon.js.map +1 -0
- package/dist/foundations/icon/icon.types.d.ts +21 -0
- package/dist/foundations/icon/icon.types.d.ts.map +1 -0
- package/dist/foundations/index.d.ts +10 -3
- package/dist/foundations/index.js +9 -1
- package/dist/foundations/interactions/interaction-policy.js +93 -1
- package/dist/foundations/interactions/interaction-policy.js.map +1 -0
- package/dist/foundations/interactions/pressable.js +51 -1
- package/dist/foundations/interactions/pressable.js.map +1 -0
- package/dist/foundations/structures/collection.d.ts +25 -40
- package/dist/foundations/structures/collection.d.ts.map +1 -1
- package/dist/foundations/structures/collection.js +51 -1
- package/dist/foundations/structures/collection.js.map +1 -0
- package/dist/foundations/structures/layer.d.ts +47 -68
- package/dist/foundations/structures/layer.d.ts.map +1 -1
- package/dist/foundations/structures/layer.js +81 -1
- package/dist/foundations/structures/layer.js.map +1 -0
- package/dist/foundations/structures/layout.d.ts +6 -3
- package/dist/foundations/structures/layout.d.ts.map +1 -1
- package/dist/foundations/structures/layout.js +13 -1
- package/dist/foundations/structures/layout.js.map +1 -0
- package/dist/foundations/structures/portal.d.ts +17 -10
- package/dist/foundations/structures/portal.d.ts.map +1 -1
- package/dist/foundations/structures/portal.js +105 -1
- package/dist/foundations/structures/portal.js.map +1 -0
- package/dist/foundations/structures/presence.d.ts +11 -5
- package/dist/foundations/structures/presence.d.ts.map +1 -1
- package/dist/foundations/structures/presence.js +39 -1
- package/dist/foundations/structures/presence.js.map +1 -0
- package/dist/foundations/structures/slot.d.ts +11 -8
- package/dist/foundations/structures/slot.d.ts.map +1 -1
- package/dist/foundations/structures/slot.js +41 -1
- package/dist/foundations/structures/slot.js.map +1 -0
- package/dist/foundations/structures.d.ts +7 -14
- package/dist/foundations/structures.js +6 -1
- package/dist/foundations/utilities/aria.js +11 -1
- package/dist/foundations/utilities/aria.js.map +1 -0
- package/dist/foundations/utilities/compose-handlers.js +20 -1
- package/dist/foundations/utilities/compose-handlers.js.map +1 -0
- package/dist/foundations/utilities/compose-ref.d.ts +7 -4
- package/dist/foundations/utilities/compose-ref.d.ts.map +1 -1
- package/dist/foundations/utilities/compose-ref.js +18 -1
- package/dist/foundations/utilities/compose-ref.js.map +1 -0
- package/dist/foundations/utilities/merge-props.js +49 -1
- package/dist/foundations/utilities/merge-props.js.map +1 -0
- package/dist/fx/fx.d.ts +24 -21
- package/dist/fx/fx.d.ts.map +1 -1
- package/dist/fx/fx.js +212 -1
- package/dist/fx/fx.js.map +1 -0
- package/dist/fx/index.d.ts +4 -7
- package/dist/fx/index.js +4 -1
- package/dist/fx/noop.js +9 -1
- package/dist/fx/noop.js.map +1 -0
- package/dist/fx/timing.d.ts +24 -21
- package/dist/fx/timing.d.ts.map +1 -1
- package/dist/fx/timing.js +236 -1
- package/dist/fx/timing.js.map +1 -0
- package/dist/index.d.ts +21 -23
- package/dist/index.js +34 -1
- package/dist/index.js.map +1 -0
- package/dist/jsx/index.d.ts +1 -4
- package/dist/jsx/index.js +3 -1
- package/dist/jsx/types.d.ts +18 -25
- package/dist/jsx/types.d.ts.map +1 -1
- package/dist/jsx/types.js +1 -1
- package/dist/jsx/utils.d.ts +4 -3
- package/dist/jsx/utils.d.ts.map +1 -1
- package/dist/jsx/utils.js +19 -1
- package/dist/jsx/utils.js.map +1 -0
- package/dist/jsx-dev-runtime.d.ts +8 -0
- package/dist/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/jsx-dev-runtime.js +32 -1
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-runtime.d.ts +12 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +45 -1
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/jsx-runtime2.d.ts +2 -0
- package/dist/jsx-runtime2.js +3 -0
- package/dist/renderer/children.js +293 -0
- package/dist/renderer/children.js.map +1 -0
- package/dist/renderer/cleanup.js +150 -1
- package/dist/renderer/cleanup.js.map +1 -0
- package/dist/renderer/dom.js +2439 -1
- package/dist/renderer/dom.js.map +1 -0
- package/dist/renderer/env.js +1 -0
- package/dist/renderer/evaluate.js +450 -1
- package/dist/renderer/evaluate.js.map +1 -0
- package/dist/renderer/fastpath.js +145 -1
- package/dist/renderer/fastpath.js.map +1 -0
- package/dist/renderer/index.js +24 -1
- package/dist/renderer/index.js.map +1 -0
- package/dist/renderer/keyed.js +119 -1
- package/dist/renderer/keyed.js.map +1 -0
- package/dist/renderer/reconcile.js +359 -1
- package/dist/renderer/reconcile.js.map +1 -0
- package/dist/renderer/types.js +1 -1
- package/dist/renderer/utils.js +220 -1
- package/dist/renderer/utils.js.map +1 -0
- package/dist/resources/index.d.ts +3 -9
- package/dist/resources/index.js +3 -1
- package/dist/router/index.d.ts +6 -10
- package/dist/router/index.js +5 -1
- package/dist/router/match.js +83 -1
- package/dist/router/match.js.map +1 -0
- package/dist/router/navigate.d.ts +20 -8
- package/dist/router/navigate.d.ts.map +1 -1
- package/dist/router/navigate.js +288 -1
- package/dist/router/navigate.js.map +1 -0
- package/dist/router/policy.d.ts +22 -0
- package/dist/router/policy.d.ts.map +1 -0
- package/dist/router/policy.js +116 -0
- package/dist/router/policy.js.map +1 -0
- package/dist/router/route-context.js +79 -0
- package/dist/router/route-context.js.map +1 -0
- package/dist/router/route.d.ts +101 -34
- package/dist/router/route.d.ts.map +1 -1
- package/dist/router/route.js +599 -1
- package/dist/router/route.js.map +1 -0
- package/dist/runtime/child-scope.d.ts +21 -0
- package/dist/runtime/child-scope.d.ts.map +1 -0
- package/dist/runtime/child-scope.js +77 -0
- package/dist/runtime/child-scope.js.map +1 -0
- package/dist/runtime/component.d.ts +67 -56
- package/dist/runtime/component.d.ts.map +1 -1
- package/dist/runtime/component.js +462 -1
- package/dist/runtime/component.js.map +1 -0
- package/dist/runtime/context.d.ts +28 -42
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/context.js +205 -1
- package/dist/runtime/context.js.map +1 -0
- package/dist/runtime/control.d.ts +43 -0
- package/dist/runtime/control.d.ts.map +1 -0
- package/dist/runtime/control.js +125 -0
- package/dist/runtime/control.js.map +1 -0
- package/dist/runtime/derive.d.ts +12 -9
- package/dist/runtime/derive.d.ts.map +1 -1
- package/dist/runtime/derive.js +134 -1
- package/dist/runtime/derive.js.map +1 -0
- package/dist/runtime/dev-namespace.js +57 -1
- package/dist/runtime/dev-namespace.js.map +1 -0
- package/dist/runtime/effect.d.ts +32 -0
- package/dist/runtime/effect.d.ts.map +1 -0
- package/dist/runtime/effect.js +146 -0
- package/dist/runtime/effect.js.map +1 -0
- package/dist/runtime/events.js +162 -1
- package/dist/runtime/events.js.map +1 -0
- package/dist/runtime/execution-model.js +15 -1
- package/dist/runtime/execution-model.js.map +1 -0
- package/dist/runtime/fastlane.js +204 -1
- package/dist/runtime/fastlane.js.map +1 -0
- package/dist/runtime/for-bench.d.ts +41 -0
- package/dist/runtime/for-bench.d.ts.map +1 -0
- package/dist/runtime/for-bench.js +173 -0
- package/dist/runtime/for-bench.js.map +1 -0
- package/dist/runtime/for.d.ts +62 -49
- package/dist/runtime/for.d.ts.map +1 -1
- package/dist/runtime/for.js +668 -1
- package/dist/runtime/for.js.map +1 -0
- package/dist/runtime/operations.d.ts +18 -15
- package/dist/runtime/operations.d.ts.map +1 -1
- package/dist/runtime/operations.js +209 -1
- package/dist/runtime/operations.js.map +1 -0
- package/dist/runtime/perf-metrics.js +64 -1
- package/dist/runtime/perf-metrics.js.map +1 -0
- package/dist/runtime/readable.d.ts +24 -18
- package/dist/runtime/readable.d.ts.map +1 -1
- package/dist/runtime/readable.js +118 -1
- package/dist/runtime/readable.js.map +1 -0
- package/dist/runtime/resource-cell.js +102 -1
- package/dist/runtime/resource-cell.js.map +1 -0
- package/dist/runtime/scheduler.d.ts +51 -50
- package/dist/runtime/scheduler.d.ts.map +1 -1
- package/dist/runtime/scheduler.js +328 -1
- package/dist/runtime/scheduler.js.map +1 -0
- package/dist/runtime/selector.d.ts +7 -5
- package/dist/runtime/selector.d.ts.map +1 -1
- package/dist/runtime/selector.js +188 -1
- package/dist/runtime/selector.js.map +1 -0
- package/dist/runtime/ssr-bridge.js +24 -1
- package/dist/runtime/ssr-bridge.js.map +1 -0
- package/dist/runtime/state.d.ts +11 -19
- package/dist/runtime/state.d.ts.map +1 -1
- package/dist/runtime/state.js +99 -1
- package/dist/runtime/state.js.map +1 -0
- package/dist/ssg/batch-render.d.ts +10 -10
- package/dist/ssg/batch-render.d.ts.map +1 -1
- package/dist/ssg/batch-render.js +84 -1
- package/dist/ssg/batch-render.js.map +1 -0
- package/dist/ssg/create-static-gen.d.ts +28 -29
- package/dist/ssg/create-static-gen.d.ts.map +1 -1
- package/dist/ssg/create-static-gen.js +282 -1
- package/dist/ssg/create-static-gen.js.map +1 -0
- package/dist/ssg/generate-metadata.d.ts +12 -15
- package/dist/ssg/generate-metadata.d.ts.map +1 -1
- package/dist/ssg/generate-metadata.js +94 -1
- package/dist/ssg/generate-metadata.js.map +1 -0
- package/dist/ssg/incremental-manifest.js +56 -1
- package/dist/ssg/incremental-manifest.js.map +1 -0
- package/dist/ssg/index.d.ts +8 -28
- package/dist/ssg/index.js +7 -1
- package/dist/ssg/resolve-ssg-data.d.ts +10 -13
- package/dist/ssg/resolve-ssg-data.d.ts.map +1 -1
- package/dist/ssg/resolve-ssg-data.js +46 -1
- package/dist/ssg/resolve-ssg-data.js.map +1 -0
- package/dist/ssg/route-utils.d.ts +14 -10
- package/dist/ssg/route-utils.d.ts.map +1 -1
- package/dist/ssg/route-utils.js +24 -1
- package/dist/ssg/route-utils.js.map +1 -0
- package/dist/ssg/types.d.ts +157 -144
- package/dist/ssg/types.d.ts.map +1 -1
- package/dist/ssg/write-static-files.d.ts +8 -14
- package/dist/ssg/write-static-files.d.ts.map +1 -1
- package/dist/ssg/write-static-files.js +73 -1
- package/dist/ssg/write-static-files.js.map +1 -0
- package/dist/ssr/attrs.js +93 -1
- package/dist/ssr/attrs.js.map +1 -0
- package/dist/ssr/context.d.ts +31 -35
- package/dist/ssr/context.d.ts.map +1 -1
- package/dist/ssr/context.js +63 -1
- package/dist/ssr/context.js.map +1 -0
- package/dist/ssr/errors.d.ts +6 -4
- package/dist/ssr/errors.d.ts.map +1 -1
- package/dist/ssr/errors.js +4 -1
- package/dist/ssr/errors.js.map +1 -0
- package/dist/ssr/escape.js +153 -1
- package/dist/ssr/escape.js.map +1 -0
- package/dist/ssr/index.d.ts +74 -72
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +543 -1
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/render-keys.d.ts +27 -29
- package/dist/ssr/render-keys.d.ts.map +1 -1
- package/dist/ssr/render-keys.js +39 -1
- package/dist/ssr/render-keys.js.map +1 -0
- package/dist/ssr/sink.js +86 -1
- package/dist/ssr/sink.js.map +1 -0
- package/dist/ssr/stream-render.js +76 -1
- package/dist/ssr/stream-render.js.map +1 -0
- package/dist/ssr/types.d.ts +14 -13
- package/dist/ssr/types.d.ts.map +1 -1
- package/package.json +49 -69
- package/dist/_virtual/___vite-browser-external.js +0 -1
- package/dist/_virtual/__vite-browser-external.js +0 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -1
- package/dist/_virtual/_fs.js +0 -1
- package/dist/_virtual/_path.js +0 -1
- package/dist/_virtual/main.js +0 -1
- package/dist/_virtual/preload-helper.js +0 -1
- package/dist/bench/benchmark-entry.d.ts +0 -14
- package/dist/bench/benchmark-entry.d.ts.map +0 -1
- package/dist/common/errors.d.ts +0 -53
- package/dist/common/errors.d.ts.map +0 -1
- package/dist/common/index.d.ts +0 -14
- package/dist/common/index.d.ts.map +0 -1
- package/dist/dev/invariant.d.ts +0 -83
- package/dist/dev/invariant.d.ts.map +0 -1
- package/dist/dev/logger.d.ts +0 -13
- package/dist/dev/logger.d.ts.map +0 -1
- package/dist/dev/vite-plugin-askr.d.ts +0 -25
- package/dist/dev/vite-plugin-askr.d.ts.map +0 -1
- package/dist/dev/warnings.d.ts +0 -5
- package/dist/dev/warnings.d.ts.map +0 -1
- package/dist/for/for.d.ts +0 -16
- package/dist/for/for.d.ts.map +0 -1
- package/dist/for/for.js +0 -1
- package/dist/for/index.d.ts +0 -2
- package/dist/for/index.d.ts.map +0 -1
- package/dist/for/index.js +0 -1
- package/dist/foundations/core.d.ts +0 -23
- package/dist/foundations/core.d.ts.map +0 -1
- package/dist/foundations/core.js +0 -1
- package/dist/foundations/index.d.ts.map +0 -1
- package/dist/foundations/interactions/dismissable.d.ts +0 -58
- package/dist/foundations/interactions/dismissable.d.ts.map +0 -1
- package/dist/foundations/interactions/dismissable.js +0 -1
- package/dist/foundations/interactions/focusable.d.ts +0 -16
- package/dist/foundations/interactions/focusable.d.ts.map +0 -1
- package/dist/foundations/interactions/focusable.js +0 -1
- package/dist/foundations/interactions/hoverable.d.ts +0 -19
- package/dist/foundations/interactions/hoverable.d.ts.map +0 -1
- package/dist/foundations/interactions/hoverable.js +0 -1
- package/dist/foundations/interactions/index.d.ts +0 -5
- package/dist/foundations/interactions/index.d.ts.map +0 -1
- package/dist/foundations/interactions/interaction-policy.d.ts +0 -96
- package/dist/foundations/interactions/interaction-policy.d.ts.map +0 -1
- package/dist/foundations/interactions/pressable.d.ts +0 -54
- package/dist/foundations/interactions/pressable.d.ts.map +0 -1
- package/dist/foundations/interactions/roving-focus.d.ts +0 -117
- package/dist/foundations/interactions/roving-focus.d.ts.map +0 -1
- package/dist/foundations/interactions/roving-focus.js +0 -1
- package/dist/foundations/state/controllable.d.ts +0 -53
- package/dist/foundations/state/controllable.d.ts.map +0 -1
- package/dist/foundations/state/controllable.js +0 -1
- package/dist/foundations/state/index.d.ts +0 -2
- package/dist/foundations/state/index.d.ts.map +0 -1
- package/dist/foundations/structures/index.d.ts +0 -5
- package/dist/foundations/structures/index.d.ts.map +0 -1
- package/dist/foundations/structures.d.ts.map +0 -1
- package/dist/foundations/utilities/aria.d.ts +0 -13
- package/dist/foundations/utilities/aria.d.ts.map +0 -1
- package/dist/foundations/utilities/compose-handlers.d.ts +0 -34
- package/dist/foundations/utilities/compose-handlers.d.ts.map +0 -1
- package/dist/foundations/utilities/event-types.d.ts +0 -17
- package/dist/foundations/utilities/event-types.d.ts.map +0 -1
- package/dist/foundations/utilities/index.d.ts +0 -7
- package/dist/foundations/utilities/index.d.ts.map +0 -1
- package/dist/foundations/utilities/merge-props.d.ts +0 -2
- package/dist/foundations/utilities/merge-props.d.ts.map +0 -1
- package/dist/foundations/utilities/use-id.d.ts +0 -29
- package/dist/foundations/utilities/use-id.d.ts.map +0 -1
- package/dist/foundations/utilities/use-id.js +0 -1
- package/dist/fx/index.d.ts.map +0 -1
- package/dist/fx/noop.d.ts +0 -12
- package/dist/fx/noop.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/jsx/index.d.ts.map +0 -1
- package/dist/jsx/jsx-dev-runtime.d.ts +0 -4
- package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-runtime.d.ts +0 -10
- package/dist/jsx/jsx-runtime.d.ts.map +0 -1
- package/dist/node_modules/esbuild/lib/main.js +0 -65
- package/dist/renderer/cleanup.d.ts +0 -28
- package/dist/renderer/cleanup.d.ts.map +0 -1
- package/dist/renderer/dom.d.ts +0 -64
- package/dist/renderer/dom.d.ts.map +0 -1
- package/dist/renderer/evaluate.d.ts +0 -4
- package/dist/renderer/evaluate.d.ts.map +0 -1
- package/dist/renderer/fastpath.d.ts +0 -7
- package/dist/renderer/fastpath.d.ts.map +0 -1
- package/dist/renderer/index.d.ts +0 -6
- package/dist/renderer/index.d.ts.map +0 -1
- package/dist/renderer/keyed.d.ts +0 -23
- package/dist/renderer/keyed.d.ts.map +0 -1
- package/dist/renderer/reconcile.d.ts +0 -88
- package/dist/renderer/reconcile.d.ts.map +0 -1
- package/dist/renderer/types.d.ts +0 -3
- package/dist/renderer/types.d.ts.map +0 -1
- package/dist/renderer/utils.d.ts +0 -63
- package/dist/renderer/utils.d.ts.map +0 -1
- package/dist/resources/index.d.ts.map +0 -1
- package/dist/router/index.d.ts.map +0 -1
- package/dist/router/match.d.ts +0 -22
- package/dist/router/match.d.ts.map +0 -1
- package/dist/runtime/dev-namespace.d.ts +0 -31
- package/dist/runtime/dev-namespace.d.ts.map +0 -1
- package/dist/runtime/events.d.ts +0 -53
- package/dist/runtime/events.d.ts.map +0 -1
- package/dist/runtime/execution-model.d.ts +0 -4
- package/dist/runtime/execution-model.d.ts.map +0 -1
- package/dist/runtime/fastlane.d.ts +0 -27
- package/dist/runtime/fastlane.d.ts.map +0 -1
- package/dist/runtime/hydration.d.ts +0 -25
- package/dist/runtime/hydration.d.ts.map +0 -1
- package/dist/runtime/perf-metrics.d.ts +0 -25
- package/dist/runtime/perf-metrics.d.ts.map +0 -1
- package/dist/runtime/resource-cell.d.ts +0 -35
- package/dist/runtime/resource-cell.d.ts.map +0 -1
- package/dist/runtime/snapshot.d.ts +0 -25
- package/dist/runtime/snapshot.d.ts.map +0 -1
- package/dist/runtime/ssr-bridge.d.ts +0 -10
- package/dist/runtime/ssr-bridge.d.ts.map +0 -1
- package/dist/ssg/discover-resources.d.ts +0 -15
- package/dist/ssg/discover-resources.d.ts.map +0 -1
- package/dist/ssg/incremental-manifest.d.ts +0 -23
- package/dist/ssg/incremental-manifest.d.ts.map +0 -1
- package/dist/ssg/index.d.ts.map +0 -1
- package/dist/ssr/attrs.d.ts +0 -26
- package/dist/ssr/attrs.d.ts.map +0 -1
- package/dist/ssr/create-ssr.d.ts +0 -19
- package/dist/ssr/create-ssr.d.ts.map +0 -1
- package/dist/ssr/escape.d.ts +0 -38
- package/dist/ssr/escape.d.ts.map +0 -1
- package/dist/ssr/sink.d.ts +0 -23
- package/dist/ssr/sink.d.ts.map +0 -1
- package/dist/ssr/stream-render.d.ts +0 -7
- package/dist/ssr/stream-render.d.ts.map +0 -1
- package/dist/vite/index.js +0 -4
|
@@ -1,39 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
signal?: AbortSignal;
|
|
12
|
-
}) => Promise<unknown> | unknown;
|
|
13
|
-
deps: unknown[];
|
|
14
|
-
index: number;
|
|
1
|
+
import { SSRRoute } from "./index.js";
|
|
2
|
+
|
|
3
|
+
//#region src/ssr/render-keys.d.ts
|
|
4
|
+
type ResourceDescriptor = {
|
|
5
|
+
key: string;
|
|
6
|
+
fn: (opts: {
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
}) => Promise<unknown> | unknown;
|
|
9
|
+
deps: unknown[];
|
|
10
|
+
index: number;
|
|
15
11
|
};
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
type ResourcePlan = {
|
|
13
|
+
resources: ResourceDescriptor[];
|
|
18
14
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
declare function getCurrentRenderData(): Record<string, unknown> | null;
|
|
16
|
+
declare function resetKeyCounter(): void;
|
|
17
|
+
declare function getNextKey(): string;
|
|
18
|
+
declare function startRenderPhase(data: Record<string, unknown> | null): void;
|
|
19
|
+
declare function stopRenderPhase(): void;
|
|
24
20
|
/** @deprecated SSR prepass has been removed */
|
|
25
|
-
|
|
21
|
+
declare function startCollection(): never;
|
|
26
22
|
/** @deprecated SSR prepass has been removed */
|
|
27
|
-
|
|
23
|
+
declare function stopCollection(): ResourcePlan;
|
|
28
24
|
/** @deprecated SSR prepass has been removed */
|
|
29
|
-
|
|
25
|
+
declare function registerResourceIntent(_fn: ResourceDescriptor['fn'], _deps: unknown[]): string;
|
|
30
26
|
/** @deprecated SSR prepass has been removed */
|
|
31
|
-
|
|
27
|
+
declare function resolvePlan(_plan: ResourcePlan): Promise<Record<string, unknown>>;
|
|
32
28
|
/** @deprecated SSR prepass has been removed */
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
declare function collectResources(_opts: {
|
|
30
|
+
url: string;
|
|
31
|
+
routes: SSRRoute[];
|
|
36
32
|
}): ResourcePlan;
|
|
37
33
|
/** @deprecated Alias for resolvePlan */
|
|
38
|
-
|
|
34
|
+
declare const resolveResources: typeof resolvePlan;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { ResourcePlan, collectResources, resolvePlan, resolveResources };
|
|
39
37
|
//# sourceMappingURL=render-keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-keys.d.ts","
|
|
1
|
+
{"version":3,"file":"render-keys.d.ts","names":[],"sources":["../../src/ssr/render-keys.ts"],"mappings":";;;KAUY,kBAAA;EACV,GAAA;EACA,EAAA,GAAK,IAAA;IAAQ,MAAA,GAAS,WAAA;EAAA,MAAkB,OAAA;EACxC,IAAA;EACA,KAAA;AAAA;AAAA,KAGU,YAAA;EACV,SAAA,EAAW,kBAAA;AAAA;AAAA,iBAGG,oBAAA,CAAA,GAAwB,MAAA;AAAA,iBAKxB,eAAA,CAAA;AAAA,iBAKA,UAAA,CAAA;AAAA,iBAMA,gBAAA,CAAiB,IAAA,EAAM,MAAA;AAAA,iBAQvB,eAAA,CAAA;;iBAcA,eAAA,CAAA;;iBAKA,cAAA,CAAA,GAAkB,YAAA;AAtClC;AAAA,iBA2CgB,sBAAA,CACd,GAAA,EAAK,kBAAA,QACL,KAAA;;iBAQoB,WAAA,CACpB,KAAA,EAAO,YAAA,GACN,OAAA,CAAQ,MAAA;;iBAOK,gBAAA,CAAiB,KAAA;EAC/B,GAAA;EACA,MAAA,EAAQ,QAAA;AAAA,IACN,YAAA;;cAKS,gBAAA,SAAgB,WAAA"}
|
package/dist/ssr/render-keys.js
CHANGED
|
@@ -1 +1,39 @@
|
|
|
1
|
-
import{getRenderContext
|
|
1
|
+
import { getRenderContext } from "./context.js";
|
|
2
|
+
//#region src/ssr/render-keys.ts
|
|
3
|
+
function getCurrentRenderData() {
|
|
4
|
+
return getRenderContext()?.renderData ?? null;
|
|
5
|
+
}
|
|
6
|
+
function getNextKey() {
|
|
7
|
+
const ctx = getRenderContext();
|
|
8
|
+
if (!ctx) return `r:0`;
|
|
9
|
+
return `r:${ctx.keyCounter++}`;
|
|
10
|
+
}
|
|
11
|
+
function startRenderPhase(data) {
|
|
12
|
+
const ctx = getRenderContext();
|
|
13
|
+
if (ctx) {
|
|
14
|
+
ctx.renderData = data ?? null;
|
|
15
|
+
ctx.keyCounter = 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function stopRenderPhase() {
|
|
19
|
+
const ctx = getRenderContext();
|
|
20
|
+
if (ctx) {
|
|
21
|
+
ctx.renderData = null;
|
|
22
|
+
ctx.keyCounter = 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const PREPASS_REMOVED_MSG = "SSR collection/prepass is removed: SSR is strictly synchronous";
|
|
26
|
+
/** @deprecated SSR prepass has been removed */
|
|
27
|
+
async function resolvePlan(_plan) {
|
|
28
|
+
throw new Error(`${PREPASS_REMOVED_MSG}; async resource plans are not supported`);
|
|
29
|
+
}
|
|
30
|
+
/** @deprecated SSR prepass has been removed */
|
|
31
|
+
function collectResources(_opts) {
|
|
32
|
+
throw new Error(`${PREPASS_REMOVED_MSG}; collectResources is disabled`);
|
|
33
|
+
}
|
|
34
|
+
/** @deprecated Alias for resolvePlan */
|
|
35
|
+
const resolveResources = resolvePlan;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { collectResources, getCurrentRenderData, getNextKey, resolvePlan, resolveResources, startRenderPhase, stopRenderPhase };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=render-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-keys.js","names":[],"sources":["../../src/ssr/render-keys.ts"],"sourcesContent":["/**\n * SSR Data Management\n *\n * Manages render-phase keying for deterministic SSR data lookup.\n * All state is stored in the per-render context for concurrency safety.\n */\n\nimport type { SSRRoute } from './index';\nimport { getRenderContext } from './context';\n\nexport type ResourceDescriptor = {\n key: string;\n fn: (opts: { signal?: AbortSignal }) => Promise<unknown> | unknown;\n deps: unknown[];\n index: number;\n};\n\nexport type ResourcePlan = {\n resources: ResourceDescriptor[]; // declarative manifest in stable order\n};\n\nexport function getCurrentRenderData(): Record<string, unknown> | null {\n const ctx = getRenderContext();\n return ctx?.renderData ?? null;\n}\n\nexport function resetKeyCounter() {\n const ctx = getRenderContext();\n if (ctx) ctx.keyCounter = 0;\n}\n\nexport function getNextKey(): string {\n const ctx = getRenderContext();\n if (!ctx) return `r:0`; // Fallback for edge cases\n return `r:${ctx.keyCounter++}`;\n}\n\nexport function startRenderPhase(data: Record<string, unknown> | null) {\n const ctx = getRenderContext();\n if (ctx) {\n ctx.renderData = data ?? null;\n ctx.keyCounter = 0;\n }\n}\n\nexport function stopRenderPhase() {\n const ctx = getRenderContext();\n if (ctx) {\n ctx.renderData = null;\n ctx.keyCounter = 0;\n }\n}\n\n// --- Deprecated APIs (throw descriptive errors) ---\n\nconst PREPASS_REMOVED_MSG =\n 'SSR collection/prepass is removed: SSR is strictly synchronous';\n\n/** @deprecated SSR prepass has been removed */\nexport function startCollection(): never {\n throw new Error(`${PREPASS_REMOVED_MSG}; do not call startCollection()`);\n}\n\n/** @deprecated SSR prepass has been removed */\nexport function stopCollection(): ResourcePlan {\n throw new Error(`${PREPASS_REMOVED_MSG}; do not call stopCollection()`);\n}\n\n/** @deprecated SSR prepass has been removed */\nexport function registerResourceIntent(\n _fn: ResourceDescriptor['fn'],\n _deps: unknown[]\n): string {\n throw new Error(\n `${PREPASS_REMOVED_MSG}; resource() no longer registers intents for prepass`\n );\n}\n\n/** @deprecated SSR prepass has been removed */\nexport async function resolvePlan(\n _plan: ResourcePlan\n): Promise<Record<string, unknown>> {\n throw new Error(\n `${PREPASS_REMOVED_MSG}; async resource plans are not supported`\n );\n}\n\n/** @deprecated SSR prepass has been removed */\nexport function collectResources(_opts: {\n url: string;\n routes: SSRRoute[];\n}): ResourcePlan {\n throw new Error(`${PREPASS_REMOVED_MSG}; collectResources is disabled`);\n}\n\n/** @deprecated Alias for resolvePlan */\nexport const resolveResources = resolvePlan;\n"],"mappings":";;AAqBA,SAAgB,uBAAuD;AAErE,QADY,kBACL,EAAK,cAAc;;AAQ5B,SAAgB,aAAqB;CACnC,MAAM,MAAM,kBAAkB;AAC9B,KAAI,CAAC,IAAK,QAAO;AACjB,QAAO,KAAK,IAAI;;AAGlB,SAAgB,iBAAiB,MAAsC;CACrE,MAAM,MAAM,kBAAkB;AAC9B,KAAI,KAAK;AACP,MAAI,aAAa,QAAQ;AACzB,MAAI,aAAa;;;AAIrB,SAAgB,kBAAkB;CAChC,MAAM,MAAM,kBAAkB;AAC9B,KAAI,KAAK;AACP,MAAI,aAAa;AACjB,MAAI,aAAa;;;AAMrB,MAAM,sBACJ;;AAuBF,eAAsB,YACpB,OACkC;AAClC,OAAM,IAAI,MACR,GAAG,oBAAoB,0CACxB;;;AAIH,SAAgB,iBAAiB,OAGhB;AACf,OAAM,IAAI,MAAM,GAAG,oBAAoB,gCAAgC;;;AAIzE,MAAa,mBAAmB"}
|
package/dist/ssr/sink.js
CHANGED
|
@@ -1 +1,86 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/ssr/sink.ts
|
|
2
|
+
var StringSink = class StringSink {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.chunks = [];
|
|
5
|
+
this.bufferChunks = [];
|
|
6
|
+
this.bufferLen = 0;
|
|
7
|
+
}
|
|
8
|
+
static {
|
|
9
|
+
this.FLUSH_THRESHOLD = 32 * 1024;
|
|
10
|
+
}
|
|
11
|
+
write(html) {
|
|
12
|
+
if (!html) return;
|
|
13
|
+
this.bufferChunks.push(html);
|
|
14
|
+
this.bufferLen += html.length;
|
|
15
|
+
if (this.bufferLen >= StringSink.FLUSH_THRESHOLD) {
|
|
16
|
+
this.chunks.push(this.bufferChunks.join(""));
|
|
17
|
+
this.bufferChunks.length = 0;
|
|
18
|
+
this.bufferLen = 0;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
write2(a, b) {
|
|
22
|
+
if (a) {
|
|
23
|
+
this.bufferChunks.push(a);
|
|
24
|
+
this.bufferLen += a.length;
|
|
25
|
+
}
|
|
26
|
+
if (b) {
|
|
27
|
+
this.bufferChunks.push(b);
|
|
28
|
+
this.bufferLen += b.length;
|
|
29
|
+
}
|
|
30
|
+
if (this.bufferLen >= StringSink.FLUSH_THRESHOLD) {
|
|
31
|
+
this.chunks.push(this.bufferChunks.join(""));
|
|
32
|
+
this.bufferChunks.length = 0;
|
|
33
|
+
this.bufferLen = 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
write3(a, b, c) {
|
|
37
|
+
if (a) {
|
|
38
|
+
this.bufferChunks.push(a);
|
|
39
|
+
this.bufferLen += a.length;
|
|
40
|
+
}
|
|
41
|
+
if (b) {
|
|
42
|
+
this.bufferChunks.push(b);
|
|
43
|
+
this.bufferLen += b.length;
|
|
44
|
+
}
|
|
45
|
+
if (c) {
|
|
46
|
+
this.bufferChunks.push(c);
|
|
47
|
+
this.bufferLen += c.length;
|
|
48
|
+
}
|
|
49
|
+
if (this.bufferLen >= StringSink.FLUSH_THRESHOLD) {
|
|
50
|
+
this.chunks.push(this.bufferChunks.join(""));
|
|
51
|
+
this.bufferChunks.length = 0;
|
|
52
|
+
this.bufferLen = 0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
end() {
|
|
56
|
+
if (this.bufferLen) {
|
|
57
|
+
this.chunks.push(this.bufferChunks.join(""));
|
|
58
|
+
this.bufferChunks.length = 0;
|
|
59
|
+
this.bufferLen = 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
toString() {
|
|
63
|
+
if (this.bufferLen) {
|
|
64
|
+
this.chunks.push(this.bufferChunks.join(""));
|
|
65
|
+
this.bufferChunks.length = 0;
|
|
66
|
+
this.bufferLen = 0;
|
|
67
|
+
}
|
|
68
|
+
return this.chunks.join("");
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var StreamSink = class {
|
|
72
|
+
constructor(onChunk, onComplete) {
|
|
73
|
+
this.onChunk = onChunk;
|
|
74
|
+
this.onComplete = onComplete;
|
|
75
|
+
}
|
|
76
|
+
write(html) {
|
|
77
|
+
if (html) this.onChunk(html);
|
|
78
|
+
}
|
|
79
|
+
end() {
|
|
80
|
+
this.onComplete();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
export { StreamSink, StringSink };
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=sink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sink.js","names":[],"sources":["../../src/ssr/sink.ts"],"sourcesContent":["export interface RenderSink {\n write(html: string): void;\n end(): void;\n}\n\nexport class StringSink implements RenderSink {\n private chunks: string[] = [];\n private bufferChunks: string[] = [];\n private bufferLen = 0;\n\n // Reduce array churn by batching many small writes into a larger buffer.\n // This is especially important for large SSR trees where we may write\n // hundreds of thousands of small fragments.\n private static readonly FLUSH_THRESHOLD = 32 * 1024;\n\n write(html: string) {\n if (!html) return;\n this.bufferChunks.push(html);\n this.bufferLen += html.length;\n if (this.bufferLen >= StringSink.FLUSH_THRESHOLD) {\n this.chunks.push(this.bufferChunks.join(''));\n this.bufferChunks.length = 0;\n this.bufferLen = 0;\n }\n }\n\n // Batch write for hot paths (avoids multiple push calls)\n write2(a: string, b: string) {\n if (a) {\n this.bufferChunks.push(a);\n this.bufferLen += a.length;\n }\n if (b) {\n this.bufferChunks.push(b);\n this.bufferLen += b.length;\n }\n if (this.bufferLen >= StringSink.FLUSH_THRESHOLD) {\n this.chunks.push(this.bufferChunks.join(''));\n this.bufferChunks.length = 0;\n this.bufferLen = 0;\n }\n }\n\n write3(a: string, b: string, c: string) {\n if (a) {\n this.bufferChunks.push(a);\n this.bufferLen += a.length;\n }\n if (b) {\n this.bufferChunks.push(b);\n this.bufferLen += b.length;\n }\n if (c) {\n this.bufferChunks.push(c);\n this.bufferLen += c.length;\n }\n if (this.bufferLen >= StringSink.FLUSH_THRESHOLD) {\n this.chunks.push(this.bufferChunks.join(''));\n this.bufferChunks.length = 0;\n this.bufferLen = 0;\n }\n }\n\n end() {\n if (this.bufferLen) {\n this.chunks.push(this.bufferChunks.join(''));\n this.bufferChunks.length = 0;\n this.bufferLen = 0;\n }\n }\n\n toString() {\n // Ensure any buffered content is included even if end() wasn't called.\n if (this.bufferLen) {\n this.chunks.push(this.bufferChunks.join(''));\n this.bufferChunks.length = 0;\n this.bufferLen = 0;\n }\n return this.chunks.join('');\n }\n}\n\nexport class StreamSink implements RenderSink {\n constructor(\n private readonly onChunk: (html: string) => void,\n private readonly onComplete: () => void\n ) {}\n\n write(html: string) {\n if (html) this.onChunk(html);\n }\n\n end() {\n this.onComplete();\n }\n}\n"],"mappings":";AAKA,IAAa,aAAb,MAAa,WAAiC;;gBACjB,EAAE;sBACI,EAAE;mBACf;;;yBAKsB,KAAK;;CAE/C,MAAM,MAAc;AAClB,MAAI,CAAC,KAAM;AACX,OAAK,aAAa,KAAK,KAAK;AAC5B,OAAK,aAAa,KAAK;AACvB,MAAI,KAAK,aAAa,WAAW,iBAAiB;AAChD,QAAK,OAAO,KAAK,KAAK,aAAa,KAAK,GAAG,CAAC;AAC5C,QAAK,aAAa,SAAS;AAC3B,QAAK,YAAY;;;CAKrB,OAAO,GAAW,GAAW;AAC3B,MAAI,GAAG;AACL,QAAK,aAAa,KAAK,EAAE;AACzB,QAAK,aAAa,EAAE;;AAEtB,MAAI,GAAG;AACL,QAAK,aAAa,KAAK,EAAE;AACzB,QAAK,aAAa,EAAE;;AAEtB,MAAI,KAAK,aAAa,WAAW,iBAAiB;AAChD,QAAK,OAAO,KAAK,KAAK,aAAa,KAAK,GAAG,CAAC;AAC5C,QAAK,aAAa,SAAS;AAC3B,QAAK,YAAY;;;CAIrB,OAAO,GAAW,GAAW,GAAW;AACtC,MAAI,GAAG;AACL,QAAK,aAAa,KAAK,EAAE;AACzB,QAAK,aAAa,EAAE;;AAEtB,MAAI,GAAG;AACL,QAAK,aAAa,KAAK,EAAE;AACzB,QAAK,aAAa,EAAE;;AAEtB,MAAI,GAAG;AACL,QAAK,aAAa,KAAK,EAAE;AACzB,QAAK,aAAa,EAAE;;AAEtB,MAAI,KAAK,aAAa,WAAW,iBAAiB;AAChD,QAAK,OAAO,KAAK,KAAK,aAAa,KAAK,GAAG,CAAC;AAC5C,QAAK,aAAa,SAAS;AAC3B,QAAK,YAAY;;;CAIrB,MAAM;AACJ,MAAI,KAAK,WAAW;AAClB,QAAK,OAAO,KAAK,KAAK,aAAa,KAAK,GAAG,CAAC;AAC5C,QAAK,aAAa,SAAS;AAC3B,QAAK,YAAY;;;CAIrB,WAAW;AAET,MAAI,KAAK,WAAW;AAClB,QAAK,OAAO,KAAK,KAAK,aAAa,KAAK,GAAG,CAAC;AAC5C,QAAK,aAAa,SAAS;AAC3B,QAAK,YAAY;;AAEnB,SAAO,KAAK,OAAO,KAAK,GAAG;;;AAI/B,IAAa,aAAb,MAA8C;CAC5C,YACE,SACA,YACA;AAFiB,OAAA,UAAA;AACA,OAAA,aAAA;;CAGnB,MAAM,MAAc;AAClB,MAAI,KAAM,MAAK,QAAQ,KAAK;;CAG9B,MAAM;AACJ,OAAK,YAAY"}
|
|
@@ -1 +1,76 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Fragment } from "../common/jsx.js";
|
|
2
|
+
import { throwSSRDataMissing } from "./context.js";
|
|
3
|
+
import "../jsx/index.js";
|
|
4
|
+
import { VOID_ELEMENTS, escapeText } from "./escape.js";
|
|
5
|
+
import { renderAttrsDirect } from "./attrs.js";
|
|
6
|
+
//#region src/ssr/stream-render.ts
|
|
7
|
+
function isPromiseLike(x) {
|
|
8
|
+
if (!x || typeof x !== "object") return false;
|
|
9
|
+
return typeof x.then === "function";
|
|
10
|
+
}
|
|
11
|
+
function executeComponent(type, props, ctx) {
|
|
12
|
+
const res = type(props ?? {}, { signal: ctx.signal });
|
|
13
|
+
if (isPromiseLike(res)) throwSSRDataMissing();
|
|
14
|
+
return res;
|
|
15
|
+
}
|
|
16
|
+
function renderChildrenDirect(node, sink, ctx) {
|
|
17
|
+
let raw = node.children;
|
|
18
|
+
if (raw === void 0) raw = node.props?.children;
|
|
19
|
+
if (raw === null || raw === void 0 || raw === false) return;
|
|
20
|
+
if (Array.isArray(raw)) {
|
|
21
|
+
for (let i = 0; i < raw.length; i++) renderNodeToSink(raw[i], sink, ctx);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
renderNodeToSink(raw, sink, ctx);
|
|
25
|
+
}
|
|
26
|
+
function renderNodeToSink(node, sink, ctx) {
|
|
27
|
+
if (node === null || node === void 0) return;
|
|
28
|
+
if (typeof node === "string") {
|
|
29
|
+
sink.write(escapeText(node));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (typeof node === "number") {
|
|
33
|
+
sink.write(String(node));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (typeof node === "boolean") return;
|
|
37
|
+
if (typeof node !== "object") return;
|
|
38
|
+
const vnode = node;
|
|
39
|
+
const type = vnode.type;
|
|
40
|
+
if (type === Fragment) {
|
|
41
|
+
renderChildrenDirect(vnode, sink, ctx);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (typeof type === "symbol") {
|
|
45
|
+
renderChildrenDirect(vnode, sink, ctx);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (typeof type === "function") {
|
|
49
|
+
renderNodeToSink(executeComponent(type, vnode.props, ctx), sink, ctx);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const tag = type;
|
|
53
|
+
const props = vnode.props;
|
|
54
|
+
const dangerous = props?.dangerouslySetInnerHTML;
|
|
55
|
+
const dangerousHtml = dangerous && typeof dangerous === "object" && "__html" in dangerous ? String(dangerous.__html) : void 0;
|
|
56
|
+
if (VOID_ELEMENTS.has(tag)) {
|
|
57
|
+
sink.write("<");
|
|
58
|
+
sink.write(tag);
|
|
59
|
+
renderAttrsDirect(props, sink);
|
|
60
|
+
sink.write(" />");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
sink.write("<");
|
|
64
|
+
sink.write(tag);
|
|
65
|
+
renderAttrsDirect(props, sink);
|
|
66
|
+
sink.write(">");
|
|
67
|
+
if (dangerousHtml !== void 0) sink.write(dangerousHtml);
|
|
68
|
+
else renderChildrenDirect(vnode, sink, ctx);
|
|
69
|
+
sink.write("</");
|
|
70
|
+
sink.write(tag);
|
|
71
|
+
sink.write(">");
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { renderNodeToSink };
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=stream-render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-render.js","names":[],"sources":["../../src/ssr/stream-render.ts"],"sourcesContent":["import type { Props } from '../common/props';\nimport type { RenderSink } from './sink';\nimport type { VNode, SSRComponent } from './types';\nimport { Fragment } from '../jsx';\nimport { type RenderContext, throwSSRDataMissing } from './context';\nimport { VOID_ELEMENTS, escapeText } from './escape';\nimport { renderAttrsDirect } from './attrs';\n\n// Re-export for backwards compatibility\nexport type Component = SSRComponent;\n\n// Legacy alias for context type\nexport type SSRContext = RenderContext;\n\nfunction isPromiseLike(x: unknown): x is PromiseLike<unknown> {\n if (!x || typeof x !== 'object') return false;\n return typeof (x as { then?: unknown }).then === 'function';\n}\n\nfunction executeComponent(\n type: Component,\n props: Props | undefined,\n ctx: RenderContext\n): unknown {\n const res = type(props ?? {}, { signal: ctx.signal });\n if (isPromiseLike(res)) {\n throwSSRDataMissing();\n }\n return res;\n}\n\n// Render children directly without allocating wrapper array when possible\nfunction renderChildrenDirect(\n node: Record<string, unknown>,\n sink: RenderSink,\n ctx: RenderContext\n): void {\n // Prefer explicit children; fallback to props.children\n let raw: unknown = node.children;\n if (raw === undefined) {\n raw = (node.props as Record<string, unknown> | undefined)?.children;\n }\n\n if (raw === null || raw === undefined || raw === false) return;\n\n if (Array.isArray(raw)) {\n for (let i = 0; i < raw.length; i++) {\n renderNodeToSink(raw[i], sink, ctx);\n }\n return;\n }\n\n // Single child - no array allocation\n renderNodeToSink(raw, sink, ctx);\n}\n\nexport function renderNodeToSink(\n node: unknown,\n sink: RenderSink,\n ctx: RenderContext\n): void {\n if (node === null || node === undefined) return;\n\n // Fast path: primitive strings\n if (typeof node === 'string') {\n sink.write(escapeText(node));\n return;\n }\n\n // Fast path: numbers\n if (typeof node === 'number') {\n sink.write(String(node));\n return;\n }\n\n // Skip booleans (false is common from conditional rendering)\n if (typeof node === 'boolean') return;\n\n // Must be object at this point\n if (typeof node !== 'object') return;\n\n const vnode = node as VNode;\n const type = vnode.type;\n\n // Fragment: render children directly (canonical check via === is fastest)\n if (type === Fragment) {\n renderChildrenDirect(\n vnode as unknown as Record<string, unknown>,\n sink,\n ctx\n );\n return;\n }\n\n // Symbol type that isn't our Fragment\n if (typeof type === 'symbol') {\n // Unknown symbol - render children as fragment fallback\n renderChildrenDirect(\n vnode as unknown as Record<string, unknown>,\n sink,\n ctx\n );\n return;\n }\n\n // Function component\n if (typeof type === 'function') {\n const out = executeComponent(type as Component, vnode.props, ctx);\n renderNodeToSink(out, sink, ctx);\n return;\n }\n\n // Element node (type is string)\n const tag = type as string;\n const props = vnode.props;\n\n // Check for dangerouslySetInnerHTML\n const dangerous = props?.dangerouslySetInnerHTML as\n | { __html: unknown }\n | undefined;\n const dangerousHtml =\n dangerous && typeof dangerous === 'object' && '__html' in dangerous\n ? String(dangerous.__html)\n : undefined;\n\n // Void element - self-closing\n if (VOID_ELEMENTS.has(tag)) {\n sink.write('<');\n sink.write(tag);\n renderAttrsDirect(props, sink);\n sink.write(' />');\n return;\n }\n\n // Regular element\n sink.write('<');\n sink.write(tag);\n renderAttrsDirect(props, sink);\n sink.write('>');\n\n if (dangerousHtml !== undefined) {\n sink.write(dangerousHtml);\n } else {\n renderChildrenDirect(\n vnode as unknown as Record<string, unknown>,\n sink,\n ctx\n );\n }\n\n sink.write('</');\n sink.write(tag);\n sink.write('>');\n}\n"],"mappings":";;;;;;AAcA,SAAS,cAAc,GAAuC;AAC5D,KAAI,CAAC,KAAK,OAAO,MAAM,SAAU,QAAO;AACxC,QAAO,OAAQ,EAAyB,SAAS;;AAGnD,SAAS,iBACP,MACA,OACA,KACS;CACT,MAAM,MAAM,KAAK,SAAS,EAAE,EAAE,EAAE,QAAQ,IAAI,QAAQ,CAAC;AACrD,KAAI,cAAc,IAAI,CACpB,sBAAqB;AAEvB,QAAO;;AAIT,SAAS,qBACP,MACA,MACA,KACM;CAEN,IAAI,MAAe,KAAK;AACxB,KAAI,QAAQ,OACV,OAAO,KAAK,OAA+C;AAG7D,KAAI,QAAQ,QAAQ,QAAQ,UAAa,QAAQ,MAAO;AAExD,KAAI,MAAM,QAAQ,IAAI,EAAE;AACtB,OAAK,IAAI,IAAI,GAAG,IAAI,IAAI,QAAQ,IAC9B,kBAAiB,IAAI,IAAI,MAAM,IAAI;AAErC;;AAIF,kBAAiB,KAAK,MAAM,IAAI;;AAGlC,SAAgB,iBACd,MACA,MACA,KACM;AACN,KAAI,SAAS,QAAQ,SAAS,OAAW;AAGzC,KAAI,OAAO,SAAS,UAAU;AAC5B,OAAK,MAAM,WAAW,KAAK,CAAC;AAC5B;;AAIF,KAAI,OAAO,SAAS,UAAU;AAC5B,OAAK,MAAM,OAAO,KAAK,CAAC;AACxB;;AAIF,KAAI,OAAO,SAAS,UAAW;AAG/B,KAAI,OAAO,SAAS,SAAU;CAE9B,MAAM,QAAQ;CACd,MAAM,OAAO,MAAM;AAGnB,KAAI,SAAS,UAAU;AACrB,uBACE,OACA,MACA,IACD;AACD;;AAIF,KAAI,OAAO,SAAS,UAAU;AAE5B,uBACE,OACA,MACA,IACD;AACD;;AAIF,KAAI,OAAO,SAAS,YAAY;AAE9B,mBADY,iBAAiB,MAAmB,MAAM,OAAO,IAC5C,EAAK,MAAM,IAAI;AAChC;;CAIF,MAAM,MAAM;CACZ,MAAM,QAAQ,MAAM;CAGpB,MAAM,YAAY,OAAO;CAGzB,MAAM,gBACJ,aAAa,OAAO,cAAc,YAAY,YAAY,YACtD,OAAO,UAAU,OAAO,GACxB;AAGN,KAAI,cAAc,IAAI,IAAI,EAAE;AAC1B,OAAK,MAAM,IAAI;AACf,OAAK,MAAM,IAAI;AACf,oBAAkB,OAAO,KAAK;AAC9B,OAAK,MAAM,MAAM;AACjB;;AAIF,MAAK,MAAM,IAAI;AACf,MAAK,MAAM,IAAI;AACf,mBAAkB,OAAO,KAAK;AAC9B,MAAK,MAAM,IAAI;AAEf,KAAI,kBAAkB,OACpB,MAAK,MAAM,cAAc;KAEzB,sBACE,OACA,MACA,IACD;AAGH,MAAK,MAAM,KAAK;AAChB,MAAK,MAAM,IAAI;AACf,MAAK,MAAM,IAAI"}
|
package/dist/ssr/types.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import type { RenderContext } from './context';
|
|
1
|
+
import { Props } from "../common/props.js";
|
|
2
|
+
import { JSXElement } from "../common/jsx.js";
|
|
3
|
+
import { RenderContext } from "./context.js";
|
|
4
|
+
|
|
5
|
+
//#region src/ssr/types.d.ts
|
|
7
6
|
/** VNode representation for SSR rendering */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
type VNode = {
|
|
8
|
+
type: string | SSRComponent | symbol;
|
|
9
|
+
props?: Props;
|
|
10
|
+
children?: unknown[];
|
|
12
11
|
};
|
|
13
12
|
/**
|
|
14
13
|
* Component function signature for SSR.
|
|
15
14
|
* Components receive props and an optional context with signal and SSR context.
|
|
16
15
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
type SSRComponent = (props: Props, context?: {
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
ssr?: RenderContext;
|
|
20
19
|
}) => VNode | JSXElement | string | number | boolean | null | undefined;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { SSRComponent, VNode };
|
|
21
22
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/ssr/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/ssr/types.ts"],"mappings":";;;;;;KASY,KAAA;EACV,IAAA,WAAe,YAAA;EACf,KAAA,GAAQ,KAAA;EACR,QAAA;AAAA;;;;;KAOU,YAAA,IACV,KAAA,EAAO,KAAA,EACP,OAAA;EAAY,MAAA,GAAS,WAAA;EAAa,GAAA,GAAM,aAAA;AAAA,MACrC,KAAA,GAAQ,UAAA"}
|
package/package.json
CHANGED
|
@@ -1,42 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askrjs/askr",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"description": "Actor-backed deterministic UI framework",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
5
|
+
"keywords": [
|
|
6
|
+
"askr",
|
|
7
|
+
"framework",
|
|
8
|
+
"jsx",
|
|
9
|
+
"ssr",
|
|
10
|
+
"ui"
|
|
11
|
+
],
|
|
11
12
|
"homepage": "https://github.com/askrjs/askr#readme",
|
|
12
13
|
"bugs": {
|
|
13
14
|
"url": "https://github.com/askrjs/askr/issues"
|
|
14
15
|
},
|
|
16
|
+
"license": "Apache-2.0",
|
|
15
17
|
"author": {
|
|
16
18
|
"name": "askrjs",
|
|
17
19
|
"url": "https://github.com/askrjs"
|
|
18
20
|
},
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
"jsx",
|
|
24
|
-
"ssr"
|
|
25
|
-
],
|
|
26
|
-
"main": "./dist/index.js",
|
|
27
|
-
"types": "./dist/index.d.ts",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/askrjs/askr.git"
|
|
24
|
+
},
|
|
28
25
|
"files": [
|
|
29
26
|
"dist"
|
|
30
27
|
],
|
|
28
|
+
"type": "module",
|
|
31
29
|
"sideEffects": [],
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
32
|
"exports": {
|
|
33
33
|
".": {
|
|
34
34
|
"import": "./dist/index.js",
|
|
35
35
|
"types": "./dist/index.d.ts"
|
|
36
36
|
},
|
|
37
|
-
"./
|
|
38
|
-
"import": "./dist/
|
|
39
|
-
"types": "./dist/
|
|
37
|
+
"./boot": {
|
|
38
|
+
"import": "./dist/boot/index.js",
|
|
39
|
+
"types": "./dist/boot/index.d.ts"
|
|
40
|
+
},
|
|
41
|
+
"./control": {
|
|
42
|
+
"import": "./dist/control/index.js",
|
|
43
|
+
"types": "./dist/control/index.d.ts"
|
|
40
44
|
},
|
|
41
45
|
"./foundations": {
|
|
42
46
|
"import": "./dist/foundations/index.js",
|
|
@@ -69,64 +73,40 @@
|
|
|
69
73
|
"./jsx-dev-runtime": {
|
|
70
74
|
"import": "./dist/jsx-dev-runtime.js",
|
|
71
75
|
"types": "./dist/jsx-dev-runtime.d.ts"
|
|
72
|
-
},
|
|
73
|
-
"./vite": {
|
|
74
|
-
"import": "./dist/vite/index.js",
|
|
75
|
-
"types": "./dist/vite/index.d.ts"
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
"bin": {
|
|
79
|
-
"askr-ssg": "./dist/bin/askr-ssg.js"
|
|
80
|
-
},
|
|
81
78
|
"publishConfig": {
|
|
82
79
|
"access": "public"
|
|
83
80
|
},
|
|
84
81
|
"scripts": {
|
|
85
|
-
"build": "
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"test": "
|
|
94
|
-
"test:
|
|
95
|
-
"test:
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"bench": "
|
|
99
|
-
"bench:
|
|
100
|
-
"bench:
|
|
101
|
-
"bench:watch": "cross-env NODE_ENV=production vitest bench -c vitest.bench.dom.config.ts --watch",
|
|
102
|
-
"bench:watch:ssr": "cross-env NODE_ENV=production vitest bench -c vitest.bench.ssr.config.ts --watch",
|
|
103
|
-
"bench:tier1": "npm run bench:tier1:dom && npm run bench:tier1:ssr",
|
|
104
|
-
"bench:tier1:dom": "cross-env NODE_ENV=production vitest bench -c vitest.bench.dom.config.ts benches/tier1/ --run",
|
|
105
|
-
"bench:tier1:ssr": "cross-env NODE_ENV=production vitest bench -c vitest.bench.ssr.config.ts benches/tier1/ --run",
|
|
106
|
-
"bench:tier2": "npm run bench:tier2:dom && npm run bench:tier2:ssr",
|
|
107
|
-
"bench:tier2:dom": "cross-env NODE_ENV=production vitest bench -c vitest.bench.dom.config.ts benches/tier2/ --run",
|
|
108
|
-
"bench:tier2:ssr": "cross-env NODE_ENV=production vitest bench -c vitest.bench.ssr.config.ts benches/tier2/ --run",
|
|
109
|
-
"bench:tier3": "cross-env NODE_ENV=production vitest bench -c vitest.bench.dom.config.ts benches/tier3/ --run",
|
|
110
|
-
"bench:tier4": "cross-env NODE_ENV=production vitest bench -c vitest.bench.dom.config.ts benches/tier4/ --run",
|
|
111
|
-
"bench:json": "node -e \"const fs=require('node:fs'); fs.rmSync('bench-results',{recursive:true,force:true}); fs.mkdirSync('bench-results',{recursive:true});\" && cross-env NODE_ENV=production vitest bench -c vitest.bench.dom.config.ts --run --outputJson bench-results/dom.json && cross-env NODE_ENV=production vitest bench -c vitest.bench.ssr.config.ts --run --outputJson bench-results/ssr.json && node scripts/generate-bench-log.js",
|
|
112
|
-
"perf:size": "node scripts/check-size-budgets.mjs",
|
|
113
|
-
"perf:release": "npm run bench:json && npm run perf:size",
|
|
114
|
-
"fmt": "prettier --write .",
|
|
115
|
-
"lint": "eslint src tests checks benches --ext .ts,.tsx"
|
|
82
|
+
"build": "vp pack",
|
|
83
|
+
"dev": "vp dev",
|
|
84
|
+
"fmt": "vp fmt .",
|
|
85
|
+
"lint": "vp lint src tests test-utils checks benches",
|
|
86
|
+
"test": "npm run test:unit && npm run test:jsdom && npm run test:browser && npm run test:a11y && npm run test:browser:smoke",
|
|
87
|
+
"test:a11y": "playwright test tests/playwright/a11y --project=chromium-a11y",
|
|
88
|
+
"test:browser": "playwright test tests/playwright/e2e --project=chromium",
|
|
89
|
+
"test:browser:smoke": "playwright install chromium firefox webkit && playwright test tests/playwright/e2e --project=chromium --project=firefox --project=webkit --grep @smoke",
|
|
90
|
+
"test:jsdom": "vp test run -c vitest.jsdom.config.ts",
|
|
91
|
+
"test:types": "vp pack && tsd",
|
|
92
|
+
"test:unit": "vp test run -c vitest.unit.config.ts",
|
|
93
|
+
"bench": "vp test bench -c vitest.bench.micro.config.ts --run && vp test bench -c vitest.bench.dom.config.ts --run && vp test bench -c vitest.bench.ssr.config.ts --run",
|
|
94
|
+
"bench:tier1": "vp test bench -c vitest.bench.micro.config.ts benches/micro/tier1/ --run && vp test bench -c vitest.bench.dom.config.ts benches/jsdom/tier1/ --run && vp test bench -c vitest.bench.ssr.config.ts benches/ssr/tier1/ --run",
|
|
95
|
+
"bench:tier2": "vp test bench -c vitest.bench.dom.config.ts benches/jsdom/tier2/ --run && vp test bench -c vitest.bench.ssr.config.ts benches/ssr/tier2/ --run",
|
|
96
|
+
"bench:tier3": "vp test bench -c vitest.bench.dom.tier3.config.ts --run",
|
|
97
|
+
"bench:tier4": "vp test bench -c vitest.bench.dom.tier4.config.ts --run"
|
|
116
98
|
},
|
|
117
99
|
"devDependencies": {
|
|
118
|
-
"@
|
|
119
|
-
"@
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"jiti": "^2.6.1",
|
|
124
|
-
"jsdom": "^28.1.0",
|
|
125
|
-
"prettier": "^3.8.1",
|
|
100
|
+
"@axe-core/playwright": "^4.11.2",
|
|
101
|
+
"@playwright/test": "^1.59.1",
|
|
102
|
+
"@types/node": "^25.6.0",
|
|
103
|
+
"jsdom": "^29.1.0",
|
|
104
|
+
"playwright": "^1.59.1",
|
|
126
105
|
"tsd": "^0.33.0",
|
|
127
|
-
"typescript": "^
|
|
128
|
-
"
|
|
129
|
-
|
|
130
|
-
|
|
106
|
+
"typescript": "^6.0.3",
|
|
107
|
+
"vite-plus": "^0.1.20"
|
|
108
|
+
},
|
|
109
|
+
"engines": {
|
|
110
|
+
"node": ">=18"
|
|
131
111
|
}
|
|
132
112
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"./__vite-browser-external.js";import{getAugmentedNamespace as r}from"./_commonjsHelpers.js";const o=r(e);export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={};export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function f(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function l(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}function c(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var a=e.default;if(typeof a=="function"){var t=function r(){var o=!1;try{o=this instanceof r}catch{}return o?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};t.prototype=a.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),t}export{n as commonjsGlobal,c as getAugmentedNamespace,u as getDefaultExportFromCjs,l as getDefaultExportFromNamespaceIfNotNamed,f as getDefaultExportFromNamespaceIfPresent};
|
package/dist/_virtual/_fs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{default as o}from"fs";export{o as default};
|
package/dist/_virtual/_path.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{default as o}from"path";export{o as default};
|
package/dist/_virtual/main.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getDefaultExportFromCjs as f}from"./_commonjsHelpers.js";import{__require as s}from"../node_modules/esbuild/lib/main.js";function u(t,n){for(var o=0;o<n.length;o++){const e=n[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(e,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var i=s();const c=f(i),l=u({__proto__:null,default:c},[i]);export{c as default,l as m};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const p="modulepreload",y=function(a){return"/"+a},m={},P=function(v,i,u){let f=Promise.resolve();if(i&&i.length>0){let E=function(e){return Promise.all(e.map(o=>Promise.resolve(o).then(s=>({status:"fulfilled",value:s}),s=>({status:"rejected",reason:s}))))};const r=document.getElementsByTagName("link"),t=document.querySelector("meta[property=csp-nonce]"),h=t?.nonce||t?.getAttribute("nonce");f=E(i.map(e=>{if(e=y(e,u),e in m)return;m[e]=!0;const o=e.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(u)for(let c=r.length-1;c>=0;c--){const l=r[c];if(l.href===e&&(!o||l.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${e}"]${s}`))return;const n=document.createElement("link");if(n.rel=o?"stylesheet":p,o||(n.as="script"),n.crossOrigin="",n.href=e,h&&n.setAttribute("nonce",h),document.head.appendChild(n),o)return new Promise((c,l)=>{n.addEventListener("load",c),n.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${e}`)))})}))}function d(r){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=r,window.dispatchEvent(t),!t.defaultPrevented)throw r}return f.then(r=>{for(const t of r||[])t.status==="rejected"&&d(t.reason);return v().catch(d)})};export{P as __vitePreload};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
type RowData = {
|
|
2
|
-
id: number;
|
|
3
|
-
label: string;
|
|
4
|
-
};
|
|
5
|
-
export declare function mountBenchmark(root: Element, initialRows?: RowData[]): {
|
|
6
|
-
setRows(rows: RowData[]): void;
|
|
7
|
-
setSelected(id: number | null): void;
|
|
8
|
-
cleanup(): void;
|
|
9
|
-
};
|
|
10
|
-
declare const _default: {
|
|
11
|
-
mountBenchmark: typeof mountBenchmark;
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|
|
14
|
-
//# sourceMappingURL=benchmark-entry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"benchmark-entry.d.ts","sourceRoot":"","sources":["../../src/bench/benchmark-entry.tsx"],"names":[],"mappings":"AAKA,KAAK,OAAO,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7C,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,OAAO,EAAE;kBAsEnD,OAAO,EAAE;oBAMP,MAAM,GAAG,IAAI;;EAQhC;;;;AAED,wBAAkC"}
|
package/dist/common/errors.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error handling utilities
|
|
3
|
-
* No framework magic — just JavaScript patterns
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Safe wrapper for async functions
|
|
7
|
-
* Returns result or error value without throwing
|
|
8
|
-
*
|
|
9
|
-
* Useful for: async operations where you want to handle errors inline
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* const { data, error } = await handle(fetchUser(id));
|
|
14
|
-
* if (error) return renderError(error);
|
|
15
|
-
* return renderData(data);
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare function handle<T>(promise: Promise<T>): Promise<{
|
|
19
|
-
data: T | null;
|
|
20
|
-
error: Error | null;
|
|
21
|
-
}>;
|
|
22
|
-
/**
|
|
23
|
-
* Catch errors in async operations and render fallback
|
|
24
|
-
* Returns fallback value if error occurs
|
|
25
|
-
*
|
|
26
|
-
* Useful for: graceful degradation
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const data = await catchError(
|
|
31
|
-
* fetchData(),
|
|
32
|
-
* { type: 'div', children: ['Failed to load'] }
|
|
33
|
-
* );
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export declare function catchError<T>(promise: Promise<T>, fallback: T): Promise<T>;
|
|
37
|
-
/**
|
|
38
|
-
* Try/catch helper with typed error handling
|
|
39
|
-
* Useful for: logging and recovery strategies
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```ts
|
|
43
|
-
* const result = await tryWithLogging(
|
|
44
|
-
* () => fetch(url),
|
|
45
|
-
* { message: 'Failed to fetch', retryable: true }
|
|
46
|
-
* );
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export declare function tryWithLogging<T>(fn: () => Promise<T>, errorInfo?: {
|
|
50
|
-
message?: string;
|
|
51
|
-
retryable?: boolean;
|
|
52
|
-
}): Promise<T | null>;
|
|
53
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;;;;GAYG;AACH,wBAAsB,MAAM,CAAC,CAAC,EAC5B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,OAAO,CAAC;IAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CAAE,CAAC,CAOlD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,QAAQ,EAAE,CAAC,GACV,OAAO,CAAC,CAAC,CAAC,CAMZ;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAAC,CAAC,EACpC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,SAAS,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GACpD,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAQnB"}
|