@flighthq/render 0.3.0-next.1689.2810c05 → 0.3.0-next.1692.f1a7a9a
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/renderer.d.ts.map +1 -1
- package/dist/renderer.js +9 -2
- package/dist/renderer.js.map +1 -1
- package/package.json +10 -10
- package/src/renderer.test.ts +24 -1
package/dist/renderer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMtG,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAG9F;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAI3F;AAID,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMtG,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAG9F;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAI3F;AAID,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAY3F;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI,CAE9F;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAKzF;AAKD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,GAAG,IAAI,CAE7G"}
|
package/dist/renderer.js
CHANGED
|
@@ -15,9 +15,16 @@ export function copyRenderersFromRenderState(target, source) {
|
|
|
15
15
|
// cloned, never aliased: derived states start with a snapshot and diverge until an explicit re-copy.
|
|
16
16
|
export function copyRenderStateRegistrations(target, source) {
|
|
17
17
|
const targetRuntime = getRenderStateRuntime(target);
|
|
18
|
-
const
|
|
18
|
+
const sourceRuntime = getRenderStateRuntime(source);
|
|
19
|
+
const sourcePaddingRegistry = sourceRuntime.renderEffectPaddingResolverRegistry;
|
|
19
20
|
targetRuntime.renderEffectPaddingResolverRegistry =
|
|
20
|
-
|
|
21
|
+
sourcePaddingRegistry === null || sourcePaddingRegistry === undefined ? null : new Map(sourcePaddingRegistry);
|
|
22
|
+
// The shape-command set is a base-runtime registry every backend replays through, so a pipeline
|
|
23
|
+
// that inherits the renderers must inherit the commands too. Without it an offscreen state resolves
|
|
24
|
+
// no handler for any command in a shape's stream and bakes an empty target.
|
|
25
|
+
const sourceShapeCommands = sourceRuntime.canvasShapeCommandRegistry;
|
|
26
|
+
targetRuntime.canvasShapeCommandRegistry =
|
|
27
|
+
sourceShapeCommands === null || sourceShapeCommands === undefined ? null : new Map(sourceShapeCommands);
|
|
21
28
|
}
|
|
22
29
|
export function noopRendererData(_state, _source) {
|
|
23
30
|
return null;
|
package/dist/renderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":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,CAAC;AAC1C,CAAC;AAED,oGAAoG;AACpG,qGAAqG;AACrG,kFAAkF;AAClF,MAAM,UAAU,iBAAiB,CAAC,KAAkB,EAAE,OAAiD;IACrG,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,OAAO;QAAE,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAClF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/render",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.1692.f1a7a9a",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/flighthq/flight.git",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@flighthq/color": "0.3.0-next.
|
|
40
|
-
"@flighthq/entity": "0.3.0-next.
|
|
41
|
-
"@flighthq/geometry": "0.3.0-next.
|
|
42
|
-
"@flighthq/log": "0.3.0-next.
|
|
43
|
-
"@flighthq/materials": "0.3.0-next.
|
|
44
|
-
"@flighthq/mesh": "0.3.0-next.
|
|
45
|
-
"@flighthq/node": "0.3.0-next.
|
|
46
|
-
"@flighthq/signals": "0.3.0-next.
|
|
47
|
-
"@flighthq/types": "0.3.0-next.
|
|
39
|
+
"@flighthq/color": "0.3.0-next.1692.f1a7a9a",
|
|
40
|
+
"@flighthq/entity": "0.3.0-next.1692.f1a7a9a",
|
|
41
|
+
"@flighthq/geometry": "0.3.0-next.1692.f1a7a9a",
|
|
42
|
+
"@flighthq/log": "0.3.0-next.1692.f1a7a9a",
|
|
43
|
+
"@flighthq/materials": "0.3.0-next.1692.f1a7a9a",
|
|
44
|
+
"@flighthq/mesh": "0.3.0-next.1692.f1a7a9a",
|
|
45
|
+
"@flighthq/node": "0.3.0-next.1692.f1a7a9a",
|
|
46
|
+
"@flighthq/signals": "0.3.0-next.1692.f1a7a9a",
|
|
47
|
+
"@flighthq/types": "0.3.0-next.1692.f1a7a9a"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@flighthq/adjustments": "*",
|
package/src/renderer.test.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Scene2DClipHooks, Renderer, RenderState } from '@flighthq/types/contract';
|
|
1
|
+
import type { CanvasShapeCommand, Scene2DClipHooks, Renderer, RenderState } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
copyAllRenderersFromRenderState,
|
|
@@ -83,6 +83,29 @@ describe('copyRenderStateRegistrations', () => {
|
|
|
83
83
|
);
|
|
84
84
|
expect(getRenderStateRuntime(target).renderEffectPaddingResolverRegistry?.get('acme.Effect')).toBe(resolver);
|
|
85
85
|
});
|
|
86
|
+
|
|
87
|
+
it('snapshot-copies the shape-command registry without aliasing the map', () => {
|
|
88
|
+
const source = createRenderState();
|
|
89
|
+
const target = createRenderState();
|
|
90
|
+
const command = { key: 'beginFill', draw: vi.fn() } as unknown as CanvasShapeCommand;
|
|
91
|
+
getRenderStateRuntime(source).canvasShapeCommandRegistry = new Map([['beginFill', command]]);
|
|
92
|
+
|
|
93
|
+
copyRenderStateRegistrations(target, source);
|
|
94
|
+
|
|
95
|
+
expect(getRenderStateRuntime(target).canvasShapeCommandRegistry).not.toBe(
|
|
96
|
+
getRenderStateRuntime(source).canvasShapeCommandRegistry,
|
|
97
|
+
);
|
|
98
|
+
expect(getRenderStateRuntime(target).canvasShapeCommandRegistry?.get('beginFill')).toBe(command);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it('leaves the shape-command registry null when the source never registered one', () => {
|
|
102
|
+
const source = createRenderState();
|
|
103
|
+
const target = createRenderState();
|
|
104
|
+
|
|
105
|
+
copyRenderStateRegistrations(target, source);
|
|
106
|
+
|
|
107
|
+
expect(getRenderStateRuntime(target).canvasShapeCommandRegistry).toBeNull();
|
|
108
|
+
});
|
|
86
109
|
});
|
|
87
110
|
|
|
88
111
|
describe('noopRendererData', () => {
|