@alloy-js/core 0.17.0 → 0.18.0-dev.3
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/dist/src/binder.d.ts +2 -1
- package/dist/src/binder.d.ts.map +1 -1
- package/dist/src/binder.js +2 -2
- package/dist/src/code.d.ts +1 -1
- package/dist/src/code.d.ts.map +1 -1
- package/dist/src/components/Block.d.ts +1 -1
- package/dist/src/components/Block.d.ts.map +1 -1
- package/dist/src/components/Declaration.d.ts +1 -1
- package/dist/src/components/Declaration.d.ts.map +1 -1
- package/dist/src/components/Declaration.js +1 -1
- package/dist/src/components/For.d.ts +1 -1
- package/dist/src/components/For.d.ts.map +1 -1
- package/dist/src/components/For.js +1 -1
- package/dist/src/components/Indent.d.ts +1 -1
- package/dist/src/components/Indent.d.ts.map +1 -1
- package/dist/src/components/List.d.ts +1 -1
- package/dist/src/components/List.d.ts.map +1 -1
- package/dist/src/components/List.js +2 -1
- package/dist/src/components/MemberDeclaration.d.ts +2 -2
- package/dist/src/components/MemberDeclaration.d.ts.map +1 -1
- package/dist/src/components/MemberDeclaration.js +2 -1
- package/dist/src/components/MemberScope.d.ts +2 -2
- package/dist/src/components/MemberScope.d.ts.map +1 -1
- package/dist/src/components/Output.d.ts +1 -1
- package/dist/src/components/Output.d.ts.map +1 -1
- package/dist/src/components/Output.js +1 -1
- package/dist/src/components/Prose.d.ts +1 -1
- package/dist/src/components/Prose.d.ts.map +1 -1
- package/dist/src/components/ReferenceOrContent.d.ts +1 -1
- package/dist/src/components/ReferenceOrContent.d.ts.map +1 -1
- package/dist/src/components/Scope.d.ts +1 -1
- package/dist/src/components/Scope.d.ts.map +1 -1
- package/dist/src/components/Show.d.ts +1 -1
- package/dist/src/components/Show.d.ts.map +1 -1
- package/dist/src/components/SourceDirectory.d.ts +1 -1
- package/dist/src/components/SourceDirectory.d.ts.map +1 -1
- package/dist/src/components/SourceDirectory.js +1 -1
- package/dist/src/components/SourceFile.d.ts +1 -1
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js +1 -1
- package/dist/src/components/StatementList.d.ts +1 -1
- package/dist/src/components/StatementList.d.ts.map +1 -1
- package/dist/src/components/Switch.d.ts +2 -2
- package/dist/src/components/Switch.d.ts.map +1 -1
- package/dist/src/components/Switch.js +2 -1
- package/dist/src/components/Wrap.d.ts +1 -1
- package/dist/src/components/Wrap.d.ts.map +1 -1
- package/dist/src/context/binder.d.ts +1 -1
- package/dist/src/context/binder.d.ts.map +1 -1
- package/dist/src/context/source-file.d.ts +1 -1
- package/dist/src/context/source-file.d.ts.map +1 -1
- package/dist/src/context.d.ts +2 -2
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/context.js +1 -1
- package/dist/src/debug.d.ts +1 -0
- package/dist/src/debug.d.ts.map +1 -1
- package/dist/src/debug.js +4 -1
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -1
- package/dist/src/jsx-runtime.d.ts +4 -281
- package/dist/src/jsx-runtime.d.ts.map +1 -1
- package/dist/src/jsx-runtime.js +3 -319
- package/dist/src/props-combinators.d.ts +19 -0
- package/dist/src/props-combinators.d.ts.map +1 -0
- package/dist/src/props-combinators.js +108 -0
- package/dist/src/reactive-union-set.d.ts.map +1 -1
- package/dist/src/reactive-union-set.js +1 -1
- package/dist/src/reactivity.d.ts +75 -0
- package/dist/src/reactivity.d.ts.map +1 -0
- package/dist/src/reactivity.js +141 -0
- package/dist/src/render.d.ts +5 -1
- package/dist/src/render.d.ts.map +1 -1
- package/dist/src/render.js +68 -15
- package/dist/src/runtime/component.d.ts +24 -0
- package/dist/src/runtime/component.d.ts.map +1 -0
- package/dist/src/runtime/component.js +19 -0
- package/dist/src/runtime/intrinsic.d.ts +168 -0
- package/dist/src/runtime/intrinsic.d.ts.map +1 -0
- package/dist/src/runtime/intrinsic.js +11 -0
- package/dist/src/slot.d.ts +2 -2
- package/dist/src/slot.d.ts.map +1 -1
- package/dist/src/slot.js +1 -1
- package/dist/src/stc.d.ts +1 -1
- package/dist/src/stc.d.ts.map +1 -1
- package/dist/src/sti.d.ts +7 -6
- package/dist/src/sti.d.ts.map +1 -1
- package/dist/src/sti.js +1 -1
- package/dist/src/symbols/flags.d.ts +70 -0
- package/dist/src/symbols/flags.d.ts.map +1 -0
- package/dist/src/symbols/flags.js +72 -0
- package/dist/src/symbols/index.d.ts +1 -0
- package/dist/src/symbols/index.d.ts.map +1 -1
- package/dist/src/symbols/index.js +1 -0
- package/dist/src/symbols/output-scope.d.ts +2 -24
- package/dist/src/symbols/output-scope.d.ts.map +1 -1
- package/dist/src/symbols/output-scope.js +1 -25
- package/dist/src/symbols/output-symbol.d.ts +2 -47
- package/dist/src/symbols/output-symbol.d.ts.map +1 -1
- package/dist/src/symbols/output-symbol.js +2 -48
- package/dist/src/symbols/symbol-flow.d.ts.map +1 -1
- package/dist/src/symbols/symbol-flow.js +2 -2
- package/dist/src/symbols/symbol-slot.d.ts +1 -1
- package/dist/src/symbols/symbol-slot.d.ts.map +1 -1
- package/dist/src/symbols/symbol-slot.js +1 -1
- package/dist/src/symbols/symbol-table.d.ts +3 -3
- package/dist/src/symbols/symbol-table.d.ts.map +1 -1
- package/dist/src/tap.d.ts +1 -1
- package/dist/src/tap.d.ts.map +1 -1
- package/dist/src/tracer.d.ts +60 -3
- package/dist/src/tracer.d.ts.map +1 -1
- package/dist/src/tracer.js +60 -5
- package/dist/src/utils.d.ts +4 -3
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +2 -1
- package/dist/test/props-with-defaults.test.js +1 -1
- package/dist/test/reactive-union-set.test.js +1 -1
- package/dist/test/reactivity/cleanup.test.js +2 -1
- package/dist/test/reactivity/memo.test.js +1 -1
- package/dist/test/reactivity/untrack.test.js +1 -1
- package/dist/test/rendering/memoization.test.js +2 -1
- package/dist/test/split-props.test.js +1 -1
- package/dist/test/symbols/output-scope.test.js +2 -1
- package/dist/test/symbols/output-symbol.test.js +4 -3
- package/dist/test/symbols/resolution.test.js +2 -1
- package/dist/test/symbols/utils.d.ts +3 -2
- package/dist/test/symbols/utils.d.ts.map +1 -1
- package/dist/test/symbols/utils.js +2 -1
- package/dist/testing/extend-expect.d.ts +15 -0
- package/dist/testing/extend-expect.d.ts.map +1 -1
- package/dist/testing/extend-expect.js +2 -1
- package/dist/testing/render.d.ts +1 -1
- package/dist/testing/render.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -4
- package/src/binder.ts +3 -5
- package/src/code.ts +1 -1
- package/src/components/Block.tsx +1 -1
- package/src/components/Declaration.tsx +2 -1
- package/src/components/For.tsx +2 -1
- package/src/components/Indent.tsx +1 -1
- package/src/components/List.tsx +3 -1
- package/src/components/MemberDeclaration.tsx +4 -3
- package/src/components/MemberScope.tsx +2 -2
- package/src/components/Output.tsx +2 -1
- package/src/components/Prose.tsx +1 -1
- package/src/components/ReferenceOrContent.tsx +1 -1
- package/src/components/Scope.tsx +1 -1
- package/src/components/Show.tsx +1 -1
- package/src/components/SourceDirectory.tsx +2 -1
- package/src/components/SourceFile.tsx +2 -1
- package/src/components/StatementList.tsx +1 -1
- package/src/components/Switch.tsx +2 -1
- package/src/components/Wrap.tsx +1 -1
- package/src/context/binder.ts +1 -1
- package/src/context/source-file.ts +1 -1
- package/src/context.ts +3 -7
- package/src/debug.ts +5 -1
- package/src/index.ts +4 -1
- package/src/jsx-runtime.ts +15 -690
- package/src/props-combinators.ts +148 -0
- package/src/reactive-union-set.ts +1 -1
- package/src/reactivity.ts +230 -0
- package/src/render.ts +97 -26
- package/src/runtime/component.ts +67 -0
- package/src/runtime/intrinsic.ts +199 -0
- package/src/slot.ts +3 -4
- package/src/stc.ts +2 -2
- package/src/sti.ts +11 -11
- package/src/symbols/flags.ts +82 -0
- package/src/symbols/index.ts +1 -0
- package/src/symbols/output-scope.ts +2 -29
- package/src/symbols/output-symbol.ts +2 -55
- package/src/symbols/symbol-flow.ts +3 -7
- package/src/symbols/symbol-slot.tsx +2 -1
- package/src/symbols/symbol-table.ts +3 -3
- package/src/tap.ts +1 -1
- package/src/tracer.ts +38 -4
- package/src/utils.tsx +7 -5
- package/temp/api.json +984 -1261
- package/test/props-with-defaults.test.ts +1 -1
- package/test/reactive-union-set.test.tsx +1 -1
- package/test/reactivity/cleanup.test.tsx +2 -1
- package/test/reactivity/memo.test.tsx +1 -1
- package/test/reactivity/untrack.test.ts +1 -1
- package/test/rendering/basic.test.tsx +1 -1
- package/test/rendering/memoization.test.tsx +1 -1
- package/test/split-props.test.ts +1 -1
- package/test/symbols/output-scope.test.ts +2 -4
- package/test/symbols/output-symbol.test.ts +4 -7
- package/test/symbols/resolution.test.ts +2 -4
- package/test/symbols/utils.ts +3 -5
- package/test/utils.test.tsx +1 -1
- package/testing/extend-expect.ts +16 -0
- package/testing/render.ts +1 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { effect, reactive } from "@vue/reactivity";
|
|
2
2
|
import { expect, it, vi } from "vitest";
|
|
3
|
-
import { defaultProps } from "../src/
|
|
3
|
+
import { defaultProps } from "../src/props-combinators.js";
|
|
4
4
|
|
|
5
5
|
it("applies defaults to regular object props", () => {
|
|
6
6
|
const props = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { effect } from "@alloy-js/core/jsx-runtime";
|
|
2
1
|
import { reactive } from "@vue/reactivity";
|
|
3
2
|
import { describe, expect, it } from "vitest";
|
|
4
3
|
import { ReactiveUnionSet } from "../src/reactive-union-set.js";
|
|
4
|
+
import { effect } from "../src/reactivity.js";
|
|
5
5
|
import { flushJobs } from "../src/scheduler.js";
|
|
6
6
|
|
|
7
7
|
describe("is reactive", () => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Children, effect, memo, onCleanup } from "@alloy-js/core/jsx-runtime";
|
|
2
1
|
import { ref } from "@vue/reactivity";
|
|
3
2
|
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { effect, memo, onCleanup } from "../../src/reactivity.js";
|
|
4
4
|
import { renderTree } from "../../src/render.js";
|
|
5
|
+
import type { Children } from "../../src/runtime/component.js";
|
|
5
6
|
import { flushJobs } from "../../src/scheduler.js";
|
|
6
7
|
|
|
7
8
|
describe("memo cleanup", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { memo } from "@alloy-js/core/jsx-runtime";
|
|
2
1
|
import { ref } from "@vue/reactivity";
|
|
3
2
|
import { expect, it } from "vitest";
|
|
3
|
+
import { memo } from "../../src/reactivity.js";
|
|
4
4
|
|
|
5
5
|
it("doesn't recalculate when dependencies don't change", () => {
|
|
6
6
|
const signal = ref(0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref } from "@vue/reactivity";
|
|
2
2
|
import { expect, it } from "vitest";
|
|
3
|
-
import { memo, untrack } from "../../src/
|
|
3
|
+
import { memo, untrack } from "../../src/reactivity.js";
|
|
4
4
|
import { flushJobs } from "../../src/scheduler.js";
|
|
5
5
|
|
|
6
6
|
it("ignores signals for dependency tracking", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { Children } from "../../src/
|
|
2
|
+
import { Children } from "../../src/runtime/component.js";
|
|
3
3
|
import "../../testing/extend-expect.js";
|
|
4
4
|
describe("string nodes", () => {
|
|
5
5
|
it("renders string nodes with substitutions", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { memo } from "@alloy-js/core/jsx-runtime";
|
|
2
1
|
import { ref } from "@vue/reactivity";
|
|
3
2
|
import { expect, it } from "vitest";
|
|
3
|
+
import { memo } from "../../src/reactivity.js";
|
|
4
4
|
import { renderTree } from "../../src/render.js";
|
|
5
5
|
import { flushJobs } from "../../src/scheduler.js";
|
|
6
6
|
|
package/test/split-props.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { effect, reactive } from "@vue/reactivity";
|
|
2
2
|
import { expect, it, vi } from "vitest";
|
|
3
|
-
import { splitProps } from "../src/
|
|
3
|
+
import { splitProps } from "../src/props-combinators.js";
|
|
4
4
|
|
|
5
5
|
it("splits regular object props", () => {
|
|
6
6
|
const props = {
|
|
@@ -3,10 +3,8 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
|
3
3
|
import { Binder, createOutputBinder } from "../../src/binder.js";
|
|
4
4
|
import { Refkey } from "../../src/refkey.js";
|
|
5
5
|
import { flushJobs } from "../../src/scheduler.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
OutputScopeFlags,
|
|
9
|
-
} from "../../src/symbols/output-scope.js";
|
|
6
|
+
import { OutputScopeFlags } from "../../src/symbols/flags.js";
|
|
7
|
+
import { OutputScope } from "../../src/symbols/output-scope.js";
|
|
10
8
|
import { OutputSymbol } from "../../src/symbols/output-symbol.js";
|
|
11
9
|
import { SymbolTable } from "../../src/symbols/symbol-table.js";
|
|
12
10
|
|
|
@@ -2,19 +2,16 @@ import { reactive, watch } from "@vue/reactivity";
|
|
|
2
2
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
3
|
import { Binder, createOutputBinder } from "../../src/binder.js";
|
|
4
4
|
import { ComponentContext } from "../../src/context.js";
|
|
5
|
+
import { MemberScopeContext } from "../../src/context/member-scope.js";
|
|
5
6
|
import { ScopeContext } from "../../src/index.browser.js";
|
|
6
7
|
import { renderTree } from "../../src/render.js";
|
|
7
8
|
import { flushJobs } from "../../src/scheduler.js";
|
|
8
9
|
import {
|
|
9
|
-
OutputScope,
|
|
10
10
|
OutputScopeFlags,
|
|
11
|
-
} from "../../src/symbols/output-scope.js";
|
|
12
|
-
import {
|
|
13
|
-
OutputSymbol,
|
|
14
11
|
OutputSymbolFlags,
|
|
15
|
-
} from "../../src/symbols/
|
|
16
|
-
|
|
17
|
-
import {
|
|
12
|
+
} from "../../src/symbols/flags.js";
|
|
13
|
+
import { OutputScope } from "../../src/symbols/output-scope.js";
|
|
14
|
+
import { OutputSymbol } from "../../src/symbols/output-symbol.js";
|
|
18
15
|
|
|
19
16
|
let binder: Binder;
|
|
20
17
|
beforeEach(() => {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { createOutputBinder, refkey } from "../../src/index.browser.js";
|
|
3
3
|
import { flushJobs } from "../../src/scheduler.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
OutputSymbolFlags,
|
|
7
|
-
} from "../../src/symbols/output-symbol.js";
|
|
4
|
+
import { OutputSymbolFlags } from "../../src/symbols/flags.js";
|
|
5
|
+
import { OutputSymbol } from "../../src/symbols/output-symbol.js";
|
|
8
6
|
import { createScopeTree } from "./utils.js";
|
|
9
7
|
|
|
10
8
|
describe("Symbol name resolution", () => {
|
package/test/symbols/utils.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Binder } from "../../src/index.browser.js";
|
|
2
2
|
import { Refkey, refkey } from "../../src/refkey.js";
|
|
3
3
|
import {
|
|
4
|
-
OutputScope,
|
|
5
4
|
OutputScopeFlags,
|
|
6
|
-
} from "../../src/symbols/output-scope.js";
|
|
7
|
-
import {
|
|
8
|
-
OutputSymbol,
|
|
9
5
|
OutputSymbolFlags,
|
|
10
|
-
} from "../../src/symbols/
|
|
6
|
+
} from "../../src/symbols/flags.js";
|
|
7
|
+
import { OutputScope } from "../../src/symbols/output-scope.js";
|
|
8
|
+
import { OutputSymbol } from "../../src/symbols/output-symbol.js";
|
|
11
9
|
|
|
12
10
|
type ScopeRecords = Record<string, ScopeDescriptor>;
|
|
13
11
|
type SymbolRecords = Record<string, SymbolDescriptor>;
|
package/test/utils.test.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
2
1
|
import { computed, ref, triggerRef } from "@vue/reactivity";
|
|
3
2
|
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { Children } from "../src/index.js";
|
|
4
4
|
import { renderTree } from "../src/render.js";
|
|
5
5
|
import { flushJobs } from "../src/scheduler.js";
|
|
6
6
|
import { children, join, mapJoin } from "../src/utils.js";
|
package/testing/extend-expect.ts
CHANGED
|
@@ -28,3 +28,19 @@ expect.extend({
|
|
|
28
28
|
};
|
|
29
29
|
},
|
|
30
30
|
});
|
|
31
|
+
|
|
32
|
+
import "vitest";
|
|
33
|
+
|
|
34
|
+
interface ToRenderToRenderOptions {
|
|
35
|
+
printWidth?: number;
|
|
36
|
+
tabWidth?: number;
|
|
37
|
+
useTabs?: boolean;
|
|
38
|
+
}
|
|
39
|
+
interface CustomMatchers<R = unknown> {
|
|
40
|
+
toRenderTo: (str: string, options?: ToRenderToRenderOptions) => R;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare module "vitest" {
|
|
44
|
+
interface Assertion<T = any> extends CustomMatchers<T> {}
|
|
45
|
+
interface AsymmetricMatchersContaining extends CustomMatchers {}
|
|
46
|
+
}
|
package/testing/render.ts
CHANGED