@pyreon/compiler 0.15.0 → 0.18.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 +17 -0
- package/lib/analysis/index.js.html +1 -1
- package/lib/index.js +1314 -21
- package/lib/types/index.d.ts +167 -2
- package/package.json +15 -5
- package/src/defer-inline.ts +446 -0
- package/src/index.ts +19 -0
- package/src/island-audit.ts +675 -0
- package/src/jsx.ts +68 -33
- package/src/load-native.ts +155 -0
- package/src/pyreon-intercept.ts +127 -1
- package/src/ssg-audit.ts +513 -0
- package/src/tests/defer-inline.test.ts +199 -0
- package/src/tests/detector-tag-consistency.test.ts +28 -15
- package/src/tests/island-audit.test.ts +524 -0
- package/src/tests/jsx.test.ts +23 -3
- package/src/tests/load-native.test.ts +53 -0
- package/src/tests/pyreon-intercept.test.ts +141 -0
- package/src/tests/ssg-audit.test.ts +402 -0
package/README.md
CHANGED
|
@@ -54,6 +54,7 @@ const App = () => <div>{_$h0}</div>
|
|
|
54
54
|
|
|
55
55
|
- **`transformJSX(code, filename?, options?): TransformResult`** -- Transforms JSX source code. Uses the Rust native binary when available, falls back to JS.
|
|
56
56
|
- **`transformJSX_JS(code, filename?, options?): TransformResult`** -- JS-only transform (bypasses native binary). Useful for debugging or cross-backend testing.
|
|
57
|
+
- **`loadNativeBinding(): NativeBinding | null`** -- Resolve the native `.node` binding via two paths: (1) in-tree at `packages/core/compiler/native/` (workspace-internal), (2) per-platform npm package (`@pyreon/compiler-<platform>-<arch>[-<libc>]`). Returns `null` when neither path resolves; `transformJSX()` then falls through to the JS path silently.
|
|
57
58
|
|
|
58
59
|
### Types
|
|
59
60
|
|
|
@@ -68,6 +69,22 @@ const App = () => <div>{_$h0}</div>
|
|
|
68
69
|
- **JS fallback** (`src/jsx.ts`): uses `oxc-parser` (Rust NAPI binding) for parsing + JS reactive pass. Activated automatically when the native binary isn't available.
|
|
69
70
|
- **Auto-detection**: `transformJSX()` loads the native binary via `createRequire` (ESM-safe), falls back per-call with try/catch.
|
|
70
71
|
|
|
72
|
+
### Per-platform packages
|
|
73
|
+
|
|
74
|
+
The native binary ships as **separate optional dependencies**, one per platform. npm / bun installs only the matching one for the consumer's platform via `os` / `cpu` fields in each platform package's manifest:
|
|
75
|
+
|
|
76
|
+
| Platform | Arch | libc | Package |
|
|
77
|
+
| -------- | ------- | ------ | ------------------------------------ |
|
|
78
|
+
| darwin | arm64 | — | `@pyreon/compiler-darwin-arm64` |
|
|
79
|
+
| darwin | x64 | — | `@pyreon/compiler-darwin-x64` |
|
|
80
|
+
| linux | x64 | gnu | `@pyreon/compiler-linux-x64-gnu` |
|
|
81
|
+
| linux | x64 | musl | `@pyreon/compiler-linux-x64-musl` |
|
|
82
|
+
| linux | arm64 | gnu | `@pyreon/compiler-linux-arm64-gnu` |
|
|
83
|
+
| linux | arm64 | musl | `@pyreon/compiler-linux-arm64-musl` |
|
|
84
|
+
| win32 | x64 | — | `@pyreon/compiler-win32-x64-msvc` |
|
|
85
|
+
|
|
86
|
+
`detectLibc()` distinguishes glibc vs musl on Linux at load time (the wrong libc silently fails to load, doesn't throw). If neither the in-tree binary nor the per-platform package is available (CI without the package, WASM, unsupported platform), the loader returns `null` and `transformJSX()` uses the JS path — no error.
|
|
87
|
+
|
|
71
88
|
## Implementation Notes
|
|
72
89
|
|
|
73
90
|
- Props named `key` and `ref` are never wrapped.
|
|
@@ -5386,7 +5386,7 @@ var drawChart = (function (exports) {
|
|
|
5386
5386
|
</script>
|
|
5387
5387
|
<script>
|
|
5388
5388
|
/*<!--*/
|
|
5389
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"
|
|
5389
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"2a48c34b-1","name":"defer-inline.ts"},{"uid":"2a48c34b-3","name":"event-names.ts"},{"uid":"2a48c34b-5","name":"load-native.ts"},{"uid":"2a48c34b-7","name":"jsx.ts"},{"uid":"2a48c34b-9","name":"project-scanner.ts"},{"uid":"2a48c34b-11","name":"react-intercept.ts"},{"uid":"2a48c34b-13","name":"pyreon-intercept.ts"},{"uid":"2a48c34b-15","name":"test-audit.ts"},{"uid":"2a48c34b-17","name":"island-audit.ts"},{"uid":"2a48c34b-19","name":"ssg-audit.ts"},{"uid":"2a48c34b-21","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"2a48c34b-1":{"renderedLength":10244,"gzipLength":3722,"brotliLength":0,"metaUid":"2a48c34b-0"},"2a48c34b-3":{"renderedLength":2941,"gzipLength":1335,"brotliLength":0,"metaUid":"2a48c34b-2"},"2a48c34b-5":{"renderedLength":3959,"gzipLength":1744,"brotliLength":0,"metaUid":"2a48c34b-4"},"2a48c34b-7":{"renderedLength":45561,"gzipLength":11025,"brotliLength":0,"metaUid":"2a48c34b-6"},"2a48c34b-9":{"renderedLength":4762,"gzipLength":1730,"brotliLength":0,"metaUid":"2a48c34b-8"},"2a48c34b-11":{"renderedLength":27698,"gzipLength":6923,"brotliLength":0,"metaUid":"2a48c34b-10"},"2a48c34b-13":{"renderedLength":24221,"gzipLength":7766,"brotliLength":0,"metaUid":"2a48c34b-12"},"2a48c34b-15":{"renderedLength":13167,"gzipLength":5060,"brotliLength":0,"metaUid":"2a48c34b-14"},"2a48c34b-17":{"renderedLength":18208,"gzipLength":6051,"brotliLength":0,"metaUid":"2a48c34b-16"},"2a48c34b-19":{"renderedLength":12753,"gzipLength":4173,"brotliLength":0,"metaUid":"2a48c34b-18"},"2a48c34b-21":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"2a48c34b-20"}},"nodeMetas":{"2a48c34b-0":{"id":"/src/defer-inline.ts","moduleParts":{"index.js":"2a48c34b-1"},"imported":[{"uid":"2a48c34b-22"}],"importedBy":[{"uid":"2a48c34b-20"}]},"2a48c34b-2":{"id":"/src/event-names.ts","moduleParts":{"index.js":"2a48c34b-3"},"imported":[],"importedBy":[{"uid":"2a48c34b-6"}]},"2a48c34b-4":{"id":"/src/load-native.ts","moduleParts":{"index.js":"2a48c34b-5"},"imported":[{"uid":"2a48c34b-26"},{"uid":"2a48c34b-27"},{"uid":"2a48c34b-24"}],"importedBy":[{"uid":"2a48c34b-6"}]},"2a48c34b-6":{"id":"/src/jsx.ts","moduleParts":{"index.js":"2a48c34b-7"},"imported":[{"uid":"2a48c34b-22"},{"uid":"2a48c34b-2"},{"uid":"2a48c34b-4"}],"importedBy":[{"uid":"2a48c34b-20"}]},"2a48c34b-8":{"id":"/src/project-scanner.ts","moduleParts":{"index.js":"2a48c34b-9"},"imported":[{"uid":"2a48c34b-23"},{"uid":"2a48c34b-24"}],"importedBy":[{"uid":"2a48c34b-20"}]},"2a48c34b-10":{"id":"/src/react-intercept.ts","moduleParts":{"index.js":"2a48c34b-11"},"imported":[{"uid":"2a48c34b-25"}],"importedBy":[{"uid":"2a48c34b-20"}]},"2a48c34b-12":{"id":"/src/pyreon-intercept.ts","moduleParts":{"index.js":"2a48c34b-13"},"imported":[{"uid":"2a48c34b-25"}],"importedBy":[{"uid":"2a48c34b-20"}]},"2a48c34b-14":{"id":"/src/test-audit.ts","moduleParts":{"index.js":"2a48c34b-15"},"imported":[{"uid":"2a48c34b-23"},{"uid":"2a48c34b-24"}],"importedBy":[{"uid":"2a48c34b-20"}]},"2a48c34b-16":{"id":"/src/island-audit.ts","moduleParts":{"index.js":"2a48c34b-17"},"imported":[{"uid":"2a48c34b-23"},{"uid":"2a48c34b-24"},{"uid":"2a48c34b-25"}],"importedBy":[{"uid":"2a48c34b-20"}]},"2a48c34b-18":{"id":"/src/ssg-audit.ts","moduleParts":{"index.js":"2a48c34b-19"},"imported":[{"uid":"2a48c34b-23"},{"uid":"2a48c34b-24"},{"uid":"2a48c34b-25"}],"importedBy":[{"uid":"2a48c34b-20"}]},"2a48c34b-20":{"id":"/src/index.ts","moduleParts":{"index.js":"2a48c34b-21"},"imported":[{"uid":"2a48c34b-0"},{"uid":"2a48c34b-6"},{"uid":"2a48c34b-8"},{"uid":"2a48c34b-10"},{"uid":"2a48c34b-12"},{"uid":"2a48c34b-14"},{"uid":"2a48c34b-16"},{"uid":"2a48c34b-18"}],"importedBy":[],"isEntry":true},"2a48c34b-22":{"id":"oxc-parser","moduleParts":{},"imported":[],"importedBy":[{"uid":"2a48c34b-0"},{"uid":"2a48c34b-6"}]},"2a48c34b-23":{"id":"node:fs","moduleParts":{},"imported":[],"importedBy":[{"uid":"2a48c34b-8"},{"uid":"2a48c34b-14"},{"uid":"2a48c34b-16"},{"uid":"2a48c34b-18"}]},"2a48c34b-24":{"id":"node:path","moduleParts":{},"imported":[],"importedBy":[{"uid":"2a48c34b-8"},{"uid":"2a48c34b-14"},{"uid":"2a48c34b-16"},{"uid":"2a48c34b-18"},{"uid":"2a48c34b-4"}]},"2a48c34b-25":{"id":"typescript","moduleParts":{},"imported":[],"importedBy":[{"uid":"2a48c34b-10"},{"uid":"2a48c34b-12"},{"uid":"2a48c34b-16"},{"uid":"2a48c34b-18"}]},"2a48c34b-26":{"id":"node:module","moduleParts":{},"imported":[],"importedBy":[{"uid":"2a48c34b-4"}]},"2a48c34b-27":{"id":"node:url","moduleParts":{},"imported":[],"importedBy":[{"uid":"2a48c34b-4"}]}},"env":{"rollup":"4.23.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
5390
5390
|
|
|
5391
5391
|
const run = () => {
|
|
5392
5392
|
const width = window.innerWidth;
|