@abide/abide 0.43.0 → 0.44.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/AGENTS.md +293 -219
- package/CHANGELOG.md +46 -0
- package/README.md +191 -67
- package/package.json +2 -2
- package/src/abideLsp.ts +8 -4
- package/src/abideResolverPlugin.ts +11 -1
- package/src/build.ts +9 -0
- package/src/buildDisconnected.ts +2 -0
- package/src/devEntry.ts +1 -0
- package/src/lib/bundle/probeAbideServer.ts +1 -1
- package/src/lib/cli/parseArgvForRpc.ts +4 -2
- package/src/lib/cli/types/CliManifest.ts +6 -4
- package/src/lib/mcp/annotationsForMethod.ts +1 -1
- package/src/lib/mcp/toolResultFromResponse.ts +1 -1
- package/src/lib/mcp/types/JsonRpcRequest.ts +3 -3
- package/src/lib/server/AppModule.ts +1 -1
- package/src/lib/server/cli/handleCliDownload.ts +7 -5
- package/src/lib/server/cli/installScript.ts +3 -3
- package/src/lib/server/prompts/promptRegistry.ts +1 -1
- package/src/lib/server/prompts/types/Prompt.ts +2 -1
- package/src/lib/server/rpc/dispatchRpcInProcess.ts +2 -2
- package/src/lib/server/rpc/types/RpcHelper.ts +1 -1
- package/src/lib/server/runtime/createPublicAssetServer.ts +2 -2
- package/src/lib/server/runtime/createRouteDispatcher.ts +1 -1
- package/src/lib/server/runtime/createServer.ts +21 -0
- package/src/lib/server/runtime/createUiPageRenderer.ts +7 -11
- package/src/lib/server/runtime/crossOriginForbidden.ts +2 -2
- package/src/lib/server/runtime/crossOriginGate.ts +1 -1
- package/src/lib/server/runtime/devHotModuleResponse.ts +2 -2
- package/src/lib/server/runtime/disableIdleTimeoutForStream.ts +1 -1
- package/src/lib/server/runtime/logExposedSurfaces.ts +3 -4
- package/src/lib/server/runtime/serializeCacheSnapshot.ts +3 -8
- package/src/lib/server/runtime/snapshotEntryFromCache.ts +10 -7
- package/src/lib/server/runtime/streamFromIterator.ts +2 -2
- package/src/lib/server/runtime/types/InspectorRpc.ts +2 -2
- package/src/lib/server/socket.ts +1 -1
- package/src/lib/server/sockets/createSocketDispatcher.ts +2 -2
- package/src/lib/server/sockets/socketRegistry.ts +2 -2
- package/src/lib/server/sockets/types/SocketClientFrame.ts +3 -3
- package/src/lib/shared/CACHE_WRAPPED.ts +3 -2
- package/src/lib/shared/REMOTE_FUNCTION.ts +1 -1
- package/src/lib/shared/STREAMING_CONTENT_TYPES.ts +3 -2
- package/src/lib/shared/bodyValueForKind.ts +35 -0
- package/src/lib/shared/cache.ts +1 -1
- package/src/lib/shared/cacheEntryFromSnapshot.ts +23 -18
- package/src/lib/shared/createPushIterator.ts +1 -1
- package/src/lib/shared/decodeResponse.ts +11 -8
- package/src/lib/shared/hasReplayableRequest.ts +17 -0
- package/src/lib/shared/html.ts +7 -26
- package/src/lib/shared/manifestModule.ts +2 -2
- package/src/lib/shared/online.ts +1 -1
- package/src/lib/shared/outboxProbeSlot.ts +1 -1
- package/src/lib/shared/pageUrlForFile.ts +1 -1
- package/src/lib/shared/routeParamsShape.ts +20 -0
- package/src/lib/shared/snapshotShippable.ts +22 -0
- package/src/lib/shared/types/CacheEntry.ts +1 -1
- package/src/lib/shared/types/CacheInvalidation.ts +3 -3
- package/src/lib/shared/types/ClientFlags.ts +5 -3
- package/src/lib/shared/types/LastConnection.ts +1 -1
- package/src/lib/shared/url.ts +4 -1
- package/src/lib/shared/withBase.ts +1 -2
- package/src/lib/shared/writeDts.ts +2 -2
- package/src/lib/shared/writeRoutesDts.ts +3 -31
- package/src/lib/test/createTestSocketChannel.ts +3 -3
- package/src/lib/ui/COMPONENT_WRAPPER_PREFIX.ts +1 -1
- package/src/lib/ui/compile/ABIDE_SEMANTIC_TOKENS_LEGEND.ts +40 -6
- package/src/lib/ui/compile/REACTIVE_CALLEES.ts +1 -1
- package/src/lib/ui/compile/UI_RUNTIME_IMPORTS.ts +49 -37
- package/src/lib/ui/compile/abideUiPlugin.ts +1 -1
- package/src/lib/ui/compile/assertRuntimeHelpersBound.ts +3 -1
- package/src/lib/ui/compile/awaitPlan.ts +14 -2
- package/src/lib/ui/compile/catchBinding.ts +8 -0
- package/src/lib/ui/compile/classStyleMergePlan.ts +108 -0
- package/src/lib/ui/compile/collectAbideDiagnostics.ts +11 -0
- package/src/lib/ui/compile/compileComponent.ts +4 -4
- package/src/lib/ui/compile/compileModule.ts +20 -6
- package/src/lib/ui/compile/compileSSR.ts +12 -10
- package/src/lib/ui/compile/compileShadow.ts +107 -16
- package/src/lib/ui/compile/composeProps.ts +3 -3
- package/src/lib/ui/compile/createShadowLanguageService.ts +30 -2
- package/src/lib/ui/compile/createShadowProgram.ts +2 -1
- package/src/lib/ui/compile/createShadowScope.ts +42 -0
- package/src/lib/ui/compile/decodeHtmlEntities.ts +4 -0
- package/src/lib/ui/compile/desugarSignals.ts +12 -7
- package/src/lib/ui/compile/eachPlan.ts +61 -0
- package/src/lib/ui/compile/elementPlan.ts +55 -0
- package/src/lib/ui/compile/encodeSemanticTokens.ts +24 -1
- package/src/lib/ui/compile/generateBuild.ts +150 -127
- package/src/lib/ui/compile/generateSSR.ts +112 -73
- package/src/lib/ui/compile/ifPlan.ts +7 -1
- package/src/lib/ui/compile/interpolatedTemplateLiteral.ts +25 -0
- package/src/lib/ui/compile/isPlainIdentifier.ts +7 -0
- package/src/lib/ui/compile/isTextLeaf.ts +8 -7
- package/src/lib/ui/compile/lowerContext.ts +36 -46
- package/src/lib/ui/compile/lowerDocAccess.ts +2 -2
- package/src/lib/ui/compile/lowerScript.ts +1 -1
- package/src/lib/ui/compile/markupTokens.ts +313 -0
- package/src/lib/ui/compile/pagePropsType.ts +23 -0
- package/src/lib/ui/compile/parseTemplate.ts +131 -61
- package/src/lib/ui/compile/reactiveBinding.ts +47 -0
- package/src/lib/ui/compile/renameSignalRefs.ts +44 -10
- package/src/lib/ui/compile/skeletonable.ts +5 -5
- package/src/lib/ui/compile/snippetPlan.ts +28 -0
- package/src/lib/ui/compile/spreadExcludedNames.ts +4 -4
- package/src/lib/ui/compile/structuralBlockTokens.ts +3 -4
- package/src/lib/ui/compile/switchPlan.ts +7 -1
- package/src/lib/ui/compile/tryPlan.ts +8 -1
- package/src/lib/ui/compile/types/AnalyzedComponent.ts +2 -2
- package/src/lib/ui/compile/types/Binding.ts +24 -0
- package/src/lib/ui/compile/types/CompiledShadow.ts +13 -1
- package/src/lib/ui/compile/types/ElementPlan.ts +43 -0
- package/src/lib/ui/compile/types/ShadowKind.ts +9 -0
- package/src/lib/ui/compile/types/ShadowScope.ts +19 -0
- package/src/lib/ui/compile/types/TemplateAttr.ts +7 -0
- package/src/lib/ui/compile/types/TemplateNode.ts +8 -8
- package/src/lib/ui/compile/withBindings.ts +45 -0
- package/src/lib/ui/createScope.ts +2 -2
- package/src/lib/ui/dom/MATHML_NAMESPACE.ts +2 -2
- package/src/lib/ui/dom/SVG_NAMESPACE.ts +3 -2
- package/src/lib/ui/dom/appendText.ts +1 -1
- package/src/lib/ui/dom/applyResolved.ts +1 -1
- package/src/lib/ui/dom/buildDetachedRange.ts +4 -3
- package/src/lib/ui/dom/cloneStatic.ts +3 -2
- package/src/lib/ui/dom/each.ts +26 -7
- package/src/lib/ui/dom/foreignWrapperTag.ts +2 -2
- package/src/lib/ui/dom/mountChild.ts +8 -1
- package/src/lib/ui/dom/readCall.ts +6 -4
- package/src/lib/ui/dom/scopeLabel.ts +3 -3
- package/src/lib/ui/dom/switchBlock.ts +3 -1
- package/src/lib/ui/dom/types/EachRow.ts +4 -0
- package/src/lib/ui/dom/types/SkeletonHoles.ts +4 -2
- package/src/lib/ui/history.ts +1 -2
- package/src/lib/ui/html.ts +28 -0
- package/src/lib/ui/installHotBridge.ts +0 -2
- package/src/lib/ui/renderChain.ts +16 -3
- package/src/lib/ui/router.ts +66 -15
- package/src/lib/ui/rpcOutbox/createOutboxQueue.ts +1 -1
- package/src/lib/ui/runtime/CHILD_PRESENT.ts +8 -0
- package/src/lib/ui/runtime/OUTLET_MARKER.ts +2 -2
- package/src/lib/ui/runtime/RANGE_MARKER.ts +1 -1
- package/src/lib/ui/runtime/REACTIVE_CONTEXT.ts +9 -3
- package/src/lib/ui/runtime/captureModelDoc.ts +1 -1
- package/src/lib/ui/runtime/createDoc.ts +5 -1
- package/src/lib/ui/runtime/createEffectNode.ts +5 -5
- package/src/lib/ui/runtime/flushEffects.ts +22 -9
- package/src/lib/ui/runtime/historyEntries.ts +1 -1
- package/src/lib/ui/runtime/track.ts +4 -2
- package/src/lib/ui/runtime/trigger.ts +34 -20
- package/src/lib/ui/runtime/types/Route.ts +2 -2
- package/src/lib/ui/runtime/types/UiComponent.ts +3 -2
- package/src/lib/ui/runtime/types/UiProps.ts +9 -12
- package/src/lib/ui/runtime/walkPath.ts +15 -3
- package/src/lib/ui/startClient.ts +41 -14
- package/src/lib/ui/state.ts +3 -3
- package/src/lib/ui/types/Scope.ts +3 -3
- package/src/serverBuildPlugins.ts +11 -5
- package/src/zodCjsPlugin.ts +36 -0
- package/template/.zed/settings.json +7 -1
- package/template/package.json +3 -0
- package/template/src/ui/pages/layout.abide +3 -5
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { BunPlugin } from 'bun'
|
|
2
2
|
import { abideResolverPlugin } from './abideResolverPlugin.ts'
|
|
3
3
|
import { abideUiPlugin } from './lib/ui/compile/abideUiPlugin.ts'
|
|
4
|
+
import { zodCjsPlugin } from './zodCjsPlugin.ts'
|
|
4
5
|
|
|
5
6
|
/*
|
|
6
|
-
The server-target Bun.build plugin
|
|
7
|
-
the abide-ui `.abide` loader (so SSR `render()` resolves)
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
The server-target Bun.build plugin set shared by compile / buildCli / bundleApp:
|
|
8
|
+
the abide-ui `.abide` loader (so SSR `render()` resolves), abide's virtual-module
|
|
9
|
+
resolver, and the zod→CommonJS shim that works around bun's broken ESM-cycle
|
|
10
|
+
bundling (see zodCjsPlugin). `embedAssets` flips on the gzip asset embed used by
|
|
11
|
+
the standalone server binary; the CLI + launcher builds leave it off.
|
|
10
12
|
*/
|
|
11
13
|
export function serverBuildPlugins({
|
|
12
14
|
cwd,
|
|
@@ -15,5 +17,9 @@ export function serverBuildPlugins({
|
|
|
15
17
|
cwd: string
|
|
16
18
|
embedAssets?: boolean
|
|
17
19
|
}): BunPlugin[] {
|
|
18
|
-
return [
|
|
20
|
+
return [
|
|
21
|
+
zodCjsPlugin(cwd),
|
|
22
|
+
abideUiPlugin,
|
|
23
|
+
abideResolverPlugin({ cwd, embedAssets, target: 'server' }),
|
|
24
|
+
]
|
|
19
25
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs'
|
|
2
|
+
import { dirname } from 'node:path'
|
|
3
|
+
import type { BunPlugin } from 'bun'
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Routes every `zod` import in a server bundle to zod's CommonJS build.
|
|
7
|
+
|
|
8
|
+
zod v4's ESM is reached through two subpaths (`zod` and `zod/v4/core`) whose
|
|
9
|
+
modules form an initialization cycle. Bun's bundler emits a broken init order
|
|
10
|
+
for that cycle (oven-sh/bun#31586, closed as not-planned), so a bundled binary
|
|
11
|
+
crashes (`<helper> is not defined`) or — for a lazily imported module — silently
|
|
12
|
+
fails to evaluate, which drops every rpc whose module imports zod from the
|
|
13
|
+
registry. It only bites bundled output; `abide dev` runs unbundled and is fine.
|
|
14
|
+
|
|
15
|
+
zod ships a parallel CommonJS build (`index.cjs`, `v4/core/index.cjs`, …), and
|
|
16
|
+
CommonJS resolves circular requires through a mutating `module.exports` with no
|
|
17
|
+
temporal-dead-zone, so the cycle initializes correctly. Resolving each zod
|
|
18
|
+
specifier to its `.cjs` sibling makes bun bundle zod as CommonJS and sidesteps
|
|
19
|
+
the bug while keeping zod v4. Server-only: the client bundle strips zod from rpc
|
|
20
|
+
modules (they become remote proxies), and dev never bundles.
|
|
21
|
+
*/
|
|
22
|
+
export function zodCjsPlugin(cwd: string): BunPlugin {
|
|
23
|
+
return {
|
|
24
|
+
name: 'abide-zod-cjs',
|
|
25
|
+
setup(build) {
|
|
26
|
+
build.onResolve({ filter: /^zod($|\/)/ }, (args) => {
|
|
27
|
+
/* Resolve from the importer (or cwd for the entry) to zod's ESM
|
|
28
|
+
target, then swap to its `.cjs` sibling when one exists. */
|
|
29
|
+
const from = args.importer ? dirname(args.importer) : cwd
|
|
30
|
+
const resolved = Bun.resolveSync(args.path, from)
|
|
31
|
+
const cjs = resolved.replace(/\.js$/, '.cjs')
|
|
32
|
+
return { path: existsSync(cjs) ? cjs : resolved }
|
|
33
|
+
})
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"auto_install_extensions": { "abide": true },
|
|
3
|
-
"semantic_tokens": "combined"
|
|
3
|
+
"semantic_tokens": "combined",
|
|
4
|
+
"global_lsp_settings": {
|
|
5
|
+
"semantic_token_rules": [
|
|
6
|
+
{ "token_type": "tag", "style": ["tag"] },
|
|
7
|
+
{ "token_type": "attribute", "style": ["attribute"] }
|
|
8
|
+
]
|
|
9
|
+
}
|
|
4
10
|
}
|
package/template/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
/*
|
|
3
3
|
Root layout. A layout.abide wraps every page at or below its folder — here
|
|
4
|
-
src/ui/pages/, so it wraps the whole app. The page
|
|
5
|
-
the resolver finds it by filename (no per-page import), and the client router
|
|
4
|
+
src/ui/pages/, so it wraps the whole app. The page renders where this layout
|
|
5
|
+
calls {children()}; the resolver finds it by filename (no per-page import), and the client router
|
|
6
6
|
keeps it mounted across navigation, so this chrome never re-mounts. A nested
|
|
7
7
|
layout.abide (in a subfolder) wraps inside this one. Runs on the server during
|
|
8
8
|
SSR and on the client after hydration.
|
|
@@ -16,6 +16,4 @@ import '../app.css'
|
|
|
16
16
|
<a href="/about">About</a>
|
|
17
17
|
</nav>
|
|
18
18
|
</header>
|
|
19
|
-
<main>
|
|
20
|
-
<slot></slot>
|
|
21
|
-
</main>
|
|
19
|
+
<main>{children()}</main>
|