@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.
Files changed (64) hide show
  1. package/package.json +11 -13
  2. package/src/defer-inline.ts +0 -686
  3. package/src/event-names.ts +0 -65
  4. package/src/index.ts +0 -61
  5. package/src/island-audit.ts +0 -675
  6. package/src/jsx.ts +0 -2792
  7. package/src/load-native.ts +0 -156
  8. package/src/lpih.ts +0 -270
  9. package/src/manifest.ts +0 -280
  10. package/src/project-scanner.ts +0 -214
  11. package/src/pyreon-intercept.ts +0 -1029
  12. package/src/react-intercept.ts +0 -1217
  13. package/src/reactivity-lens.ts +0 -190
  14. package/src/ssg-audit.ts +0 -513
  15. package/src/test-audit.ts +0 -435
  16. package/src/tests/backend-parity-r7-r9.test.ts +0 -91
  17. package/src/tests/backend-prop-derived-callback-divergence.test.ts +0 -74
  18. package/src/tests/collapse-bail-census.test.ts +0 -330
  19. package/src/tests/collapse-key-source-hygiene.test.ts +0 -88
  20. package/src/tests/component-child-no-wrap.test.ts +0 -204
  21. package/src/tests/defer-inline.test.ts +0 -387
  22. package/src/tests/depth-stress.test.ts +0 -16
  23. package/src/tests/detector-tag-consistency.test.ts +0 -101
  24. package/src/tests/dynamic-collapse-detector.test.ts +0 -164
  25. package/src/tests/dynamic-collapse-emit.test.ts +0 -192
  26. package/src/tests/dynamic-collapse-scan.test.ts +0 -111
  27. package/src/tests/element-valued-const-child.test.ts +0 -61
  28. package/src/tests/falsy-child-characterization.test.ts +0 -48
  29. package/src/tests/island-audit.test.ts +0 -524
  30. package/src/tests/jsx.test.ts +0 -2908
  31. package/src/tests/load-native.test.ts +0 -53
  32. package/src/tests/lpih.test.ts +0 -404
  33. package/src/tests/malformed-input-resilience.test.ts +0 -50
  34. package/src/tests/manifest-snapshot.test.ts +0 -55
  35. package/src/tests/native-equivalence.test.ts +0 -924
  36. package/src/tests/partial-collapse-detector.test.ts +0 -121
  37. package/src/tests/partial-collapse-emit.test.ts +0 -104
  38. package/src/tests/partial-collapse-robustness.test.ts +0 -53
  39. package/src/tests/project-scanner.test.ts +0 -269
  40. package/src/tests/prop-derived-shadow.test.ts +0 -96
  41. package/src/tests/pure-call-reactive-args.test.ts +0 -50
  42. package/src/tests/pyreon-intercept.test.ts +0 -816
  43. package/src/tests/r13-callback-stmt-equivalence.test.ts +0 -58
  44. package/src/tests/r14-ssr-mode-parity.test.ts +0 -51
  45. package/src/tests/r15-elemconst-propderived.test.ts +0 -47
  46. package/src/tests/r19-defer-inline-robust.test.ts +0 -54
  47. package/src/tests/r20-backend-equivalence-sweep.test.ts +0 -50
  48. package/src/tests/react-intercept.test.ts +0 -1104
  49. package/src/tests/reactivity-lens.test.ts +0 -170
  50. package/src/tests/rocketstyle-collapse.test.ts +0 -208
  51. package/src/tests/runtime/control-flow.test.ts +0 -159
  52. package/src/tests/runtime/dom-properties.test.ts +0 -138
  53. package/src/tests/runtime/events.test.ts +0 -301
  54. package/src/tests/runtime/harness.ts +0 -94
  55. package/src/tests/runtime/pr-352-shapes.test.ts +0 -121
  56. package/src/tests/runtime/reactive-props.test.ts +0 -81
  57. package/src/tests/runtime/signals.test.ts +0 -129
  58. package/src/tests/runtime/whitespace.test.ts +0 -106
  59. package/src/tests/signal-autocall-shadow.test.ts +0 -86
  60. package/src/tests/sourcemap-fidelity.test.ts +0 -77
  61. package/src/tests/ssg-audit.test.ts +0 -402
  62. package/src/tests/static-text-baking.test.ts +0 -64
  63. package/src/tests/test-audit.test.ts +0 -549
  64. package/src/tests/transform-state-isolation.test.ts +0 -49
@@ -1,65 +0,0 @@
1
- /**
2
- * React-style → DOM event-name remap.
3
- *
4
- * The compiler translates JSX event handler attributes (`onClick`,
5
- * `onMouseEnter`, ...) to DOM event names by stripping the `on` prefix
6
- * and lowercasing. That rule covers MOST React event-name conventions
7
- * because the underlying DOM event name happens to be the lowercased
8
- * multi-word form (e.g. `onKeyDown` → `keydown`, `onMouseEnter` →
9
- * `mouseenter`, `onPointerLeave` → `pointerleave`,
10
- * `onAnimationStart` → `animationstart`, `onContextMenu` → `contextmenu`).
11
- *
12
- * **The exceptions** — where lowercasing produces the WRONG DOM event
13
- * name — are listed in `REACT_EVENT_REMAP` below. Each entry maps the
14
- * lowercased React form to the actual DOM event name.
15
- *
16
- * Today there is exactly ONE remap: `doubleclick → dblclick`. React
17
- * inherits this mismatch from the DOM spec — `dblclick` is the canonical
18
- * event name (RFC at `https://dom.spec.whatwg.org/#interface-mouseevent`),
19
- * while React's component-prop convention is the `onDoubleClick` shape.
20
- *
21
- * **Audit completeness.** The full React event-prop list from
22
- * `https://react.dev/reference/react-dom/components/common` was checked
23
- * against canonical DOM event names. Every multi-word event other than
24
- * `onDoubleClick` lowercases correctly:
25
- * - Pointer family: `onPointerDown` → `pointerdown`, `onGotPointerCapture` → `gotpointercapture`, …
26
- * - Mouse family: `onMouseEnter` → `mouseenter`, `onMouseLeave` → `mouseleave`, …
27
- * - Drag family: `onDragStart` → `dragstart`, `onDragEnd` → `dragend`, …
28
- * - Touch family: `onTouchStart` → `touchstart`, `onTouchEnd` → `touchend`, …
29
- * - Composition family: `onCompositionEnd` → `compositionend`, …
30
- * - Animation/transition: `onAnimationStart` → `animationstart`, `onTransitionEnd` → `transitionend`, …
31
- * - Media family: `onCanPlayThrough` → `canplaythrough`, `onLoadedData` → `loadeddata`, `onTimeUpdate` → `timeupdate`, `onVolumeChange` → `volumechange`, …
32
- * - Form family: `onContextMenu` → `contextmenu`, `onBeforeInput` → `beforeinput`, …
33
- *
34
- * If a future React release adds a new event-prop with a non-trivial
35
- * mismatch, append the entry here. Both compiler backends (JS and Rust)
36
- * read the same shape — the Rust port lives in `native/src/lib.rs` next
37
- * to `emit_event_listener`. Keep them in sync.
38
- *
39
- * **Testing.** `packages/core/compiler/src/tests/runtime/events.test.ts`
40
- * exercises this table end-to-end via a real-Chromium harness:
41
- * - `onDoubleClick fires (multi-word + delegated)` — locks in the remap.
42
- * - `onContextMenu fires (multi-word, lowercases to contextmenu)` —
43
- * locks in the no-remap default for an adjacent multi-word event.
44
- * - `event-name-remap-table sanity` — asserts that every entry in
45
- * `REACT_EVENT_REMAP` has a corresponding runtime test.
46
- */
47
- export const REACT_EVENT_REMAP: Readonly<Record<string, string>> = Object.freeze({
48
- doubleclick: 'dblclick',
49
- })
50
-
51
- /**
52
- * Translate a React-style event prop name (`onDoubleClick`) to the
53
- * canonical DOM event name (`dblclick`). Returns null for non-event
54
- * attribute names (anything not starting with `on` or shorter than 3
55
- * characters — single-letter `on*` props don't correspond to DOM events).
56
- *
57
- * The compiler uses the returned name in two emission shapes:
58
- * - Delegated events (in `DELEGATED_EVENTS`): `el.__ev_${eventName} = handler`
59
- * - Direct listeners: `el.addEventListener("${eventName}", handler)`
60
- */
61
- export function reactEventToDom(attrName: string): string | null {
62
- if (attrName.length <= 2 || !attrName.startsWith('on')) return null
63
- const lower = attrName.slice(2).toLowerCase()
64
- return REACT_EVENT_REMAP[lower] ?? lower
65
- }
package/src/index.ts DELETED
@@ -1,61 +0,0 @@
1
- // @pyreon/compiler — JSX reactive transform for Pyreon
2
-
3
- export type { DeferInlineResult, DeferInlineWarning } from './defer-inline'
4
- export { transformDeferInline } from './defer-inline'
5
- export type {
6
- CompilerWarning,
7
- ReactivityKind,
8
- ReactivitySpan,
9
- TransformResult,
10
- } from './jsx'
11
- export { transformJSX, transformJSX_JS, rocketstyleCollapseKey, scanCollapsibleSites } from './jsx'
12
- export type { CollapsibleSite } from './jsx'
13
- export type {
14
- AnalyzeReactivityResult,
15
- ReactivityFinding,
16
- ReactivityFindingKind,
17
- } from './reactivity-lens'
18
- export { analyzeReactivity, formatReactivityLens } from './reactivity-lens'
19
- export type { LPIHFireDatum, LPIHMergeOptions } from './lpih'
20
- export { firesToCreationSiteFindings, mergeFireDataIntoFindings } from './lpih'
21
- export type { ComponentInfo, IslandInfo, ProjectContext, RouteInfo } from './project-scanner'
22
- export { generateContext } from './project-scanner'
23
- export type {
24
- ErrorDiagnosis,
25
- MigrationChange,
26
- MigrationResult,
27
- ReactDiagnostic,
28
- ReactDiagnosticCode,
29
- } from './react-intercept'
30
- export {
31
- detectReactPatterns,
32
- diagnoseError,
33
- hasReactPatterns,
34
- migrateReactCode,
35
- } from './react-intercept'
36
- export type { PyreonDiagnostic, PyreonDiagnosticCode } from './pyreon-intercept'
37
- export { detectPyreonPatterns, hasPyreonPatterns } from './pyreon-intercept'
38
- export type {
39
- AuditFormatOptions,
40
- AuditRisk,
41
- TestAuditEntry,
42
- TestAuditResult,
43
- } from './test-audit'
44
- export { auditTestEnvironment, formatTestAudit } from './test-audit'
45
- export type {
46
- IslandAuditFormatOptions,
47
- IslandAuditResult,
48
- IslandFinding,
49
- IslandFindingCode,
50
- IslandLocation,
51
- } from './island-audit'
52
- export { auditIslands, formatIslandAudit } from './island-audit'
53
- // M3.4 — `pyreon doctor --check-ssg` audit.
54
- export type {
55
- SsgAuditFormatOptions,
56
- SsgAuditResult,
57
- SsgFinding,
58
- SsgFindingCode,
59
- SsgLocation,
60
- } from './ssg-audit'
61
- export { auditSsg, formatSsgAudit } from './ssg-audit'