@alloy-js/core 0.23.0-dev.9 → 0.24.0-dev.1
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 +34 -0
- package/api-extractor.json +1 -8
- package/api-extractor.testing.json +19 -0
- package/dist/dev/src/binder.js +595 -0
- package/dist/dev/src/binder.js.map +1 -0
- package/dist/dev/src/code.js +181 -0
- package/dist/dev/src/code.js.map +1 -0
- package/dist/dev/src/components/AccessExpression.js +230 -0
- package/dist/dev/src/components/AccessExpression.js.map +1 -0
- package/dist/dev/src/components/AccessExpression.test.js +237 -0
- package/dist/dev/src/components/AccessExpression.test.js.map +1 -0
- package/dist/dev/src/components/AppendFile.js +246 -0
- package/dist/dev/src/components/AppendFile.js.map +1 -0
- package/dist/dev/src/components/Block.js +78 -0
- package/dist/dev/src/components/Block.js.map +1 -0
- package/dist/dev/src/components/CopyFile.js +16 -0
- package/dist/dev/src/components/CopyFile.js.map +1 -0
- package/dist/dev/src/components/Declaration.js +70 -0
- package/dist/dev/src/components/Declaration.js.map +1 -0
- package/dist/dev/src/components/For.js +40 -0
- package/dist/dev/src/components/For.js.map +1 -0
- package/dist/dev/src/components/Indent.js +37 -0
- package/dist/dev/src/components/Indent.js.map +1 -0
- package/dist/dev/src/components/List.js +29 -0
- package/dist/dev/src/components/List.js.map +1 -0
- package/dist/dev/src/components/MemberDeclaration.js +70 -0
- package/dist/dev/src/components/MemberDeclaration.js.map +1 -0
- package/dist/dev/src/components/MemberName.js +18 -0
- package/dist/dev/src/components/MemberName.js.map +1 -0
- package/dist/dev/src/components/MemberScope.js +62 -0
- package/dist/dev/src/components/MemberScope.js.map +1 -0
- package/dist/dev/src/components/Name.js +11 -0
- package/dist/dev/src/components/Name.js.map +1 -0
- package/dist/dev/src/components/Output.js +72 -0
- package/dist/dev/src/components/Output.js.map +1 -0
- package/dist/dev/src/components/Prose.js +32 -0
- package/dist/dev/src/components/Prose.js.map +1 -0
- package/dist/dev/src/components/ReferenceOrContent.js +12 -0
- package/dist/dev/src/components/ReferenceOrContent.js.map +1 -0
- package/dist/dev/src/components/Scope.js +56 -0
- package/dist/dev/src/components/Scope.js.map +1 -0
- package/dist/dev/src/components/Show.js +4 -0
- package/dist/dev/src/components/Show.js.map +1 -0
- package/dist/dev/src/components/SourceDirectory.js +41 -0
- package/dist/dev/src/components/SourceDirectory.js.map +1 -0
- package/dist/dev/src/components/SourceFile.js +52 -0
- package/dist/dev/src/components/SourceFile.js.map +1 -0
- package/dist/dev/src/components/StatementList.js +20 -0
- package/dist/dev/src/components/StatementList.js.map +1 -0
- package/dist/dev/src/components/Switch.js +42 -0
- package/dist/dev/src/components/Switch.js.map +1 -0
- package/dist/dev/src/components/TemplateFile.js +153 -0
- package/dist/dev/src/components/TemplateFile.js.map +1 -0
- package/dist/dev/src/components/UpdateFile.js +71 -0
- package/dist/dev/src/components/UpdateFile.js.map +1 -0
- package/dist/dev/src/components/Wrap.js +18 -0
- package/dist/dev/src/components/Wrap.js.map +1 -0
- package/dist/dev/src/components/index.js +25 -0
- package/dist/dev/src/components/index.js.map +1 -0
- package/dist/dev/src/components/stc/index.js +27 -0
- package/dist/dev/src/components/stc/index.js.map +1 -0
- package/dist/dev/src/components/stc/sti.js +10 -0
- package/dist/dev/src/components/stc/sti.js.map +1 -0
- package/dist/dev/src/content-slot.js +78 -0
- package/dist/dev/src/content-slot.js.map +1 -0
- package/dist/dev/src/content-slot.test.js +89 -0
- package/dist/dev/src/content-slot.test.js.map +1 -0
- package/dist/dev/src/context/assignment.js +46 -0
- package/dist/dev/src/context/assignment.js.map +1 -0
- package/dist/dev/src/context/binder.js +17 -0
- package/dist/dev/src/context/binder.js.map +1 -0
- package/dist/dev/src/context/declaration.js +3 -0
- package/dist/dev/src/context/declaration.js.map +1 -0
- package/dist/dev/src/context/format-options.js +45 -0
- package/dist/dev/src/context/format-options.js.map +1 -0
- package/dist/dev/src/context/index.js +11 -0
- package/dist/dev/src/context/index.js.map +1 -0
- package/dist/dev/src/context/member-declaration.js +11 -0
- package/dist/dev/src/context/member-declaration.js.map +1 -0
- package/dist/dev/src/context/member-scope.js +12 -0
- package/dist/dev/src/context/member-scope.js.map +1 -0
- package/dist/dev/src/context/name-policy.js +13 -0
- package/dist/dev/src/context/name-policy.js.map +1 -0
- package/dist/dev/src/context/scope.js +18 -0
- package/dist/dev/src/context/scope.js.map +1 -0
- package/dist/dev/src/context/source-directory.js +12 -0
- package/dist/dev/src/context/source-directory.js.map +1 -0
- package/dist/dev/src/context/source-file.js +3 -0
- package/dist/dev/src/context/source-file.js.map +1 -0
- package/dist/dev/src/context.js +47 -0
- package/dist/dev/src/context.js.map +1 -0
- package/dist/dev/src/debug/cli.js +164 -0
- package/dist/dev/src/debug/cli.js.map +1 -0
- package/dist/dev/src/debug/diagnostics-broadcast.test.js +100 -0
- package/dist/dev/src/debug/diagnostics-broadcast.test.js.map +1 -0
- package/dist/dev/src/debug/diagnostics.test.js +50 -0
- package/dist/dev/src/debug/diagnostics.test.js.map +1 -0
- package/dist/dev/src/debug/effects.js +293 -0
- package/dist/dev/src/debug/effects.js.map +1 -0
- package/dist/dev/src/debug/effects.test.js +280 -0
- package/dist/dev/src/debug/effects.test.js.map +1 -0
- package/dist/dev/src/debug/files.js +29 -0
- package/dist/dev/src/debug/files.js.map +1 -0
- package/dist/dev/src/debug/files.test.js +78 -0
- package/dist/dev/src/debug/files.test.js.map +1 -0
- package/dist/dev/src/debug/index.js +71 -0
- package/dist/dev/src/debug/index.js.map +1 -0
- package/dist/dev/src/debug/message-format.test.js +836 -0
- package/dist/dev/src/debug/message-format.test.js.map +1 -0
- package/dist/dev/src/debug/render-tree-orphans.test.js +365 -0
- package/dist/dev/src/debug/render-tree-orphans.test.js.map +1 -0
- package/dist/dev/src/debug/render.js +479 -0
- package/dist/dev/src/debug/render.js.map +1 -0
- package/dist/dev/src/debug/render.test.js +363 -0
- package/dist/dev/src/debug/render.test.js.map +1 -0
- package/dist/dev/src/debug/serialize.js +70 -0
- package/dist/dev/src/debug/serialize.js.map +1 -0
- package/dist/dev/src/debug/source-map.browser.js +24 -0
- package/dist/dev/src/debug/source-map.browser.js.map +1 -0
- package/dist/dev/src/debug/source-map.js +111 -0
- package/dist/dev/src/debug/source-map.js.map +1 -0
- package/dist/dev/src/debug/symbols.js +196 -0
- package/dist/dev/src/debug/symbols.js.map +1 -0
- package/dist/dev/src/debug/symbols.test.js +93 -0
- package/dist/dev/src/debug/symbols.test.js.map +1 -0
- package/dist/dev/src/debug/trace-writer.js +674 -0
- package/dist/dev/src/debug/trace-writer.js.map +1 -0
- package/dist/dev/src/debug/trace.js +460 -0
- package/dist/dev/src/debug/trace.js.map +1 -0
- package/dist/dev/src/devtools/devtools-protocol.js +2 -0
- package/dist/dev/src/devtools/devtools-protocol.js.map +1 -0
- package/dist/dev/src/devtools/devtools-server.browser.js +36 -0
- package/dist/dev/src/devtools/devtools-server.browser.js.map +1 -0
- package/dist/dev/src/devtools/devtools-server.js +458 -0
- package/dist/dev/src/devtools/devtools-server.js.map +1 -0
- package/dist/dev/src/devtools/devtools-transport.js +114 -0
- package/dist/dev/src/devtools/devtools-transport.js.map +1 -0
- package/dist/dev/src/devtools-entry.browser.js +2 -0
- package/dist/dev/src/devtools-entry.browser.js.map +1 -0
- package/dist/dev/src/devtools-entry.js +2 -0
- package/dist/dev/src/devtools-entry.js.map +1 -0
- package/dist/dev/src/diagnostics.js +97 -0
- package/dist/dev/src/diagnostics.js.map +1 -0
- package/dist/dev/src/host/alloy-host.browser.js +32 -0
- package/dist/dev/src/host/alloy-host.browser.js.map +1 -0
- package/dist/dev/src/host/alloy-host.js +144 -0
- package/dist/dev/src/host/alloy-host.js.map +1 -0
- package/dist/dev/src/host/interface.js +2 -0
- package/dist/dev/src/host/interface.js.map +1 -0
- package/dist/dev/src/host/node-host.browser.js +21 -0
- package/dist/dev/src/host/node-host.browser.js.map +1 -0
- package/dist/dev/src/host/node-host.js +20 -0
- package/dist/dev/src/host/node-host.js.map +1 -0
- package/dist/dev/src/index.browser.js +3 -0
- package/dist/dev/src/index.browser.js.map +1 -0
- package/dist/dev/src/index.js +27 -0
- package/dist/dev/src/index.js.map +1 -0
- package/dist/dev/src/inspect.browser.js +6 -0
- package/dist/dev/src/inspect.browser.js.map +1 -0
- package/dist/dev/src/inspect.js +2 -0
- package/dist/dev/src/inspect.js.map +1 -0
- package/dist/dev/src/jsx-runtime.js +17 -0
- package/dist/dev/src/jsx-runtime.js.map +1 -0
- package/dist/dev/src/library-symbol-reference.js +59 -0
- package/dist/dev/src/library-symbol-reference.js.map +1 -0
- package/dist/dev/src/name-policy.js +51 -0
- package/dist/dev/src/name-policy.js.map +1 -0
- package/dist/dev/src/pretty-string/pretty-string.js +100 -0
- package/dist/dev/src/pretty-string/pretty-string.js.map +1 -0
- package/dist/dev/src/pretty-string/pretty-string.test.js +38 -0
- package/dist/dev/src/pretty-string/pretty-string.test.js.map +1 -0
- package/dist/dev/src/print-hook.js +10 -0
- package/dist/dev/src/print-hook.js.map +1 -0
- package/dist/dev/src/props-combinators.js +109 -0
- package/dist/dev/src/props-combinators.js.map +1 -0
- package/dist/dev/src/reactive-union-set.js +213 -0
- package/dist/dev/src/reactive-union-set.js.map +1 -0
- package/dist/dev/src/reactivity.js +452 -0
- package/dist/dev/src/reactivity.js.map +1 -0
- package/dist/dev/src/refkey.js +167 -0
- package/dist/dev/src/refkey.js.map +1 -0
- package/dist/dev/src/render-stack.js +252 -0
- package/dist/dev/src/render-stack.js.map +1 -0
- package/dist/dev/src/render.js +872 -0
- package/dist/dev/src/render.js.map +1 -0
- package/dist/dev/src/resource.js +124 -0
- package/dist/dev/src/resource.js.map +1 -0
- package/dist/dev/src/runtime/component.js +41 -0
- package/dist/dev/src/runtime/component.js.map +1 -0
- package/dist/dev/src/runtime/intrinsic.js +12 -0
- package/dist/dev/src/runtime/intrinsic.js.map +1 -0
- package/dist/dev/src/scheduler.js +217 -0
- package/dist/dev/src/scheduler.js.map +1 -0
- package/dist/dev/src/stc.js +40 -0
- package/dist/dev/src/stc.js.map +1 -0
- package/dist/dev/src/sti.js +31 -0
- package/dist/dev/src/sti.js.map +1 -0
- package/dist/dev/src/symbols/basic-scope.js +21 -0
- package/dist/dev/src/symbols/basic-scope.js.map +1 -0
- package/dist/dev/src/symbols/basic-symbol.js +34 -0
- package/dist/dev/src/symbols/basic-symbol.js.map +1 -0
- package/dist/dev/src/symbols/decl.js +26 -0
- package/dist/dev/src/symbols/decl.js.map +1 -0
- package/dist/dev/src/symbols/index.js +10 -0
- package/dist/dev/src/symbols/index.js.map +1 -0
- package/dist/dev/src/symbols/output-scope.js +235 -0
- package/dist/dev/src/symbols/output-scope.js.map +1 -0
- package/dist/dev/src/symbols/output-space.js +51 -0
- package/dist/dev/src/symbols/output-space.js.map +1 -0
- package/dist/dev/src/symbols/output-symbol.js +644 -0
- package/dist/dev/src/symbols/output-symbol.js.map +1 -0
- package/dist/dev/src/symbols/symbol-flow.js +106 -0
- package/dist/dev/src/symbols/symbol-flow.js.map +1 -0
- package/dist/dev/src/symbols/symbol-slot.js +75 -0
- package/dist/dev/src/symbols/symbol-slot.js.map +1 -0
- package/dist/dev/src/symbols/symbol-slot.test.js +68 -0
- package/dist/dev/src/symbols/symbol-slot.test.js.map +1 -0
- package/dist/dev/src/symbols/symbol-table.js +103 -0
- package/dist/dev/src/symbols/symbol-table.js.map +1 -0
- package/dist/dev/src/tap.js +109 -0
- package/dist/dev/src/tap.js.map +1 -0
- package/dist/dev/src/trace.js +2 -0
- package/dist/dev/src/trace.js.map +1 -0
- package/dist/dev/src/tracer.js +180 -0
- package/dist/dev/src/tracer.js.map +1 -0
- package/dist/dev/src/utils.js +487 -0
- package/dist/dev/src/utils.js.map +1 -0
- package/dist/dev/src/write-output.js +48 -0
- package/dist/dev/src/write-output.js.map +1 -0
- package/dist/dev/test/browser-build.test.js +85 -0
- package/dist/dev/test/browser-build.test.js.map +1 -0
- package/dist/dev/test/children.test.js +44 -0
- package/dist/dev/test/children.test.js.map +1 -0
- package/dist/dev/test/components/append-file.test.js +394 -0
- package/dist/dev/test/components/append-file.test.js.map +1 -0
- package/dist/dev/test/components/block.test.js +83 -0
- package/dist/dev/test/components/block.test.js.map +1 -0
- package/dist/dev/test/components/copy-file.test.js +119 -0
- package/dist/dev/test/components/copy-file.test.js.map +1 -0
- package/dist/dev/test/components/declaration.test.js +40 -0
- package/dist/dev/test/components/declaration.test.js.map +1 -0
- package/dist/dev/test/components/list.test.js +250 -0
- package/dist/dev/test/components/list.test.js.map +1 -0
- package/dist/dev/test/components/prose.test.js +42 -0
- package/dist/dev/test/components/prose.test.js.map +1 -0
- package/dist/dev/test/components/reference-or-content.test.js +246 -0
- package/dist/dev/test/components/reference-or-content.test.js.map +1 -0
- package/dist/dev/test/components/source-file.test.js +271 -0
- package/dist/dev/test/components/source-file.test.js.map +1 -0
- package/dist/dev/test/components/template-file.test.js +200 -0
- package/dist/dev/test/components/template-file.test.js.map +1 -0
- package/dist/dev/test/components/update-file.test.js +210 -0
- package/dist/dev/test/components/update-file.test.js.map +1 -0
- package/dist/dev/test/components/wrap.test.js +48 -0
- package/dist/dev/test/components/wrap.test.js.map +1 -0
- package/dist/dev/test/control-flow/for.test.js +318 -0
- package/dist/dev/test/control-flow/for.test.js.map +1 -0
- package/dist/dev/test/control-flow/match.test.js +112 -0
- package/dist/dev/test/control-flow/match.test.js.map +1 -0
- package/dist/dev/test/control-flow/show.test.js +38 -0
- package/dist/dev/test/control-flow/show.test.js.map +1 -0
- package/dist/dev/test/lazy-isempty.test.js +121 -0
- package/dist/dev/test/lazy-isempty.test.js.map +1 -0
- package/dist/dev/test/name-policy.test.js +28 -0
- package/dist/dev/test/name-policy.test.js.map +1 -0
- package/dist/dev/test/props-with-defaults.test.js +94 -0
- package/dist/dev/test/props-with-defaults.test.js.map +1 -0
- package/dist/dev/test/reactive-union-set-disposers.test.js +98 -0
- package/dist/dev/test/reactive-union-set-disposers.test.js.map +1 -0
- package/dist/dev/test/reactive-union-set.test.js +171 -0
- package/dist/dev/test/reactive-union-set.test.js.map +1 -0
- package/dist/dev/test/reactivity/circular-reactives.test.js +62 -0
- package/dist/dev/test/reactivity/circular-reactives.test.js.map +1 -0
- package/dist/dev/test/reactivity/cleanup.test.js +96 -0
- package/dist/dev/test/reactivity/cleanup.test.js.map +1 -0
- package/dist/dev/test/reactivity/memo.test.js +17 -0
- package/dist/dev/test/reactivity/memo.test.js.map +1 -0
- package/dist/dev/test/reactivity/ref-rendering.test.js +38 -0
- package/dist/dev/test/reactivity/ref-rendering.test.js.map +1 -0
- package/dist/dev/test/reactivity/shallow-reactive.test.js +56 -0
- package/dist/dev/test/reactivity/shallow-reactive.test.js.map +1 -0
- package/dist/dev/test/reactivity/test.test.js +74 -0
- package/dist/dev/test/reactivity/test.test.js.map +1 -0
- package/dist/dev/test/reactivity/untrack.test.js +27 -0
- package/dist/dev/test/reactivity/untrack.test.js.map +1 -0
- package/dist/dev/test/refkey.test.js +36 -0
- package/dist/dev/test/refkey.test.js.map +1 -0
- package/dist/dev/test/rendering/basic.test.js +194 -0
- package/dist/dev/test/rendering/basic.test.js.map +1 -0
- package/dist/dev/test/rendering/code.test.js +64 -0
- package/dist/dev/test/rendering/code.test.js.map +1 -0
- package/dist/dev/test/rendering/formatting.test.js +797 -0
- package/dist/dev/test/rendering/formatting.test.js.map +1 -0
- package/dist/dev/test/rendering/indent.test.js +183 -0
- package/dist/dev/test/rendering/indent.test.js.map +1 -0
- package/dist/dev/test/rendering/memoization.test.js +37 -0
- package/dist/dev/test/rendering/memoization.test.js.map +1 -0
- package/dist/dev/test/rendering/print-render-stack.test.js +287 -0
- package/dist/dev/test/rendering/print-render-stack.test.js.map +1 -0
- package/dist/dev/test/rendering/refkeys.test.js +37 -0
- package/dist/dev/test/rendering/refkeys.test.js.map +1 -0
- package/dist/dev/test/scheduler-extended.test.js +96 -0
- package/dist/dev/test/scheduler-extended.test.js.map +1 -0
- package/dist/dev/test/scheduler.test.js +46 -0
- package/dist/dev/test/scheduler.test.js.map +1 -0
- package/dist/dev/test/split-props.test.js +78 -0
- package/dist/dev/test/split-props.test.js.map +1 -0
- package/dist/dev/test/stc.test.js +35 -0
- package/dist/dev/test/stc.test.js.map +1 -0
- package/dist/dev/test/symbols/deconflicted-name.test.js +120 -0
- package/dist/dev/test/symbols/deconflicted-name.test.js.map +1 -0
- package/dist/dev/test/symbols/output-scope.test.js +221 -0
- package/dist/dev/test/symbols/output-scope.test.js.map +1 -0
- package/dist/dev/test/symbols/output-symbol.test.js +202 -0
- package/dist/dev/test/symbols/output-symbol.test.js.map +1 -0
- package/dist/dev/test/symbols/resolution.test.js +487 -0
- package/dist/dev/test/symbols/resolution.test.js.map +1 -0
- package/dist/dev/test/symbols/symbol-table.test.js +15 -0
- package/dist/dev/test/symbols/symbol-table.test.js.map +1 -0
- package/dist/dev/test/symbols/utils.js +26 -0
- package/dist/dev/test/symbols/utils.js.map +1 -0
- package/dist/dev/test/utils.test.js +317 -0
- package/dist/dev/test/utils.test.js.map +1 -0
- package/dist/dev/testing/create-test-wrapper.js +130 -0
- package/dist/dev/testing/create-test-wrapper.js.map +1 -0
- package/dist/dev/testing/devtools-utils.js +162 -0
- package/dist/dev/testing/devtools-utils.js.map +1 -0
- package/dist/dev/testing/extend-expect.js +187 -0
- package/dist/dev/testing/extend-expect.js.map +1 -0
- package/dist/dev/testing/extend-expect.test.js +234 -0
- package/dist/dev/testing/extend-expect.test.js.map +1 -0
- package/dist/dev/testing/index.js +4 -0
- package/dist/dev/testing/index.js.map +1 -0
- package/dist/dev/testing/render.js +34 -0
- package/dist/dev/testing/render.js.map +1 -0
- package/dist/dev/testing/vitest.d.js +14 -0
- package/dist/dev/testing/vitest.d.js.map +1 -0
- package/dist/devtools/index.html +29 -17
- package/dist/src/binder.d.ts +107 -3
- package/dist/src/binder.d.ts.map +1 -1
- package/dist/src/binder.js +113 -1
- package/dist/src/binder.js.map +1 -1
- package/dist/src/components/AccessExpression.d.ts +78 -0
- package/dist/src/components/AccessExpression.d.ts.map +1 -0
- package/dist/src/components/AccessExpression.js +218 -0
- package/dist/src/components/AccessExpression.js.map +1 -0
- package/dist/src/components/AccessExpression.test.d.ts +2 -0
- package/dist/src/components/AccessExpression.test.d.ts.map +1 -0
- package/dist/src/components/AccessExpression.test.js +137 -0
- package/dist/src/components/AccessExpression.test.js.map +1 -0
- package/dist/src/components/Block.d.ts +12 -0
- package/dist/src/components/Block.d.ts.map +1 -1
- package/dist/src/components/Block.js +12 -0
- package/dist/src/components/Block.js.map +1 -1
- package/dist/src/components/For.d.ts.map +1 -1
- package/dist/src/components/For.js +1 -1
- package/dist/src/components/For.js.map +1 -1
- package/dist/src/components/List.d.ts +11 -1
- package/dist/src/components/List.d.ts.map +1 -1
- package/dist/src/components/List.js +1 -1
- package/dist/src/components/List.js.map +1 -1
- package/dist/src/components/MemberDeclaration.d.ts +6 -6
- package/dist/src/components/MemberDeclaration.js +6 -6
- package/dist/src/components/MemberName.d.ts +6 -0
- package/dist/src/components/MemberName.d.ts.map +1 -1
- package/dist/src/components/MemberName.js +7 -0
- package/dist/src/components/MemberName.js.map +1 -1
- package/dist/src/components/MemberScope.d.ts +5 -0
- package/dist/src/components/MemberScope.d.ts.map +1 -1
- package/dist/src/components/MemberScope.js +5 -0
- package/dist/src/components/MemberScope.js.map +1 -1
- package/dist/src/components/Output.d.ts +4 -2
- package/dist/src/components/Output.d.ts.map +1 -1
- package/dist/src/components/Output.js.map +1 -1
- package/dist/src/components/Scope.d.ts +6 -0
- package/dist/src/components/Scope.d.ts.map +1 -1
- package/dist/src/components/Scope.js +6 -0
- package/dist/src/components/Scope.js.map +1 -1
- package/dist/src/components/SourceFile.d.ts +22 -2
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js.map +1 -1
- package/dist/src/components/Switch.d.ts.map +1 -1
- package/dist/src/components/Switch.js +1 -1
- package/dist/src/components/Switch.js.map +1 -1
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +1 -0
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/context/binder.d.ts +4 -0
- package/dist/src/context/binder.d.ts.map +1 -1
- package/dist/src/context/binder.js +5 -0
- package/dist/src/context/binder.js.map +1 -1
- package/dist/src/context/format-options.d.ts +14 -1
- package/dist/src/context/format-options.d.ts.map +1 -1
- package/dist/src/context/format-options.js +14 -1
- package/dist/src/context/format-options.js.map +1 -1
- package/dist/src/context/scope.d.ts +4 -0
- package/dist/src/context/scope.d.ts.map +1 -1
- package/dist/src/context/scope.js +5 -0
- package/dist/src/context/scope.js.map +1 -1
- package/dist/src/context/source-directory.d.ts +9 -0
- package/dist/src/context/source-directory.d.ts.map +1 -1
- package/dist/src/context/source-directory.js +9 -0
- package/dist/src/context/source-directory.js.map +1 -1
- package/dist/src/debug/cli.d.ts.map +1 -1
- package/dist/src/debug/cli.js +3 -2
- package/dist/src/debug/cli.js.map +1 -1
- package/dist/src/debug/diagnostics-broadcast.test.d.ts +2 -0
- package/dist/src/debug/diagnostics-broadcast.test.d.ts.map +1 -0
- package/dist/src/debug/diagnostics-broadcast.test.js +100 -0
- package/dist/src/debug/diagnostics-broadcast.test.js.map +1 -0
- package/dist/src/debug/diagnostics.test.js +3 -2
- package/dist/src/debug/diagnostics.test.js.map +1 -1
- package/dist/src/debug/effects.d.ts +12 -4
- package/dist/src/debug/effects.d.ts.map +1 -1
- package/dist/src/debug/effects.js +119 -54
- package/dist/src/debug/effects.js.map +1 -1
- package/dist/src/debug/effects.test.js +213 -41
- package/dist/src/debug/effects.test.js.map +1 -1
- package/dist/src/debug/files.d.ts.map +1 -1
- package/dist/src/debug/files.js +7 -18
- package/dist/src/debug/files.js.map +1 -1
- package/dist/src/debug/files.test.js +13 -36
- package/dist/src/debug/files.test.js.map +1 -1
- package/dist/src/debug/index.d.ts +4 -2
- package/dist/src/debug/index.d.ts.map +1 -1
- package/dist/src/debug/index.js +4 -2
- package/dist/src/debug/index.js.map +1 -1
- package/dist/src/debug/message-format.test.d.ts +2 -0
- package/dist/src/debug/message-format.test.d.ts.map +1 -0
- package/dist/src/debug/message-format.test.js +700 -0
- package/dist/src/debug/message-format.test.js.map +1 -0
- package/dist/src/debug/render-tree-orphans.test.d.ts +2 -0
- package/dist/src/debug/render-tree-orphans.test.d.ts.map +1 -0
- package/dist/src/debug/render-tree-orphans.test.js +297 -0
- package/dist/src/debug/render-tree-orphans.test.js.map +1 -0
- package/dist/src/debug/render.d.ts.map +1 -1
- package/dist/src/debug/render.js +91 -131
- package/dist/src/debug/render.js.map +1 -1
- package/dist/src/debug/render.test.js +91 -128
- package/dist/src/debug/render.test.js.map +1 -1
- package/dist/src/debug/source-map.browser.d.ts +16 -0
- package/dist/src/debug/source-map.browser.d.ts.map +1 -0
- package/dist/src/debug/source-map.browser.js +24 -0
- package/dist/src/debug/source-map.browser.js.map +1 -0
- package/dist/src/debug/source-map.d.ts +22 -0
- package/dist/src/debug/source-map.d.ts.map +1 -0
- package/dist/src/debug/source-map.js +111 -0
- package/dist/src/debug/source-map.js.map +1 -0
- package/dist/src/debug/symbols.d.ts +6 -5
- package/dist/src/debug/symbols.d.ts.map +1 -1
- package/dist/src/debug/symbols.js +46 -23
- package/dist/src/debug/symbols.js.map +1 -1
- package/dist/src/debug/symbols.test.js +15 -26
- package/dist/src/debug/symbols.test.js.map +1 -1
- package/dist/src/debug/trace-writer.d.ts +56 -0
- package/dist/src/debug/trace-writer.d.ts.map +1 -0
- package/dist/src/debug/trace-writer.js +674 -0
- package/dist/src/debug/trace-writer.js.map +1 -0
- package/dist/src/debug/trace.d.ts +10 -10
- package/dist/src/debug/trace.d.ts.map +1 -1
- package/dist/src/debug/trace.js +41 -24
- package/dist/src/debug/trace.js.map +1 -1
- package/dist/src/devtools/devtools-protocol.d.ts +318 -161
- package/dist/src/devtools/devtools-protocol.d.ts.map +1 -1
- package/dist/src/devtools/devtools-server.browser.d.ts +1 -5
- package/dist/src/devtools/devtools-server.browser.d.ts.map +1 -1
- package/dist/src/devtools/devtools-server.browser.js +3 -3
- package/dist/src/devtools/devtools-server.browser.js.map +1 -1
- package/dist/src/devtools/devtools-server.d.ts +5 -6
- package/dist/src/devtools/devtools-server.d.ts.map +1 -1
- package/dist/src/devtools/devtools-server.js +227 -25
- package/dist/src/devtools/devtools-server.js.map +1 -1
- package/dist/src/devtools/devtools-transport.d.ts +2 -2
- package/dist/src/devtools/devtools-transport.d.ts.map +1 -1
- package/dist/src/devtools/devtools-transport.js +2 -2
- package/dist/src/devtools/devtools-transport.js.map +1 -1
- package/dist/src/devtools-entry.browser.d.ts +1 -1
- package/dist/src/devtools-entry.browser.d.ts.map +1 -1
- package/dist/src/devtools-entry.browser.js.map +1 -1
- package/dist/src/devtools-entry.d.ts +1 -1
- package/dist/src/devtools-entry.d.ts.map +1 -1
- package/dist/src/devtools-entry.js.map +1 -1
- package/dist/src/diagnostics.d.ts +1 -1
- package/dist/src/diagnostics.d.ts.map +1 -1
- package/dist/src/diagnostics.js +27 -19
- package/dist/src/diagnostics.js.map +1 -1
- package/dist/src/host/node-host.browser.d.ts +11 -0
- package/dist/src/host/node-host.browser.d.ts.map +1 -0
- package/dist/src/host/node-host.browser.js +21 -0
- package/dist/src/host/node-host.browser.js.map +1 -0
- package/dist/src/host/node-host.d.ts +11 -0
- package/dist/src/host/node-host.d.ts.map +1 -0
- package/dist/src/host/node-host.js +20 -0
- package/dist/src/host/node-host.js.map +1 -0
- package/dist/src/library-symbol-reference.d.ts +52 -0
- package/dist/src/library-symbol-reference.d.ts.map +1 -1
- package/dist/src/library-symbol-reference.js +54 -0
- package/dist/src/library-symbol-reference.js.map +1 -1
- package/dist/src/name-policy.d.ts +30 -3
- package/dist/src/name-policy.d.ts.map +1 -1
- package/dist/src/name-policy.js +27 -0
- package/dist/src/name-policy.js.map +1 -1
- package/dist/src/reactivity.d.ts +28 -2
- package/dist/src/reactivity.d.ts.map +1 -1
- package/dist/src/reactivity.js +154 -45
- package/dist/src/reactivity.js.map +1 -1
- package/dist/src/render-stack.d.ts.map +1 -1
- package/dist/src/render-stack.js +4 -3
- package/dist/src/render-stack.js.map +1 -1
- package/dist/src/render.d.ts +2 -0
- package/dist/src/render.d.ts.map +1 -1
- package/dist/src/render.js +84 -30
- package/dist/src/render.js.map +1 -1
- package/dist/src/scheduler.d.ts +5 -0
- package/dist/src/scheduler.d.ts.map +1 -1
- package/dist/src/scheduler.js +94 -23
- package/dist/src/scheduler.js.map +1 -1
- package/dist/src/symbols/output-scope.d.ts +33 -1
- package/dist/src/symbols/output-scope.d.ts.map +1 -1
- package/dist/src/symbols/output-scope.js +34 -1
- package/dist/src/symbols/output-scope.js.map +1 -1
- package/dist/src/symbols/output-space.d.ts +12 -0
- package/dist/src/symbols/output-space.d.ts.map +1 -1
- package/dist/src/symbols/output-space.js +15 -0
- package/dist/src/symbols/output-space.js.map +1 -1
- package/dist/src/symbols/output-symbol.d.ts +128 -12
- package/dist/src/symbols/output-symbol.d.ts.map +1 -1
- package/dist/src/symbols/output-symbol.js +158 -18
- package/dist/src/symbols/output-symbol.js.map +1 -1
- package/dist/src/symbols/symbol-slot.d.ts.map +1 -1
- package/dist/src/symbols/symbol-slot.js +7 -0
- package/dist/src/symbols/symbol-slot.js.map +1 -1
- package/dist/src/symbols/symbol-slot.test.js +18 -1
- package/dist/src/symbols/symbol-slot.test.js.map +1 -1
- package/dist/src/symbols/symbol-table.d.ts.map +1 -1
- package/dist/src/symbols/symbol-table.js +13 -3
- package/dist/src/symbols/symbol-table.js.map +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +11 -5
- package/dist/src/utils.js.map +1 -1
- package/dist/src/write-output.d.ts.map +1 -1
- package/dist/src/write-output.js +6 -5
- package/dist/src/write-output.js.map +1 -1
- package/dist/test/browser-build.test.js +66 -67
- package/dist/test/browser-build.test.js.map +1 -1
- package/dist/test/reactivity/shallow-reactive.test.js +4 -0
- package/dist/test/reactivity/shallow-reactive.test.js.map +1 -1
- package/dist/test/symbols/deconflicted-name.test.d.ts +2 -0
- package/dist/test/symbols/deconflicted-name.test.d.ts.map +1 -0
- package/dist/test/symbols/deconflicted-name.test.js +120 -0
- package/dist/test/symbols/deconflicted-name.test.js.map +1 -0
- package/dist/test/symbols/output-scope.test.js +41 -0
- package/dist/test/symbols/output-scope.test.js.map +1 -1
- package/dist/testing/create-test-wrapper.d.ts +75 -2
- package/dist/testing/create-test-wrapper.d.ts.map +1 -1
- package/dist/testing/create-test-wrapper.js +55 -1
- package/dist/testing/create-test-wrapper.js.map +1 -1
- package/dist/testing/devtools-utils.d.ts +12 -3
- package/dist/testing/devtools-utils.d.ts.map +1 -1
- package/dist/testing/devtools-utils.js +26 -4
- package/dist/testing/devtools-utils.js.map +1 -1
- package/dist/testing/extend-expect.d.ts +26 -0
- package/dist/testing/extend-expect.d.ts.map +1 -1
- package/dist/testing/extend-expect.js +20 -0
- package/dist/testing/extend-expect.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/render.d.ts +9 -0
- package/dist/testing/render.d.ts.map +1 -1
- package/dist/testing/render.js +11 -0
- package/dist/testing/render.js.map +1 -1
- package/dist/testing/vitest.d.js +12 -0
- package/dist/testing/vitest.d.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/api/components/AppendRegion.md +83 -0
- package/docs/api/components/Block.md +49 -0
- package/docs/api/components/CopyFile.md +26 -0
- package/docs/api/components/Declaration.md +85 -0
- package/docs/api/components/For.md +91 -0
- package/docs/api/components/Indent.md +40 -0
- package/docs/api/components/List.md +68 -0
- package/docs/api/components/MemberDeclaration.md +89 -0
- package/docs/api/components/MemberName.md +21 -0
- package/docs/api/components/MemberScope.md +81 -0
- package/docs/api/components/Name.md +19 -0
- package/docs/api/components/Output.md +62 -0
- package/docs/api/components/Prose.md +29 -0
- package/docs/api/components/ReferenceOrContent.md +28 -0
- package/docs/api/components/Scope.md +83 -0
- package/docs/api/components/Show.md +32 -0
- package/docs/api/components/SourceDirectory.md +28 -0
- package/docs/api/components/SourceFile.md +60 -0
- package/docs/api/components/StatementList.md +29 -0
- package/docs/api/components/Switch.md +42 -0
- package/docs/api/components/TemplateFile.md +71 -0
- package/docs/api/components/TemplateVariable.md +57 -0
- package/docs/api/components/UpdateFile.md +56 -0
- package/docs/api/components/Wrap.md +40 -0
- package/docs/api/components/createAccessExpression.md +55 -0
- package/docs/api/components/index.md +27 -0
- package/docs/api/contexts/Assignment-context.md +43 -0
- package/docs/api/contexts/Binder-context.md +22 -0
- package/docs/api/contexts/Declaration-context.md +15 -0
- package/docs/api/contexts/Member-context.md +17 -0
- package/docs/api/contexts/MemberDeclaration-context.md +24 -0
- package/docs/api/contexts/NamePolicy-context.md +18 -0
- package/docs/api/contexts/Scope-context.md +20 -0
- package/docs/api/contexts/SourceDirectory-context.md +26 -0
- package/docs/api/contexts/SourceFile-context.md +19 -0
- package/docs/api/contexts/index.md +11 -0
- package/docs/api/functions/attachDiagnosticsCollector.md +18 -0
- package/docs/api/functions/baseListPropsToMapJoinArgs.md +20 -0
- package/docs/api/functions/children.md +27 -0
- package/docs/api/functions/childrenArray.md +25 -0
- package/docs/api/functions/code.md +25 -0
- package/docs/api/functions/computed.md +18 -0
- package/docs/api/functions/createComponent.md +20 -0
- package/docs/api/functions/createContentSlot.md +33 -0
- package/docs/api/functions/createContext.md +19 -0
- package/docs/api/functions/createCustomContext.md +18 -0
- package/docs/api/functions/createDeclarationTap.md +20 -0
- package/docs/api/functions/createFileResource.md +35 -0
- package/docs/api/functions/createFormatOptionsContextFor.md +28 -0
- package/docs/api/functions/createIntrinsic.md +19 -0
- package/docs/api/functions/createMemberTap.md +20 -0
- package/docs/api/functions/createNamePolicy.md +37 -0
- package/docs/api/functions/createNamedContext.md +19 -0
- package/docs/api/functions/createOutputBinder.md +24 -0
- package/docs/api/functions/createRenderTreeHook.md +19 -0
- package/docs/api/functions/createResource.md +77 -0
- package/docs/api/functions/createScope.md +35 -0
- package/docs/api/functions/createScopeTap.md +20 -0
- package/docs/api/functions/createSourceFileTap.md +20 -0
- package/docs/api/functions/createSymbol.md +25 -0
- package/docs/api/functions/createSymbolSlot.md +19 -0
- package/docs/api/functions/createTap.md +55 -0
- package/docs/api/functions/decl.md +20 -0
- package/docs/api/functions/defaultProps.md +21 -0
- package/docs/api/functions/effect.md +26 -0
- package/docs/api/functions/emitDiagnostic.md +18 -0
- package/docs/api/functions/emitSymbol.md +18 -0
- package/docs/api/functions/ensureIsEmpty.md +20 -0
- package/docs/api/functions/findCurrentEffectId.md +19 -0
- package/docs/api/functions/findKeyedChild.md +19 -0
- package/docs/api/functions/findKeyedChildren.md +19 -0
- package/docs/api/functions/findUnkeyedChildren.md +18 -0
- package/docs/api/functions/formatReactivePropertyLabel.md +21 -0
- package/docs/api/functions/getAssignmentSymbol.md +19 -0
- package/docs/api/functions/getContext.md +17 -0
- package/docs/api/functions/getContextForRenderNode.md +18 -0
- package/docs/api/functions/getDiagnosticsForTree.md +18 -0
- package/docs/api/functions/getEffectDebugId.md +18 -0
- package/docs/api/functions/getElementCache.md +17 -0
- package/docs/api/functions/getReactiveCreationLocation.md +18 -0
- package/docs/api/functions/getSymbolCreator.md +18 -0
- package/docs/api/functions/getSymbolCreatorSymbol.md +17 -0
- package/docs/api/functions/index.md +105 -0
- package/docs/api/functions/inspectRefkey.md +18 -0
- package/docs/api/functions/instantiateTakenMembersTo.md +20 -0
- package/docs/api/functions/isComponentCreator.md +19 -0
- package/docs/api/functions/isCustomContext.md +18 -0
- package/docs/api/functions/isIntrinsicElement.md +18 -0
- package/docs/api/functions/isKeyedChild.md +18 -0
- package/docs/api/functions/isLibrarySymbolReference.md +18 -0
- package/docs/api/functions/isMemberRefkey.md +18 -0
- package/docs/api/functions/isNamekey.md +18 -0
- package/docs/api/functions/isPrintHook.md +18 -0
- package/docs/api/functions/isRefkey.md +18 -0
- package/docs/api/functions/isRefkeyable.md +18 -0
- package/docs/api/functions/isRenderableObject.md +20 -0
- package/docs/api/functions/isSymbolRefkey.md +18 -0
- package/docs/api/functions/join.md +33 -0
- package/docs/api/functions/mapJoin.md +106 -0
- package/docs/api/functions/memberRefkey.md +27 -0
- package/docs/api/functions/memo.md +29 -0
- package/docs/api/functions/mergeProps.md +64 -0
- package/docs/api/functions/moveTakenMembersTo.md +18 -0
- package/docs/api/functions/namekey.md +41 -0
- package/docs/api/functions/nextReactiveId.md +19 -0
- package/docs/api/functions/notifyContentState.md +17 -0
- package/docs/api/functions/onCleanup.md +26 -0
- package/docs/api/functions/printTree.md +31 -0
- package/docs/api/functions/reactivePropertyRefId.md +21 -0
- package/docs/api/functions/ref.md +21 -0
- package/docs/api/functions/refId.md +18 -0
- package/docs/api/functions/refkey.md +24 -0
- package/docs/api/functions/render.md +31 -0
- package/docs/api/functions/renderAsync.md +31 -0
- package/docs/api/functions/renderTree.md +18 -0
- package/docs/api/functions/reportDiagnostics.md +18 -0
- package/docs/api/functions/resetRefIdCounter.md +17 -0
- package/docs/api/functions/resolve.md +31 -0
- package/docs/api/functions/root.md +25 -0
- package/docs/api/functions/shallowReactive.md +18 -0
- package/docs/api/functions/shallowRef.md +21 -0
- package/docs/api/functions/sourceFilesForTree.md +31 -0
- package/docs/api/functions/splitProps.md +19 -0
- package/docs/api/functions/stc.md +18 -0
- package/docs/api/functions/sti.md +18 -0
- package/docs/api/functions/symbolForRefkey.md +24 -0
- package/docs/api/functions/taggedComponent.md +19 -0
- package/docs/api/functions/takeSymbols.md +18 -0
- package/docs/api/functions/text.md +19 -0
- package/docs/api/functions/toRef.md +20 -0
- package/docs/api/functions/toRefkey.md +18 -0
- package/docs/api/functions/toRefs.md +20 -0
- package/docs/api/functions/traverseOutput.md +21 -0
- package/docs/api/functions/unresolvedRefkey.md +18 -0
- package/docs/api/functions/untrack.md +18 -0
- package/docs/api/functions/useContext.md +18 -0
- package/docs/api/functions/useFormatOptions.md +18 -0
- package/docs/api/functions/useMemberContext.md +17 -0
- package/docs/api/functions/useMemberScope.md +17 -0
- package/docs/api/functions/writeOutput.md +21 -0
- package/docs/api/index.md +9 -0
- package/docs/api/testing/functions/createTestWrapper.md +70 -0
- package/docs/api/testing/functions/d.md +21 -0
- package/docs/api/testing/functions/dedent.md +18 -0
- package/docs/api/testing/functions/index.md +6 -0
- package/docs/api/testing/functions/renderToString.md +20 -0
- package/docs/api/testing/index.md +4 -0
- package/docs/api/testing/types/TestWrapper.md +10 -0
- package/docs/api/testing/types/ToRenderToOptions.md +24 -0
- package/docs/api/testing/types/index.md +4 -0
- package/docs/api/types/AlignIntrinsicElement.md +5 -0
- package/docs/api/types/AppendRegionProps.md +5 -0
- package/docs/api/types/BaseListProps.md +21 -0
- package/docs/api/types/BasePartProps.md +10 -0
- package/docs/api/types/BasicScope.md +15 -0
- package/docs/api/types/BasicSymbol.md +18 -0
- package/docs/api/types/Binder.md +18 -0
- package/docs/api/types/BinderOptions.md +7 -0
- package/docs/api/types/BrIntrinsicElement.md +5 -0
- package/docs/api/types/BreakParentIntrinsicElement.md +5 -0
- package/docs/api/types/Child.md +5 -0
- package/docs/api/types/Children.md +5 -0
- package/docs/api/types/ChildrenOptions.md +7 -0
- package/docs/api/types/CommonFormatOptions.md +8 -0
- package/docs/api/types/Component.md +8 -0
- package/docs/api/types/ComponentContext.md +11 -0
- package/docs/api/types/ComponentCreator.md +11 -0
- package/docs/api/types/ComponentDefinition.md +7 -0
- package/docs/api/types/ContentOutputFile.md +10 -0
- package/docs/api/types/ContentSlot.md +12 -0
- package/docs/api/types/Context.md +19 -0
- package/docs/api/types/ContextProviderProps.md +8 -0
- package/docs/api/types/CopyFileContext.md +8 -0
- package/docs/api/types/CopyOutputFile.md +9 -0
- package/docs/api/types/CustomContext.md +10 -0
- package/docs/api/types/CustomContextChildrenCallback.md +5 -0
- package/docs/api/types/DeclarationProps.md +5 -0
- package/docs/api/types/DedentIntrinsicElement.md +5 -0
- package/docs/api/types/DedentToRootIntrinsicElement.md +5 -0
- package/docs/api/types/Diagnostic.md +11 -0
- package/docs/api/types/DiagnosticHandle.md +7 -0
- package/docs/api/types/DiagnosticInput.md +10 -0
- package/docs/api/types/DiagnosticSeverity.md +5 -0
- package/docs/api/types/DiagnosticStackEntry.md +9 -0
- package/docs/api/types/DiagnosticsCollector.md +8 -0
- package/docs/api/types/Disposable_2.md +7 -0
- package/docs/api/types/EffectDebugOptions.md +8 -0
- package/docs/api/types/EffectOptions.md +7 -0
- package/docs/api/types/ElementCache.md +5 -0
- package/docs/api/types/ElementCacheKey.md +5 -0
- package/docs/api/types/FillIntrinsicElement.md +5 -0
- package/docs/api/types/ForCallbackArgs.md +5 -0
- package/docs/api/types/ForSupportedCollections.md +5 -0
- package/docs/api/types/GroupIntrinsicElement.md +5 -0
- package/docs/api/types/HardlineIntrinsicElement.md +5 -0
- package/docs/api/types/HbrIntrinsicElement.md +5 -0
- package/docs/api/types/IfBreakIntrinsicElement.md +5 -0
- package/docs/api/types/IndentIfBreakIntrinsicElement.md +5 -0
- package/docs/api/types/IndentIntrinsicElement.md +5 -0
- package/docs/api/types/IntrinsicElement.md +5 -0
- package/docs/api/types/IntrinsicElementBase.md +9 -0
- package/docs/api/types/IntrinsicElements.md +26 -0
- package/docs/api/types/JoinOptions.md +9 -0
- package/docs/api/types/LbrIntrinsicElement.md +5 -0
- package/docs/api/types/LibrarySymbolReference.md +13 -0
- package/docs/api/types/LineIntrinsicElement.md +5 -0
- package/docs/api/types/LineSuffixBoundaryIntrinsicElement.md +5 -0
- package/docs/api/types/LineSuffixIntrinsicElement.md +5 -0
- package/docs/api/types/LiterallineIntrinsicElement.md +5 -0
- package/docs/api/types/MakeChildrenOptional.md +7 -0
- package/docs/api/types/MarkAsRootIntrinsicElement.md +5 -0
- package/docs/api/types/MatchProps.md +9 -0
- package/docs/api/types/MemberDeclarationProps.md +5 -0
- package/docs/api/types/MemberDescriptor.md +10 -0
- package/docs/api/types/MemberRefkey.md +10 -0
- package/docs/api/types/MemberResolutionContext.md +10 -0
- package/docs/api/types/MemberResolver.md +32 -0
- package/docs/api/types/MemberScopeProps.md +5 -0
- package/docs/api/types/Metadata.md +5 -0
- package/docs/api/types/NameConflictResolver.md +27 -0
- package/docs/api/types/NamePolicy.md +8 -0
- package/docs/api/types/NamePolicyGetter.md +9 -0
- package/docs/api/types/Namekey.md +10 -0
- package/docs/api/types/NamekeyOptions.md +8 -0
- package/docs/api/types/OnReactiveSetAddCallback.md +5 -0
- package/docs/api/types/OnReactiveSetDeleteCallback.md +5 -0
- package/docs/api/types/OutputDeclarationSpace.md +13 -0
- package/docs/api/types/OutputDirectory.md +59 -0
- package/docs/api/types/OutputFile.md +5 -0
- package/docs/api/types/OutputFileBase.md +8 -0
- package/docs/api/types/OutputMemberSpace.md +13 -0
- package/docs/api/types/OutputScope.md +33 -0
- package/docs/api/types/OutputScopeOptions.md +9 -0
- package/docs/api/types/OutputSpace.md +7 -0
- package/docs/api/types/OutputSymbol.md +78 -0
- package/docs/api/types/OutputSymbolOptions.md +16 -0
- package/docs/api/types/OutputVisitor.md +10 -0
- package/docs/api/types/PrintHook.md +10 -0
- package/docs/api/types/PrintTreeOptions.md +11 -0
- package/docs/api/types/Props.md +5 -0
- package/docs/api/types/ReactiveUnionSet.md +20 -0
- package/docs/api/types/ReactiveUnionSetOptions.md +8 -0
- package/docs/api/types/Refkey.md +5 -0
- package/docs/api/types/Refkeyable.md +5 -0
- package/docs/api/types/RefkeyableObject.md +7 -0
- package/docs/api/types/RenderableObject.md +9 -0
- package/docs/api/types/RenderedTextTree.md +5 -0
- package/docs/api/types/ResolutionResult.md +39 -0
- package/docs/api/types/ResolveDeclarationByKeyOptions.md +7 -0
- package/docs/api/types/Resource.md +11 -0
- package/docs/api/types/RootOptions.md +7 -0
- package/docs/api/types/SbrIntrinsicElement.md +5 -0
- package/docs/api/types/ScopeProps.md +5 -0
- package/docs/api/types/SoftlineIntrinsicElement.md +5 -0
- package/docs/api/types/SourceLocation.md +9 -0
- package/docs/api/types/SplitProps.md +12 -0
- package/docs/api/types/StcComponentCreator.md +9 -0
- package/docs/api/types/StcSignature.md +5 -0
- package/docs/api/types/StiComponentCreator.md +9 -0
- package/docs/api/types/StiSignature.md +7 -0
- package/docs/api/types/SymbolCreator.md +15 -0
- package/docs/api/types/SymbolRefkey.md +9 -0
- package/docs/api/types/SymbolSlot.md +12 -0
- package/docs/api/types/SymbolTable.md +15 -0
- package/docs/api/types/TakeSymbolCallback.md +7 -0
- package/docs/api/types/TakeSymbolsCallback.md +7 -0
- package/docs/api/types/Tap.md +11 -0
- package/docs/api/types/TapHandler.md +9 -0
- package/docs/api/types/Tapper.md +9 -0
- package/docs/api/types/TemplateVariableProps.md +5 -0
- package/docs/api/types/index.md +122 -0
- package/docs/api/variables/FormatOptions.md +5 -0
- package/docs/api/variables/Match.md +7 -0
- package/docs/api/variables/REFKEYABLE.md +5 -0
- package/docs/api/variables/RENDERABLE.md +5 -0
- package/docs/api/variables/TO_SYMBOL.md +39 -0
- package/docs/api/variables/contextsByKey.md +5 -0
- package/docs/api/variables/index.md +11 -0
- package/docs/api/variables/intrinsicElementKey.md +5 -0
- package/docs/api/variables/matchTag.md +5 -0
- package/docs/api/variables/printHookTag.md +7 -0
- package/docs/components.md +97 -0
- package/docs/context.md +67 -0
- package/docs/control-flow.md +5 -0
- package/docs/debugging.md +105 -0
- package/docs/formatting.md +99 -0
- package/docs/guides/language-package-guide.md +593 -0
- package/docs/guides/references-and-refkeys.md +210 -0
- package/docs/guides/style-guide.md +244 -0
- package/docs/index.md +22 -0
- package/docs/reactivity.md +68 -0
- package/docs/rendering.md +41 -0
- package/docs/symbols-and-scopes.md +180 -0
- package/package.json +15 -5
- package/src/binder.ts +154 -41
- package/src/components/AccessExpression.test.tsx +132 -0
- package/src/components/AccessExpression.tsx +344 -0
- package/src/components/Block.tsx +12 -0
- package/src/components/For.tsx +14 -10
- package/src/components/List.tsx +18 -5
- package/src/components/MemberDeclaration.tsx +6 -6
- package/src/components/MemberName.tsx +6 -0
- package/src/components/MemberScope.tsx +5 -0
- package/src/components/Output.tsx +4 -1
- package/src/components/Scope.tsx +6 -0
- package/src/components/SourceFile.tsx +22 -2
- package/src/components/Switch.tsx +11 -7
- package/src/components/index.tsx +1 -0
- package/src/context/binder.ts +4 -0
- package/src/context/format-options.ts +14 -1
- package/src/context/scope.ts +4 -0
- package/src/context/source-directory.ts +9 -0
- package/src/debug/cli.ts +3 -2
- package/src/debug/diagnostics-broadcast.test.tsx +98 -0
- package/src/debug/diagnostics.test.tsx +3 -2
- package/src/debug/effects.test.tsx +248 -36
- package/src/debug/effects.ts +198 -64
- package/src/debug/files.test.tsx +15 -35
- package/src/debug/files.ts +11 -11
- package/src/debug/index.ts +4 -0
- package/src/debug/message-format.test.tsx +759 -0
- package/src/debug/render-tree-orphans.test.tsx +344 -0
- package/src/debug/render.test.tsx +96 -118
- package/src/debug/render.ts +196 -125
- package/src/debug/source-map.browser.ts +30 -0
- package/src/debug/source-map.ts +135 -0
- package/src/debug/symbols.test.tsx +19 -20
- package/src/debug/symbols.ts +106 -23
- package/src/debug/trace-writer.ts +984 -0
- package/src/debug/trace.ts +46 -32
- package/src/devtools/devtools-protocol.ts +361 -176
- package/src/devtools/devtools-server.browser.ts +4 -9
- package/src/devtools/devtools-server.ts +226 -33
- package/src/devtools/devtools-transport.ts +4 -4
- package/src/devtools-entry.browser.ts +11 -15
- package/src/devtools-entry.ts +9 -15
- package/src/diagnostics.ts +44 -22
- package/src/host/node-host.browser.ts +23 -0
- package/src/host/node-host.ts +22 -0
- package/src/library-symbol-reference.ts +52 -0
- package/src/name-policy.ts +30 -3
- package/src/reactivity.ts +179 -55
- package/src/render-stack.ts +4 -3
- package/src/render.ts +106 -30
- package/src/scheduler.ts +145 -26
- package/src/symbols/output-scope.ts +33 -1
- package/src/symbols/output-space.ts +13 -0
- package/src/symbols/output-symbol.ts +185 -22
- package/src/symbols/symbol-slot.test.tsx +28 -1
- package/src/symbols/symbol-slot.tsx +8 -0
- package/src/symbols/symbol-table.ts +13 -3
- package/src/utils.tsx +7 -4
- package/src/write-output.ts +6 -5
- package/temp/api-testing.json +673 -0
- package/temp/api.json +895 -73
- package/test/browser-build.test.ts +71 -78
- package/test/reactivity/shallow-reactive.test.tsx +4 -0
- package/test/symbols/deconflicted-name.test.ts +120 -0
- package/test/symbols/output-scope.test.ts +38 -0
- package/testing/create-test-wrapper.tsx +81 -2
- package/testing/devtools-utils.ts +46 -4
- package/testing/extend-expect.ts +22 -1
- package/testing/index.ts +1 -1
- package/testing/render.ts +9 -0
- package/testing/vitest.d.ts +18 -3
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# References & Refkeys
|
|
2
|
+
|
|
3
|
+
Alloy's refkey system lets you declare named symbols and reference them across files. When a reference is rendered, Alloy automatically computes the correct name, generates any needed imports, and handles name conflicts.
|
|
4
|
+
|
|
5
|
+
## Creating Refkeys
|
|
6
|
+
|
|
7
|
+
A **refkey** uniquely identifies a symbol. Create one with `refkey()`:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { refkey } from "@alloy-js/core";
|
|
11
|
+
|
|
12
|
+
// Unique refkey (different every call)
|
|
13
|
+
const myKey = refkey();
|
|
14
|
+
|
|
15
|
+
// Seeded refkey (same args → same refkey)
|
|
16
|
+
const modelKey = refkey(schemaObject);
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Seeded refkeys are the most common pattern. When you're generating code from input data (like a schema), pass the data object to `refkey()` and you'll always get the same key for the same object. This means you don't need to pass refkeys around — any code that has the original data object can recreate the same refkey.
|
|
20
|
+
|
|
21
|
+
### Composite Refkeys
|
|
22
|
+
|
|
23
|
+
Pass multiple arguments to create a composite key when you need multiple declarations for the same input:
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
// Two declarations from the same schema
|
|
27
|
+
<Declaration name="UserInput" refkey={refkey(userSchema, "input")} />
|
|
28
|
+
<Declaration name="UserOutput" refkey={refkey(userSchema, "output")} />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Arguments are compared by identity for objects and by value for primitives. The order matters — `refkey(a, b)` is different from `refkey(b, a)`.
|
|
32
|
+
|
|
33
|
+
## Declaring Symbols
|
|
34
|
+
|
|
35
|
+
Pass a refkey to a declaration component to register a symbol:
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
<Declaration name="getUser" refkey={refkey(getUserOp)}>
|
|
39
|
+
{body}
|
|
40
|
+
</Declaration>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The declaration component creates a symbol in the current scope, associated with that refkey. Other components can then reference it by the same refkey.
|
|
44
|
+
|
|
45
|
+
## Referencing Symbols
|
|
46
|
+
|
|
47
|
+
There are two ways to reference a declared symbol.
|
|
48
|
+
|
|
49
|
+
### Inline Refkeys in JSX
|
|
50
|
+
|
|
51
|
+
The simplest approach: use a refkey directly as a JSX child.
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
<SourceFile path="client.ts">
|
|
55
|
+
const user = await {refkey(getUserOp)}();
|
|
56
|
+
</SourceFile>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
When a refkey appears as a JSX child, Alloy resolves it through the current source file's `reference` function. This renders the symbol's name and, if the declaration is in a different file or package, automatically generates the necessary import statement.
|
|
60
|
+
|
|
61
|
+
The above might render:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
import { getUser } from "./api.js";
|
|
65
|
+
|
|
66
|
+
const user = await getUser();
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### The Reference Component
|
|
70
|
+
|
|
71
|
+
Each language package provides a `Reference` component for explicit control:
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { Reference } from "@alloy-js/typescript";
|
|
75
|
+
|
|
76
|
+
<Reference refkey={refkey(model)} type />;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The `type` prop (TypeScript-specific) generates `import type` instead of `import`. Most of the time inline refkeys are sufficient — use `Reference` when you need language-specific options.
|
|
80
|
+
|
|
81
|
+
### Refkeys in `code` Templates
|
|
82
|
+
|
|
83
|
+
Refkeys work inside `code` template expressions too:
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
code`someExpression(${refkey(responseModel)})`;
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
This resolves the refkey and splices the rendered name into the output.
|
|
90
|
+
|
|
91
|
+
## Namekeys
|
|
92
|
+
|
|
93
|
+
A **namekey** is a special refkey that also carries a name and naming options. Use it when you want to both name and reference a symbol in one value:
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
import { namekey } from "@alloy-js/core";
|
|
97
|
+
|
|
98
|
+
const myClass = namekey("MyClass");
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<>
|
|
102
|
+
<Declaration name={myClass}>{/* ... */}</Declaration>
|
|
103
|
+
{myClass}
|
|
104
|
+
</>
|
|
105
|
+
);
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
This renders a declaration named `MyClass` and a reference to it. The namekey serves as both the `name` prop and a refkey.
|
|
109
|
+
|
|
110
|
+
### Name Policy Bypass
|
|
111
|
+
|
|
112
|
+
Namekeys can opt out of the language's name policy or conflict resolution:
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
// Keep the exact name, don't apply camelCase/snake_case transforms
|
|
116
|
+
const specialName = namekey("$internal", { ignoreNamePolicy: true });
|
|
117
|
+
|
|
118
|
+
// Don't disambiguate if another symbol has the same name
|
|
119
|
+
const fixedName = namekey("toString", { ignoreNameConflict: true });
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Refkey vs. Namekey
|
|
123
|
+
|
|
124
|
+
| | `refkey()` | `namekey()` |
|
|
125
|
+
| -------------- | ------------------------------------ | -------------------------------------------- |
|
|
126
|
+
| **Purpose** | Identify a symbol by its source data | Identify + name a symbol |
|
|
127
|
+
| **Name** | Set separately via `name` prop | Carried in the namekey |
|
|
128
|
+
| **Uniqueness** | Same args → same key | Always unique (like `refkey()` with no args) |
|
|
129
|
+
| **Use when** | Generating from input data | Generating fixed/known names |
|
|
130
|
+
|
|
131
|
+
Use `refkey(data)` when you're mapping input data to declarations — this is the common case. Use `namekey()` when you're creating declarations with known names that don't come from input data.
|
|
132
|
+
|
|
133
|
+
## Member Refkeys
|
|
134
|
+
|
|
135
|
+
Use `memberRefkey()` to reference a member of a symbol — for example, an instance property of a class:
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
import { memberRefkey } from "@alloy-js/core";
|
|
139
|
+
|
|
140
|
+
const classKey = refkey(myClass);
|
|
141
|
+
const propKey = memberRefkey(classKey, refkey(myClass, "id"));
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Member refkeys resolve through the language's member resolution system, which handles things like `this.id` inside a class vs. `instance.id` outside.
|
|
145
|
+
|
|
146
|
+
## Cross-File References
|
|
147
|
+
|
|
148
|
+
Refkeys work across files automatically. When you reference a symbol declared in another file, the language package generates the necessary import:
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
<SourceFile path="models.ts">
|
|
152
|
+
<Declaration name="User" refkey={refkey(userSchema)}>
|
|
153
|
+
{/* language-specific declaration body */}
|
|
154
|
+
</Declaration>
|
|
155
|
+
</SourceFile>
|
|
156
|
+
|
|
157
|
+
<SourceFile path="client.ts">
|
|
158
|
+
const user: {refkey(userSchema)} = await fetchUser();
|
|
159
|
+
</SourceFile>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The language package handles the import generation. For example, in TypeScript `client.ts` renders with an auto-generated import:
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
import { User } from "./models.js";
|
|
166
|
+
|
|
167
|
+
const user: User = await fetchUser();
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
This works across packages too — Alloy resolves the correct package name and path.
|
|
171
|
+
|
|
172
|
+
**Order doesn't matter.** References can appear before their declarations in the component tree. Alloy resolves everything reactively, so forward references work naturally.
|
|
173
|
+
|
|
174
|
+
## External Package Symbols
|
|
175
|
+
|
|
176
|
+
Language packages provide helpers like `createPackage()` (TypeScript) or `createModule()` (Python) to declare symbols from external libraries that your generated code imports:
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
import { createPackage } from "@alloy-js/typescript";
|
|
180
|
+
|
|
181
|
+
const node = createPackage({
|
|
182
|
+
name: "node:path",
|
|
183
|
+
descriptor: {
|
|
184
|
+
".": { named: ["join", "resolve", "dirname"] },
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// Reference in a component — auto-generates: import { join } from "node:path"
|
|
189
|
+
code`${node.join}("a", "b")`;
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
These symbols aren't declared in the output tree — they exist only in the binder's symbol table and generate imports when referenced.
|
|
193
|
+
|
|
194
|
+
## How Resolution Works
|
|
195
|
+
|
|
196
|
+
When a refkey is encountered during rendering:
|
|
197
|
+
|
|
198
|
+
1. The render pipeline detects the refkey (via `isRefkeyable()` check)
|
|
199
|
+
2. It calls `sourceFile.reference({ refkey })` — the reference function provided by the language package's SourceFile component
|
|
200
|
+
3. The language's `ref()` function calls `resolve()` from core, which searches the scope tree for the symbol matching the refkey
|
|
201
|
+
4. Based on where the symbol is relative to the reference (local, different module, different package), the language package renders the appropriate syntax and generates any needed imports
|
|
202
|
+
5. The result is reactive — if the symbol moves or is renamed, the reference updates automatically
|
|
203
|
+
|
|
204
|
+
## Best Practices
|
|
205
|
+
|
|
206
|
+
- **Seed refkeys from input data** — `refkey(schemaObj)` is better than passing refkeys around manually.
|
|
207
|
+
- **Use composite keys for disambiguation** — `refkey(schema, "input")` vs `refkey(schema, "output")` when one input maps to multiple declarations.
|
|
208
|
+
- **Use inline refkeys** (`{refkey(...)}` in JSX) for most references — simpler than `<Reference>`.
|
|
209
|
+
- **Use `namekey` sparingly** — only when the name is known ahead of time and not derived from input data.
|
|
210
|
+
- **Export declarations that need cross-file references** — a symbol must be reachable through the scope tree to be referenced.
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# Alloy JSX Style Guide
|
|
2
|
+
|
|
3
|
+
Idiomatic patterns for writing Alloy JSX components. Alloy JSX is **not** React — it renders to source code text, not DOM elements. Do not use HTML elements like `<div>`, `<span>`, etc.
|
|
4
|
+
|
|
5
|
+
## String Content
|
|
6
|
+
|
|
7
|
+
Use plain string children or the `code` template tag. **Never** wrap string literals in expression braces.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
// ✅ Good — plain text children
|
|
11
|
+
<Declaration>hello world</Declaration>;
|
|
12
|
+
|
|
13
|
+
// ✅ Good — code template for interpolation
|
|
14
|
+
code`Promise<${returnType}>`;
|
|
15
|
+
|
|
16
|
+
// ✅ Good — code template for multi-line structured output
|
|
17
|
+
return code`
|
|
18
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
19
|
+
<project>
|
|
20
|
+
${children}
|
|
21
|
+
</project>
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
// ❌ Bad — unnecessary expression wrapper around a string
|
|
25
|
+
<Declaration>{"hello world"}</Declaration>;
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Use `code` template tags for any output that mixes static text with interpolated expressions. Use plain template literals only for inline fragments that won't appear directly in rendered output (e.g. computing a variable).
|
|
29
|
+
|
|
30
|
+
When you introduce a JSX line break only for source formatting, preserve any rendered space that should still exist at that boundary with `{' '}`:
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
// ✅ Good — line break is only for formatting, so keep the rendered space explicit
|
|
34
|
+
<>
|
|
35
|
+
Hello{' '}
|
|
36
|
+
world
|
|
37
|
+
</>
|
|
38
|
+
|
|
39
|
+
// ❌ Avoid — the line break removed the intended space between words
|
|
40
|
+
<>
|
|
41
|
+
Hello
|
|
42
|
+
world
|
|
43
|
+
</>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Conditional Rendering
|
|
47
|
+
|
|
48
|
+
Use `{condition && content}` for short inline content like keywords, punctuation, or modifiers:
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
// ✅ Good — short conditional modifier
|
|
52
|
+
{
|
|
53
|
+
props.async && "async ";
|
|
54
|
+
}
|
|
55
|
+
{
|
|
56
|
+
props.nullable && "?";
|
|
57
|
+
}
|
|
58
|
+
{
|
|
59
|
+
!props.children && ";";
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Use `<Show when={}>` for larger conditional blocks:
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
// ✅ Good — conditional block with Show
|
|
67
|
+
<Show when={!!param.type}>
|
|
68
|
+
: <TypeSlot>{param.type}</TypeSlot>
|
|
69
|
+
</Show>;
|
|
70
|
+
|
|
71
|
+
// ❌ Avoid — large conditional blocks with &&
|
|
72
|
+
{
|
|
73
|
+
props.typeParameters && (
|
|
74
|
+
<TypeParameterList parameters={props.typeParameters} />
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Boolean Props
|
|
80
|
+
|
|
81
|
+
Use shorthand for literal `true` values. Use explicit expressions when the value is conditional:
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
// ✅ Good — shorthand for literal true
|
|
85
|
+
<For each={items} comma hardline enderPunctuation>
|
|
86
|
+
|
|
87
|
+
// ✅ Good — explicit expression when conditional
|
|
88
|
+
<Indent
|
|
89
|
+
hardline={!props.inline && hasContent}
|
|
90
|
+
softline={props.inline || isEmpty}
|
|
91
|
+
trailingBreak
|
|
92
|
+
>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## List Rendering
|
|
96
|
+
|
|
97
|
+
Use `<For each={}>` to render lists in output. Use `.map()` only for transforming data before rendering:
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
// ✅ Good — For in render output
|
|
101
|
+
<For each={props.model.properties} comma hardline enderPunctuation>
|
|
102
|
+
{(prop) => <Property property={prop} />}
|
|
103
|
+
</For>;
|
|
104
|
+
|
|
105
|
+
// ✅ Good — .map() for data transformation
|
|
106
|
+
const parameters = (props.parameters as string[]).map((name) => ({
|
|
107
|
+
name,
|
|
108
|
+
type: undefined,
|
|
109
|
+
}));
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Fragments
|
|
113
|
+
|
|
114
|
+
Use `<>...</>` to combine adjacent pieces of output without a wrapper. Prefer `code` template tags when the content is primarily text with interpolation:
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
// ✅ Good — fragment for combining JSX pieces
|
|
118
|
+
<>
|
|
119
|
+
{extendsClause}
|
|
120
|
+
{implementsClause}
|
|
121
|
+
</>;
|
|
122
|
+
|
|
123
|
+
// ✅ Good — code template when mixing text and expressions
|
|
124
|
+
code`extends ${baseClass}`;
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Props
|
|
128
|
+
|
|
129
|
+
Do not destructure props. Access them as `props.x`:
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
// ✅ Good
|
|
133
|
+
export function MyComponent(props: MyComponentProps) {
|
|
134
|
+
return (
|
|
135
|
+
<Declaration name={props.name} refkey={props.refkey}>
|
|
136
|
+
{props.children}
|
|
137
|
+
</Declaration>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// ❌ Bad — destructured props break reactivity
|
|
142
|
+
export function MyComponent({ name, refkey, children }: MyComponentProps) {
|
|
143
|
+
// ...
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Use `splitProps` to separate props for forwarding:
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
const [rest, forProps] = splitProps(props, ["children"]);
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Reactivity
|
|
154
|
+
|
|
155
|
+
Use `computed()` for reactive derived values. Use `memo()` for memoizing children or component expressions:
|
|
156
|
+
|
|
157
|
+
```tsx
|
|
158
|
+
// ✅ Good — computed for a reactive signal
|
|
159
|
+
const keyword = computed(() => (props.const ? "const" : "var"));
|
|
160
|
+
|
|
161
|
+
// ✅ Good — memo for memoizing rendered children
|
|
162
|
+
const resolvedChildren = memo(() =>
|
|
163
|
+
childrenArray(() => props.children, { preserveFragments: true }),
|
|
164
|
+
);
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Component Return Patterns
|
|
168
|
+
|
|
169
|
+
Choose your return style based on the content:
|
|
170
|
+
|
|
171
|
+
- **JSX** for structural component trees
|
|
172
|
+
- **`code` template** for text-heavy structured output
|
|
173
|
+
- **`memo()`** wrapping reactive logic that determines what to render
|
|
174
|
+
|
|
175
|
+
```tsx
|
|
176
|
+
// JSX return
|
|
177
|
+
export function MyComponent(props: MyComponentProps) {
|
|
178
|
+
return (
|
|
179
|
+
<Declaration name={props.name}>
|
|
180
|
+
<Indent hardline trailingBreak>
|
|
181
|
+
{props.children}
|
|
182
|
+
</Indent>
|
|
183
|
+
</Declaration>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// code template return
|
|
188
|
+
export function XmlElement(props: XmlElementProps) {
|
|
189
|
+
return code`
|
|
190
|
+
<${props.tag}>
|
|
191
|
+
${props.children}
|
|
192
|
+
</${props.tag}>
|
|
193
|
+
`;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// memo return for reactive branching
|
|
197
|
+
export function ValueExpression(props: ValueExpressionProps): Children {
|
|
198
|
+
return memo((): Children => {
|
|
199
|
+
if (Array.isArray(props.jsValue)) {
|
|
200
|
+
return <ArrayExpression jsValue={props.jsValue} />;
|
|
201
|
+
}
|
|
202
|
+
return String(props.jsValue);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Symbols and References
|
|
208
|
+
|
|
209
|
+
Use `refkey()` to capture symbols and reference them across files:
|
|
210
|
+
|
|
211
|
+
```tsx
|
|
212
|
+
// Creating a declaration with a refkey
|
|
213
|
+
<InterfaceDeclaration name={props.model.name} refkey={refkey(props.model)}>
|
|
214
|
+
<For each={props.model.properties} comma hardline enderPunctuation>
|
|
215
|
+
{(prop) => <InterfaceMember name={prop.name} type={prop.type} />}
|
|
216
|
+
</For>
|
|
217
|
+
</InterfaceDeclaration>;
|
|
218
|
+
|
|
219
|
+
// Referencing the symbol elsewhere (auto-resolves name and imports)
|
|
220
|
+
code`Promise<${refkey(responseModel)}>`;
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Component File Organization
|
|
224
|
+
|
|
225
|
+
Structure component files as: imports, props interface, component function.
|
|
226
|
+
|
|
227
|
+
```tsx
|
|
228
|
+
import { Children, code, refkey } from "@alloy-js/core";
|
|
229
|
+
import { Declaration } from "@alloy-js/typescript";
|
|
230
|
+
|
|
231
|
+
export interface MyComponentProps {
|
|
232
|
+
name: string;
|
|
233
|
+
children?: Children;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export function MyComponent(props: MyComponentProps) {
|
|
237
|
+
return <Declaration name={props.name}>{props.children}</Declaration>;
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
- File names use `kebab-case` (e.g. `my-component.tsx`)
|
|
242
|
+
- Component names use `PascalCase`
|
|
243
|
+
- Props interfaces are named `<ComponentName>Props`
|
|
244
|
+
- Annotate return type as `Children` when the return is non-trivial
|
package/docs/index.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @alloy-js/core
|
|
2
|
+
|
|
3
|
+
## Conceptual Guides
|
|
4
|
+
|
|
5
|
+
- [Components](components.md) — defining components, props, children, tagged children
|
|
6
|
+
- [Control Flow](control-flow.md) — Show, For, Switch/Match
|
|
7
|
+
- [Rendering](rendering.md) — the render pipeline, tree structure, output files
|
|
8
|
+
- [Reactivity](reactivity.md) — reactive primitives, effects, memos, scheduling
|
|
9
|
+
- [Formatting](formatting.md) — intrinsic elements, layout components, `code`/`text` tags
|
|
10
|
+
- [Symbols & Scopes](symbols-and-scopes.md) — declarations, references, refkeys, name policies, the binder
|
|
11
|
+
- [Context](context.md) — dependency injection through the component tree
|
|
12
|
+
- [Debugging](debugging.md) — diagnostics, trace files, devtools
|
|
13
|
+
|
|
14
|
+
## Framework Guides
|
|
15
|
+
|
|
16
|
+
- [Style Guide](guides/style-guide.md) — idiomatic Alloy JSX patterns, conditional rendering, props, reactivity
|
|
17
|
+
- [References & Refkeys](guides/references-and-refkeys.md) — symbol declarations, cross-file references, namekeys
|
|
18
|
+
- [Language Package Guide](guides/language-package-guide.md) — creating a new `@alloy-js/<language>` package
|
|
19
|
+
|
|
20
|
+
## API Reference
|
|
21
|
+
|
|
22
|
+
- [API Reference](api/index.md) — auto-generated API documentation
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Reactivity
|
|
2
|
+
|
|
3
|
+
Alloy uses Vue's signal primitives from `@vue/reactivity`, wrapped with an owner/context system, a custom scheduler, and cleanup lifecycle.
|
|
4
|
+
|
|
5
|
+
## Primitives
|
|
6
|
+
|
|
7
|
+
- [**`ref(value)`**](api/functions/ref.md) — reactive container. Access/set via `.value`. Deep conversion.
|
|
8
|
+
- [**`shallowRef(value)`**](api/functions/shallowRef.md) — no deep conversion. **Prefer in most cases.**
|
|
9
|
+
- [**`computed(fn)`**](api/functions/computed.md) — derived reactive value (lazy, cached).
|
|
10
|
+
- **`reactive(obj)`** — deeply reactive proxy.
|
|
11
|
+
- [**`shallowReactive(obj)`**](api/functions/shallowReactive.md) — no deep conversion. **Prefer over `reactive()`.**
|
|
12
|
+
|
|
13
|
+
## [`effect(fn, current?, options?)`](api/functions/effect.md)
|
|
14
|
+
|
|
15
|
+
Re-runs `fn` when tracked dependencies change. Runs through Alloy's scheduler, creates a new [`Context`](api/types/Context.md) in the owner chain, supports cleanup via [`onCleanup()`](api/functions/onCleanup.md).
|
|
16
|
+
|
|
17
|
+
## [`memo(fn, equal?, name?)`](api/functions/memo.md)
|
|
18
|
+
|
|
19
|
+
Returns a getter caching the result of `fn`. Re-evaluates when dependencies change. If `equal` is true, skips downstream updates when the value is unchanged.
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
const fullName = memo(() => `${first.value} ${last.value}`);
|
|
23
|
+
fullName(); // cached
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## [`root(fn)`](api/functions/root.md)
|
|
27
|
+
|
|
28
|
+
Creates an isolated reactive scope. Reactive reads inside `fn` are not tracked by any outer effect. The callback receives a dispose function. Returns the callback's return value.
|
|
29
|
+
|
|
30
|
+
## [`untrack(fn)`](api/functions/untrack.md)
|
|
31
|
+
|
|
32
|
+
Executes `fn` without tracking reactive dependencies. Useful for reading reactive values without subscribing, or performing side effects (e.g., registering imports) without creating unwanted dependencies.
|
|
33
|
+
|
|
34
|
+
## [`onCleanup(fn)`](api/functions/onCleanup.md)
|
|
35
|
+
|
|
36
|
+
Registers a cleanup function on the current context. Runs when the containing effect re-executes (before the next run) or when the containing root/component is disposed.
|
|
37
|
+
|
|
38
|
+
Common uses:
|
|
39
|
+
|
|
40
|
+
- Deleting symbols when a declaration is removed: `onCleanup(() => symbol.delete())`
|
|
41
|
+
- Removing items from reactive collections
|
|
42
|
+
- Dismissing diagnostics
|
|
43
|
+
|
|
44
|
+
## Owner Chain
|
|
45
|
+
|
|
46
|
+
Every [`effect()`](api/functions/effect.md) and [`root()`](api/functions/root.md) creates a [`Context`](api/types/Context.md) linked to its parent via `.owner`, forming a tree mirroring the component hierarchy. [`useContext()`](api/functions/useContext.md) traverses this chain.
|
|
47
|
+
|
|
48
|
+
## Scheduler
|
|
49
|
+
|
|
50
|
+
Synchronous dual-queue scheduler:
|
|
51
|
+
|
|
52
|
+
- **Immediate queue** — drained first.
|
|
53
|
+
- **Deferred queue** — drained after.
|
|
54
|
+
|
|
55
|
+
`flushJobs()` runs synchronously during [`render()`](api/functions/render.md). `flushJobsAsync()` awaits pending promises — primarily useful in tests.
|
|
56
|
+
|
|
57
|
+
## Reactivity in JSX
|
|
58
|
+
|
|
59
|
+
The JSX transform wraps reactive expressions in effects. When a dependency changes, only that expression re-evaluates — the component function does not re-run.
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
function Counter(props: { count: Ref<number> }) {
|
|
63
|
+
// Runs once. {props.count.value} is tracked in its own effect.
|
|
64
|
+
return <>Count: {props.count.value}</>;
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
> **Warning:** Props may be reactive getters. `<Comp foo={myRef.value} />` compiles to a getter tracking `myRef`. Never use `/*@once*/` unless you're certain the value is non-reactive.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Rendering
|
|
2
|
+
|
|
3
|
+
Alloy renders a component tree into output files. The pipeline has three layers.
|
|
4
|
+
|
|
5
|
+
## Pipeline
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Component Tree → Rendered Text Tree → Output Files
|
|
9
|
+
(JSX) (strings + hooks) (formatted text)
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
1. [**`render(children, options?)`**](api/functions/render.md) — entry point. Returns an [`OutputDirectory`](api/types/OutputDirectory.md).
|
|
13
|
+
2. [**`renderTree(children)`**](api/functions/renderTree.md) — evaluates components into a [`RenderedTextTree`](api/types/RenderedTextTree.md). Components run inside reactive effects and re-execute when dependencies change.
|
|
14
|
+
3. **`sourceFilesForTree(tree)`** — walks the rendered tree, calling [`printTree()`](api/functions/printTree.md) per file to produce a formatted string for each source file.
|
|
15
|
+
|
|
16
|
+
`renderTree()`, `printTree()`, and `sourceFilesForTree()` are available individually for advanced use cases.
|
|
17
|
+
|
|
18
|
+
## Key Components
|
|
19
|
+
|
|
20
|
+
- [**`<Output>`**](api/components/Output.md) — root. Sets up binder, format options, name policy, base path.
|
|
21
|
+
- [**`<SourceDirectory>`**](api/components/SourceDirectory.md) — directory in the output tree.
|
|
22
|
+
- [**`<SourceFile>`**](api/components/SourceFile.md) — file with `path`, `filetype`, optional print options.
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
render(
|
|
26
|
+
<Output>
|
|
27
|
+
<SourceDirectory path="src">
|
|
28
|
+
<SourceFile path="index.ts" filetype="typescript">
|
|
29
|
+
console.log("hello");
|
|
30
|
+
</SourceFile>
|
|
31
|
+
</SourceDirectory>
|
|
32
|
+
</Output>,
|
|
33
|
+
);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## File Operations
|
|
37
|
+
|
|
38
|
+
- [**`<AppendFile>`**](api/components/AppendFile.md) — append to an existing output file.
|
|
39
|
+
- [**`<CopyFile>`**](api/components/CopyFile.md) — copy from the host filesystem into output.
|
|
40
|
+
- [**`<UpdateFile>`**](api/components/UpdateFile.md) — read and transform an existing output file.
|
|
41
|
+
- [**`<TemplateFile>`**](api/components/TemplateFile.md) — read a host file, transform, write to output.
|