@abide/abide 0.58.0 → 0.101.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/CHANGELOG.md +11 -1774
- package/bin/abide.ts +793 -204
- package/package.json +35 -152
- package/scaffold/src/server/app.ts +6 -0
- package/scaffold/src/shared/.gitkeep +0 -0
- package/scaffold/src/ui/app.html +8 -0
- package/scaffold/src/ui/pages/page.abide +13 -0
- package/src/compiler/CHARACTER_REFERENCES.ts +2242 -0
- package/src/compiler/CheckerAnswer.ts +62 -0
- package/src/compiler/Cursor.ts +367 -0
- package/src/compiler/Finding.ts +2 -0
- package/src/compiler/Lowering.ts +648 -0
- package/src/compiler/PositionTable.ts +125 -0
- package/src/compiler/REACTIVE_MEMBERS.ts +36 -0
- package/src/compiler/SHARED_NAMES.ts +45 -0
- package/src/compiler/SPECIFIERS.ts +16 -0
- package/src/compiler/ShadowMap.ts +144 -0
- package/src/compiler/TemplateNode.ts +176 -0
- package/src/compiler/TypeSession.ts +1079 -0
- package/src/compiler/VOID_ELEMENTS.ts +22 -0
- package/src/compiler/aliasedSymbol.ts +15 -0
- package/src/compiler/ambientReadsIn.ts +152 -0
- package/src/compiler/argsDefaultsIn.ts +173 -0
- package/src/compiler/argsSchemaOf.ts +230 -0
- package/src/compiler/checkApp.ts +117 -0
- package/src/compiler/checkedShadow.ts +182 -0
- package/src/compiler/classifyRead.ts +577 -0
- package/src/compiler/classifyTemplate.ts +501 -0
- package/src/compiler/compileApp.ts +559 -0
- package/src/compiler/compiledEntry.ts +141 -0
- package/src/compiler/componentGraph.ts +139 -0
- package/src/compiler/declaredExports.ts +645 -0
- package/src/compiler/decodeCharacterReferences.ts +111 -0
- package/src/compiler/emitClient.ts +1343 -0
- package/src/compiler/emitComponent.ts +162 -0
- package/src/compiler/emitSource.ts +91 -0
- package/src/compiler/formatDiagnosis.ts +19 -0
- package/src/compiler/handlersUnder.ts +112 -0
- package/src/compiler/index.ts +15 -0
- package/src/compiler/invocationProps.ts +67 -0
- package/src/compiler/isNamedAlone.ts +9 -0
- package/src/compiler/lineOf.ts +38 -0
- package/src/compiler/parseAbide.ts +1341 -0
- package/src/compiler/projectShadow.ts +643 -0
- package/src/compiler/reactiveOptions.ts +82 -0
- package/src/compiler/reactiveTypes.ts +222 -0
- package/src/compiler/readSources.ts +100 -0
- package/src/compiler/readsIn.ts +1023 -0
- package/src/compiler/renderMarkup.ts +781 -0
- package/src/compiler/scaffold.ts +105 -0
- package/src/compiler/scopeStyles.ts +309 -0
- package/src/compiler/serveLanguage.ts +405 -0
- package/src/compiler/shareScope.ts +51 -0
- package/src/compiler/sharedModuleWrites.ts +88 -0
- package/src/compiler/splitImports.ts +387 -0
- package/src/compiler/templateWarnings.ts +128 -0
- package/src/compiler/tokenize.ts +317 -0
- package/src/compiler/trackingWarnings.ts +279 -0
- package/src/compiler/writeDefaultProject.ts +42 -0
- package/src/server/BRIDGE_VERSION.ts +3 -0
- package/src/server/CLIENT_BUILD.ts +56 -0
- package/src/server/DEFAULT_PORT.ts +6 -0
- package/src/server/DOCUMENT_HEADERS.ts +11 -0
- package/src/server/Inbox.ts +36 -0
- package/src/server/LogPanel.ts +239 -0
- package/src/server/MCP_PROTOCOL_VERSION.ts +3 -0
- package/src/server/SETTLE_MILLISECONDS.ts +7 -0
- package/src/server/VIRTUAL_DIRECTORY.ts +6 -0
- package/src/server/answerFailure.ts +91 -0
- package/src/server/answerRequest.ts +560 -0
- package/src/server/answerRpc.ts +550 -0
- package/src/server/answerSocket.ts +585 -0
- package/src/server/answerValue.ts +375 -0
- package/src/server/appDirectories.ts +9 -0
- package/src/server/appKit.ts +204 -0
- package/src/server/appPlugins.ts +26 -0
- package/src/server/argsFor.ts +40 -0
- package/src/server/assistant.ts +163 -0
- package/src/server/banner.ts +43 -0
- package/src/server/bridgeRelay.ts +249 -0
- package/src/server/buildDirectory.ts +10 -0
- package/src/server/callerOf.ts +60 -0
- package/src/server/claudeApi.ts +224 -0
- package/src/server/claudeCode.ts +187 -0
- package/src/server/clientBuildOptions.ts +49 -0
- package/src/server/coerceArgs.ts +110 -0
- package/src/server/commands.ts +442 -0
- package/src/server/componentImports.ts +56 -0
- package/src/server/componentModules.d.ts +9 -0
- package/src/server/compressAnswer.ts +100 -0
- package/src/server/config.ts +192 -0
- package/src/server/configFields.ts +92 -0
- package/src/server/createApp.ts +428 -0
- package/src/server/crossingOrigin.ts +49 -0
- package/src/server/csp.ts +77 -0
- package/src/server/devWorker.ts +641 -0
- package/src/server/faultPolicy.ts +59 -0
- package/src/server/fenceServer.ts +48 -0
- package/src/server/generatedSurfaces.ts +430 -0
- package/src/server/hooks.ts +190 -0
- package/src/server/index.ts +87 -0
- package/src/server/installServer.ts +47 -0
- package/src/server/launcherOptions.ts +62 -0
- package/src/server/launcherPage.ts +156 -0
- package/src/server/manifestOf.ts +114 -0
- package/src/server/muxUpgrade.ts +72 -0
- package/src/server/namesUnder.ts +15 -0
- package/src/server/nativeMenu.ts +296 -0
- package/src/server/negotiateEncoding.ts +39 -0
- package/src/server/plainAnswer.ts +19 -0
- package/src/server/prefers.ts +25 -0
- package/src/server/principal.ts +261 -0
- package/src/server/qualitiesOf.ts +22 -0
- package/src/server/randomToken.ts +9 -0
- package/src/server/reachable.ts +31 -0
- package/src/server/refuseAddressCollision.ts +30 -0
- package/src/server/remote.ts +242 -0
- package/src/server/render.ts +464 -0
- package/src/server/renderComponent.ts +33 -0
- package/src/server/reportHealth.ts +46 -0
- package/src/server/requestScope.ts +435 -0
- package/src/server/responseHelpers.ts +75 -0
- package/src/server/runCompiled.ts +44 -0
- package/src/server/runDesktop.ts +572 -0
- package/src/server/seedBuffer.ts +293 -0
- package/src/server/serveBuild.ts +198 -0
- package/src/server/serveDev.ts +505 -0
- package/src/server/shell.ts +506 -0
- package/src/server/surfaceOf.ts +47 -0
- package/src/server/testBuild.ts +237 -0
- package/src/server/trace.ts +151 -0
- package/src/server/versionOf.ts +109 -0
- package/src/server/withoutTrailingSlash.ts +4 -0
- package/src/shared/ADDRESSES.ts +69 -0
- package/src/shared/ANCHORS.ts +54 -0
- package/src/shared/Attributes.ts +339 -0
- package/src/shared/BOOLEAN_ATTRIBUTES.ts +41 -0
- package/src/shared/CHILDREN.ts +11 -0
- package/src/shared/CURRENT_ROUTER.ts +25 -0
- package/src/shared/CopyOptions.ts +19 -0
- package/src/shared/DEBUG_META.ts +6 -0
- package/src/shared/EARLY_CALLS.ts +8 -0
- package/src/shared/FAILURE_STATUS_TEXT.ts +48 -0
- package/src/shared/Failed.ts +146 -0
- package/src/shared/GLOBAL_GETS.ts +13 -0
- package/src/shared/Issues.ts +49 -0
- package/src/shared/JsonValue.ts +18 -0
- package/src/shared/LOAD_SIGNAL.ts +10 -0
- package/src/shared/MOUNT_META.ts +6 -0
- package/src/shared/Middleware.ts +34 -0
- package/src/shared/NAVIGATION_HEADER.ts +7 -0
- package/src/shared/PRINCIPAL_HEADER.ts +6 -0
- package/src/shared/RPC_SERVER.ts +67 -0
- package/src/shared/Raw.ts +90 -0
- package/src/shared/Schema.ts +229 -0
- package/src/shared/UNEXPECTED.ts +11 -0
- package/src/shared/URL_ATTRIBUTES.ts +19 -0
- package/src/shared/VERSION_HEADER.ts +6 -0
- package/src/shared/WORK.ts +37 -0
- package/src/shared/anchorMarkup.ts +15 -0
- package/src/shared/answerOf.ts +141 -0
- package/src/shared/applyPatch.ts +173 -0
- package/src/shared/armAnchor.ts +17 -0
- package/src/shared/attributeText.ts +50 -0
- package/src/shared/boundValue.ts +58 -0
- package/src/shared/cookies.ts +271 -0
- package/src/shared/csp.ts +55 -0
- package/src/shared/decodedOrKept.ts +14 -0
- package/src/shared/escapeText.ts +103 -0
- package/src/shared/framing.ts +131 -0
- package/src/shared/headKeyOf.ts +34 -0
- package/src/shared/health.ts +51 -0
- package/src/shared/index.ts +117 -0
- package/src/shared/isEventName.ts +10 -0
- package/src/shared/isRecord.ts +4 -0
- package/src/shared/issuesOf.ts +18 -0
- package/src/shared/jsonSchema.ts +50 -0
- package/src/shared/listOf.ts +20 -0
- package/src/shared/log.ts +284 -0
- package/src/shared/matchRoute.ts +99 -0
- package/src/shared/menuItem.ts +80 -0
- package/src/shared/mount.ts +45 -0
- package/src/shared/muxFrames.ts +35 -0
- package/src/shared/navigate.ts +26 -0
- package/src/shared/note.ts +24 -0
- package/src/shared/numberFromText.ts +10 -0
- package/src/shared/online.ts +19 -0
- package/src/shared/paint.ts +4 -0
- package/src/shared/principal.ts +145 -0
- package/src/shared/principalRotated.ts +47 -0
- package/src/shared/propCell.ts +99 -0
- package/src/shared/props.ts +24 -0
- package/src/shared/putOwn.ts +24 -0
- package/src/shared/queryText.ts +18 -0
- package/src/shared/reactive/CELL.ts +8 -0
- package/src/shared/reactive/Cursor.ts +217 -0
- package/src/shared/reactive/ENTRY_LIVES.ts +7 -0
- package/src/shared/reactive/Expiry.ts +103 -0
- package/src/shared/reactive/FOLLOWED.ts +8 -0
- package/src/shared/reactive/KEYED_BRAND.ts +8 -0
- package/src/shared/reactive/Keyed.ts +424 -0
- package/src/shared/reactive/MUTATION.ts +5 -0
- package/src/shared/reactive/NO_INITIAL.ts +6 -0
- package/src/shared/reactive/NotLanded.ts +21 -0
- package/src/shared/reactive/PATCHES.ts +11 -0
- package/src/shared/reactive/PATCH_SINKS.ts +26 -0
- package/src/shared/reactive/REACTIVE_BRAND.ts +9 -0
- package/src/shared/reactive/RESHAPING.ts +13 -0
- package/src/shared/reactive/Reactive.ts +4501 -0
- package/src/shared/reactive/SELECTION_MEMBERS.ts +12 -0
- package/src/shared/reactive/STREAMING.ts +5 -0
- package/src/shared/reactive/argsContract.ts +97 -0
- package/src/shared/reactive/byOf.ts +18 -0
- package/src/shared/reactive/callLoad.ts +200 -0
- package/src/shared/reactive/canonicalKey.ts +95 -0
- package/src/shared/reactive/chunksOfStream.ts +51 -0
- package/src/shared/reactive/index.ts +542 -0
- package/src/shared/reactive/isReactive.ts +19 -0
- package/src/shared/reactive/isThenable.ts +14 -0
- package/src/shared/reactive/matchesPattern.ts +16 -0
- package/src/shared/reactive/pairReactive.ts +41 -0
- package/src/shared/reactive/parameterDefaults.ts +356 -0
- package/src/shared/reactive/recordWrites.ts +472 -0
- package/src/shared/reactive/scoped.ts +157 -0
- package/src/shared/reactive/scoping.ts +64 -0
- package/src/shared/reactive/share.ts +91 -0
- package/src/shared/reactive/structural.ts +62 -0
- package/src/shared/reactive/tracking.ts +552 -0
- package/src/shared/reactive/watch.ts +314 -0
- package/src/shared/refuse.ts +224 -0
- package/src/shared/route.ts +29 -0
- package/src/shared/routePattern.ts +146 -0
- package/src/shared/rpc.ts +501 -0
- package/src/shared/rpcRequest.ts +73 -0
- package/src/shared/safeUrl.ts +68 -0
- package/src/shared/seededDocument.ts +36 -0
- package/src/shared/setUpLevels.ts +53 -0
- package/src/shared/slotValue.ts +34 -0
- package/src/shared/spread.ts +79 -0
- package/src/shared/takeEarlyCall.ts +86 -0
- package/src/shared/url.ts +140 -0
- package/src/shared/validateJson.ts +578 -0
- package/src/shared/versionInEtag.ts +14 -0
- package/src/shared/writePath.ts +95 -0
- package/src/ui/ArmRegion.ts +185 -0
- package/src/ui/LAYER_NAMES.ts +30 -0
- package/src/ui/List.ts +273 -0
- package/src/ui/Mismatch.ts +32 -0
- package/src/ui/RawRun.ts +99 -0
- package/src/ui/Router.ts +698 -0
- package/src/ui/Scope.ts +115 -0
- package/src/ui/TryRegion.ts +278 -0
- package/src/ui/adoptWalk.ts +126 -0
- package/src/ui/applyHead.ts +146 -0
- package/src/ui/bindElement.ts +44 -0
- package/src/ui/bindProperty.ts +79 -0
- package/src/ui/bindSpread.ts +44 -0
- package/src/ui/escapeless.ts +14 -0
- package/src/ui/index.ts +64 -0
- package/src/ui/leave.ts +35 -0
- package/src/ui/listenForRoutes.ts +92 -0
- package/src/ui/measureLayer.ts +34 -0
- package/src/ui/menuBridge.ts +19 -0
- package/src/ui/moveNode.ts +34 -0
- package/src/ui/parseMarkup.ts +35 -0
- package/src/ui/reconcile.ts +368 -0
- package/src/ui/regions.ts +137 -0
- package/src/ui/reportMenu.ts +57 -0
- package/src/ui/routing.ts +18 -0
- package/src/ui/rowKeyOf.ts +19 -0
- package/src/ui/rows.ts +99 -0
- package/src/ui/setAttribute.ts +37 -0
- package/src/ui/setClass.ts +27 -0
- package/src/ui/setMarkup.ts +20 -0
- package/src/ui/setStyleProperty.ts +30 -0
- package/src/ui/setText.ts +28 -0
- package/src/ui/socketWire.ts +258 -0
- package/src/ui/wire.ts +141 -0
- package/AGENTS.md +0 -446
- package/README.md +0 -249
- package/src/abideLsp.ts +0 -251
- package/src/abideModules.d.ts +0 -8
- package/src/abideResolverPlugin.ts +0 -1101
- package/src/appEntry.ts +0 -161
- package/src/assets/app.html +0 -12
- package/src/build.ts +0 -189
- package/src/buildCli.ts +0 -125
- package/src/buildDisconnected.ts +0 -117
- package/src/bundleApp.ts +0 -146
- package/src/bundleDisconnectedEntry.ts +0 -14
- package/src/checkAbide.ts +0 -145
- package/src/cliEntry.ts +0 -25
- package/src/clientBuildPlugins.ts +0 -33
- package/src/clientEntry.ts +0 -17
- package/src/compile.ts +0 -61
- package/src/controlServerWorker.ts +0 -433
- package/src/devEntry.ts +0 -381
- package/src/discoveryEntry.ts +0 -82
- package/src/initAgent.ts +0 -50
- package/src/lib/bundle/BundleMenu.ts +0 -12
- package/src/lib/bundle/BundleMenuItem.ts +0 -25
- package/src/lib/bundle/BundleWindow.ts +0 -37
- package/src/lib/bundle/WEBVIEW_BUILD_REVISION.ts +0 -9
- package/src/lib/bundle/WEBVIEW_VERSION.ts +0 -7
- package/src/lib/bundle/bindConnectedFlag.ts +0 -29
- package/src/lib/bundle/bindRequestNavigate.ts +0 -34
- package/src/lib/bundle/buildWebviewLib.ts +0 -111
- package/src/lib/bundle/bundled.ts +0 -35
- package/src/lib/bundle/disconnected.abide +0 -265
- package/src/lib/bundle/disconnected.css +0 -9
- package/src/lib/bundle/ensureWebviewLib.ts +0 -20
- package/src/lib/bundle/exitWithParent.ts +0 -30
- package/src/lib/bundle/infoPlist.ts +0 -52
- package/src/lib/bundle/installDownloads.ts +0 -34
- package/src/lib/bundle/installMacMenu.ts +0 -49
- package/src/lib/bundle/listenLocalControlServer.ts +0 -19
- package/src/lib/bundle/native/abideMenu.mm +0 -422
- package/src/lib/bundle/native/webview.h +0 -4557
- package/src/lib/bundle/onMenu.ts +0 -42
- package/src/lib/bundle/openWebview.ts +0 -104
- package/src/lib/bundle/pngToIcns.ts +0 -47
- package/src/lib/bundle/probeAbideServer.ts +0 -57
- package/src/lib/bundle/resolveServerBinary.ts +0 -12
- package/src/lib/bundle/resolveWebviewLib.ts +0 -53
- package/src/lib/bundle/serverBinaryFilename.ts +0 -8
- package/src/lib/bundle/signMacApp.ts +0 -37
- package/src/lib/bundle/spawnEmbeddedServer.ts +0 -73
- package/src/lib/bundle/stableLocalPort.ts +0 -19
- package/src/lib/bundle/waitForServer.ts +0 -28
- package/src/lib/bundle/webviewCachePath.ts +0 -23
- package/src/lib/bundle/webviewLibName.ts +0 -11
- package/src/lib/cli/completeCli.ts +0 -38
- package/src/lib/cli/connectToServer.ts +0 -23
- package/src/lib/cli/createClient.ts +0 -108
- package/src/lib/cli/dispatchCommand.ts +0 -72
- package/src/lib/cli/loadEnvFromBinaryDir.ts +0 -15
- package/src/lib/cli/parseArgvForRpc.ts +0 -131
- package/src/lib/cli/printCommandHelp.ts +0 -43
- package/src/lib/cli/printSessionHelp.ts +0 -28
- package/src/lib/cli/printSessionStatus.ts +0 -21
- package/src/lib/cli/printTopLevelHelp.ts +0 -83
- package/src/lib/cli/printTrimmed.ts +0 -8
- package/src/lib/cli/printValue.ts +0 -10
- package/src/lib/cli/renderCliCompletions.ts +0 -56
- package/src/lib/cli/resolveCliTarget.ts +0 -47
- package/src/lib/cli/runCli.ts +0 -188
- package/src/lib/cli/runSession.ts +0 -107
- package/src/lib/cli/startLocalInstance.ts +0 -14
- package/src/lib/cli/tokenizeArgvFlags.ts +0 -86
- package/src/lib/cli/tokenizeLine.ts +0 -51
- package/src/lib/cli/types/CliManifest.ts +0 -11
- package/src/lib/cli/types/CliManifestEntry.ts +0 -17
- package/src/lib/cli/types/CliTarget.ts +0 -13
- package/src/lib/mcp/annotationsForMethod.ts +0 -29
- package/src/lib/mcp/buildPrompts.ts +0 -25
- package/src/lib/mcp/createMcpResourceServer.ts +0 -113
- package/src/lib/mcp/createMcpServer.ts +0 -56
- package/src/lib/mcp/dispatchMcpRequest.ts +0 -159
- package/src/lib/mcp/mcpResourceServerSlot.ts +0 -13
- package/src/lib/mcp/mcpSurface.ts +0 -57
- package/src/lib/mcp/mcpTools.ts +0 -196
- package/src/lib/mcp/renderPrompt.ts +0 -25
- package/src/lib/mcp/toolResultFromResponse.ts +0 -100
- package/src/lib/mcp/types/JsonRpcRequest.ts +0 -12
- package/src/lib/mcp/types/JsonRpcResponse.ts +0 -20
- package/src/lib/mcp/types/McpResourceContents.ts +0 -10
- package/src/lib/mcp/types/McpResourceDescriptor.ts +0 -6
- package/src/lib/mcp/types/McpResourceServer.ts +0 -12
- package/src/lib/mcp/types/McpServer.ts +0 -9
- package/src/lib/mcp/types/McpServerOptions.ts +0 -16
- package/src/lib/mcp/types/McpSurface.ts +0 -15
- package/src/lib/mcp/types/PromptDescriptor.ts +0 -5
- package/src/lib/mcp/types/PromptMessage.ts +0 -2
- package/src/lib/mcp/types/ToolDescriptor.ts +0 -7
- package/src/lib/mcp/types/ToolResult.ts +0 -2
- package/src/lib/server/AppModule.ts +0 -47
- package/src/lib/server/DELETE.ts +0 -10
- package/src/lib/server/GET.ts +0 -10
- package/src/lib/server/HEAD.ts +0 -10
- package/src/lib/server/PATCH.ts +0 -10
- package/src/lib/server/POST.ts +0 -10
- package/src/lib/server/PUT.ts +0 -10
- package/src/lib/server/agent.ts +0 -86
- package/src/lib/server/appDataDir.ts +0 -16
- package/src/lib/server/cli/buildEnvContent.ts +0 -19
- package/src/lib/server/cli/createTarGz.ts +0 -77
- package/src/lib/server/cli/handleCliDownload.ts +0 -152
- package/src/lib/server/cli/handleCliInstall.ts +0 -37
- package/src/lib/server/cli/installScript.ts +0 -31
- package/src/lib/server/cli/maxSourceMtime.ts +0 -26
- package/src/lib/server/cookies.ts +0 -30
- package/src/lib/server/env.ts +0 -51
- package/src/lib/server/error.ts +0 -110
- package/src/lib/server/json.ts +0 -57
- package/src/lib/server/jsonl.ts +0 -47
- package/src/lib/server/prompts/definePrompt.ts +0 -21
- package/src/lib/server/prompts/promptRegistry.ts +0 -9
- package/src/lib/server/prompts/registerPrompt.ts +0 -6
- package/src/lib/server/prompts/renderPromptTemplate.ts +0 -17
- package/src/lib/server/prompts/types/Prompt.ts +0 -14
- package/src/lib/server/prompts/types/PromptOptions.ts +0 -12
- package/src/lib/server/prompts/types/PromptRegistryEntry.ts +0 -13
- package/src/lib/server/prompts/types/PromptRoutes.ts +0 -10
- package/src/lib/server/redirect.ts +0 -43
- package/src/lib/server/render.ts +0 -70
- package/src/lib/server/request.ts +0 -19
- package/src/lib/server/rpc/defineRpc.ts +0 -271
- package/src/lib/server/rpc/dispatchRpcInProcess.ts +0 -46
- package/src/lib/server/rpc/findRpcByCommandName.ts +0 -18
- package/src/lib/server/rpc/parseArgs.ts +0 -244
- package/src/lib/server/rpc/readBodyWithinLimit.ts +0 -47
- package/src/lib/server/rpc/registerRpc.ts +0 -6
- package/src/lib/server/rpc/resolveRpcJsonSchema.ts +0 -28
- package/src/lib/server/rpc/rpcRegistry.ts +0 -11
- package/src/lib/server/rpc/runWithRpcTimeout.ts +0 -58
- package/src/lib/server/rpc/types/RemoteHandler.ts +0 -31
- package/src/lib/server/rpc/types/RemoteRoutes.ts +0 -13
- package/src/lib/server/rpc/types/RpcHelper.ts +0 -185
- package/src/lib/server/rpc/types/RpcRegistryEntry.ts +0 -50
- package/src/lib/server/rpc/types/TypedError.ts +0 -18
- package/src/lib/server/rpc/types/TypedResponse.ts +0 -18
- package/src/lib/server/rpc/unprocessed.ts +0 -13
- package/src/lib/server/rpc/validationError.ts +0 -17
- package/src/lib/server/runtime/DEFAULT_PORT.ts +0 -6
- package/src/lib/server/runtime/DEV_READY_MESSAGE.ts +0 -6
- package/src/lib/server/runtime/DEV_REBUILD_MESSAGE.ts +0 -4
- package/src/lib/server/runtime/DEV_RELOAD_CLIENT_SCRIPT.ts +0 -92
- package/src/lib/server/runtime/SSR_SWAP_SCRIPT.ts +0 -19
- package/src/lib/server/runtime/STATUS_TEXT.ts +0 -22
- package/src/lib/server/runtime/STREAMED_HTML_HEADER.ts +0 -13
- package/src/lib/server/runtime/acceptsGzip.ts +0 -33
- package/src/lib/server/runtime/amendBroadcaster.ts +0 -53
- package/src/lib/server/runtime/buildCacheSnapshot.ts +0 -63
- package/src/lib/server/runtime/buildHealthPayload.ts +0 -34
- package/src/lib/server/runtime/buildInFlightSnapshot.ts +0 -35
- package/src/lib/server/runtime/buildInspectorSurface.ts +0 -47
- package/src/lib/server/runtime/buildOpenApiSpec.ts +0 -150
- package/src/lib/server/runtime/buildPreloadManifest.ts +0 -153
- package/src/lib/server/runtime/cacheControlForAsset.ts +0 -22
- package/src/lib/server/runtime/cacheStalenessBroadcaster.ts +0 -33
- package/src/lib/server/runtime/containsTraversal.ts +0 -41
- package/src/lib/server/runtime/createAppAssetServer.ts +0 -100
- package/src/lib/server/runtime/createAppRouteResolver.ts +0 -145
- package/src/lib/server/runtime/createAssetHeaderCache.ts +0 -31
- package/src/lib/server/runtime/createPlumbingRouter.ts +0 -212
- package/src/lib/server/runtime/createPublicAssetServer.ts +0 -76
- package/src/lib/server/runtime/createRouteDispatcher.ts +0 -121
- package/src/lib/server/runtime/createServer.ts +0 -605
- package/src/lib/server/runtime/createUiPageRenderer.ts +0 -489
- package/src/lib/server/runtime/crossOriginForbidden.ts +0 -17
- package/src/lib/server/runtime/crossOriginGate.ts +0 -29
- package/src/lib/server/runtime/devClientFingerprint.ts +0 -103
- package/src/lib/server/runtime/devReloadResponse.ts +0 -41
- package/src/lib/server/runtime/disableIdleTimeoutForStream.ts +0 -27
- package/src/lib/server/runtime/envSchemaStore.ts +0 -15
- package/src/lib/server/runtime/finalizeResponse.ts +0 -42
- package/src/lib/server/runtime/findOpenPort.ts +0 -21
- package/src/lib/server/runtime/flushingGzipStream.ts +0 -62
- package/src/lib/server/runtime/getActiveServer.ts +0 -6
- package/src/lib/server/runtime/globToPathSet.ts +0 -29
- package/src/lib/server/runtime/gzipResponse.ts +0 -57
- package/src/lib/server/runtime/inFlightRequests.ts +0 -13
- package/src/lib/server/runtime/inProcessServer.ts +0 -20
- package/src/lib/server/runtime/installAmbientScopeStore.ts +0 -54
- package/src/lib/server/runtime/internalErrorResponse.ts +0 -28
- package/src/lib/server/runtime/isCrossOriginRequest.ts +0 -23
- package/src/lib/server/runtime/listenOnOpenPort.ts +0 -36
- package/src/lib/server/runtime/logExposedSurfaces.ts +0 -156
- package/src/lib/server/runtime/maybeMountInspector.ts +0 -104
- package/src/lib/server/runtime/mimeForExtension.ts +0 -14
- package/src/lib/server/runtime/pageRenderSlot.ts +0 -15
- package/src/lib/server/runtime/pageUrlFromStore.ts +0 -15
- package/src/lib/server/runtime/parseIdleTimeout.ts +0 -10
- package/src/lib/server/runtime/parsePort.ts +0 -11
- package/src/lib/server/runtime/pathStore.ts +0 -15
- package/src/lib/server/runtime/registryManifests.ts +0 -66
- package/src/lib/server/runtime/renderCellBarrierStore.ts +0 -15
- package/src/lib/server/runtime/requestContext.ts +0 -5
- package/src/lib/server/runtime/resolvePageSnapshot.ts +0 -25
- package/src/lib/server/runtime/respondWithEmbeddedAsset.ts +0 -18
- package/src/lib/server/runtime/runWithRequestScope.ts +0 -165
- package/src/lib/server/runtime/serializeCacheSnapshot.ts +0 -31
- package/src/lib/server/runtime/serverSlot.ts +0 -13
- package/src/lib/server/runtime/setActiveServer.ts +0 -6
- package/src/lib/server/runtime/snapshotEntryFromCache.ts +0 -121
- package/src/lib/server/runtime/streamCacheResolutions.ts +0 -44
- package/src/lib/server/runtime/streamFromIterator.ts +0 -124
- package/src/lib/server/runtime/textResponse.ts +0 -23
- package/src/lib/server/runtime/typedErrorResponse.ts +0 -26
- package/src/lib/server/runtime/types/Assets.ts +0 -6
- package/src/lib/server/runtime/types/DevReloadStamp.ts +0 -14
- package/src/lib/server/runtime/types/InspectorCacheEntry.ts +0 -24
- package/src/lib/server/runtime/types/InspectorCacheSnapshot.ts +0 -11
- package/src/lib/server/runtime/types/InspectorContext.ts +0 -34
- package/src/lib/server/runtime/types/InspectorInFlightRequest.ts +0 -20
- package/src/lib/server/runtime/types/InspectorInFlightSnapshot.ts +0 -10
- package/src/lib/server/runtime/types/InspectorPrompt.ts +0 -15
- package/src/lib/server/runtime/types/InspectorRpc.ts +0 -27
- package/src/lib/server/runtime/types/InspectorSocket.ts +0 -17
- package/src/lib/server/runtime/types/InspectorSurface.ts +0 -16
- package/src/lib/server/runtime/types/RequestStore.ts +0 -125
- package/src/lib/server/runtime/warnUnguardedMcp.ts +0 -43
- package/src/lib/server/runtime/withResponseDefaults.ts +0 -29
- package/src/lib/server/server.ts +0 -33
- package/src/lib/server/socket.ts +0 -32
- package/src/lib/server/sockets/amendFamilyEntry.ts +0 -39
- package/src/lib/server/sockets/createSocketDispatcher.ts +0 -397
- package/src/lib/server/sockets/defineSocket.ts +0 -225
- package/src/lib/server/sockets/lookupSocket.ts +0 -6
- package/src/lib/server/sockets/registerSocket.ts +0 -18
- package/src/lib/server/sockets/socketOperations.ts +0 -36
- package/src/lib/server/sockets/socketRegistry.ts +0 -9
- package/src/lib/server/sockets/types/SocketOperation.ts +0 -22
- package/src/lib/server/sockets/types/SocketOptions.ts +0 -26
- package/src/lib/server/sockets/types/SocketRegistryEntry.ts +0 -19
- package/src/lib/server/sockets/types/SocketRoutes.ts +0 -10
- package/src/lib/server/sse.ts +0 -58
- package/src/lib/shared/ABIDE_PACKAGE_NAME.ts +0 -7
- package/src/lib/shared/ABIDE_VERSION.ts +0 -9
- package/src/lib/shared/AMEND_TOPIC_PREFIX.ts +0 -9
- package/src/lib/shared/ASYNC_CELL.ts +0 -5
- package/src/lib/shared/CACHE_CONTROL_VALUES.ts +0 -16
- package/src/lib/shared/CACHE_STALENESS_SOCKET.ts +0 -8
- package/src/lib/shared/CLI_PATH.ts +0 -7
- package/src/lib/shared/DEFER.ts +0 -8
- package/src/lib/shared/DEV_REBUILD_PATH.ts +0 -6
- package/src/lib/shared/DEV_RELOAD_PATH.ts +0 -6
- package/src/lib/shared/HEALTH_PATH.ts +0 -7
- package/src/lib/shared/HTTP_METHODS.ts +0 -6
- package/src/lib/shared/HttpError.ts +0 -30
- package/src/lib/shared/IDENTITY_PATH.ts +0 -6
- package/src/lib/shared/INSPECTOR_PATH.ts +0 -7
- package/src/lib/shared/MCP_PATH.ts +0 -6
- package/src/lib/shared/NAV_HEADER.ts +0 -8
- package/src/lib/shared/OFFLINE_HEADER.ts +0 -8
- package/src/lib/shared/PROXIED_SERVER_SUBDIRS.ts +0 -15
- package/src/lib/shared/REF_JSON_HEADER.ts +0 -9
- package/src/lib/shared/REF_JSON_TAGS.ts +0 -43
- package/src/lib/shared/REMOTE_FUNCTION.ts +0 -8
- package/src/lib/shared/REPLAYABLE_METHODS.ts +0 -12
- package/src/lib/shared/RESERVED_SOCKET_PREFIX.ts +0 -8
- package/src/lib/shared/RPC_ARGS_TYPE.ts +0 -7
- package/src/lib/shared/RPC_SHIM_GLOBALS.ts +0 -9
- package/src/lib/shared/SEEDS.ts +0 -33
- package/src/lib/shared/SOCKETS_PATH.ts +0 -7
- package/src/lib/shared/SOCKET_SEED.ts +0 -12
- package/src/lib/shared/SSR_SCRIPT_ID.ts +0 -11
- package/src/lib/shared/STREAMING_CONTENT_TYPES.ts +0 -12
- package/src/lib/shared/SocketDisconnectedError.ts +0 -13
- package/src/lib/shared/TEXT_PLAIN.ts +0 -7
- package/src/lib/shared/abideImportName.ts +0 -44
- package/src/lib/shared/abideLog.ts +0 -38
- package/src/lib/shared/activeCacheStore.ts +0 -12
- package/src/lib/shared/activePage.ts +0 -12
- package/src/lib/shared/amend.ts +0 -48
- package/src/lib/shared/amendBroadcastSlot.ts +0 -19
- package/src/lib/shared/appDataDir.ts +0 -34
- package/src/lib/shared/appNameSlot.ts +0 -10
- package/src/lib/shared/applyAmendLocally.ts +0 -20
- package/src/lib/shared/applyCacheStalenessLocally.ts +0 -18
- package/src/lib/shared/assertExhaustive.ts +0 -14
- package/src/lib/shared/attachRpcSelectorMethods.ts +0 -44
- package/src/lib/shared/attachSocketSelectorMethods.ts +0 -34
- package/src/lib/shared/augmentModule.ts +0 -18
- package/src/lib/shared/basePath.ts +0 -11
- package/src/lib/shared/basePathFromAppUrl.ts +0 -20
- package/src/lib/shared/baseSlot.ts +0 -9
- package/src/lib/shared/binaryDirEnvPath.ts +0 -12
- package/src/lib/shared/bodyValueForKind.ts +0 -34
- package/src/lib/shared/browserClientFlags.ts +0 -10
- package/src/lib/shared/buildArtifact.ts +0 -20
- package/src/lib/shared/buildRpcProxy.ts +0 -39
- package/src/lib/shared/buildRpcRequest.ts +0 -81
- package/src/lib/shared/buildSocketOverChannel.ts +0 -102
- package/src/lib/shared/bundleGraphFromMetafile.ts +0 -68
- package/src/lib/shared/bundleLayout.ts +0 -36
- package/src/lib/shared/cache.ts +0 -1584
- package/src/lib/shared/cacheEntryFromSnapshot.ts +0 -77
- package/src/lib/shared/cacheManagedSlot.ts +0 -10
- package/src/lib/shared/cacheReaderSocketSlot.ts +0 -11
- package/src/lib/shared/cacheStalenessSlot.ts +0 -21
- package/src/lib/shared/cacheStoreSlot.ts +0 -12
- package/src/lib/shared/cacheStores.ts +0 -10
- package/src/lib/shared/canonicalJson.ts +0 -86
- package/src/lib/shared/carriesBodyArgs.ts +0 -13
- package/src/lib/shared/changeAffectsClient.ts +0 -40
- package/src/lib/shared/clearLastConnection.ts +0 -7
- package/src/lib/shared/commandNameForUrl.ts +0 -17
- package/src/lib/shared/contentBodyKind.ts +0 -27
- package/src/lib/shared/contentTypeOf.ts +0 -6
- package/src/lib/shared/createCacheStore.ts +0 -147
- package/src/lib/shared/createChannelLog.ts +0 -146
- package/src/lib/shared/createLifecycleChannel.ts +0 -62
- package/src/lib/shared/createLivenessWatch.ts +0 -118
- package/src/lib/shared/createPushIterator.ts +0 -132
- package/src/lib/shared/createReachable.ts +0 -78
- package/src/lib/shared/createRemoteFunction.ts +0 -210
- package/src/lib/shared/createResolverSlot.ts +0 -30
- package/src/lib/shared/createRpcServerProgram.ts +0 -1007
- package/src/lib/shared/createSocketSubRegistry.ts +0 -112
- package/src/lib/shared/createSubscriber.ts +0 -55
- package/src/lib/shared/createTraceContext.ts +0 -21
- package/src/lib/shared/dataDirEnvPath.ts +0 -12
- package/src/lib/shared/debugGate.ts +0 -90
- package/src/lib/shared/decodeRefJson.ts +0 -112
- package/src/lib/shared/decodeResponse.ts +0 -54
- package/src/lib/shared/decodeWireBody.ts +0 -35
- package/src/lib/shared/detectRpcMethod.ts +0 -24
- package/src/lib/shared/detectTarget.ts +0 -27
- package/src/lib/shared/docSnapshotsSlot.ts +0 -13
- package/src/lib/shared/done.ts +0 -20
- package/src/lib/shared/emitLogRecord.ts +0 -217
- package/src/lib/shared/encodeRefJson.ts +0 -108
- package/src/lib/shared/encodeSeedValue.ts +0 -24
- package/src/lib/shared/encodeWireBody.ts +0 -18
- package/src/lib/shared/escapeHtml.ts +0 -15
- package/src/lib/shared/escapeRegex.ts +0 -9
- package/src/lib/shared/exeSuffix.ts +0 -9
- package/src/lib/shared/exitOnBuildFailure.ts +0 -18
- package/src/lib/shared/extraForwardHeaders.ts +0 -16
- package/src/lib/shared/fieldErrorsFromIssues.ts +0 -27
- package/src/lib/shared/fileName.ts +0 -9
- package/src/lib/shared/fileStem.ts +0 -11
- package/src/lib/shared/findExportCallSite.ts +0 -233
- package/src/lib/shared/formatTraceparent.ts +0 -6
- package/src/lib/shared/forwardHeaders.ts +0 -44
- package/src/lib/shared/generateDeclarations.ts +0 -72
- package/src/lib/shared/getRemoteMeta.ts +0 -5
- package/src/lib/shared/hasSeedableRequest.ts +0 -25
- package/src/lib/shared/health.ts +0 -179
- package/src/lib/shared/healthReadSlot.ts +0 -11
- package/src/lib/shared/healthSeedSlot.ts +0 -12
- package/src/lib/shared/html.ts +0 -19
- package/src/lib/shared/httpErrorFor.ts +0 -26
- package/src/lib/shared/hydrationWindow.ts +0 -53
- package/src/lib/shared/importNamesToStrip.ts +0 -13
- package/src/lib/shared/invalidate.ts +0 -39
- package/src/lib/shared/invalidateEvent.ts +0 -11
- package/src/lib/shared/invalidateTripwire.ts +0 -40
- package/src/lib/shared/isAbideHealthPayload.ts +0 -11
- package/src/lib/shared/isAsciiWhitespace.ts +0 -5
- package/src/lib/shared/isAsyncCell.ts +0 -11
- package/src/lib/shared/isAsyncIterable.ts +0 -8
- package/src/lib/shared/isCompileTarget.ts +0 -21
- package/src/lib/shared/isDebugEnabled.ts +0 -19
- package/src/lib/shared/isDebugNegated.ts +0 -17
- package/src/lib/shared/isIdentPart.ts +0 -9
- package/src/lib/shared/isIdentStart.ts +0 -8
- package/src/lib/shared/isLayoutFile.ts +0 -12
- package/src/lib/shared/isModuleNotFound.ts +0 -18
- package/src/lib/shared/isReadOnlyMethod.ts +0 -14
- package/src/lib/shared/isReplayableMethod.ts +0 -7
- package/src/lib/shared/isStreamingResponse.ts +0 -12
- package/src/lib/shared/isSubscribable.ts +0 -15
- package/src/lib/shared/isThenable.ts +0 -9
- package/src/lib/shared/jsonSchemaForPromptArguments.ts +0 -29
- package/src/lib/shared/jsonSchemaForSchema.ts +0 -39
- package/src/lib/shared/jsonSchemaForType.ts +0 -245
- package/src/lib/shared/jsonlErrorFrame.ts +0 -24
- package/src/lib/shared/keyForRemoteCall.ts +0 -30
- package/src/lib/shared/keyMatchesPrefix.ts +0 -9
- package/src/lib/shared/keyPrefixForRemote.ts +0 -12
- package/src/lib/shared/lastConnectionPath.ts +0 -7
- package/src/lib/shared/layoutChainForRoute.ts +0 -22
- package/src/lib/shared/lenientDecode.ts +0 -15
- package/src/lib/shared/loadEnvFile.ts +0 -17
- package/src/lib/shared/loadEnvFromDataDir.ts +0 -14
- package/src/lib/shared/loadProjectTsConfig.ts +0 -28
- package/src/lib/shared/log.ts +0 -24
- package/src/lib/shared/logClosingRecord.ts +0 -28
- package/src/lib/shared/logTapSlot.ts +0 -13
- package/src/lib/shared/manifestModule.ts +0 -39
- package/src/lib/shared/markFrameworkSourcesIgnored.ts +0 -47
- package/src/lib/shared/matchRoute.ts +0 -165
- package/src/lib/shared/matcherFromEnvelope.ts +0 -31
- package/src/lib/shared/memoizeByKey.ts +0 -32
- package/src/lib/shared/messageFromError.ts +0 -6
- package/src/lib/shared/normalizePathname.ts +0 -11
- package/src/lib/shared/normalizeTarget.ts +0 -10
- package/src/lib/shared/online.ts +0 -51
- package/src/lib/shared/page.ts +0 -30
- package/src/lib/shared/pageSlot.ts +0 -17
- package/src/lib/shared/pageUrlForFile.ts +0 -14
- package/src/lib/shared/parseBoundedEnvInt.ts +0 -20
- package/src/lib/shared/parseEnv.ts +0 -41
- package/src/lib/shared/parsePromptMarkdown.ts +0 -35
- package/src/lib/shared/parseRouteSegments.ts +0 -31
- package/src/lib/shared/parseTraceparent.ts +0 -26
- package/src/lib/shared/peek.ts +0 -46
- package/src/lib/shared/pending.ts +0 -36
- package/src/lib/shared/pendingAsyncCellsSlot.ts +0 -13
- package/src/lib/shared/prepareRemoteExport.ts +0 -40
- package/src/lib/shared/prepareRpcModule.ts +0 -240
- package/src/lib/shared/prepareSocketModule.ts +0 -46
- package/src/lib/shared/probeRegistries.ts +0 -68
- package/src/lib/shared/producerKey.ts +0 -32
- package/src/lib/shared/programNameForPackage.ts +0 -16
- package/src/lib/shared/promptNameForFile.ts +0 -10
- package/src/lib/shared/queryStringFromArgs.ts +0 -38
- package/src/lib/shared/randomHexId.ts +0 -14
- package/src/lib/shared/reachable.ts +0 -99
- package/src/lib/shared/readEnvFile.ts +0 -15
- package/src/lib/shared/readLastConnection.ts +0 -18
- package/src/lib/shared/readPackageJson.ts +0 -9
- package/src/lib/shared/recordRemoteMeta.ts +0 -5
- package/src/lib/shared/refresh.ts +0 -39
- package/src/lib/shared/refreshing.ts +0 -37
- package/src/lib/shared/remoteMetaStore.ts +0 -16
- package/src/lib/shared/requestScopeSlot.ts +0 -13
- package/src/lib/shared/resolveClientFlags.ts +0 -20
- package/src/lib/shared/resolvedCellsSlot.ts +0 -13
- package/src/lib/shared/responseBodyKind.ts +0 -35
- package/src/lib/shared/responseErrorText.ts +0 -9
- package/src/lib/shared/reviveWireField.ts +0 -49
- package/src/lib/shared/reviveWireOutput.ts +0 -36
- package/src/lib/shared/routeParamsShape.ts +0 -20
- package/src/lib/shared/rpcErrorRegistry.ts +0 -69
- package/src/lib/shared/rpcServerForRoot.ts +0 -25
- package/src/lib/shared/rpcTimeoutSlot.ts +0 -9
- package/src/lib/shared/rpcUrlForFile.ts +0 -19
- package/src/lib/shared/runningAsStandaloneBinary.ts +0 -13
- package/src/lib/shared/safeJsonForScript.ts +0 -17
- package/src/lib/shared/scanPages.ts +0 -25
- package/src/lib/shared/selectorMatcher.ts +0 -55
- package/src/lib/shared/selectorPrefix.ts +0 -32
- package/src/lib/shared/serializeEnv.ts +0 -30
- package/src/lib/shared/serializeSelector.ts +0 -69
- package/src/lib/shared/setAppName.ts +0 -5
- package/src/lib/shared/setOwnProperty.ts +0 -19
- package/src/lib/shared/setsIntersect.ts +0 -15
- package/src/lib/shared/sharedCacheStore.ts +0 -14
- package/src/lib/shared/sharedCacheStoreSlot.ts +0 -10
- package/src/lib/shared/skipNonCode.ts +0 -230
- package/src/lib/shared/snapshotShippable.ts +0 -23
- package/src/lib/shared/snippet.ts +0 -30
- package/src/lib/shared/socketNameForFile.ts +0 -11
- package/src/lib/shared/socketTailsSlot.ts +0 -13
- package/src/lib/shared/socketTapSlot.ts +0 -12
- package/src/lib/shared/sseErrorFrame.ts +0 -29
- package/src/lib/shared/streamResponse.ts +0 -180
- package/src/lib/shared/streamedCellsSlot.ts +0 -14
- package/src/lib/shared/stripImport.ts +0 -29
- package/src/lib/shared/subscribableFromResponse.ts +0 -51
- package/src/lib/shared/subscribableProbes.ts +0 -111
- package/src/lib/shared/tailProbeSlot.ts +0 -23
- package/src/lib/shared/toTagSet.ts +0 -4
- package/src/lib/shared/trace.ts +0 -16
- package/src/lib/shared/types/AmendApply.ts +0 -15
- package/src/lib/shared/types/AsyncComputed.ts +0 -20
- package/src/lib/shared/types/AsyncState.ts +0 -13
- package/src/lib/shared/types/CacheEntry.ts +0 -100
- package/src/lib/shared/types/CacheInvalidation.ts +0 -9
- package/src/lib/shared/types/CacheOnContext.ts +0 -15
- package/src/lib/shared/types/CacheOptions.ts +0 -53
- package/src/lib/shared/types/CachePolicy.ts +0 -31
- package/src/lib/shared/types/CacheReaderHook.ts +0 -11
- package/src/lib/shared/types/CacheSelector.ts +0 -17
- package/src/lib/shared/types/CacheSnapshotEntry.ts +0 -32
- package/src/lib/shared/types/CacheStalenessApply.ts +0 -13
- package/src/lib/shared/types/CacheStalenessFrame.ts +0 -24
- package/src/lib/shared/types/CacheStats.ts +0 -13
- package/src/lib/shared/types/CacheStore.ts +0 -45
- package/src/lib/shared/types/ChannelLog.ts +0 -13
- package/src/lib/shared/types/ClientFlags.ts +0 -13
- package/src/lib/shared/types/CompileTarget.ts +0 -6
- package/src/lib/shared/types/DebugGate.ts +0 -10
- package/src/lib/shared/types/DocSnapshots.ts +0 -12
- package/src/lib/shared/types/ErrorJsonSchemas.ts +0 -8
- package/src/lib/shared/types/ErrorSpec.ts +0 -11
- package/src/lib/shared/types/FrameworkLog.ts +0 -13
- package/src/lib/shared/types/HttpMethod.ts +0 -3
- package/src/lib/shared/types/InputCoercion.ts +0 -17
- package/src/lib/shared/types/LastConnection.ts +0 -9
- package/src/lib/shared/types/Log.ts +0 -13
- package/src/lib/shared/types/LogRecord.ts +0 -42
- package/src/lib/shared/types/LogVoice.ts +0 -7
- package/src/lib/shared/types/NamedAsyncIterable.ts +0 -26
- package/src/lib/shared/types/OutputWirePlan.ts +0 -17
- package/src/lib/shared/types/PageSnapshot.ts +0 -14
- package/src/lib/shared/types/PagesScan.ts +0 -7
- package/src/lib/shared/types/PendingAsyncCells.ts +0 -10
- package/src/lib/shared/types/PromptArgument.ts +0 -12
- package/src/lib/shared/types/RawRemoteFunction.ts +0 -20
- package/src/lib/shared/types/RemoteCallable.ts +0 -40
- package/src/lib/shared/types/RemoteFunction.ts +0 -116
- package/src/lib/shared/types/ReplayableMethod.ts +0 -7
- package/src/lib/shared/types/RequestScopeInfo.ts +0 -16
- package/src/lib/shared/types/ResolvedCells.ts +0 -11
- package/src/lib/shared/types/ResolverSlot.ts +0 -13
- package/src/lib/shared/types/ReturnBody.ts +0 -15
- package/src/lib/shared/types/RpcBuildStamps.ts +0 -32
- package/src/lib/shared/types/RpcError.ts +0 -26
- package/src/lib/shared/types/RpcErrorGuard.ts +0 -35
- package/src/lib/shared/types/RpcInvoker.ts +0 -6
- package/src/lib/shared/types/RpcOptions.ts +0 -22
- package/src/lib/shared/types/Socket.ts +0 -54
- package/src/lib/shared/types/SocketChannel.ts +0 -17
- package/src/lib/shared/types/SocketClientFrame.ts +0 -19
- package/src/lib/shared/types/SocketServerFrame.ts +0 -24
- package/src/lib/shared/types/SocketSubCallbacks.ts +0 -13
- package/src/lib/shared/types/SocketTails.ts +0 -13
- package/src/lib/shared/types/SourceMap.ts +0 -14
- package/src/lib/shared/types/SsrBootState.ts +0 -27
- package/src/lib/shared/types/SsrPayload.ts +0 -36
- package/src/lib/shared/types/StandardSchemaV1.ts +0 -56
- package/src/lib/shared/types/StreamPolicy.ts +0 -11
- package/src/lib/shared/types/StreamedCells.ts +0 -19
- package/src/lib/shared/types/StreamedResolution.ts +0 -28
- package/src/lib/shared/types/TailHooks.ts +0 -13
- package/src/lib/shared/types/TraceContext.ts +0 -17
- package/src/lib/shared/types/ValidationErrorData.ts +0 -20
- package/src/lib/shared/types/WireKind.ts +0 -11
- package/src/lib/shared/url.ts +0 -141
- package/src/lib/shared/validationHttpError.ts +0 -33
- package/src/lib/shared/warmSeedKey.ts +0 -16
- package/src/lib/shared/wireJsonReplacer.ts +0 -30
- package/src/lib/shared/withBase.ts +0 -10
- package/src/lib/shared/withBaseUrl.ts +0 -17
- package/src/lib/shared/withCacheManaged.ts +0 -18
- package/src/lib/shared/withJsonSchema.ts +0 -21
- package/src/lib/shared/writeDts.ts +0 -19
- package/src/lib/shared/writeHealthDts.ts +0 -36
- package/src/lib/shared/writeLastConnection.ts +0 -13
- package/src/lib/shared/writePublicAssetsDts.ts +0 -27
- package/src/lib/shared/writeRoutesDts.ts +0 -41
- package/src/lib/shared/writeRpcDts.ts +0 -60
- package/src/lib/shared/writeTestRpcDts.ts +0 -45
- package/src/lib/shared/writeTestSocketsDts.ts +0 -34
- package/src/lib/test/assertAgentFrameConformance.ts +0 -73
- package/src/lib/test/createScriptedSurface.ts +0 -45
- package/src/lib/test/createTestApp.ts +0 -242
- package/src/lib/test/createTestSocketChannel.ts +0 -85
- package/src/lib/ui/README.md +0 -86
- package/src/lib/ui/activePendingCells.ts +0 -14
- package/src/lib/ui/amendReaderHook.ts +0 -125
- package/src/lib/ui/compile/ABIDE_SEMANTIC_TOKENS_LEGEND.ts +0 -79
- package/src/lib/ui/compile/AbideCompileError.ts +0 -16
- package/src/lib/ui/compile/BLOCK_KEYWORDS.ts +0 -21
- package/src/lib/ui/compile/SSR_ESCAPE.ts +0 -40
- package/src/lib/ui/compile/TS_PRINTER.ts +0 -7
- package/src/lib/ui/compile/UI_RUNTIME_IMPORTS.ts +0 -86
- package/src/lib/ui/compile/VOID_TAGS.ts +0 -22
- package/src/lib/ui/compile/abideUiPlugin.ts +0 -109
- package/src/lib/ui/compile/analyzeComponent.ts +0 -222
- package/src/lib/ui/compile/asOutlet.ts +0 -30
- package/src/lib/ui/compile/assertTranspiles.ts +0 -19
- package/src/lib/ui/compile/assetModulesFile.ts +0 -32
- package/src/lib/ui/compile/assignmentTargetNames.ts +0 -54
- package/src/lib/ui/compile/asyncInterpolationFields.ts +0 -152
- package/src/lib/ui/compile/asyncValuePositionError.ts +0 -21
- package/src/lib/ui/compile/asyncValuePositionInterpolations.ts +0 -64
- package/src/lib/ui/compile/attrLiftPosition.ts +0 -18
- package/src/lib/ui/compile/awaitPlan.ts +0 -60
- package/src/lib/ui/compile/awaitSubjectExpr.ts +0 -23
- package/src/lib/ui/compile/bindListenEvent.ts +0 -18
- package/src/lib/ui/compile/cachedShadowProgram.ts +0 -39
- package/src/lib/ui/compile/cachedSourceFile.ts +0 -40
- package/src/lib/ui/compile/catchBinding.ts +0 -10
- package/src/lib/ui/compile/classStyleMergePlan.ts +0 -108
- package/src/lib/ui/compile/classifyInterpolationType.ts +0 -46
- package/src/lib/ui/compile/collectAbideDiagnostics.ts +0 -166
- package/src/lib/ui/compile/compileComponent.ts +0 -46
- package/src/lib/ui/compile/compileModule.ts +0 -306
- package/src/lib/ui/compile/compileSSR.ts +0 -119
- package/src/lib/ui/compile/compileShadow.ts +0 -1326
- package/src/lib/ui/compile/componentOrdinals.ts +0 -39
- package/src/lib/ui/compile/composeProps.ts +0 -64
- package/src/lib/ui/compile/createShadowLanguageService.ts +0 -348
- package/src/lib/ui/compile/createShadowProgram.ts +0 -127
- package/src/lib/ui/compile/createShadowScope.ts +0 -42
- package/src/lib/ui/compile/declaredNames.ts +0 -36
- package/src/lib/ui/compile/decodeHtmlEntities.ts +0 -53
- package/src/lib/ui/compile/destructureBindingNames.ts +0 -38
- package/src/lib/ui/compile/desugarSignals.ts +0 -1113
- package/src/lib/ui/compile/eachPlan.ts +0 -61
- package/src/lib/ui/compile/elementPlan.ts +0 -55
- package/src/lib/ui/compile/encodeSemanticTokens.ts +0 -60
- package/src/lib/ui/compile/expressionIsPrefixEvaluable.ts +0 -19
- package/src/lib/ui/compile/generateBuild.ts +0 -903
- package/src/lib/ui/compile/generateSSR.ts +0 -973
- package/src/lib/ui/compile/groupBindParts.ts +0 -28
- package/src/lib/ui/compile/hasTopLevelAwait.ts +0 -28
- package/src/lib/ui/compile/hoistCells.ts +0 -120
- package/src/lib/ui/compile/hoistableAwaits.ts +0 -183
- package/src/lib/ui/compile/hoistableChildRenders.ts +0 -112
- package/src/lib/ui/compile/identifierReferencePattern.ts +0 -13
- package/src/lib/ui/compile/ifPlan.ts +0 -36
- package/src/lib/ui/compile/interpolatedTemplateLiteral.ts +0 -27
- package/src/lib/ui/compile/interpolationClassifierForRoot.ts +0 -32
- package/src/lib/ui/compile/isAnchorPositioned.ts +0 -19
- package/src/lib/ui/compile/isControlFlow.ts +0 -20
- package/src/lib/ui/compile/isFunctionScopeBoundary.ts +0 -20
- package/src/lib/ui/compile/isPlainIdentifier.ts +0 -7
- package/src/lib/ui/compile/isSpuriousAsyncReadDiagnostic.ts +0 -215
- package/src/lib/ui/compile/isTextLeaf.ts +0 -16
- package/src/lib/ui/compile/isWhitespaceText.ts +0 -19
- package/src/lib/ui/compile/liftAsyncSubExpressions.ts +0 -166
- package/src/lib/ui/compile/liftScriptSeed.ts +0 -47
- package/src/lib/ui/compile/loadShadowTsConfig.ts +0 -31
- package/src/lib/ui/compile/lowerAsyncInterpolations.ts +0 -92
- package/src/lib/ui/compile/lowerCompoundAssignment.ts +0 -49
- package/src/lib/ui/compile/lowerContext.ts +0 -167
- package/src/lib/ui/compile/lowerDocAccess.ts +0 -302
- package/src/lib/ui/compile/lowerScript.ts +0 -190
- package/src/lib/ui/compile/lowerUpdateExpression.ts +0 -32
- package/src/lib/ui/compile/makeVarNamer.ts +0 -10
- package/src/lib/ui/compile/nearestProjectRoot.ts +0 -16
- package/src/lib/ui/compile/nodeAtShadowOffset.ts +0 -28
- package/src/lib/ui/compile/offsetToLineColumn.ts +0 -16
- package/src/lib/ui/compile/offsetToPosition.ts +0 -9
- package/src/lib/ui/compile/pagePropsType.ts +0 -23
- package/src/lib/ui/compile/parseTemplate.ts +0 -25
- package/src/lib/ui/compile/parseTemplateRecovering.ts +0 -1385
- package/src/lib/ui/compile/prepareNestedScript.ts +0 -62
- package/src/lib/ui/compile/reactiveBinding.ts +0 -47
- package/src/lib/ui/compile/referencedIdentifiers.ts +0 -35
- package/src/lib/ui/compile/remapShadowDiagnostic.ts +0 -30
- package/src/lib/ui/compile/renameSignalRefs.ts +0 -425
- package/src/lib/ui/compile/resolveAbideImports.ts +0 -29
- package/src/lib/ui/compile/resolveBranches.ts +0 -21
- package/src/lib/ui/compile/resolveReactiveExport.ts +0 -92
- package/src/lib/ui/compile/scopeAttr.ts +0 -9
- package/src/lib/ui/compile/scopeCss.ts +0 -138
- package/src/lib/ui/compile/seedTypeClassifierForRoot.ts +0 -60
- package/src/lib/ui/compile/shadowInterpolationClassifier.ts +0 -47
- package/src/lib/ui/compile/shadowNaming.ts +0 -11
- package/src/lib/ui/compile/signalCallee.ts +0 -24
- package/src/lib/ui/compile/skeletonContext.ts +0 -133
- package/src/lib/ui/compile/skeletonable.ts +0 -68
- package/src/lib/ui/compile/snippetPlan.ts +0 -28
- package/src/lib/ui/compile/sourceFileOptionsSignature.ts +0 -20
- package/src/lib/ui/compile/sourceToShadowOffset.ts +0 -24
- package/src/lib/ui/compile/spreadExcludedNames.ts +0 -27
- package/src/lib/ui/compile/staticAttr.ts +0 -11
- package/src/lib/ui/compile/staticAttrValue.ts +0 -13
- package/src/lib/ui/compile/staticTextPart.ts +0 -12
- package/src/lib/ui/compile/stripEffects.ts +0 -48
- package/src/lib/ui/compile/structuralHeadTokens.ts +0 -107
- package/src/lib/ui/compile/switchPlan.ts +0 -28
- package/src/lib/ui/compile/templateAnchorAdapter.ts +0 -61
- package/src/lib/ui/compile/templateElementAdapter.ts +0 -44
- package/src/lib/ui/compile/templateSemanticTokens.ts +0 -21
- package/src/lib/ui/compile/templateStartOffset.ts +0 -15
- package/src/lib/ui/compile/tryPlan.ts +0 -37
- package/src/lib/ui/compile/types/AbideDiagnostic.ts +0 -14
- package/src/lib/ui/compile/types/AnalyzedComponent.ts +0 -42
- package/src/lib/ui/compile/types/AsyncInterpolationField.ts +0 -19
- package/src/lib/ui/compile/types/Binding.ts +0 -24
- package/src/lib/ui/compile/types/CompiledShadow.ts +0 -27
- package/src/lib/ui/compile/types/ElementPlan.ts +0 -43
- package/src/lib/ui/compile/types/InterpolationClassifier.ts +0 -12
- package/src/lib/ui/compile/types/InterpolationKind.ts +0 -7
- package/src/lib/ui/compile/types/ParseDiagnostic.ts +0 -8
- package/src/lib/ui/compile/types/SeedTypeClassifier.ts +0 -15
- package/src/lib/ui/compile/types/SemanticToken.ts +0 -11
- package/src/lib/ui/compile/types/ShadowKind.ts +0 -9
- package/src/lib/ui/compile/types/ShadowScope.ts +0 -19
- package/src/lib/ui/compile/types/SkeletonContext.ts +0 -21
- package/src/lib/ui/compile/types/TemplateAttr.ts +0 -34
- package/src/lib/ui/compile/types/TemplateNode.ts +0 -137
- package/src/lib/ui/compile/types/TextPart.ts +0 -8
- package/src/lib/ui/compile/types/ValuePositionInterpolation.ts +0 -13
- package/src/lib/ui/compile/unwrapParens.ts +0 -10
- package/src/lib/ui/compile/walkAnchorOrder.ts +0 -57
- package/src/lib/ui/compile/walkElementOrder.ts +0 -60
- package/src/lib/ui/compile/withBindings.ts +0 -45
- package/src/lib/ui/compile/wrapReactionCellSources.ts +0 -121
- package/src/lib/ui/compile/wrapReactiveSeeds.ts +0 -44
- package/src/lib/ui/compile/wrapSeed.ts +0 -28
- package/src/lib/ui/compile/writtenTemplateNames.ts +0 -84
- package/src/lib/ui/computed.ts +0 -75
- package/src/lib/ui/createScope.ts +0 -157
- package/src/lib/ui/dom/MATHML_NAMESPACE.ts +0 -6
- package/src/lib/ui/dom/SVG_NAMESPACE.ts +0 -8
- package/src/lib/ui/dom/adoptRange.ts +0 -27
- package/src/lib/ui/dom/anchorCursor.ts +0 -25
- package/src/lib/ui/dom/anchoredBranch.ts +0 -153
- package/src/lib/ui/dom/appendSnippet.ts +0 -75
- package/src/lib/ui/dom/appendStatic.ts +0 -26
- package/src/lib/ui/dom/appendText.ts +0 -160
- package/src/lib/ui/dom/appendTextAt.ts +0 -39
- package/src/lib/ui/dom/assertClaimedText.ts +0 -30
- package/src/lib/ui/dom/attach.ts +0 -25
- package/src/lib/ui/dom/attr.ts +0 -57
- package/src/lib/ui/dom/awaitBlock.ts +0 -314
- package/src/lib/ui/dom/awaitSubject.ts +0 -118
- package/src/lib/ui/dom/bindProp.ts +0 -22
- package/src/lib/ui/dom/bindSelectValue.ts +0 -48
- package/src/lib/ui/dom/bindableProp.ts +0 -47
- package/src/lib/ui/dom/buildDetachedRange.ts +0 -31
- package/src/lib/ui/dom/cellPending.ts +0 -24
- package/src/lib/ui/dom/claimText.ts +0 -38
- package/src/lib/ui/dom/clearBetween.ts +0 -16
- package/src/lib/ui/dom/cloneStatic.ts +0 -69
- package/src/lib/ui/dom/commentData.ts +0 -14
- package/src/lib/ui/dom/depthZeroNodes.ts +0 -34
- package/src/lib/ui/dom/discardAndRebuild.ts +0 -23
- package/src/lib/ui/dom/discardBoundary.ts +0 -46
- package/src/lib/ui/dom/disposeRange.ts +0 -18
- package/src/lib/ui/dom/domAnchorAdapter.ts +0 -29
- package/src/lib/ui/dom/domElementAdapter.ts +0 -20
- package/src/lib/ui/dom/each.ts +0 -253
- package/src/lib/ui/dom/eachAsync.ts +0 -188
- package/src/lib/ui/dom/effectiveChildNamespace.ts +0 -13
- package/src/lib/ui/dom/enterNamespace.ts +0 -20
- package/src/lib/ui/dom/fillBefore.ts +0 -42
- package/src/lib/ui/dom/fillBoundary.ts +0 -38
- package/src/lib/ui/dom/fillRange.ts +0 -30
- package/src/lib/ui/dom/foreignWrapperTag.ts +0 -22
- package/src/lib/ui/dom/hydrate.ts +0 -34
- package/src/lib/ui/dom/inheritedNamespace.ts +0 -19
- package/src/lib/ui/dom/isComment.ts +0 -6
- package/src/lib/ui/dom/isElement.ts +0 -6
- package/src/lib/ui/dom/markerDepthDelta.ts +0 -19
- package/src/lib/ui/dom/matchingRangeClose.ts +0 -29
- package/src/lib/ui/dom/mergeProps.ts +0 -32
- package/src/lib/ui/dom/mount.ts +0 -30
- package/src/lib/ui/dom/mountChild.ts +0 -129
- package/src/lib/ui/dom/mountRange.ts +0 -48
- package/src/lib/ui/dom/mountSlot.ts +0 -38
- package/src/lib/ui/dom/mountSwappableRange.ts +0 -122
- package/src/lib/ui/dom/moveRange.ts +0 -19
- package/src/lib/ui/dom/mutateDocContainer.ts +0 -65
- package/src/lib/ui/dom/on.ts +0 -33
- package/src/lib/ui/dom/openMarker.ts +0 -22
- package/src/lib/ui/dom/outlet.ts +0 -63
- package/src/lib/ui/dom/parseRawNodes.ts +0 -17
- package/src/lib/ui/dom/readCall.ts +0 -29
- package/src/lib/ui/dom/readCell.ts +0 -55
- package/src/lib/ui/dom/readTextOrSuspend.ts +0 -21
- package/src/lib/ui/dom/removeRange.ts +0 -18
- package/src/lib/ui/dom/replaceRange.ts +0 -24
- package/src/lib/ui/dom/restProps.ts +0 -32
- package/src/lib/ui/dom/skeleton.ts +0 -153
- package/src/lib/ui/dom/spreadAttrs.ts +0 -95
- package/src/lib/ui/dom/spreadProps.ts +0 -31
- package/src/lib/ui/dom/switchBlock.ts +0 -80
- package/src/lib/ui/dom/templateFor.ts +0 -28
- package/src/lib/ui/dom/tryBlock.ts +0 -263
- package/src/lib/ui/dom/types/EachRow.ts +0 -21
- package/src/lib/ui/dom/types/SkeletonHoles.ts +0 -10
- package/src/lib/ui/dom/types/SwitchCase.ts +0 -11
- package/src/lib/ui/dom/when.ts +0 -58
- package/src/lib/ui/dom/withScope.ts +0 -37
- package/src/lib/ui/dom/withSuspense.ts +0 -22
- package/src/lib/ui/dom/writeCell.ts +0 -22
- package/src/lib/ui/effect.ts +0 -24
- package/src/lib/ui/enterScope.ts +0 -18
- package/src/lib/ui/exitScope.ts +0 -8
- package/src/lib/ui/finalizeStreamedChildren.ts +0 -88
- package/src/lib/ui/flight.ts +0 -56
- package/src/lib/ui/html.ts +0 -39
- package/src/lib/ui/isolateCellBarrier.ts +0 -17
- package/src/lib/ui/linked.ts +0 -125
- package/src/lib/ui/navigate.ts +0 -77
- package/src/lib/ui/probeNavigation.ts +0 -33
- package/src/lib/ui/props.ts +0 -17
- package/src/lib/ui/remoteProxy.ts +0 -256
- package/src/lib/ui/renderChain.ts +0 -113
- package/src/lib/ui/renderToStream.ts +0 -128
- package/src/lib/ui/resumeSeedScript.ts +0 -27
- package/src/lib/ui/router.ts +0 -649
- package/src/lib/ui/runtime/AsyncCellError.ts +0 -21
- package/src/lib/ui/runtime/BRANCH_SEGMENT.ts +0 -24
- package/src/lib/ui/runtime/CELL_SEED.ts +0 -12
- package/src/lib/ui/runtime/CHILD_PRESENT.ts +0 -8
- package/src/lib/ui/runtime/CURRENT_BOUNDARY.ts +0 -11
- package/src/lib/ui/runtime/CURRENT_PATH.ts +0 -29
- package/src/lib/ui/runtime/CURRENT_SCOPE.ts +0 -23
- package/src/lib/ui/runtime/DOC_SEED.ts +0 -10
- package/src/lib/ui/runtime/HOLE_ATTRIBUTE.ts +0 -9
- package/src/lib/ui/runtime/NODE_STATE.ts +0 -22
- package/src/lib/ui/runtime/OUTLET_MARKER.ts +0 -10
- package/src/lib/ui/runtime/OUTLET_TAG.ts +0 -7
- package/src/lib/ui/runtime/OWNER.ts +0 -8
- package/src/lib/ui/runtime/PENDING_OUTLET.ts +0 -8
- package/src/lib/ui/runtime/RANGE_MARKER.ts +0 -18
- package/src/lib/ui/runtime/REACTIVE_CONTEXT.ts +0 -20
- package/src/lib/ui/runtime/RENDER.ts +0 -35
- package/src/lib/ui/runtime/REQUEST_SUPERSEDED.ts +0 -8
- package/src/lib/ui/runtime/RESUME.ts +0 -21
- package/src/lib/ui/runtime/SEED_MARKS.ts +0 -14
- package/src/lib/ui/runtime/STREAMED_CELLS.ts +0 -57
- package/src/lib/ui/runtime/SuspenseSignal.ts +0 -24
- package/src/lib/ui/runtime/abortNode.ts +0 -22
- package/src/lib/ui/runtime/ambientPathBacking.ts +0 -32
- package/src/lib/ui/runtime/ambientScopeBacking.ts +0 -26
- package/src/lib/ui/runtime/applyPatchToTree.ts +0 -54
- package/src/lib/ui/runtime/batch.ts +0 -22
- package/src/lib/ui/runtime/blockId.ts +0 -31
- package/src/lib/ui/runtime/boundaryFor.ts +0 -11
- package/src/lib/ui/runtime/cellBarrierBacking.ts +0 -30
- package/src/lib/ui/runtime/claimChild.ts +0 -8
- package/src/lib/ui/runtime/claimExpected.ts +0 -27
- package/src/lib/ui/runtime/claimMarker.ts +0 -13
- package/src/lib/ui/runtime/claimRun.ts +0 -22
- package/src/lib/ui/runtime/clientPage.ts +0 -116
- package/src/lib/ui/runtime/consumeSeed.ts +0 -38
- package/src/lib/ui/runtime/createAsyncCell.ts +0 -358
- package/src/lib/ui/runtime/createComputedNode.ts +0 -19
- package/src/lib/ui/runtime/createDoc.ts +0 -334
- package/src/lib/ui/runtime/createEffectNode.ts +0 -81
- package/src/lib/ui/runtime/createSignalNode.ts +0 -19
- package/src/lib/ui/runtime/currentAbortSignal.ts +0 -26
- package/src/lib/ui/runtime/detachLink.ts +0 -21
- package/src/lib/ui/runtime/endTracking.ts +0 -24
- package/src/lib/ui/runtime/enterRenderPass.ts +0 -13
- package/src/lib/ui/runtime/escapeKey.ts +0 -19
- package/src/lib/ui/runtime/exitRenderPass.ts +0 -7
- package/src/lib/ui/runtime/flushEffects.ts +0 -91
- package/src/lib/ui/runtime/generationGuard.ts +0 -40
- package/src/lib/ui/runtime/historyEntries.ts +0 -151
- package/src/lib/ui/runtime/inScope.ts +0 -19
- package/src/lib/ui/runtime/isAsyncFunction.ts +0 -14
- package/src/lib/ui/runtime/nextBlockId.ts +0 -12
- package/src/lib/ui/runtime/parkCursor.ts +0 -10
- package/src/lib/ui/runtime/pathSegments.ts +0 -10
- package/src/lib/ui/runtime/reactiveAbortState.ts +0 -15
- package/src/lib/ui/runtime/readNode.ts +0 -38
- package/src/lib/ui/runtime/renderPath.ts +0 -16
- package/src/lib/ui/runtime/reportHydrationDivergence.ts +0 -30
- package/src/lib/ui/runtime/routeBareSeed.ts +0 -28
- package/src/lib/ui/runtime/runHydrationPass.ts +0 -69
- package/src/lib/ui/runtime/runNode.ts +0 -75
- package/src/lib/ui/runtime/runtimePath.ts +0 -9
- package/src/lib/ui/runtime/scope.ts +0 -46
- package/src/lib/ui/runtime/scopeGroup.ts +0 -40
- package/src/lib/ui/runtime/toTeardown.ts +0 -38
- package/src/lib/ui/runtime/track.ts +0 -60
- package/src/lib/ui/runtime/trigger.ts +0 -74
- package/src/lib/ui/runtime/types/AbideHistoryState.ts +0 -9
- package/src/lib/ui/runtime/types/Boundary.ts +0 -9
- package/src/lib/ui/runtime/types/Cell.ts +0 -7
- package/src/lib/ui/runtime/types/Computed.ts +0 -3
- package/src/lib/ui/runtime/types/Doc.ts +0 -24
- package/src/lib/ui/runtime/types/EffectResult.ts +0 -10
- package/src/lib/ui/runtime/types/HydrationCursor.ts +0 -8
- package/src/lib/ui/runtime/types/NavVerdict.ts +0 -9
- package/src/lib/ui/runtime/types/Patch.ts +0 -11
- package/src/lib/ui/runtime/types/PathWalk.ts +0 -10
- package/src/lib/ui/runtime/types/ReactiveLink.ts +0 -21
- package/src/lib/ui/runtime/types/ReactiveNode.ts +0 -33
- package/src/lib/ui/runtime/types/RenderContext.ts +0 -10
- package/src/lib/ui/runtime/types/Route.ts +0 -9
- package/src/lib/ui/runtime/types/RouteLoader.ts +0 -7
- package/src/lib/ui/runtime/types/SsrRender.ts +0 -34
- package/src/lib/ui/runtime/types/State.ts +0 -3
- package/src/lib/ui/runtime/types/Teardown.ts +0 -5
- package/src/lib/ui/runtime/types/UiComponent.ts +0 -24
- package/src/lib/ui/runtime/types/UiProps.ts +0 -12
- package/src/lib/ui/runtime/unescapeKey.ts +0 -12
- package/src/lib/ui/runtime/unlinkDeps.ts +0 -28
- package/src/lib/ui/runtime/untrack.ts +0 -20
- package/src/lib/ui/runtime/updateIfNecessary.ts +0 -40
- package/src/lib/ui/runtime/walkPath.ts +0 -41
- package/src/lib/ui/runtime/withOptionalPath.ts +0 -8
- package/src/lib/ui/runtime/withPath.ts +0 -16
- package/src/lib/ui/runtime/withPathFrom.ts +0 -20
- package/src/lib/ui/runtime/withoutHydration.ts +0 -22
- package/src/lib/ui/runtime/writeNode.ts +0 -16
- package/src/lib/ui/scope.ts +0 -20
- package/src/lib/ui/seedBootState.ts +0 -53
- package/src/lib/ui/seedStreamedResolution.ts +0 -56
- package/src/lib/ui/settleAsyncCells.ts +0 -51
- package/src/lib/ui/socketChannel.ts +0 -156
- package/src/lib/ui/socketProxy.ts +0 -47
- package/src/lib/ui/startClient.ts +0 -156
- package/src/lib/ui/state.ts +0 -77
- package/src/lib/ui/subscribeCacheStaleness.ts +0 -85
- package/src/lib/ui/trackedComputed.ts +0 -68
- package/src/lib/ui/tryEncodeResume.ts +0 -11
- package/src/lib/ui/types/Layouts.ts +0 -9
- package/src/lib/ui/types/Pages.ts +0 -8
- package/src/lib/ui/types/Scope.ts +0 -68
- package/src/lib/ui/watch.ts +0 -150
- package/src/preload.ts +0 -19
- package/src/scaffold.ts +0 -153
- package/src/serverBuildPlugins.ts +0 -25
- package/src/serverEntry.ts +0 -138
- package/src/zodCjsPlugin.ts +0 -51
- package/template/.zed/settings.json +0 -10
- package/template/CLAUDE.md +0 -22
- package/template/bunfig.toml +0 -4
- package/template/package.json +0 -21
- package/template/src/app.ts +0 -28
- package/template/src/bundle/icon.png +0 -0
- package/template/src/cli/banner.txt +0 -3
- package/template/src/cli/footer.txt +0 -1
- package/template/src/server/config.ts +0 -17
- package/template/src/server/rpc/getHello.ts +0 -38
- package/template/src/ui/app.css +0 -21
- package/template/src/ui/app.html +0 -24
- package/template/src/ui/pages/about/page.abide +0 -7
- package/template/src/ui/pages/layout.abide +0 -19
- package/template/src/ui/pages/page.abide +0 -19
- package/template/test/app.test.ts +0 -30
- package/template/tsconfig.json +0 -18
- package/tsconfig.app.json +0 -17
package/src/ui/Router.ts
ADDED
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
import { CURRENT_ROUTER, type NavigateOptions } from '#shared/CURRENT_ROUTER.ts'
|
|
2
|
+
import { decodedOrKept } from '#shared/decodedOrKept.ts'
|
|
3
|
+
import { firstMatch, type Params, partsOf } from '#shared/matchRoute.ts'
|
|
4
|
+
import { unmounted } from '#shared/mount.ts'
|
|
5
|
+
import { NAVIGATION_HEADER } from '#shared/NAVIGATION_HEADER.ts'
|
|
6
|
+
import type { ShareScope } from '#shared/reactive/share.ts'
|
|
7
|
+
import { arrive, route } from '#shared/route.ts'
|
|
8
|
+
import { rankRoutes, type Segment } from '#shared/routePattern.ts'
|
|
9
|
+
import { setUpLevels } from '#shared/setUpLevels.ts'
|
|
10
|
+
import { paintedCallsLanded } from '#shared/takeEarlyCall.ts'
|
|
11
|
+
import { withdrawHead } from './applyHead.ts'
|
|
12
|
+
import { LAYER_MOUNT, LAYER_NAVIGATE } from './LAYER_NAMES.ts'
|
|
13
|
+
import { beginLayer, endLayer } from './measureLayer.ts'
|
|
14
|
+
import { menuBridge } from './menuBridge.ts'
|
|
15
|
+
import { fillRegion, pageRegion, type Region } from './regions.ts'
|
|
16
|
+
import type { Scope, Stoppable } from './Scope.ts'
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A page's client mount, called against the region the router owns.
|
|
20
|
+
*
|
|
21
|
+
* The same default export a page already has — the router is a CALLER of a page exactly as a page
|
|
22
|
+
* is a caller of a component, which is why nothing about the emitted module changes to be routable.
|
|
23
|
+
*/
|
|
24
|
+
export type PageMount = (
|
|
25
|
+
root: Region,
|
|
26
|
+
props?: Record<string, unknown>,
|
|
27
|
+
// 39.6 — A LEVEL'S HEAD IS ITS OWN MOUNT'S TO APPLY, from inside the instance its slots read
|
|
28
|
+
// (`emitClient`), so the router hands the module a region and says it is the router by handing
|
|
29
|
+
// it the level it stands at — a file invoked as a component too is mounted without it, and
|
|
30
|
+
// applies no head a row. 39.14 — the level is where the mount leaves its head for the router
|
|
31
|
+
// to read when it withdraws.
|
|
32
|
+
routed?: Level,
|
|
33
|
+
) => Scope
|
|
34
|
+
|
|
35
|
+
type PageModule = { default: PageMount }
|
|
36
|
+
|
|
37
|
+
export type Route = {
|
|
38
|
+
/** The route literal, in the bracket spelling the page's directory is already written in. */
|
|
39
|
+
pattern: string
|
|
40
|
+
load: () => Promise<PageModule>
|
|
41
|
+
/**
|
|
42
|
+
* The layouts this page renders inside, outermost first, as the build found them (35.1).
|
|
43
|
+
*
|
|
44
|
+
* REQUIRED, as it is on the server's own row (`ServerRoute`): `tableOf` writes the key into
|
|
45
|
+
* both tables unconditionally, so every row has one shape.
|
|
46
|
+
*/
|
|
47
|
+
layouts: (() => Promise<PageModule>)[]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type Compiled = Route & { segments: Segment[] }
|
|
51
|
+
|
|
52
|
+
type Found = { route: Compiled; params: Params }
|
|
53
|
+
|
|
54
|
+
// 41.11 — ONE LEVEL OF WHAT IS MOUNTED: the scope that stops it and the region its child
|
|
55
|
+
// occupies. The module standing there is `chain`'s at the same index. The router holds these
|
|
56
|
+
// rather than letting each level own the one below it, which is what makes a shared layout
|
|
57
|
+
// something it can KEEP: a scope stopped from above takes its children with it, and a layout that
|
|
58
|
+
// survives a navigation must not take the page it was holding a moment ago.
|
|
59
|
+
type Level = {
|
|
60
|
+
scope: Scope | undefined
|
|
61
|
+
/**
|
|
62
|
+
* Where this level's `<slot/>` is, learned when the level below it mounted there, and
|
|
63
|
+
* `undefined` again once that region leaves — a `<slot/>` inside a closed `{#if}` is nowhere.
|
|
64
|
+
*/
|
|
65
|
+
slot: Region | undefined
|
|
66
|
+
/**
|
|
67
|
+
* This level's head markup as it reads now, left by its mount (`emitClient`); `undefined` for
|
|
68
|
+
* a level with no `<head>`.
|
|
69
|
+
*
|
|
70
|
+
* 39.14 — READ WHEN THE LEVEL LEAVES OR STAYS ABOVE ONE THAT DOES, which is why it is the
|
|
71
|
+
* markup's thunk and not the markup: a layout's `<title>{name}</title>` puts back the name it
|
|
72
|
+
* reads at that moment. Left painted or not, since a painted level's head is the one the server
|
|
73
|
+
* wrote and the first navigation away from it withdraws that head like any other.
|
|
74
|
+
*/
|
|
75
|
+
head: (() => string) | undefined
|
|
76
|
+
/**
|
|
77
|
+
* 41.19 — this level's markup, left by its mount once its setup has run, for the router to run
|
|
78
|
+
* once every level below has been set up too; `undefined` once it has run, or where the module
|
|
79
|
+
* has none.
|
|
80
|
+
*/
|
|
81
|
+
markup: ((region: Region) => Scope | undefined) | undefined
|
|
82
|
+
/**
|
|
83
|
+
* 10.5 — the share scope this level's setup ran in, left by its mount, for `setUpLevels` to
|
|
84
|
+
* set the level below up inside. `null` where the module left none.
|
|
85
|
+
*/
|
|
86
|
+
share: ShareScope | null
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The client router: matches addresses, and mounts and replaces the page chain.
|
|
91
|
+
*
|
|
92
|
+
* It holds what it put on the page, so a navigation can take it back off. A page mounted into the
|
|
93
|
+
* region owns a `Scope` (12.13) and the router is the only thing that can remove its nodes, so the
|
|
94
|
+
* router is where that scope is stopped.
|
|
95
|
+
*/
|
|
96
|
+
export class Router {
|
|
97
|
+
region: Region
|
|
98
|
+
routes: Compiled[]
|
|
99
|
+
/** The chain standing in the document, outermost layout first and the page last. */
|
|
100
|
+
levels: Level[]
|
|
101
|
+
/**
|
|
102
|
+
* The chain the address resolved to.
|
|
103
|
+
*
|
|
104
|
+
* A kept layout's `<slot/>` mounts from it whenever its region opens — read at that moment
|
|
105
|
+
* rather than captured when the layout mounted, or a slot reopened after a navigation put back
|
|
106
|
+
* the page the reader had left.
|
|
107
|
+
*/
|
|
108
|
+
chain: PageModule[]
|
|
109
|
+
/**
|
|
110
|
+
* The path the standing chain was mounted for: a step to it that moves only the query or the
|
|
111
|
+
* fragment keeps the page (30.23, 30.24).
|
|
112
|
+
*/
|
|
113
|
+
mounted: string | undefined
|
|
114
|
+
/**
|
|
115
|
+
* The route the standing page was matched by.
|
|
116
|
+
*
|
|
117
|
+
* 30.23 — an address it matches again keeps it.
|
|
118
|
+
*/
|
|
119
|
+
standing: Compiled | undefined
|
|
120
|
+
/**
|
|
121
|
+
* The ticket of the live navigation; a superseded one stops when it sees a newer ticket.
|
|
122
|
+
*
|
|
123
|
+
* Both ways in await the destination's module before they touch anything, and a dynamic import
|
|
124
|
+
* resolves in whatever order the chunks arrive — so two clicks, or a click landing while
|
|
125
|
+
* `hydrate` is still loading, each mounted a page: the second one to finish overwrote the
|
|
126
|
+
* standing scope and the first page's bindings were left awake, writing into nodes the other
|
|
127
|
+
* page had replaced. Nothing about the screen showed it — the newest markup was on top — which
|
|
128
|
+
* is why it is a counter rather than a flag.
|
|
129
|
+
*
|
|
130
|
+
* TAKEN BEFORE THE AWAIT AND CHECKED AFTER IT, so a superseded navigation stops before it
|
|
131
|
+
* stops a scope, empties the region or pushes a history entry for a page nobody will see.
|
|
132
|
+
*/
|
|
133
|
+
navigation: number
|
|
134
|
+
/**
|
|
135
|
+
* The routes whose chunks `prefetch` has already asked for.
|
|
136
|
+
*
|
|
137
|
+
* `pointerover` bubbles, so a pointer crossing a link's children asks again at every edge, and
|
|
138
|
+
* after the first time the answer is the module cache's anyway.
|
|
139
|
+
*/
|
|
140
|
+
prefetched: Set<Compiled>
|
|
141
|
+
/**
|
|
142
|
+
* Whether a navigation's write is a view transition, as the build read it (39.7, 39.8).
|
|
143
|
+
*
|
|
144
|
+
* Read off the compiled `<style>` blocks. Nothing here looks at the document's stylesheets.
|
|
145
|
+
*/
|
|
146
|
+
transitions: boolean
|
|
147
|
+
/**
|
|
148
|
+
* The shell's keyed head entries, as the build read them off the shell (`keyedHead`).
|
|
149
|
+
*
|
|
150
|
+
* 39.4, 39.14 — THE OUTERMOST CONTRIBUTOR, and the one the document cannot say: the server
|
|
151
|
+
* merged out every entry of it a level overrode.
|
|
152
|
+
*/
|
|
153
|
+
shellHead: string
|
|
154
|
+
|
|
155
|
+
constructor(
|
|
156
|
+
region: Region,
|
|
157
|
+
routes: Compiled[],
|
|
158
|
+
transitions: boolean,
|
|
159
|
+
shellHead: string,
|
|
160
|
+
) {
|
|
161
|
+
this.region = region
|
|
162
|
+
this.routes = routes
|
|
163
|
+
this.levels = []
|
|
164
|
+
this.chain = []
|
|
165
|
+
this.mounted = undefined
|
|
166
|
+
this.standing = undefined
|
|
167
|
+
this.navigation = 0
|
|
168
|
+
this.prefetched = new Set()
|
|
169
|
+
this.transitions = transitions
|
|
170
|
+
this.shellHead = shellHead
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* The route and params an address matches, or `undefined` for one this app has no route for.
|
|
175
|
+
*
|
|
176
|
+
* 16.10 — AN ADDRESS OUTSIDE THE MOUNT IS NO ROUTE OF THIS APP'S, and one inside it is matched
|
|
177
|
+
* as the address below the app's root. Every way in — a click, an intent, back and forward, a
|
|
178
|
+
* hydration — is matched here.
|
|
179
|
+
*/
|
|
180
|
+
match(pathname: string): Found | undefined {
|
|
181
|
+
const below = unmounted(pathname)
|
|
182
|
+
const parts = below === undefined ? undefined : partsOf(below)
|
|
183
|
+
return parts === undefined ? undefined : firstMatch(this.routes, parts)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Loads a route's chunks ahead of a navigation the reader has signaled.
|
|
188
|
+
*
|
|
189
|
+
* 30.14 — A NAVIGATION THE READER HAS SIGNALLED, LOADED BEFORE IT HAPPENS: the route's chunks
|
|
190
|
+
* are asked for on intent, so the click finds them in the module cache and setup — and with it
|
|
191
|
+
* every call the page makes — starts at once. Only the CODE: a call run on a hover would be a
|
|
192
|
+
* call nobody asked for, and for anything but a `GET` one with an effect. A failed load is left
|
|
193
|
+
* for the click, which hands the address to the document (30.27), and the next intent asks again.
|
|
194
|
+
*/
|
|
195
|
+
prefetch(pathname: string): void {
|
|
196
|
+
const route = this.match(pathname)?.route
|
|
197
|
+
if (route === undefined || this.prefetched.has(route)) return
|
|
198
|
+
this.prefetched.add(route)
|
|
199
|
+
load(route).catch(() => this.prefetched.delete(route))
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Navigates to `url` without reloading the document.
|
|
204
|
+
*
|
|
205
|
+
* 30.7 — NAVIGATES, AND DOES NOT RELOAD. Everything between the anchors is replaced and the
|
|
206
|
+
* document, its history entry and every module already loaded stay exactly where they are.
|
|
207
|
+
*
|
|
208
|
+
* THE MARKUP COMES FROM THE PAGE'S OWN MODULE. A page the server painted arrives with its
|
|
209
|
+
* markup between the anchors and hydrates; a page navigated TO arrives as the empty pair and
|
|
210
|
+
* fills itself from the template it carries. One module, both ways in — the `fillEmpty`
|
|
211
|
+
* the emitter already writes is the whole of the difference.
|
|
212
|
+
*/
|
|
213
|
+
async go(url: URL | string, options: NavigateOptions = {}): Promise<void> {
|
|
214
|
+
const target =
|
|
215
|
+
typeof url === 'string' ? new URL(url, location.href) : url
|
|
216
|
+
// A CROSS-ORIGIN ADDRESS IS NOT A ROUTE. Handing it to `pushState` throws, and treating
|
|
217
|
+
// it as a miss would leave the caller with a navigation that silently did nothing.
|
|
218
|
+
if (target.origin !== location.origin) {
|
|
219
|
+
location.href = target.href
|
|
220
|
+
return
|
|
221
|
+
}
|
|
222
|
+
const found = this.match(target.pathname)
|
|
223
|
+
if (found === undefined) {
|
|
224
|
+
// NOT A ROUTE THIS BUILD KNOWS, so it is the server's to answer — which is a document
|
|
225
|
+
// load, and the one case where 30.7 does not apply because there is no route to run.
|
|
226
|
+
location.href = target.href
|
|
227
|
+
return
|
|
228
|
+
}
|
|
229
|
+
// 30.21, 30.23, 30.24 — THE ROUTE STANDING, AT ITS OWN PATH: another query, another fragment or
|
|
230
|
+
// the same address. The page reads its address through `route`, so it follows rather than
|
|
231
|
+
// being rebuilt, and there is no path for `middleware` to decide anything new about.
|
|
232
|
+
if (found.route === this.standing && this.mounted === target.pathname) {
|
|
233
|
+
this.follow(target, options, found)
|
|
234
|
+
return
|
|
235
|
+
}
|
|
236
|
+
this.navigation += 1
|
|
237
|
+
const ticket = this.navigation
|
|
238
|
+
route.navigating.set(true)
|
|
239
|
+
// EVERY WAY OUT CLEARS WHAT THE WAY IN SET: a load that fails, a setup that throws and a
|
|
240
|
+
// navigation that completes all leave `navigating` false and every layer closed. A
|
|
241
|
+
// superseded one leaves `navigating` to the navigation that superseded it.
|
|
242
|
+
try {
|
|
243
|
+
// 30.15 — THE SERVER IS ASKED ALONGSIDE THE LOAD, so its `middleware` decides the
|
|
244
|
+
// navigation for the price of the one round trip the chunks already cost.
|
|
245
|
+
const [answer, loaded] = await Promise.all([
|
|
246
|
+
ask(target),
|
|
247
|
+
loadOrMiss(found.route),
|
|
248
|
+
])
|
|
249
|
+
// SUPERSEDED, so this navigation is over. Nothing has been touched yet, which is the
|
|
250
|
+
// whole reason the ticket is checked here rather than after the mount — and
|
|
251
|
+
// `navigating` stays the newer navigation's to clear.
|
|
252
|
+
if (this.navigation !== ticket) return
|
|
253
|
+
// 30.18 — A REFUSAL, A RESPONSE MIDDLEWARE ANSWERED ITSELF, or no answer at all: the
|
|
254
|
+
// document asks again and paints whatever the server says. A fetch that failed —
|
|
255
|
+
// offline, or a redirect to another origin that CORS will not let it follow — goes to
|
|
256
|
+
// the address it was sent to.
|
|
257
|
+
// 30.27 — AND CHUNKS THAT WOULD NOT LOAD, with the server down or a deploy that removed
|
|
258
|
+
// them: a rejection here was dropped by the click's `void`, and the link did nothing.
|
|
259
|
+
if (answer?.status !== 204 || loaded === undefined) {
|
|
260
|
+
location.href = answer?.url ?? target.href
|
|
261
|
+
return
|
|
262
|
+
}
|
|
263
|
+
// 30.17 — REDIRECTED, and the server already said yes to where it landed: the answer is
|
|
264
|
+
// the 204 at the end of the chain. That address is mounted in place of the one asked
|
|
265
|
+
// for, and a route the client has no row for is the document's (30.10).
|
|
266
|
+
const landed = answer.redirected ? new URL(answer.url) : target
|
|
267
|
+
const landing = answer.redirected
|
|
268
|
+
? this.match(landed.pathname)
|
|
269
|
+
: found
|
|
270
|
+
if (landing === undefined) {
|
|
271
|
+
location.href = landed.href
|
|
272
|
+
return
|
|
273
|
+
}
|
|
274
|
+
// 30.23 — THE ROUTE STANDING, AT ANOTHER PATH: `middleware` has said yes to the path, and
|
|
275
|
+
// the page it matched is the one already mounted, so it follows.
|
|
276
|
+
if (landing.route === this.standing) {
|
|
277
|
+
this.follow(landed, options, landing)
|
|
278
|
+
return
|
|
279
|
+
}
|
|
280
|
+
const arriving =
|
|
281
|
+
landing === found ? loaded : await loadOrMiss(landing.route)
|
|
282
|
+
if (this.navigation !== ticket) return
|
|
283
|
+
if (arriving === undefined) {
|
|
284
|
+
location.href = landed.href
|
|
285
|
+
return
|
|
286
|
+
}
|
|
287
|
+
await this.write(ticket, () =>
|
|
288
|
+
this.commit(landed, landing, arriving, options),
|
|
289
|
+
)
|
|
290
|
+
} finally {
|
|
291
|
+
if (this.navigation === ticket) route.navigating.set(false)
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Moves the address within the standing page, leaving the page mounted.
|
|
297
|
+
*
|
|
298
|
+
* A STEP WITHIN THE STANDING PAGE: the address written and `route` moved, and the page, its
|
|
299
|
+
* scope and every call it made left where they are. It supersedes a navigation in flight the
|
|
300
|
+
* way a click on another link would. Back and forward arrive here with the bar already moved
|
|
301
|
+
* and `keepScroll`, which leaves the scroll to the browser's own restoration.
|
|
302
|
+
*
|
|
303
|
+
* 30.25 — THE SCROLL STAYS where no page was replaced, except to a fragment the address names:
|
|
304
|
+
* a reader choosing a season is not sent back to the top of the series.
|
|
305
|
+
*/
|
|
306
|
+
follow(target: URL, options: NavigateOptions, found: Found): void {
|
|
307
|
+
this.navigation += 1
|
|
308
|
+
route.navigating.set(false)
|
|
309
|
+
// THE SAME ADDRESS REPLACES rather than pushing, which is what the browser does for a
|
|
310
|
+
// link to the fragment it is already at.
|
|
311
|
+
writeAddress(
|
|
312
|
+
target,
|
|
313
|
+
options.replace === true || target.href === location.href,
|
|
314
|
+
)
|
|
315
|
+
arrive(target.href, found.route.pattern, found.params)
|
|
316
|
+
this.mounted = target.pathname
|
|
317
|
+
if (options.keepScroll !== true && target.hash !== '')
|
|
318
|
+
scrollToFragment(target.hash)
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Runs a navigation's commit, inside a view transition where one is wanted.
|
|
323
|
+
*
|
|
324
|
+
* 39.9 — AWAITED TO THE WRITE, NOT TO THE ANIMATION: `updateCallbackDone` settles once the
|
|
325
|
+
* arriving page is in the document, and `finished` would hold the navigation for however long
|
|
326
|
+
* the app's transition plays. 39.10 — a browser with no `startViewTransition` writes directly.
|
|
327
|
+
*
|
|
328
|
+
* THE TICKET IS CHECKED AGAIN INSIDE THE CALLBACK, because the browser runs it a frame later,
|
|
329
|
+
* after capturing the outgoing page — and a transition another navigation skipped still runs
|
|
330
|
+
* its callback, which would mount the page the reader clicked away from.
|
|
331
|
+
*/
|
|
332
|
+
private async write(ticket: number, commit: () => void): Promise<void> {
|
|
333
|
+
if (
|
|
334
|
+
!this.transitions ||
|
|
335
|
+
typeof document.startViewTransition !== 'function'
|
|
336
|
+
)
|
|
337
|
+
return commit()
|
|
338
|
+
await document.startViewTransition(() => {
|
|
339
|
+
if (this.navigation === ticket) commit()
|
|
340
|
+
}).updateCallbackDone
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Commits a navigation: empties the old part, writes the address and mounts the new part.
|
|
345
|
+
*
|
|
346
|
+
* What a navigation does once it is no longer supersedable: the old part stopped and emptied,
|
|
347
|
+
* the address written, the arriving part's head applied and its levels mounted.
|
|
348
|
+
*/
|
|
349
|
+
private commit(
|
|
350
|
+
target: URL,
|
|
351
|
+
found: Found,
|
|
352
|
+
arriving: PageModule[],
|
|
353
|
+
options: NavigateOptions,
|
|
354
|
+
): void {
|
|
355
|
+
// OPENED WHERE THE NAVIGATION COMMITS, which is after the last early exit and after the
|
|
356
|
+
// `await` above. The awaited load is a NETWORK wait, and a layer that contained it would
|
|
357
|
+
// report the round trip as the router's own cost — the measurement this exists to make
|
|
358
|
+
// honest is which fraction of click -> paint the router's WORK is.
|
|
359
|
+
beginLayer(LAYER_NAVIGATE)
|
|
360
|
+
try {
|
|
361
|
+
// 41.11 — WHAT THE TWO ADDRESSES SHARE IS NOT REBUILT. The comparison is by the MOUNT
|
|
362
|
+
// rather than by the loader or the module record: the table holds an arrow per row, so
|
|
363
|
+
// two routes under one layout name the same file through two different functions, and a
|
|
364
|
+
// table written by hand may answer with a fresh record each call. The function a module
|
|
365
|
+
// exports is the same function either way.
|
|
366
|
+
const shared = this.sharedLevels(arriving)
|
|
367
|
+
// READ BEFORE THE STOP, while the leaving levels' heads read what they read on screen.
|
|
368
|
+
const leaving = this.heads(shared, this.levels.length)
|
|
369
|
+
this.stopFrom(shared)
|
|
370
|
+
// The region the arriving part goes into: the page region where nothing is kept, and
|
|
371
|
+
// the deepest kept layout's own slot where something is.
|
|
372
|
+
//
|
|
373
|
+
// NOWHERE, where that slot's region is closed: the arriving part is mounted by the slot
|
|
374
|
+
// when it opens, off `chain`, and not into a region no longer in the document.
|
|
375
|
+
const into =
|
|
376
|
+
shared === 0
|
|
377
|
+
? this.region
|
|
378
|
+
: (this.levels[shared - 1] as Level).slot
|
|
379
|
+
// EMPTIED THROUGH THE PRIMITIVE EVERY OTHER REGION IS. `fillRegion(region)` with no
|
|
380
|
+
// build is this removal, and it carries the 41.10 refusal for a region no longer in a
|
|
381
|
+
// document that a hand-written walk swallows.
|
|
382
|
+
if (into !== undefined) fillRegion(into)
|
|
383
|
+
writeAddress(target, options.replace === true)
|
|
384
|
+
// 39.6 — each arriving level applies its own head as it mounts into its emptied region,
|
|
385
|
+
// outermost first; a kept layout is not mounted again, so neither is its head.
|
|
386
|
+
this.mountChain(target, found, arriving, shared, into)
|
|
387
|
+
// 39.14 — what the leaving levels keyed and the arriving ones did not goes back to the
|
|
388
|
+
// nearest kept layout's, else the shell's, else leaves.
|
|
389
|
+
withdrawHead(
|
|
390
|
+
leaving,
|
|
391
|
+
this.heads(shared, this.levels.length),
|
|
392
|
+
() => this.shellHead + this.heads(0, shared),
|
|
393
|
+
)
|
|
394
|
+
// The top of the page, or — as the browser does on a load — the fragment's element.
|
|
395
|
+
if (options.keepScroll !== true) scrollToFragment(target.hash)
|
|
396
|
+
} finally {
|
|
397
|
+
endLayer(LAYER_NAVIGATE)
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* How many levels of the arriving chain are already standing.
|
|
403
|
+
*
|
|
404
|
+
* Layouts only: a page reached here is another route's, the same route's being followed instead
|
|
405
|
+
* (30.23).
|
|
406
|
+
*
|
|
407
|
+
* EVERY STANDING LEVEL IS COMPARED, the page included: a page is never a layout, so it cannot
|
|
408
|
+
* match one, and a layout whose slot is closed stands with nothing below it.
|
|
409
|
+
*/
|
|
410
|
+
private sharedLevels(arriving: PageModule[]): number {
|
|
411
|
+
const layouts = arriving.length - 1
|
|
412
|
+
let shared = 0
|
|
413
|
+
while (
|
|
414
|
+
shared < layouts &&
|
|
415
|
+
shared < this.levels.length &&
|
|
416
|
+
(this.chain[shared] as PageModule).default ===
|
|
417
|
+
(arriving[shared] as PageModule).default
|
|
418
|
+
)
|
|
419
|
+
shared += 1
|
|
420
|
+
return shared
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/** The heads of the standing levels from `from` to `to`, outermost first. */
|
|
424
|
+
private heads(from: number, to: number): string {
|
|
425
|
+
let markup = ''
|
|
426
|
+
for (let level = from; level < to; level += 1)
|
|
427
|
+
markup += (this.levels[level] as Level).head?.() ?? ''
|
|
428
|
+
return markup
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Stops every level from `at` down, inside out, and drops them.
|
|
433
|
+
*
|
|
434
|
+
* Stopped from the INSIDE OUT, so a layout's disposers run after the page's — the order a
|
|
435
|
+
* scope's own teardown already has, and the one an author reading two `watch` cleanups in
|
|
436
|
+
* two files would expect.
|
|
437
|
+
*/
|
|
438
|
+
private stopFrom(at: number): void {
|
|
439
|
+
for (let level = this.levels.length - 1; level >= at; level -= 1)
|
|
440
|
+
(this.levels[level] as Level).scope?.stop()
|
|
441
|
+
this.levels.length = at
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Mounts the chain from level `at` into `region`, each level handed the next as `children`.
|
|
446
|
+
*
|
|
447
|
+
* 35.1 — each level is handed the one below it as `children` (32.18), so a layout puts the page
|
|
448
|
+
* in its `<slot/>` with the same mechanism a caller writing markup between two tags uses — and
|
|
449
|
+
* the router learns where that slot is on the way past, which is what lets it swap the page
|
|
450
|
+
* there later without the layout knowing.
|
|
451
|
+
*
|
|
452
|
+
* THE CHILD'S SCOPE IS THE ROUTER'S, not the layout's, so a kept layout cannot stop the page
|
|
453
|
+
* arriving under it. What `mount` hands the layout is a stop for WHATEVER STANDS IN THE SLOT
|
|
454
|
+
* when the slot's region leaves — a `<slot/>` inside a closed `{#if}` — rather than for the
|
|
455
|
+
* page that happened to be mounted first. And the slot mounts from `chain`, so a slot that
|
|
456
|
+
* opens again mounts the page the address resolves to now.
|
|
457
|
+
*/
|
|
458
|
+
private mountFrom(at: number, region: Region): void {
|
|
459
|
+
setUpLevels(
|
|
460
|
+
at,
|
|
461
|
+
this.chain.length,
|
|
462
|
+
this.levels[at - 1]?.share,
|
|
463
|
+
ROUTE_PROPS,
|
|
464
|
+
(below, props) => this.setUp(below, region, props),
|
|
465
|
+
)
|
|
466
|
+
this.markUp(at, region)
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Runs level `at`'s setup over `props`, leaving its markup on the level for `markUp`, and
|
|
471
|
+
* answers the share scope the setup left.
|
|
472
|
+
*/
|
|
473
|
+
private setUp(
|
|
474
|
+
at: number,
|
|
475
|
+
region: Region,
|
|
476
|
+
props: Record<string, (() => unknown) | undefined>,
|
|
477
|
+
): ShareScope | null {
|
|
478
|
+
const module = this.chain[at] as PageModule
|
|
479
|
+
const level: Level = {
|
|
480
|
+
scope: undefined,
|
|
481
|
+
slot: undefined,
|
|
482
|
+
head: undefined,
|
|
483
|
+
markup: undefined,
|
|
484
|
+
share: null,
|
|
485
|
+
}
|
|
486
|
+
this.levels[at] = level
|
|
487
|
+
if (at < this.chain.length - 1)
|
|
488
|
+
props.children = () => ({
|
|
489
|
+
// NO BUILD, because the level below carries its own (32.17): a module a route
|
|
490
|
+
// reaches fills the region it is mounted against when that region is empty, so
|
|
491
|
+
// the build and the mount are one call rather than two.
|
|
492
|
+
build: undefined,
|
|
493
|
+
mount: (slot: Region): Stoppable => {
|
|
494
|
+
// The level below as `mountFrom` set it up, the first time its slot opens; a
|
|
495
|
+
// slot opening again sets it up afresh.
|
|
496
|
+
const pending = this.levels[at + 1]?.markup !== undefined
|
|
497
|
+
if (!pending) this.release(level, at)
|
|
498
|
+
level.slot = slot
|
|
499
|
+
if (pending) this.markUp(at + 1, slot)
|
|
500
|
+
else this.mountFrom(at + 1, slot)
|
|
501
|
+
return { stop: () => this.release(level, at) }
|
|
502
|
+
},
|
|
503
|
+
})
|
|
504
|
+
// The region a level's markup lands in is its slot above, known only once that markup
|
|
505
|
+
// runs; a module mounted by the router leaves its markup rather than using this one.
|
|
506
|
+
// A deferred level answers the scope its setup made, so the watches that setup opened are
|
|
507
|
+
// stopped with the level even where its markup never runs — a slot that never opens.
|
|
508
|
+
level.scope = module.default(region, props, level)
|
|
509
|
+
return level.share
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/** Runs the markup level `at`'s setup left, into `region`. */
|
|
513
|
+
private markUp(at: number, region: Region): void {
|
|
514
|
+
const level = this.levels[at] as Level
|
|
515
|
+
const markup = level.markup
|
|
516
|
+
if (markup === undefined) return
|
|
517
|
+
level.markup = undefined
|
|
518
|
+
level.scope = markup(region)
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Stops what stands below `level` and forgets its slot.
|
|
523
|
+
*
|
|
524
|
+
* A no-op once the level itself has been replaced, which is how a stop handed to a layout that
|
|
525
|
+
* has since left does nothing.
|
|
526
|
+
*/
|
|
527
|
+
private release(level: Level, at: number): void {
|
|
528
|
+
if (this.levels[at] !== level) return
|
|
529
|
+
level.slot = undefined
|
|
530
|
+
this.stopFrom(at + 1)
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Hydrates the page the server painted, wiring it where it stands.
|
|
535
|
+
*
|
|
536
|
+
* No fill happens — the region is not empty — so this is the first render's hydration and not a
|
|
537
|
+
* second rendering of it.
|
|
538
|
+
*/
|
|
539
|
+
async hydrate(): Promise<void> {
|
|
540
|
+
const found = this.match(location.pathname)
|
|
541
|
+
if (found === undefined) return
|
|
542
|
+
// A TICKET LIKE ANY OTHER NAVIGATION. `listenForRoutes` is attached before this is called,
|
|
543
|
+
// so a click during the page module's own load is a `go` that supersedes it — and
|
|
544
|
+
// hydrating on top of the markup that navigation had already put in the region wired the
|
|
545
|
+
// arriving page's bindings to the departing page's nodes.
|
|
546
|
+
this.navigation += 1
|
|
547
|
+
const ticket = this.navigation
|
|
548
|
+
// NO HEAD IS APPLIED FOR A PAINTED PAGE: its region is not empty, so its mount hydrates
|
|
549
|
+
// rather than fills, and the head is the one the server wrote. Re-applying would replace
|
|
550
|
+
// each contribution with an identical copy — a `<link rel=stylesheet>` refetched and a
|
|
551
|
+
// flash of unstyled document on every load.
|
|
552
|
+
// 41.25 — AND THE CALLS THE SERVER PAINTED SETTLED ARE WAITED FOR, so setup reads each one
|
|
553
|
+
// answered, as the markup was built from it, and picks the arm the server painted.
|
|
554
|
+
const landing = paintedCallsLanded()
|
|
555
|
+
const standing = await load(found.route)
|
|
556
|
+
if (landing !== undefined) await landing
|
|
557
|
+
if (this.navigation !== ticket) return
|
|
558
|
+
// THE HYDRATE SHARE. Same name as the navigation's mount because it is the same work on the
|
|
559
|
+
// same chain — what differs is the op it is a fraction of.
|
|
560
|
+
this.mountChain(new URL(location.href), found, standing, 0, this.region)
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Records the arriving chain as standing and mounts it from level `from` into `into`.
|
|
565
|
+
*
|
|
566
|
+
* AT THE TOP OF THE CHAIN, NOT INSIDE `mountFrom`: it recurses one level per layout, and
|
|
567
|
+
* `shares()` SUMS every measure of a name inside the op — so a pair inside the recursion would
|
|
568
|
+
* count the innermost level once per level above it. 23.1 — WRITTEN BEFORE THE ARRIVING PAGE'S
|
|
569
|
+
* SETUP, which reads it.
|
|
570
|
+
*/
|
|
571
|
+
private mountChain(
|
|
572
|
+
target: URL,
|
|
573
|
+
found: Found,
|
|
574
|
+
modules: PageModule[],
|
|
575
|
+
from: number,
|
|
576
|
+
into: Region | undefined,
|
|
577
|
+
): void {
|
|
578
|
+
arrive(target.href, found.route.pattern, found.params)
|
|
579
|
+
this.chain = modules
|
|
580
|
+
// 38.89 — inside a desktop app, the window shows the menus this chain exports.
|
|
581
|
+
if (menuBridge() !== undefined)
|
|
582
|
+
void import('./reportMenu.ts').then((loaded) =>
|
|
583
|
+
loaded.reportMenu(modules as { menu?: unknown }[]),
|
|
584
|
+
)
|
|
585
|
+
this.standing = found.route
|
|
586
|
+
this.mounted = target.pathname
|
|
587
|
+
if (into === undefined) return
|
|
588
|
+
beginLayer(LAYER_MOUNT)
|
|
589
|
+
try {
|
|
590
|
+
this.mountFrom(from, into)
|
|
591
|
+
} finally {
|
|
592
|
+
endLayer(LAYER_MOUNT)
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Loads a route's chain: its layouts, outermost first, and the page last.
|
|
599
|
+
*
|
|
600
|
+
* One `Promise.all`, because a waterfall down a three-deep chain is three round trips for a
|
|
601
|
+
* navigation the reader is watching.
|
|
602
|
+
*/
|
|
603
|
+
async function load(route: Compiled): Promise<PageModule[]> {
|
|
604
|
+
return await Promise.all([
|
|
605
|
+
...route.layouts.map((layout) => layout()),
|
|
606
|
+
route.load(),
|
|
607
|
+
])
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/** A route's chain as `load` gives it; `undefined` where a chunk failed to load. */
|
|
611
|
+
function loadOrMiss(route: Compiled): Promise<PageModule[] | undefined> {
|
|
612
|
+
return load(route).catch(() => undefined)
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* Asks the server's `middleware` about an address; `undefined` where the fetch failed.
|
|
617
|
+
*
|
|
618
|
+
* 30.15 — THE ADDRESS, THROUGH THE SERVER'S `middleware` AND NOT ITS RENDER (30.16). A redirect
|
|
619
|
+
* is followed here, carrying the header, so the answer at the end of it is the server's go-ahead
|
|
620
|
+
* for the address it landed on.
|
|
621
|
+
*/
|
|
622
|
+
async function ask(target: URL): Promise<Response | undefined> {
|
|
623
|
+
try {
|
|
624
|
+
return await fetch(target, {
|
|
625
|
+
headers: { [NAVIGATION_HEADER]: '1' },
|
|
626
|
+
cache: 'no-store',
|
|
627
|
+
})
|
|
628
|
+
} catch {
|
|
629
|
+
return undefined
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* The props a routed page or layout is set up over, `children` aside: `params` as a live accessor.
|
|
635
|
+
*
|
|
636
|
+
* 33.4 — A PROP IS AN ACCESSOR. A page is mounted as any other component is, so its one prop is
|
|
637
|
+
* passed the way `renderComponent` passes a child's and the way `answerRequest` paints one: a
|
|
638
|
+
* function per key. Passed as the plain record it lowered to `params()` on a value that was not
|
|
639
|
+
* one, so every page with a `[param]` in its address hydrated dead — with its server markup
|
|
640
|
+
* already on screen, which is what kept it quiet.
|
|
641
|
+
*
|
|
642
|
+
* 33.5 — AND A LIVE ONE: `params` reads `route.params`, which every navigation writes. A layout
|
|
643
|
+
* kept across `/users/1` -> `/users/2` is not mounted again, so an accessor over the params it was
|
|
644
|
+
* mounted with went on answering user 1.
|
|
645
|
+
*/
|
|
646
|
+
const ROUTE_PROPS = { params: (): Params => route.params() }
|
|
647
|
+
|
|
648
|
+
function writeAddress(target: URL, replace: boolean): void {
|
|
649
|
+
const full = `${target.pathname}${target.search}${target.hash}`
|
|
650
|
+
if (replace) history.replaceState(null, '', full)
|
|
651
|
+
else history.pushState(null, '', full)
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Scrolls a fragment's element into view, or to the top where there is none.
|
|
656
|
+
*
|
|
657
|
+
* 30.22 — WHAT THE BROWSER DOES WITH A FRAGMENT: its element — by id, then a named `<a>` — brought
|
|
658
|
+
* into view, and the top of the page where there is none or it names none. A fragment that will not
|
|
659
|
+
* percent-decode is looked up as written.
|
|
660
|
+
*/
|
|
661
|
+
function scrollToFragment(hash: string): void {
|
|
662
|
+
const id = decodedOrKept(hash.slice(1))
|
|
663
|
+
if (id !== '') {
|
|
664
|
+
const byId = document.getElementById(id)
|
|
665
|
+
if (byId !== null) {
|
|
666
|
+
byId.scrollIntoView()
|
|
667
|
+
return
|
|
668
|
+
}
|
|
669
|
+
for (const named of document.getElementsByName(id))
|
|
670
|
+
if (named instanceof HTMLAnchorElement) {
|
|
671
|
+
named.scrollIntoView()
|
|
672
|
+
return
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
scrollTo(0, 0)
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* Builds the router over `routes` and registers it as this document's.
|
|
680
|
+
*
|
|
681
|
+
* Routes are ranked most specific first. Ranking here rather than asking the build to emit an order
|
|
682
|
+
* keeps the table a fact about the file tree.
|
|
683
|
+
*/
|
|
684
|
+
export function startRouter(
|
|
685
|
+
routes: Route[],
|
|
686
|
+
host: Element = document.body,
|
|
687
|
+
transitions = false,
|
|
688
|
+
shellHead = '',
|
|
689
|
+
): Router {
|
|
690
|
+
const router = new Router(
|
|
691
|
+
pageRegion(host),
|
|
692
|
+
rankRoutes(routes),
|
|
693
|
+
transitions,
|
|
694
|
+
shellHead,
|
|
695
|
+
)
|
|
696
|
+
CURRENT_ROUTER.current = router
|
|
697
|
+
return router
|
|
698
|
+
}
|