@pyreon/compiler 0.24.5 → 0.24.6
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/package.json +11 -13
- package/src/defer-inline.ts +0 -686
- package/src/event-names.ts +0 -65
- package/src/index.ts +0 -61
- package/src/island-audit.ts +0 -675
- package/src/jsx.ts +0 -2792
- package/src/load-native.ts +0 -156
- package/src/lpih.ts +0 -270
- package/src/manifest.ts +0 -280
- package/src/project-scanner.ts +0 -214
- package/src/pyreon-intercept.ts +0 -1029
- package/src/react-intercept.ts +0 -1217
- package/src/reactivity-lens.ts +0 -190
- package/src/ssg-audit.ts +0 -513
- package/src/test-audit.ts +0 -435
- package/src/tests/backend-parity-r7-r9.test.ts +0 -91
- package/src/tests/backend-prop-derived-callback-divergence.test.ts +0 -74
- package/src/tests/collapse-bail-census.test.ts +0 -330
- package/src/tests/collapse-key-source-hygiene.test.ts +0 -88
- package/src/tests/component-child-no-wrap.test.ts +0 -204
- package/src/tests/defer-inline.test.ts +0 -387
- package/src/tests/depth-stress.test.ts +0 -16
- package/src/tests/detector-tag-consistency.test.ts +0 -101
- package/src/tests/dynamic-collapse-detector.test.ts +0 -164
- package/src/tests/dynamic-collapse-emit.test.ts +0 -192
- package/src/tests/dynamic-collapse-scan.test.ts +0 -111
- package/src/tests/element-valued-const-child.test.ts +0 -61
- package/src/tests/falsy-child-characterization.test.ts +0 -48
- package/src/tests/island-audit.test.ts +0 -524
- package/src/tests/jsx.test.ts +0 -2908
- package/src/tests/load-native.test.ts +0 -53
- package/src/tests/lpih.test.ts +0 -404
- package/src/tests/malformed-input-resilience.test.ts +0 -50
- package/src/tests/manifest-snapshot.test.ts +0 -55
- package/src/tests/native-equivalence.test.ts +0 -924
- package/src/tests/partial-collapse-detector.test.ts +0 -121
- package/src/tests/partial-collapse-emit.test.ts +0 -104
- package/src/tests/partial-collapse-robustness.test.ts +0 -53
- package/src/tests/project-scanner.test.ts +0 -269
- package/src/tests/prop-derived-shadow.test.ts +0 -96
- package/src/tests/pure-call-reactive-args.test.ts +0 -50
- package/src/tests/pyreon-intercept.test.ts +0 -816
- package/src/tests/r13-callback-stmt-equivalence.test.ts +0 -58
- package/src/tests/r14-ssr-mode-parity.test.ts +0 -51
- package/src/tests/r15-elemconst-propderived.test.ts +0 -47
- package/src/tests/r19-defer-inline-robust.test.ts +0 -54
- package/src/tests/r20-backend-equivalence-sweep.test.ts +0 -50
- package/src/tests/react-intercept.test.ts +0 -1104
- package/src/tests/reactivity-lens.test.ts +0 -170
- package/src/tests/rocketstyle-collapse.test.ts +0 -208
- package/src/tests/runtime/control-flow.test.ts +0 -159
- package/src/tests/runtime/dom-properties.test.ts +0 -138
- package/src/tests/runtime/events.test.ts +0 -301
- package/src/tests/runtime/harness.ts +0 -94
- package/src/tests/runtime/pr-352-shapes.test.ts +0 -121
- package/src/tests/runtime/reactive-props.test.ts +0 -81
- package/src/tests/runtime/signals.test.ts +0 -129
- package/src/tests/runtime/whitespace.test.ts +0 -106
- package/src/tests/signal-autocall-shadow.test.ts +0 -86
- package/src/tests/sourcemap-fidelity.test.ts +0 -77
- package/src/tests/ssg-audit.test.ts +0 -402
- package/src/tests/static-text-baking.test.ts +0 -64
- package/src/tests/test-audit.test.ts +0 -549
- package/src/tests/transform-state-isolation.test.ts +0 -49
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compiler hardening — Round 4 (contract lock; hypothesis disproven = no bug).
|
|
3
|
-
*
|
|
4
|
-
* Hypothesis probed: does a "pure" call (Math.* / JSON.* / Object.* / String /
|
|
5
|
-
* Number — the ~40 fns `isPureStaticCall` treats as side-effect-free) get
|
|
6
|
-
* mis-classified as STATIC when its ARGUMENTS are reactive (signal / prop)?
|
|
7
|
-
* That would silently drop reactivity (the value renders once, never updates).
|
|
8
|
-
*
|
|
9
|
-
* Result: NOT a bug — `shouldWrap`/`isDynamic` correctly inspect arguments, so
|
|
10
|
-
* a pure callee with a dynamic arg is still reactively wrapped. This file is
|
|
11
|
-
* the self-discriminating regression gate for that contract: if someone later
|
|
12
|
-
* "optimizes" pure-call detection to skip wrapping by callee name alone, these
|
|
13
|
-
* specs fail (the exact stale-render bug that optimization would introduce).
|
|
14
|
-
*
|
|
15
|
-
* Bisect: make `isPureStaticCall` short-circuit `shouldWrap` regardless of
|
|
16
|
-
* args → every spec here fails (emit becomes `textContent = Math.max(n(),0)`,
|
|
17
|
-
* no `_bind`). Restore → all pass. The fully-static control proves the gate
|
|
18
|
-
* does not just assert "always reactive".
|
|
19
|
-
*/
|
|
20
|
-
import { describe, expect, it } from 'vitest'
|
|
21
|
-
import { transformJSX_JS } from '../jsx'
|
|
22
|
-
|
|
23
|
-
const emit = (c: string): string => transformJSX_JS(c, 'c.tsx').code ?? ''
|
|
24
|
-
const isReactive = (o: string): boolean => /_bind\(|_bindText\(/.test(o)
|
|
25
|
-
|
|
26
|
-
describe('Round 4 — pure call with a DYNAMIC argument must stay reactive', () => {
|
|
27
|
-
it('Math.max(signal(), 0) is reactively wrapped', () => {
|
|
28
|
-
expect(isReactive(emit(`function C(){ const n=signal(0); return <div>{Math.max(n(),0)}</div> }`))).toBe(true)
|
|
29
|
-
})
|
|
30
|
-
it('Math.round(props.x) is reactively wrapped', () => {
|
|
31
|
-
expect(isReactive(emit(`function C(p){ return <div>{Math.round(p.x)}</div> }`))).toBe(true)
|
|
32
|
-
})
|
|
33
|
-
it('JSON.stringify(props.o) is reactively wrapped', () => {
|
|
34
|
-
expect(isReactive(emit(`function C(p){ return <div>{JSON.stringify(p.o)}</div> }`))).toBe(true)
|
|
35
|
-
})
|
|
36
|
-
it('Object.keys(props.o).length is reactively wrapped', () => {
|
|
37
|
-
expect(isReactive(emit(`function C(p){ return <div>{Object.keys(p.o).length}</div> }`))).toBe(true)
|
|
38
|
-
})
|
|
39
|
-
it('String(props.x) is reactively wrapped', () => {
|
|
40
|
-
expect(isReactive(emit(`function C(p){ return <div>{String(p.x)}</div> }`))).toBe(true)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
// Control: a pure call with ONLY static args is correctly STATIC (proves
|
|
44
|
-
// the gate is not vacuously "everything is reactive").
|
|
45
|
-
it('Math.max(1,2,3) with only static args is NOT wrapped', () => {
|
|
46
|
-
const o = emit(`function C(){ return <div>{Math.max(1,2,3)}</div> }`)
|
|
47
|
-
expect(isReactive(o)).toBe(false)
|
|
48
|
-
expect(o).toContain('textContent = Math.max(1,2,3)')
|
|
49
|
-
})
|
|
50
|
-
})
|