@velarscript/web 0.31.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/analysis/calls/intrinsics/config.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/config.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/config.js +19 -0
- package/dist/analysis/calls/intrinsics/config.js.map +1 -0
- package/dist/analysis/calls/intrinsics/forms.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/forms.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/forms.js +38 -0
- package/dist/analysis/calls/intrinsics/forms.js.map +1 -0
- package/dist/analysis/calls/intrinsics/http.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/http.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/http.js +37 -0
- package/dist/analysis/calls/intrinsics/http.js.map +1 -0
- package/dist/analysis/calls/intrinsics/reactive.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/reactive.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/reactive.js +30 -0
- package/dist/analysis/calls/intrinsics/reactive.js.map +1 -0
- package/dist/analysis/calls/intrinsics/storage.d.ts +12 -0
- package/dist/analysis/calls/intrinsics/storage.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/storage.js +86 -0
- package/dist/analysis/calls/intrinsics/storage.js.map +1 -0
- package/dist/analysis/calls/intrinsics/web.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/web.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/web.js +100 -0
- package/dist/analysis/calls/intrinsics/web.js.map +1 -0
- package/dist/analysis/calls/intrinsics.d.ts +13 -0
- package/dist/analysis/calls/intrinsics.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics.js +31 -0
- package/dist/analysis/calls/intrinsics.js.map +1 -0
- package/dist/analysis/components/contracts.d.ts +19 -0
- package/dist/analysis/components/contracts.d.ts.map +1 -0
- package/dist/analysis/components/contracts.js +83 -0
- package/dist/analysis/components/contracts.js.map +1 -0
- package/dist/analysis/components/declaration.d.ts +4 -0
- package/dist/analysis/components/declaration.d.ts.map +1 -0
- package/dist/analysis/components/declaration.js +163 -0
- package/dist/analysis/components/declaration.js.map +1 -0
- package/dist/analysis/components/host.d.ts +61 -0
- package/dist/analysis/components/host.d.ts.map +1 -0
- package/dist/analysis/components/host.js +22 -0
- package/dist/analysis/components/host.js.map +1 -0
- package/dist/analysis/components/lifecycle.d.ts +22 -0
- package/dist/analysis/components/lifecycle.d.ts.map +1 -0
- package/dist/analysis/components/lifecycle.js +33 -0
- package/dist/analysis/components/lifecycle.js.map +1 -0
- package/dist/analysis/components/ownership.d.ts +74 -0
- package/dist/analysis/components/ownership.d.ts.map +1 -0
- package/dist/analysis/components/ownership.js +106 -0
- package/dist/analysis/components/ownership.js.map +1 -0
- package/dist/analysis/declarations.d.ts +99 -0
- package/dist/analysis/declarations.d.ts.map +1 -0
- package/dist/analysis/declarations.js +176 -0
- package/dist/analysis/declarations.js.map +1 -0
- package/dist/analysis/inference.d.ts +67 -0
- package/dist/analysis/inference.d.ts.map +1 -0
- package/dist/analysis/inference.js +236 -0
- package/dist/analysis/inference.js.map +1 -0
- package/dist/analysis/jsx/attributes.d.ts +103 -0
- package/dist/analysis/jsx/attributes.d.ts.map +1 -0
- package/dist/analysis/jsx/attributes.js +601 -0
- package/dist/analysis/jsx/attributes.js.map +1 -0
- package/dist/analysis/jsx/elements.d.ts +17 -0
- package/dist/analysis/jsx/elements.d.ts.map +1 -0
- package/dist/analysis/jsx/elements.js +213 -0
- package/dist/analysis/jsx/elements.js.map +1 -0
- package/dist/analysis/jsx/host.d.ts +61 -0
- package/dist/analysis/jsx/host.d.ts.map +1 -0
- package/dist/analysis/jsx/host.js +15 -0
- package/dist/analysis/jsx/host.js.map +1 -0
- package/dist/analysis/jsx/keys.d.ts +15 -0
- package/dist/analysis/jsx/keys.d.ts.map +1 -0
- package/dist/analysis/jsx/keys.js +67 -0
- package/dist/analysis/jsx/keys.js.map +1 -0
- package/dist/analysis/jsx/security.d.ts +29 -0
- package/dist/analysis/jsx/security.d.ts.map +1 -0
- package/dist/analysis/jsx/security.js +61 -0
- package/dist/analysis/jsx/security.js.map +1 -0
- package/dist/analysis/jsx-detection.d.ts +49 -0
- package/dist/analysis/jsx-detection.d.ts.map +1 -0
- package/dist/analysis/jsx-detection.js +196 -0
- package/dist/analysis/jsx-detection.js.map +1 -0
- package/dist/analysis/keyed-rebuild.d.ts +148 -0
- package/dist/analysis/keyed-rebuild.d.ts.map +1 -0
- package/dist/analysis/keyed-rebuild.js +299 -0
- package/dist/analysis/keyed-rebuild.js.map +1 -0
- package/dist/analysis/keyframes-analysis.d.ts +6 -0
- package/dist/analysis/keyframes-analysis.d.ts.map +1 -0
- package/dist/analysis/keyframes-analysis.js +79 -0
- package/dist/analysis/keyframes-analysis.js.map +1 -0
- package/dist/analysis/look/builders.d.ts +29 -0
- package/dist/analysis/look/builders.d.ts.map +1 -0
- package/dist/analysis/look/builders.js +168 -0
- package/dist/analysis/look/builders.js.map +1 -0
- package/dist/analysis/look/conditions.d.ts +13 -0
- package/dist/analysis/look/conditions.d.ts.map +1 -0
- package/dist/analysis/look/conditions.js +84 -0
- package/dist/analysis/look/conditions.js.map +1 -0
- package/dist/analysis/look/edits.d.ts +25 -0
- package/dist/analysis/look/edits.d.ts.map +1 -0
- package/dist/analysis/look/edits.js +57 -0
- package/dist/analysis/look/edits.js.map +1 -0
- package/dist/analysis/look/entries.d.ts +56 -0
- package/dist/analysis/look/entries.d.ts.map +1 -0
- package/dist/analysis/look/entries.js +223 -0
- package/dist/analysis/look/entries.js.map +1 -0
- package/dist/analysis/look/host.d.ts +47 -0
- package/dist/analysis/look/host.d.ts.map +1 -0
- package/dist/analysis/look/host.js +16 -0
- package/dist/analysis/look/host.js.map +1 -0
- package/dist/analysis/look/tokens.d.ts +75 -0
- package/dist/analysis/look/tokens.d.ts.map +1 -0
- package/dist/analysis/look/tokens.js +151 -0
- package/dist/analysis/look/tokens.js.map +1 -0
- package/dist/analysis/look/values.d.ts +45 -0
- package/dist/analysis/look/values.d.ts.map +1 -0
- package/dist/analysis/look/values.js +148 -0
- package/dist/analysis/look/values.js.map +1 -0
- package/dist/analysis/look-conditions.d.ts +47 -0
- package/dist/analysis/look-conditions.d.ts.map +1 -0
- package/dist/analysis/look-conditions.js +157 -0
- package/dist/analysis/look-conditions.js.map +1 -0
- package/dist/analysis/look-sites.d.ts +54 -0
- package/dist/analysis/look-sites.d.ts.map +1 -0
- package/dist/analysis/look-sites.js +104 -0
- package/dist/analysis/look-sites.js.map +1 -0
- package/dist/analysis/look-vocabulary-guidance.d.ts +76 -0
- package/dist/analysis/look-vocabulary-guidance.d.ts.map +1 -0
- package/dist/analysis/look-vocabulary-guidance.js +338 -0
- package/dist/analysis/look-vocabulary-guidance.js.map +1 -0
- package/dist/analysis/media-conditions.d.ts +33 -0
- package/dist/analysis/media-conditions.d.ts.map +1 -0
- package/dist/analysis/media-conditions.js +92 -0
- package/dist/analysis/media-conditions.js.map +1 -0
- package/dist/analysis/program-passes.d.ts +106 -0
- package/dist/analysis/program-passes.d.ts.map +1 -0
- package/dist/analysis/program-passes.js +149 -0
- package/dist/analysis/program-passes.js.map +1 -0
- package/dist/analysis/reactivity/bindings.d.ts +37 -0
- package/dist/analysis/reactivity/bindings.d.ts.map +1 -0
- package/dist/analysis/reactivity/bindings.js +88 -0
- package/dist/analysis/reactivity/bindings.js.map +1 -0
- package/dist/analysis/reactivity/derived.d.ts +39 -0
- package/dist/analysis/reactivity/derived.d.ts.map +1 -0
- package/dist/analysis/reactivity/derived.js +80 -0
- package/dist/analysis/reactivity/derived.js.map +1 -0
- package/dist/analysis/reactivity/host.d.ts +38 -0
- package/dist/analysis/reactivity/host.d.ts.map +1 -0
- package/dist/analysis/reactivity/host.js +14 -0
- package/dist/analysis/reactivity/host.js.map +1 -0
- package/dist/analysis/reactivity/retired-accessors.d.ts +82 -0
- package/dist/analysis/reactivity/retired-accessors.d.ts.map +1 -0
- package/dist/analysis/reactivity/retired-accessors.js +118 -0
- package/dist/analysis/reactivity/retired-accessors.js.map +1 -0
- package/dist/analysis/renderable.d.ts +47 -0
- package/dist/analysis/renderable.d.ts.map +1 -0
- package/dist/analysis/renderable.js +105 -0
- package/dist/analysis/renderable.js.map +1 -0
- package/dist/analysis/routes.d.ts +64 -0
- package/dist/analysis/routes.d.ts.map +1 -0
- package/dist/analysis/routes.js +182 -0
- package/dist/analysis/routes.js.map +1 -0
- package/dist/analysis/url-attributes.d.ts +12 -0
- package/dist/analysis/url-attributes.d.ts.map +1 -0
- package/dist/analysis/url-attributes.js +48 -0
- package/dist/analysis/url-attributes.js.map +1 -0
- package/dist/analysis/watch-cycles.d.ts +102 -0
- package/dist/analysis/watch-cycles.d.ts.map +1 -1
- package/dist/analysis/watch-cycles.js +240 -1
- package/dist/analysis/watch-cycles.js.map +1 -1
- package/dist/analysis/watch-subject.d.ts +45 -0
- package/dist/analysis/watch-subject.d.ts.map +1 -0
- package/dist/analysis/watch-subject.js +272 -0
- package/dist/analysis/watch-subject.js.map +1 -0
- package/dist/analysis/web-types.d.ts +27 -0
- package/dist/analysis/web-types.d.ts.map +1 -0
- package/dist/analysis/web-types.js +170 -0
- package/dist/analysis/web-types.js.map +1 -0
- package/dist/analyzer.d.ts +18 -617
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +208 -4853
- package/dist/analyzer.js.map +1 -1
- package/dist/compiler.d.ts +20 -0
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +29 -864
- package/dist/compiler.js.map +1 -1
- package/dist/documentation.d.ts +28 -0
- package/dist/documentation.d.ts.map +1 -0
- package/dist/documentation.js +67 -0
- package/dist/documentation.js.map +1 -0
- package/dist/editor/completions.d.ts +12 -0
- package/dist/editor/completions.d.ts.map +1 -0
- package/dist/editor/completions.js +6 -0
- package/dist/editor/completions.js.map +1 -0
- package/dist/editor/jsx-completion.d.ts +12 -0
- package/dist/editor/jsx-completion.d.ts.map +1 -0
- package/dist/editor/jsx-completion.js +137 -0
- package/dist/editor/jsx-completion.js.map +1 -0
- package/dist/editor/look-completion.d.ts +29 -0
- package/dist/editor/look-completion.d.ts.map +1 -0
- package/dist/editor/look-completion.js +159 -0
- package/dist/editor/look-completion.js.map +1 -0
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +12 -288
- package/dist/editor.js.map +1 -1
- package/dist/emit/components.d.ts +33 -0
- package/dist/emit/components.d.ts.map +1 -0
- package/dist/emit/components.js +135 -0
- package/dist/emit/components.js.map +1 -0
- package/dist/emit/jsx.d.ts +57 -0
- package/dist/emit/jsx.d.ts.map +1 -0
- package/dist/emit/jsx.js +384 -0
- package/dist/emit/jsx.js.map +1 -0
- package/dist/emit/look-css.d.ts +44 -0
- package/dist/emit/look-css.d.ts.map +1 -0
- package/dist/emit/look-css.js +177 -0
- package/dist/emit/look-css.js.map +1 -0
- package/dist/emit/look.d.ts +39 -0
- package/dist/emit/look.d.ts.map +1 -0
- package/dist/emit/look.js +218 -0
- package/dist/emit/look.js.map +1 -0
- package/dist/emit/runtime-imports.d.ts +40 -0
- package/dist/emit/runtime-imports.d.ts.map +1 -0
- package/dist/emit/runtime-imports.js +184 -0
- package/dist/emit/runtime-imports.js.map +1 -0
- package/dist/emitter.d.ts +15 -68
- package/dist/emitter.d.ts.map +1 -1
- package/dist/emitter.js +79 -1008
- package/dist/emitter.js.map +1 -1
- package/dist/look/animation.d.ts +7 -0
- package/dist/look/animation.d.ts.map +1 -0
- package/dist/look/animation.js +13 -0
- package/dist/look/animation.js.map +1 -0
- package/dist/look/builders.d.ts +35 -0
- package/dist/look/builders.d.ts.map +1 -0
- package/dist/look/builders.js +74 -0
- package/dist/look/builders.js.map +1 -0
- package/dist/look/css-functions.d.ts +28 -0
- package/dist/look/css-functions.d.ts.map +1 -0
- package/dist/look/css-functions.js +54 -0
- package/dist/look/css-functions.js.map +1 -0
- package/dist/look/keyword-sets.d.ts +41 -0
- package/dist/look/keyword-sets.d.ts.map +1 -0
- package/dist/look/keyword-sets.js +117 -0
- package/dist/look/keyword-sets.js.map +1 -0
- package/dist/look/keywords.d.ts +55 -0
- package/dist/look/keywords.d.ts.map +1 -0
- package/dist/look/keywords.js +387 -0
- package/dist/look/keywords.js.map +1 -0
- package/dist/look/media.d.ts +19 -0
- package/dist/look/media.d.ts.map +1 -0
- package/dist/look/media.js +27 -0
- package/dist/look/media.js.map +1 -0
- package/dist/look/naming.d.ts +9 -0
- package/dist/look/naming.d.ts.map +1 -0
- package/dist/look/naming.js +45 -0
- package/dist/look/naming.js.map +1 -0
- package/dist/look/properties.d.ts +16 -0
- package/dist/look/properties.d.ts.map +1 -0
- package/dist/look/properties.js +52 -0
- package/dist/look/properties.js.map +1 -0
- package/dist/look/shorthands.d.ts +25 -0
- package/dist/look/shorthands.d.ts.map +1 -0
- package/dist/look/shorthands.js +130 -0
- package/dist/look/shorthands.js.map +1 -0
- package/dist/look/tokens.d.ts +38 -0
- package/dist/look/tokens.d.ts.map +1 -0
- package/dist/look/tokens.js +59 -0
- package/dist/look/tokens.js.map +1 -0
- package/dist/look/units.d.ts +24 -0
- package/dist/look/units.d.ts.map +1 -0
- package/dist/look/units.js +33 -0
- package/dist/look/units.js.map +1 -0
- package/dist/look.d.ts +32 -227
- package/dist/look.d.ts.map +1 -1
- package/dist/look.js +28 -933
- package/dist/look.js.map +1 -1
- package/dist/module-roster.d.ts +16 -0
- package/dist/module-roster.d.ts.map +1 -0
- package/dist/module-roster.js +28 -0
- package/dist/module-roster.js.map +1 -0
- package/dist/modules/app.d.ts +9 -0
- package/dist/modules/app.d.ts.map +1 -0
- package/dist/modules/app.js +20 -0
- package/dist/modules/app.js.map +1 -0
- package/dist/modules/browser-test.d.ts +9 -0
- package/dist/modules/browser-test.d.ts.map +1 -0
- package/dist/modules/browser-test.js +67 -0
- package/dist/modules/browser-test.js.map +1 -0
- package/dist/modules/browser.d.ts +10 -0
- package/dist/modules/browser.d.ts.map +1 -0
- package/dist/modules/browser.js +89 -0
- package/dist/modules/browser.js.map +1 -0
- package/dist/modules/config.d.ts +9 -0
- package/dist/modules/config.d.ts.map +1 -0
- package/dist/modules/config.js +14 -0
- package/dist/modules/config.js.map +1 -0
- package/dist/modules/files.d.ts +9 -0
- package/dist/modules/files.d.ts.map +1 -0
- package/dist/modules/files.js +16 -0
- package/dist/modules/files.js.map +1 -0
- package/dist/modules/forms.d.ts +9 -0
- package/dist/modules/forms.d.ts.map +1 -0
- package/dist/modules/forms.js +26 -0
- package/dist/modules/forms.js.map +1 -0
- package/dist/modules/http.d.ts +9 -0
- package/dist/modules/http.d.ts.map +1 -0
- package/dist/modules/http.js +127 -0
- package/dist/modules/http.js.map +1 -0
- package/dist/modules/look.d.ts +9 -0
- package/dist/modules/look.d.ts.map +1 -0
- package/dist/modules/look.js +58 -0
- package/dist/modules/look.js.map +1 -0
- package/dist/modules/realtime.d.ts +9 -0
- package/dist/modules/realtime.d.ts.map +1 -0
- package/dist/modules/realtime.js +163 -0
- package/dist/modules/realtime.js.map +1 -0
- package/dist/modules/storage.d.ts +9 -0
- package/dist/modules/storage.d.ts.map +1 -0
- package/dist/modules/storage.js +59 -0
- package/dist/modules/storage.js.map +1 -0
- package/dist/modules/types.d.ts +78 -0
- package/dist/modules/types.d.ts.map +1 -0
- package/dist/modules/types.js +154 -0
- package/dist/modules/types.js.map +1 -0
- package/dist/modules/web.d.ts +9 -0
- package/dist/modules/web.d.ts.map +1 -0
- package/dist/modules/web.js +63 -0
- package/dist/modules/web.js.map +1 -0
- package/dist/modules/websocket.d.ts +11 -0
- package/dist/modules/websocket.d.ts.map +1 -0
- package/dist/modules/websocket.js +75 -0
- package/dist/modules/websocket.js.map +1 -0
- package/dist/parser/expressions/jsx.d.ts +17 -0
- package/dist/parser/expressions/jsx.d.ts.map +1 -0
- package/dist/parser/expressions/jsx.js +43 -0
- package/dist/parser/expressions/jsx.js.map +1 -0
- package/dist/parser/expressions/keyframes.d.ts +15 -0
- package/dist/parser/expressions/keyframes.d.ts.map +1 -0
- package/dist/parser/expressions/keyframes.js +33 -0
- package/dist/parser/expressions/keyframes.js.map +1 -0
- package/dist/parser/expressions/look.d.ts +16 -0
- package/dist/parser/expressions/look.d.ts.map +1 -0
- package/dist/parser/expressions/look.js +37 -0
- package/dist/parser/expressions/look.js.map +1 -0
- package/dist/parser/expressions/visual-block.d.ts +17 -0
- package/dist/parser/expressions/visual-block.d.ts.map +1 -0
- package/dist/parser/expressions/visual-block.js +21 -0
- package/dist/parser/expressions/visual-block.js.map +1 -0
- package/dist/parser/keyframes-source.d.ts +24 -0
- package/dist/parser/keyframes-source.d.ts.map +1 -0
- package/dist/parser/keyframes-source.js +133 -0
- package/dist/parser/keyframes-source.js.map +1 -0
- package/dist/parser/look-source.d.ts +25 -0
- package/dist/parser/look-source.d.ts.map +1 -0
- package/dist/parser/look-source.js +189 -0
- package/dist/parser/look-source.js.map +1 -0
- package/dist/parser/spans.d.ts +24 -0
- package/dist/parser/spans.d.ts.map +1 -0
- package/dist/parser/spans.js +113 -0
- package/dist/parser/spans.js.map +1 -0
- package/dist/parser/statements/components.d.ts +37 -0
- package/dist/parser/statements/components.d.ts.map +1 -0
- package/dist/parser/statements/components.js +185 -0
- package/dist/parser/statements/components.js.map +1 -0
- package/dist/parser/statements/heads.d.ts +38 -0
- package/dist/parser/statements/heads.d.ts.map +1 -0
- package/dist/parser/statements/heads.js +55 -0
- package/dist/parser/statements/heads.js.map +1 -0
- package/dist/parser/statements/imports.d.ts +9 -0
- package/dist/parser/statements/imports.d.ts.map +1 -0
- package/dist/parser/statements/imports.js +31 -0
- package/dist/parser/statements/imports.js.map +1 -0
- package/dist/parser/statements/reactive.d.ts +31 -0
- package/dist/parser/statements/reactive.d.ts.map +1 -0
- package/dist/parser/statements/reactive.js +68 -0
- package/dist/parser/statements/reactive.js.map +1 -0
- package/dist/parser/statements/unsafe-css.d.ts +21 -0
- package/dist/parser/statements/unsafe-css.d.ts.map +1 -0
- package/dist/parser/statements/unsafe-css.js +42 -0
- package/dist/parser/statements/unsafe-css.js.map +1 -0
- package/dist/parser.d.ts +37 -50
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +98 -882
- package/dist/parser.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* D89 A4: a 'map' callback that rebuilds its rows instead of carrying them
|
|
3
|
+
* over, which is what a keyed list stops recognising — what one rebuild records,
|
|
4
|
+
* and the module reading that decides whether a helper builds fresh records at
|
|
5
|
+
* all.
|
|
6
|
+
*
|
|
7
|
+
* D115 P4 R3a: the advisory is raised from the analyzer's JSX pass, but every
|
|
8
|
+
* reading it rests on is a reading of the program, so they read as a module.
|
|
9
|
+
*
|
|
10
|
+
* D115 P4 R3c: the four rules that record a rebuild and raise the advisory join
|
|
11
|
+
* them, over a `KeyedRebuildHost`.
|
|
12
|
+
*/
|
|
13
|
+
import {} from "@velarscript/compiler";
|
|
14
|
+
import { spanIdentity } from "@velarscript/compiler/extension";
|
|
15
|
+
import { isWebStatement } from "../ast.js";
|
|
16
|
+
import { rowFieldPassthrough } from "./jsx-detection.js";
|
|
17
|
+
/**
|
|
18
|
+
* D89 A4: what a `map` callback rebuilds, when it returns a newly built record
|
|
19
|
+
* instead of the row it was handed. Null is the non-trigger answer the ruling
|
|
20
|
+
* names — a callback that returns its parameter, or anything else that is not a
|
|
21
|
+
* record literal, builds nothing and moves no identity. A record is reported
|
|
22
|
+
* even when no field can be named, because it is the rebuilt row's own identity
|
|
23
|
+
* that the keyed list stops recognising, not any one field it carries.
|
|
24
|
+
*
|
|
25
|
+
* A conditional is read through because the React spelling nearly always
|
|
26
|
+
* carries one, `t.id == id ? {...t, done: true} : t`, and its `else` branch is
|
|
27
|
+
* the returns-the-original case rather than a second shape. A branch that names
|
|
28
|
+
* a field is preferred, since a suggestion that names one is the whole product.
|
|
29
|
+
*/
|
|
30
|
+
export function keyedRebuiltRecord(body, row) {
|
|
31
|
+
if (body.kind === "ObjectExpression") {
|
|
32
|
+
// `{ id: item.id, done: true }` copies the key across and rewrites `done`.
|
|
33
|
+
// Naming `id` would send the author to write the one field whose value the
|
|
34
|
+
// keyed list reads, so a field that only carries the row's own value over
|
|
35
|
+
// is not the field the message is about.
|
|
36
|
+
for (const property of body.properties) {
|
|
37
|
+
if (property.kind !== "ObjectProperty")
|
|
38
|
+
continue;
|
|
39
|
+
if (rowFieldPassthrough(property.value, row, property.name))
|
|
40
|
+
continue;
|
|
41
|
+
return { field: property.name };
|
|
42
|
+
}
|
|
43
|
+
// A pure `{...item}` rewrites no field at all; the copy itself is what
|
|
44
|
+
// moves the row's identity, so there is no field name for the message.
|
|
45
|
+
return body.properties.length > 0 ? { field: null } : null;
|
|
46
|
+
}
|
|
47
|
+
if (body.kind === "ConditionalExpression") {
|
|
48
|
+
const thenSide = keyedRebuiltRecord(body.thenValue, row);
|
|
49
|
+
const elseSide = keyedRebuiltRecord(body.elseValue, row);
|
|
50
|
+
if (thenSide?.field)
|
|
51
|
+
return thenSide;
|
|
52
|
+
if (elseSide?.field)
|
|
53
|
+
return elseSide;
|
|
54
|
+
return thenSide ?? elseSide;
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* D89 A4, the wider proven shape: every `def` of the module by name, so a
|
|
60
|
+
* `computed` whose initializer calls one can be read through to what that call
|
|
61
|
+
* builds. A name declared twice maps to null — two bodies under one name make
|
|
62
|
+
* the question unanswerable, and an advisory that cannot prove which body runs
|
|
63
|
+
* stays silent rather than guessing.
|
|
64
|
+
*/
|
|
65
|
+
export function collectModuleFunctions(program) {
|
|
66
|
+
const functions = new Map();
|
|
67
|
+
const record = (statements) => {
|
|
68
|
+
for (const statement of statements) {
|
|
69
|
+
if (statement.kind === "FunctionDeclaration") {
|
|
70
|
+
functions.set(statement.name, functions.has(statement.name) ? null : statement);
|
|
71
|
+
record(statement.body);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (isWebStatement(statement) && statement.kind === "ExtensionStatement:web:component") {
|
|
75
|
+
record(statement.body);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
record(program.body);
|
|
80
|
+
return functions;
|
|
81
|
+
}
|
|
82
|
+
/** Every name a binding pattern introduces, added to `names`. */
|
|
83
|
+
function collectPatternNames(pattern, names) {
|
|
84
|
+
if (pattern.kind === "NameBindingPattern") {
|
|
85
|
+
names.add(pattern.name);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (pattern.kind === "ListBindingPattern") {
|
|
89
|
+
for (const element of pattern.elements)
|
|
90
|
+
if (element)
|
|
91
|
+
collectPatternNames(element, names);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
for (const entry of pattern.entries)
|
|
95
|
+
collectPatternNames(entry.pattern, names);
|
|
96
|
+
}
|
|
97
|
+
if (pattern.rest)
|
|
98
|
+
names.add(pattern.rest.name);
|
|
99
|
+
}
|
|
100
|
+
/** True when the expression reads one of `names` anywhere inside it. */
|
|
101
|
+
function readsAnyName(value, names) {
|
|
102
|
+
if (!value || typeof value !== "object")
|
|
103
|
+
return false;
|
|
104
|
+
if (Array.isArray(value))
|
|
105
|
+
return value.some((item) => readsAnyName(item, names));
|
|
106
|
+
const record = value;
|
|
107
|
+
if (record.kind === "IdentifierExpression" && typeof record.name === "string" && names.has(record.name))
|
|
108
|
+
return true;
|
|
109
|
+
return Object.values(record).some((child) => readsAnyName(child, names));
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* D89 A4, the wider proven shape: whether a `def` answers a list it filled with
|
|
113
|
+
* freshly constructed records — the `for`/`append` builder that spells the same
|
|
114
|
+
* churn `list = list.map(item => {…})` spells with `map`, and the spelling the
|
|
115
|
+
* P2b consumer actually wrote.
|
|
116
|
+
*
|
|
117
|
+
* Four things are proven, and any one of them missing leaves the advisory
|
|
118
|
+
* silent, because the whole product is naming a rebuild that really happens:
|
|
119
|
+
*
|
|
120
|
+
* 1. the body's last statement returns a name it declared here, initialized to
|
|
121
|
+
* an empty list literal — so the list is the `def`'s own, not one handed in;
|
|
122
|
+
* 2. every value appended to that list is a record literal, so every element is
|
|
123
|
+
* a new value on every call. One `append(row)` of a source record is the
|
|
124
|
+
* identity-preserving spelling this advisory teaches, and one member call
|
|
125
|
+
* the proof cannot read leaves the whole answer unproven;
|
|
126
|
+
* 3. at least one such record reads a parameter of the `def` or the binding of
|
|
127
|
+
* the `for` that appends it. A builder whose records are constant answers
|
|
128
|
+
* the same content every call, so nothing it is derived from can move and
|
|
129
|
+
* the `computed` over it never recomputes;
|
|
130
|
+
* 4. nothing else touches the list — it is built and answered, nothing more.
|
|
131
|
+
*/
|
|
132
|
+
export function buildsFreshRecords(declaration) {
|
|
133
|
+
const returned = declaration.body.at(-1);
|
|
134
|
+
if (!returned || returned.kind !== "ReturnStatement" || returned.value?.kind !== "IdentifierExpression")
|
|
135
|
+
return false;
|
|
136
|
+
const built = returned.value.name;
|
|
137
|
+
const local = declaration.body.find((statement) => statement.kind === "VariableDeclaration"
|
|
138
|
+
&& statement.pattern.kind === "NameBindingPattern" && statement.pattern.name === built);
|
|
139
|
+
if (!local || local.kind !== "VariableDeclaration")
|
|
140
|
+
return false;
|
|
141
|
+
if (local.initializer.kind !== "ListExpression" || local.initializer.elements.length > 0)
|
|
142
|
+
return false;
|
|
143
|
+
const parameters = new Set(declaration.parameters.map((parameter) => parameter.name));
|
|
144
|
+
let records = 0;
|
|
145
|
+
let varying = false;
|
|
146
|
+
let unproven = false;
|
|
147
|
+
const walk = (statements, visible) => {
|
|
148
|
+
for (const statement of statements) {
|
|
149
|
+
if (statement.kind === "ForStatement") {
|
|
150
|
+
const inner = new Set(visible);
|
|
151
|
+
collectPatternNames(statement.pattern, inner);
|
|
152
|
+
if (statement.secondPattern)
|
|
153
|
+
collectPatternNames(statement.secondPattern, inner);
|
|
154
|
+
walk(statement.body, inner);
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (statement.kind === "IfStatement") {
|
|
158
|
+
walk(statement.thenBody, visible);
|
|
159
|
+
walk(statement.elseBody ?? [], visible);
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
if (statement.kind === "WhileStatement") {
|
|
163
|
+
walk(statement.body, visible);
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if (statement.kind !== "ExpressionStatement")
|
|
167
|
+
continue;
|
|
168
|
+
const call = statement.expression;
|
|
169
|
+
if (call.kind !== "CallExpression" || call.callee.kind !== "MemberExpression")
|
|
170
|
+
continue;
|
|
171
|
+
if (call.callee.object.kind !== "IdentifierExpression" || call.callee.object.name !== built)
|
|
172
|
+
continue;
|
|
173
|
+
const [appended] = call.arguments;
|
|
174
|
+
if (call.callee.property !== "append" || !appended || appended.kind !== "ObjectExpression") {
|
|
175
|
+
unproven = true;
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
records += 1;
|
|
179
|
+
if (readsAnyName(appended, visible))
|
|
180
|
+
varying = true;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
walk(declaration.body, parameters);
|
|
184
|
+
return !unproven && records > 0 && varying;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* D89 A4: records `list = list.map(item => {…})`, React's immutable update,
|
|
188
|
+
* where the callback builds a new record rather than changing a field.
|
|
189
|
+
*
|
|
190
|
+
* D90 R2 stands — `__velarKeyed` compares identity and that does not move,
|
|
191
|
+
* and the framework does not accommodate the idiom. This channel is not the
|
|
192
|
+
* framework taking responsibility; it is the compiler telling the author that
|
|
193
|
+
* the row he is typing into is about to be destroyed. Nothing is reported
|
|
194
|
+
* yet: the advisory is owed only if the rewritten list is what a keyed list
|
|
195
|
+
* renders, and the render usually sits below the update.
|
|
196
|
+
*/
|
|
197
|
+
export function recordKeyedListRebuild(host, statement) {
|
|
198
|
+
if (statement.kind !== "AssignmentStatement" || statement.operator !== "=")
|
|
199
|
+
return;
|
|
200
|
+
if (statement.target.kind !== "IdentifierExpression")
|
|
201
|
+
return;
|
|
202
|
+
const value = statement.value;
|
|
203
|
+
if (value.kind !== "CallExpression" || value.callee.kind !== "MemberExpression" || value.callee.property !== "map")
|
|
204
|
+
return;
|
|
205
|
+
// The map has to be over the list being replaced; `rows = source.map(...)`
|
|
206
|
+
// builds a new list, and a new list has no identity to preserve.
|
|
207
|
+
if (value.callee.object.kind !== "IdentifierExpression" || value.callee.object.name !== statement.target.name)
|
|
208
|
+
return;
|
|
209
|
+
const callback = value.arguments[0];
|
|
210
|
+
if (!callback || callback.kind !== "ArrowFunctionExpression")
|
|
211
|
+
return;
|
|
212
|
+
const [row] = callback.parameters;
|
|
213
|
+
if (!row || callback.parameters.length !== 1)
|
|
214
|
+
return;
|
|
215
|
+
const rebuilt = keyedRebuiltRecord(callback.body, row.name);
|
|
216
|
+
if (!rebuilt)
|
|
217
|
+
return;
|
|
218
|
+
const binding = host.lookup(statement.target.name);
|
|
219
|
+
if (!binding)
|
|
220
|
+
return;
|
|
221
|
+
host.keyedListRebuilds.push({
|
|
222
|
+
kind: "assignment",
|
|
223
|
+
source: spanIdentity(binding.span),
|
|
224
|
+
name: statement.target.name,
|
|
225
|
+
field: rebuilt.field,
|
|
226
|
+
span: statement.span,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* D89 A4, the wider proven shape: the same churn written as a derived value.
|
|
231
|
+
* `computed rows = source.map(item => {…})` and `computed rows = build(...)`
|
|
232
|
+
* over a `for`/`append` builder both hand a keyed position a fresh record for
|
|
233
|
+
* every row on every recompute, which is exactly what the assignment shape
|
|
234
|
+
* does — the reconciliation wave compiled both and found only one of them
|
|
235
|
+
* named. It is one advisory with a wider proof, not a second code: the defect,
|
|
236
|
+
* the consequence, and the suppression are the same.
|
|
237
|
+
*
|
|
238
|
+
* A `const` in a component body is deliberately not here. It is constructed
|
|
239
|
+
* once, so its records never move, and advising it would be a guess rather
|
|
240
|
+
* than a proof.
|
|
241
|
+
*/
|
|
242
|
+
export function recordDerivedKeyedListRebuild(host, statement) {
|
|
243
|
+
if (!rebuildsRecordsPerElement(host, statement.initializer))
|
|
244
|
+
return;
|
|
245
|
+
host.keyedListRebuilds.push({
|
|
246
|
+
kind: "derived",
|
|
247
|
+
source: spanIdentity(statement.span),
|
|
248
|
+
name: statement.name,
|
|
249
|
+
field: null,
|
|
250
|
+
span: statement.span,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Whether a derived initializer constructs one fresh record per source
|
|
255
|
+
* element. Two spellings are proven and everything else is silent: a `map`
|
|
256
|
+
* whose callback answers a record literal — the same recognizer the
|
|
257
|
+
* assignment shape uses — and a call to a `def` this module declares whose
|
|
258
|
+
* whole answer is a list it filled with record literals.
|
|
259
|
+
*/
|
|
260
|
+
export function rebuildsRecordsPerElement(host, value) {
|
|
261
|
+
if (value.kind !== "CallExpression")
|
|
262
|
+
return false;
|
|
263
|
+
if (value.callee.kind === "MemberExpression" && value.callee.property === "map") {
|
|
264
|
+
const callback = value.arguments[0];
|
|
265
|
+
if (!callback || callback.kind !== "ArrowFunctionExpression" || callback.parameters.length !== 1)
|
|
266
|
+
return false;
|
|
267
|
+
const [row] = callback.parameters;
|
|
268
|
+
return row !== undefined && keyedRebuiltRecord(callback.body, row.name) !== null;
|
|
269
|
+
}
|
|
270
|
+
if (value.callee.kind !== "IdentifierExpression")
|
|
271
|
+
return false;
|
|
272
|
+
const declaration = host.moduleFunctions.get(value.callee.name);
|
|
273
|
+
return declaration !== undefined && declaration !== null && buildsFreshRecords(declaration);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* D89 A4: raises the advisory for the rebuilds whose list a keyed position
|
|
277
|
+
* really renders. The advisory channel cannot reach `this.diagnostics`, so
|
|
278
|
+
* nothing here fails a build, changes an emitted byte, or moves a semantic
|
|
279
|
+
* rule; `// velar-allow A4: <reason>` suppresses it where building the rows is
|
|
280
|
+
* the only spelling, which a `readonly` list or one API response makes it.
|
|
281
|
+
*/
|
|
282
|
+
export function adviseKeyedListRebuilds(host) {
|
|
283
|
+
for (const rebuild of host.keyedListRebuilds) {
|
|
284
|
+
if (!host.keyedListSources.has(rebuild.source))
|
|
285
|
+
continue;
|
|
286
|
+
// The keys do not move; the rows do. `__velarKeyed` finds the entry under
|
|
287
|
+
// the same key and then drops it because the row it holds is no longer
|
|
288
|
+
// the same value, so a message blaming the key sends an author to check
|
|
289
|
+
// `id`, find it unchanged, and conclude the advisory is wrong.
|
|
290
|
+
// A derived value has no row to write: whatever it hands the keyed
|
|
291
|
+
// position it built itself. The two ways out are to render the rows that
|
|
292
|
+
// do have an identity, or to carry those same records through.
|
|
293
|
+
const remedy = rebuild.kind === "derived"
|
|
294
|
+
? "A derived value cannot keep rows it builds: render the source rows and change the field on them in place, or carry the source records through instead of constructing new ones."
|
|
295
|
+
: `Change the field in place instead: '${rebuild.name}[index].${rebuild.field ?? "<field>"} = ...'`;
|
|
296
|
+
host.advise("A4", `This rebuilds every row of '${rebuild.name}'${rebuild.kind === "derived" ? " on every recompute" : ""}, so every row is a new value and the keyed list that renders '${rebuild.name}' no longer recognises any of them: it destroys and rebuilds all of its children — an input being typed into loses focus. ${remedy}`, rebuild.span);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
//# sourceMappingURL=keyed-rebuild.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyed-rebuild.js","sourceRoot":"","sources":["../../src/analysis/keyed-rebuild.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAiC,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAiE,MAAM,iCAAiC,CAAC;AAC9H,OAAO,EAAE,cAAc,EAAsD,MAAM,WAAW,CAAC;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;;;;;;;;;;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WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,IAAI,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAAC;AAC9F,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAsB;IAC5D,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC7C,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,SAAS;QACzD,0EAA0E;QAC1E,uEAAuE;QACvE,wEAAwE;QACxE,+DAA+D;QAC/D,mEAAmE;QACnE,yEAAyE;QACzE,+DAA+D;QAC/D,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,KAAK,SAAS;YACvC,CAAC,CAAC,iLAAiL;YACnL,CAAC,CAAC,uCAAuC,OAAO,CAAC,IAAI,WAAW,OAAO,CAAC,KAAK,IAAI,SAAS,SAAS,CAAC;QACtG,IAAI,CAAC,MAAM,CACT,IAAI,EACJ,+BAA+B,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,kEAAkE,OAAO,CAAC,IAAI,6HAA6H,MAAM,EAAE,EACzT,OAAO,CAAC,IAAI,CACb,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Expression } from "@velarscript/compiler/extension";
|
|
2
|
+
import { type WebKeyframesExpression } from "../ast.ts";
|
|
3
|
+
import { type LookAnalysisHost } from "./look/host.ts";
|
|
4
|
+
export declare function analyzeKeyframes(host: LookAnalysisHost, expression: WebKeyframesExpression): void;
|
|
5
|
+
export declare function reportKeyframeSnapshotReads(host: LookAnalysisHost, expression: Expression): void;
|
|
6
|
+
//# sourceMappingURL=keyframes-analysis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyframes-analysis.d.ts","sourceRoot":"","sources":["../../src/analysis/keyframes-analysis.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAMxD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAkCjG;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAmBhG"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The analysis half of `keyframes:` — the stops, their offsets, and the Look
|
|
3
|
+
* values each stop carries.
|
|
4
|
+
*
|
|
5
|
+
* D115 P4 R3b. It reads the same `LookAnalysisHost` the `look/` family does,
|
|
6
|
+
* because a keyframe stop is a Look value in a position that has no run time:
|
|
7
|
+
* every builder call in it is folded at compile time, so a call the builder
|
|
8
|
+
* check already refused drops its consequence here rather than reporting twice.
|
|
9
|
+
* Named apart from `../keyframes.ts`, which is the CSS lowering.
|
|
10
|
+
*/
|
|
11
|
+
import {} from "@velarscript/compiler";
|
|
12
|
+
import { stringType } from "@velarscript/compiler/extension";
|
|
13
|
+
import {} from "../ast.js";
|
|
14
|
+
import { keyframeCssValue } from "../keyframes.js";
|
|
15
|
+
import { LOOK_NON_ANIMATABLE_PROPERTIES } from "../look.js";
|
|
16
|
+
import { lookLiteralZero, mentionsLookUnitType } from "./look-sites.js";
|
|
17
|
+
import { refusedBuilderCallWithin } from "./look/builders.js";
|
|
18
|
+
import { analyzeLookValue } from "./look/entries.js";
|
|
19
|
+
import {} from "./look/host.js";
|
|
20
|
+
import { reportLookNumberWithoutUnit } from "./look/values.js";
|
|
21
|
+
import { diagnostic, LOOK_PROPERTY_TYPES } from "./web-types.js";
|
|
22
|
+
export function analyzeKeyframes(host, expression) {
|
|
23
|
+
for (const stop of expression.stops) {
|
|
24
|
+
const properties = new Set();
|
|
25
|
+
for (const entry of stop.entries) {
|
|
26
|
+
if (properties.has(entry.name)) {
|
|
27
|
+
host.diagnostics.push(diagnostic("VEL5039", `Keyframe property '${entry.name}' is defined more than once at the same stop`, entry.span));
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
properties.add(entry.name);
|
|
31
|
+
if (LOOK_NON_ANIMATABLE_PROPERTIES.has(entry.name)) {
|
|
32
|
+
host.diagnostics.push(diagnostic("VEL5060", `Look property '${entry.name}' does not participate in animation interpolation`, entry.span));
|
|
33
|
+
host.inferExpression(entry.value);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (!analyzeLookValue(host, entry.name, entry.value, entry.span, null))
|
|
37
|
+
continue;
|
|
38
|
+
const expected = LOOK_PROPERTY_TYPES.get(entry.name) ?? stringType;
|
|
39
|
+
const actual = host.inferExpression(entry.value, expected);
|
|
40
|
+
reportKeyframeSnapshotReads(host, entry.value);
|
|
41
|
+
// LK-I2: a builder that failed its own argument check has already been told what
|
|
42
|
+
// is wrong with it, and "does not resolve to static CSS" is only the consequence —
|
|
43
|
+
// a sentence that sends its author looking for a rule against named arguments in
|
|
44
|
+
// a stop, which there is not (`spread=2px` in range compiles).
|
|
45
|
+
if (keyframeCssValue(entry.value, host.lookStatic.values) === null && !refusedBuilderCallWithin(host, entry.value.span)) {
|
|
46
|
+
host.diagnostics.push(diagnostic("VEL5060", "A keyframe value must resolve to static CSS from literals, unit values, arithmetic, velar/look builders, or const bindings — local or imported — that hold any of those, and the text it resolves to must read as one declaration value: no ';', '{', '}', or '@' outside a string, with parentheses, strings, and comments all closed", entry.value.span));
|
|
47
|
+
}
|
|
48
|
+
if (mentionsLookUnitType(expected) && lookLiteralZero(entry.value))
|
|
49
|
+
continue;
|
|
50
|
+
if (reportLookNumberWithoutUnit(host, entry.name, actual, expected, entry.value.span))
|
|
51
|
+
continue;
|
|
52
|
+
if (actual.kind !== "null" && expected.kind !== "unknown")
|
|
53
|
+
host.requireAssignable(actual, expected, entry.value.span);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export function reportKeyframeSnapshotReads(host, expression) {
|
|
58
|
+
const visit = (value) => {
|
|
59
|
+
if (Array.isArray(value)) {
|
|
60
|
+
value.forEach(visit);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (!value || typeof value !== "object")
|
|
64
|
+
return;
|
|
65
|
+
const record = value;
|
|
66
|
+
if (record.kind === "IdentifierExpression" && typeof record.name === "string") {
|
|
67
|
+
const name = record.name;
|
|
68
|
+
if (host.reactiveBindingKind(name) !== null || host.derivedReactiveRead(name)) {
|
|
69
|
+
host.diagnostics.push(diagnostic("VEL5060", `Keyframes generate static CSS, so reactive '${name}' cannot be read inside a stop; make animation presence dynamic with look:animation={condition ? animate(frames, 1s) : null}`, record.span));
|
|
70
|
+
}
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
for (const [key, child] of Object.entries(record))
|
|
74
|
+
if (key !== "span")
|
|
75
|
+
visit(child);
|
|
76
|
+
};
|
|
77
|
+
visit(expression);
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=keyframes-analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyframes-analysis.js","sourceRoot":"","sources":["../../src/analysis/keyframes-analysis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAa,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAmB,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAA+B,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,M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AAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAAC,OAAO;QAAC,CAAC;QAC3D,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO;QAChD,MAAM,MAAM,GAAG,KAAgC,CAAC;QAChD,IAAI,MAAM,CAAC,IAAI,KAAK,sBAAsB,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC9E,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YACzB,IAAI,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC9E,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAC9B,SAAS,EACT,+CAA+C,IAAI,8HAA8H,EACjL,MAAM,CAAC,IAAY,CACpB,CAAC,CAAC;YACL,CAAC;YACD,OAAO;QACT,CAAC;QACD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,IAAI,GAAG,KAAK,MAAM;gBAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACtF,CAAC,CAAC;IACF,KAAK,CAAC,UAAU,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The compile-time half of the velar/look builders: the numeric domains each
|
|
3
|
+
* one publishes, the animation vocabulary `animate` takes, and the record of
|
|
4
|
+
* which calls were refused on their own arguments.
|
|
5
|
+
*
|
|
6
|
+
* D115 P4 R3b. That record lives with the check that made it because a
|
|
7
|
+
* `keyframes:` stop lowers its builder calls at compile time — no call survives
|
|
8
|
+
* to run the runtime guard, so the stop reads what this file already decided
|
|
9
|
+
* rather than reporting the same argument twice.
|
|
10
|
+
*/
|
|
11
|
+
import { type Span } from "@velarscript/compiler";
|
|
12
|
+
import { type Expression } from "@velarscript/compiler/extension";
|
|
13
|
+
import { type LookAnalysisHost } from "./host.ts";
|
|
14
|
+
/**
|
|
15
|
+
* LOK-U8: the velar/look builders check their numeric domains at run time, so
|
|
16
|
+
* a literal out-of-range colour used to compile clean and blank the page on
|
|
17
|
+
* the first paint. Literal arguments are checked in the same terms while the
|
|
18
|
+
* module compiles; dynamic arguments keep the runtime guard.
|
|
19
|
+
*/
|
|
20
|
+
export declare function checkLookBuilderCall(host: LookAnalysisHost, expression: Extract<Expression, {
|
|
21
|
+
kind: "CallExpression";
|
|
22
|
+
}>): void;
|
|
23
|
+
export declare function checkAnimateBuilderCall(host: LookAnalysisHost, expression: Extract<Expression, {
|
|
24
|
+
kind: "CallExpression";
|
|
25
|
+
}>): void;
|
|
26
|
+
export declare function checkAnimationKeyword(host: LookAnalysisHost, value: Expression | null, name: string, vocabulary: ReadonlySet<string>): void;
|
|
27
|
+
/** Whether a builder call this compile refused on its own arguments lies inside `sourceSpan`. */
|
|
28
|
+
export declare function refusedBuilderCallWithin(host: LookAnalysisHost, sourceSpan: Span): boolean;
|
|
29
|
+
//# sourceMappingURL=builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../src/analysis/look/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,KAAK,UAAU,EAAgB,MAAM,iCAAiC,CAAC;AAMhF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAIlD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAC,GAAG,IAAI,CAyF9H;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAC,GAAG,IAAI,CAgCjI;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CAK3I;AAED,iGAAiG;AACjG,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,GAAG,OAAO,CAE1F"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The compile-time half of the velar/look builders: the numeric domains each
|
|
3
|
+
* one publishes, the animation vocabulary `animate` takes, and the record of
|
|
4
|
+
* which calls were refused on their own arguments.
|
|
5
|
+
*
|
|
6
|
+
* D115 P4 R3b. That record lives with the check that made it because a
|
|
7
|
+
* `keyframes:` stop lowers its builder calls at compile time — no call survives
|
|
8
|
+
* to run the runtime guard, so the stop reads what this file already decided
|
|
9
|
+
* rather than reporting the same argument twice.
|
|
10
|
+
*/
|
|
11
|
+
import {} from "@velarscript/compiler";
|
|
12
|
+
import { spanIdentity } from "@velarscript/compiler/extension";
|
|
13
|
+
import { evaluateLookStaticExpression } from "../../look-static.js";
|
|
14
|
+
import { LOOK_ANIMATION_DIRECTIONS, LOOK_ANIMATION_EASINGS, LOOK_ANIMATION_FILLS, LOOK_BORDER_STYLE_NAMES, LOOK_BUILDER_NUMERIC_RANGES, LOOK_BUILDER_SIGNATURES, LOOK_LENGTH_BUILDERS } from "../../look.js";
|
|
15
|
+
import { teachLookLengthSlot, teachLookPercentageSlot } from "../look-values.js";
|
|
16
|
+
import { lookDurationLiteral, numericLiteral } from "../look-vocabulary-guidance.js";
|
|
17
|
+
import { diagnostic } from "../web-types.js";
|
|
18
|
+
import {} from "./host.js";
|
|
19
|
+
import { checkLookTokenCall, reportLookColorVarReference } from "./tokens.js";
|
|
20
|
+
import { validateLookStringVocabulary } from "./values.js";
|
|
21
|
+
/**
|
|
22
|
+
* LOK-U8: the velar/look builders check their numeric domains at run time, so
|
|
23
|
+
* a literal out-of-range colour used to compile clean and blank the page on
|
|
24
|
+
* the first paint. Literal arguments are checked in the same terms while the
|
|
25
|
+
* module compiles; dynamic arguments keep the runtime guard.
|
|
26
|
+
*/
|
|
27
|
+
export function checkLookBuilderCall(host, expression) {
|
|
28
|
+
const callee = expression.callee.kind === "IdentifierExpression" ? expression.callee.name : "";
|
|
29
|
+
const builder = host.lookBuilderNames.get(callee);
|
|
30
|
+
if (!builder)
|
|
31
|
+
return;
|
|
32
|
+
const key = spanIdentity(expression.span);
|
|
33
|
+
if (host.checkedBuilderCalls.has(key))
|
|
34
|
+
return;
|
|
35
|
+
host.checkedBuilderCalls.add(key);
|
|
36
|
+
if (builder === "animate") {
|
|
37
|
+
checkAnimateBuilderCall(host, expression);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (builder === "token") {
|
|
41
|
+
checkLookTokenCall(host, expression);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const ranges = LOOK_BUILDER_NUMERIC_RANGES.get(builder);
|
|
45
|
+
// A named argument fills the same slot its positional spelling does, so the
|
|
46
|
+
// position comes from the builder's own signature — the one table the
|
|
47
|
+
// module interface, the named-argument arity check, and the `keyframes:`
|
|
48
|
+
// lowering already derive from. Reading `-1` here instead put every check
|
|
49
|
+
// in this loop out of reach of the named spelling, not only the range
|
|
50
|
+
// table: `rgba(0, 0, 0, alpha=2)` compiled clean while `rgba(0, 0, 0, 2)`
|
|
51
|
+
// was refused.
|
|
52
|
+
const parameters = LOOK_BUILDER_SIGNATURES.get(builder)?.parameters;
|
|
53
|
+
// LOK-D3: which slots take a length is the builder's own published type,
|
|
54
|
+
// read from the binding this call resolved through — the declaration core's
|
|
55
|
+
// assignability check refused against — and not a second table of positions.
|
|
56
|
+
const declared = host.expandAliases(host.lookup(callee)?.type ?? { kind: "unknown" });
|
|
57
|
+
const before = host.diagnostics.length;
|
|
58
|
+
let taught = false;
|
|
59
|
+
for (const [index, argument] of expression.arguments.entries()) {
|
|
60
|
+
const named = expression.argumentNames?.[index] ?? null;
|
|
61
|
+
const position = named === null ? index : parameters?.indexOf(named) ?? -1;
|
|
62
|
+
const range = position >= 0 ? ranges?.[position] : undefined;
|
|
63
|
+
// LOK-U8 completed: a `keyframes:` stop lowers its builder calls at
|
|
64
|
+
// compile time, so no call survives to run the runtime guard. Reading the
|
|
65
|
+
// folded value rather than the literal node is what makes the promise
|
|
66
|
+
// "a computed argument keeps the same check" true where the run time the
|
|
67
|
+
// charter names does not exist.
|
|
68
|
+
const folded = evaluateLookStaticExpression(argument, host.lookStatic.values);
|
|
69
|
+
const literal = folded?.kind === "number" ? folded.value : null;
|
|
70
|
+
// D114 P6 item 2 (LK-I3): a slot whose domain carries a unit states its
|
|
71
|
+
// bound in that unit and reads the value out of the unit's own number, so
|
|
72
|
+
// `hsl(200, 120%, 50%)` is refused in the same VEL5042 wording that
|
|
73
|
+
// refused `hsl(200, 120, 50)` before the slot became a `Percentage`.
|
|
74
|
+
const rangeUnit = range?.[3];
|
|
75
|
+
const ranged = rangeUnit === undefined ? literal
|
|
76
|
+
: folded?.kind === "unit" && folded.unit === rangeUnit ? folded.value : null;
|
|
77
|
+
if (range && ranged !== null && (ranged < range[1] || ranged > range[2])) {
|
|
78
|
+
const unit = rangeUnit ?? "";
|
|
79
|
+
host.diagnostics.push(diagnostic("VEL5042", `${range[0]} must be from ${range[1]}${unit} through ${range[2]}${unit}; ${builder} received ${ranged}${unit}`, argument.span));
|
|
80
|
+
}
|
|
81
|
+
if (rangeUnit === "%" && literal !== null && teachLookPercentageSlot(host.diagnostics, range[0], argument, literal, host.lookStatic.sites))
|
|
82
|
+
taught = true;
|
|
83
|
+
const nonNegativeBlur = (builder === "blur" && position === 0) || (builder === "dropShadow" && position === 2);
|
|
84
|
+
if (nonNegativeBlur && folded?.kind === "unit" && folded.value < 0) {
|
|
85
|
+
host.diagnostics.push(diagnostic("VEL5042", `${builder} blur cannot be negative`, argument.span));
|
|
86
|
+
}
|
|
87
|
+
// LOK-D3, builder half: a unitless number in a length position is dead
|
|
88
|
+
// CSS exactly as it is on a property — except in a slot whose own type
|
|
89
|
+
// refuses the number outright, where core's refusal is already the report
|
|
90
|
+
// and gains the remedy rather than a neighbour.
|
|
91
|
+
if (LOOK_LENGTH_BUILDERS.has(builder) && literal !== null
|
|
92
|
+
&& teachLookLengthSlot(host.diagnostics, builder, position, declared, argument, literal, host.lookStatic.sites))
|
|
93
|
+
taught = true;
|
|
94
|
+
if (builder === "border" && position === 2 && argument.kind === "LiteralExpression" && typeof argument.value === "string"
|
|
95
|
+
&& !LOOK_BORDER_STYLE_NAMES.has(argument.value)) {
|
|
96
|
+
host.diagnostics.push(diagnostic("VEL5042", `Border style '${argument.value}' is not a CSS border style; use one of ${[...LOOK_BORDER_STYLE_NAMES].join(", ")}`, argument.span));
|
|
97
|
+
}
|
|
98
|
+
// D60 rule 150 gave `transitionProperty` a real vocabulary and the
|
|
99
|
+
// charter says the builder takes the same one. It took none, so the
|
|
100
|
+
// longhand's refusal taught the camelCase spelling the builder accepted
|
|
101
|
+
// and the browser discarded. Routing the argument through the property's
|
|
102
|
+
// own checker keeps one vocabulary and one message.
|
|
103
|
+
if (builder === "transition" && position === 0) {
|
|
104
|
+
validateLookStringVocabulary(host, "transitionProperty", argument, "The transition builder's property argument");
|
|
105
|
+
}
|
|
106
|
+
// D103 rule 4: one spelling. `color(string)` used to be the only checked
|
|
107
|
+
// Look value that let a design token through, and it let it through as
|
|
108
|
+
// text nobody read — so the same reference was legal on `color` and
|
|
109
|
+
// refused on `width`, and the accepting half checked nothing.
|
|
110
|
+
if (builder === "color" && position === 0)
|
|
111
|
+
reportLookColorVarReference(host, expression, argument);
|
|
112
|
+
}
|
|
113
|
+
if (builder === "tracks" && expression.arguments.length > 1024) {
|
|
114
|
+
host.diagnostics.push(diagnostic("VEL5042", "tracks cannot contain more than 1024 values", expression.span));
|
|
115
|
+
}
|
|
116
|
+
if (builder === "filters" && expression.arguments.length > 64) {
|
|
117
|
+
host.diagnostics.push(diagnostic("VEL5042", "filters cannot compose more than 64 values", expression.span));
|
|
118
|
+
}
|
|
119
|
+
// D114 0.29.0 LK-I2: a call its own argument check refused is recorded so a `keyframes:` stop can drop the consequence. The record is the call rather than the code, because a bad token name and a stop's one-declaration rule are two facts about one value (D103-2) and both are still reported. A slot lesson written *into* core's refusal grows no diagnostic, so it says so itself.
|
|
120
|
+
if (taught || host.diagnostics.length > before)
|
|
121
|
+
host.refusedBuilderCalls.push(expression.span);
|
|
122
|
+
}
|
|
123
|
+
export function checkAnimateBuilderCall(host, expression) {
|
|
124
|
+
const argument = (name, position) => {
|
|
125
|
+
const named = expression.argumentNames?.findIndex((candidate) => candidate === name) ?? -1;
|
|
126
|
+
if (named >= 0)
|
|
127
|
+
return expression.arguments[named] ?? null;
|
|
128
|
+
const sourceName = expression.argumentNames?.[position];
|
|
129
|
+
return sourceName === null || sourceName === undefined ? expression.arguments[position] ?? null : null;
|
|
130
|
+
};
|
|
131
|
+
const duration = argument("duration", 1);
|
|
132
|
+
const delay = argument("delay", 3);
|
|
133
|
+
const count = argument("count", 4);
|
|
134
|
+
const loop = argument("loop", 5);
|
|
135
|
+
const easing = argument("easing", 2);
|
|
136
|
+
const direction = argument("direction", 6);
|
|
137
|
+
const fill = argument("fill", 7);
|
|
138
|
+
const durationValue = lookDurationLiteral(duration);
|
|
139
|
+
const delayValue = lookDurationLiteral(delay);
|
|
140
|
+
if (durationValue !== null && durationValue <= 0) {
|
|
141
|
+
host.diagnostics.push(diagnostic("VEL5060", "Animation duration must be greater than zero", duration.span));
|
|
142
|
+
}
|
|
143
|
+
if (delayValue !== null && delayValue < 0) {
|
|
144
|
+
host.diagnostics.push(diagnostic("VEL5060", "Animation delay cannot be negative", delay.span));
|
|
145
|
+
}
|
|
146
|
+
const countValue = numericLiteral(count);
|
|
147
|
+
if (countValue !== null && (!Number.isInteger(countValue) || countValue <= 0 || countValue > 1_000_000)) {
|
|
148
|
+
host.diagnostics.push(diagnostic("VEL5060", "Animation count must be a positive integer no greater than 1000000", count.span));
|
|
149
|
+
}
|
|
150
|
+
if (count && loop) {
|
|
151
|
+
host.diagnostics.push(diagnostic("VEL5060", "animate accepts either count or loop, not both: count names the number of runs, and loop=true replaces that count with an unbounded one", expression.span));
|
|
152
|
+
}
|
|
153
|
+
checkAnimationKeyword(host, easing, "easing", LOOK_ANIMATION_EASINGS);
|
|
154
|
+
checkAnimationKeyword(host, direction, "direction", LOOK_ANIMATION_DIRECTIONS);
|
|
155
|
+
checkAnimationKeyword(host, fill, "fill", LOOK_ANIMATION_FILLS);
|
|
156
|
+
}
|
|
157
|
+
export function checkAnimationKeyword(host, value, name, vocabulary) {
|
|
158
|
+
if (!value || value.kind !== "LiteralExpression" || typeof value.value !== "string")
|
|
159
|
+
return;
|
|
160
|
+
if (!vocabulary.has(value.value)) {
|
|
161
|
+
host.diagnostics.push(diagnostic("VEL5060", `Animation ${name} '${value.value}' is not supported; use one of ${[...vocabulary].join(", ")}`, value.span));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
/** Whether a builder call this compile refused on its own arguments lies inside `sourceSpan`. */
|
|
165
|
+
export function refusedBuilderCallWithin(host, sourceSpan) {
|
|
166
|
+
return host.refusedBuilderCalls.some((call) => call.start >= sourceSpan.start && call.end <= sourceSpan.end);
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=builders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.js","sourceRoot":"","sources":["../../../src/analysis/look/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAa,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAmB,YAAY,EAAE,MAAM,iCAAiC,CAA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