embedded-react 0.18.0 → 0.19.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/NOTICE +1 -1
- package/README.md +1 -1
- package/aot/compile.mjs +2 -2
- package/aot/screenshot-smoke.mjs +3 -3
- package/assets/build-builtin-font.mjs +3 -3
- package/assets/emit-c.mjs +6 -4
- package/assets/emit-container.mjs +1 -1
- package/build.mjs +2 -2
- package/compile-bin.mjs +2 -2
- package/hotreload/protocol.mjs +1 -1
- package/pack-container.mjs +3 -3
- package/package.json +7 -7
- package/sim/embedded-react.wasm +0 -0
- package/src/embedded-react/FlatList.js +1 -1
package/NOTICE
CHANGED
|
@@ -48,7 +48,7 @@ under their own respective licenses and copyrights:
|
|
|
48
48
|
Used by the Flow A bridge to drive the native engine.
|
|
49
49
|
|
|
50
50
|
The embedded-react public API (e.g. the View / Text / Pressable / Animated /
|
|
51
|
-
StyleSheet modules under
|
|
51
|
+
StyleSheet modules under packages/embedded-react/src/embedded-react/) is an original,
|
|
52
52
|
independent reimplementation inspired by the React Native API surface. It is not
|
|
53
53
|
derived from or copied out of React Native's source, and is the original work of
|
|
54
54
|
Cory Lamming.
|
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ The package is the React Native analog: hooks come from `react`, everything else
|
|
|
52
52
|
|
|
53
53
|
## Part of a monorepo
|
|
54
54
|
|
|
55
|
-
This package is the `
|
|
55
|
+
This package is the `packages/embedded-react` folder of the
|
|
56
56
|
[Embedded React](https://github.com/TheMasterCoder007/embedded-react) repository. The C engine, the
|
|
57
57
|
hardware backends, the board examples, the demo apps and the simulators live there, and the engine is
|
|
58
58
|
distributed separately as C source (CMake `FetchContent`, the ESP-IDF Component Registry, PlatformIO)
|
package/aot/compile.mjs
CHANGED
|
@@ -84,8 +84,8 @@ import { inferWideSlots, sameSlotWidths } from './compiler/expressions.mjs';
|
|
|
84
84
|
/*----------------------------------------------------------------------------------------------------------------------
|
|
85
85
|
- Constants
|
|
86
86
|
---------------------------------------------------------------------------------------------------------------------*/
|
|
87
|
-
const aotDir = dirname(fileURLToPath(import.meta.url)); //
|
|
88
|
-
const repoRoot = resolve(aotDir, '
|
|
87
|
+
const aotDir = dirname(fileURLToPath(import.meta.url)); // packages/embedded-react/aot
|
|
88
|
+
const repoRoot = resolve(aotDir, '../../..');
|
|
89
89
|
const demosDir = resolve(repoRoot, 'demos');
|
|
90
90
|
const distDir = resolve(aotDir, '..', 'dist');
|
|
91
91
|
/*----------------------------------------------------------------------------------------------------------------------
|
package/aot/screenshot-smoke.mjs
CHANGED
|
@@ -32,9 +32,9 @@ import {existsSync, mkdirSync, readFileSync, rmSync} from 'node:fs';
|
|
|
32
32
|
import {resolve, dirname} from 'node:path';
|
|
33
33
|
import {fileURLToPath} from 'node:url';
|
|
34
34
|
|
|
35
|
-
const here = dirname(fileURLToPath(import.meta.url)); //
|
|
36
|
-
const jsDir = resolve(here, '..'); //
|
|
37
|
-
const repoRoot = resolve(here, '
|
|
35
|
+
const here = dirname(fileURLToPath(import.meta.url)); // packages/embedded-react/aot
|
|
36
|
+
const jsDir = resolve(here, '..'); // packages/embedded-react
|
|
37
|
+
const repoRoot = resolve(here, '../../..');
|
|
38
38
|
const exampleDir = resolve(repoRoot, 'examples/linux-aot');
|
|
39
39
|
const buildDir = resolve(exampleDir, 'build');
|
|
40
40
|
const exe = resolve(
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// (there is no Python step). font_registry.c falls back to g_inter_sizes[] for any text without a
|
|
20
20
|
// matching custom family.
|
|
21
21
|
//
|
|
22
|
-
// cd
|
|
22
|
+
// cd packages/embedded-react && npm run build:builtin-font
|
|
23
23
|
//
|
|
24
24
|
// Regenerating changes glyph metrics slightly vs a prior rasterizer, so re-run the engine text tests
|
|
25
25
|
// (test_text, yoga_parity) and re-flash to eyeball on-device after changing it.
|
|
@@ -29,8 +29,8 @@ import {writeFileSync} from 'node:fs';
|
|
|
29
29
|
import {bakeFont, BUILTIN_EXTRAS, BUILTIN_SIZES} from './bake-font.mjs';
|
|
30
30
|
import {emitBuiltinFont} from './emit-c.mjs';
|
|
31
31
|
|
|
32
|
-
const here = dirname(fileURLToPath(import.meta.url)); //
|
|
33
|
-
const repoRoot = resolve(here, '
|
|
32
|
+
const here = dirname(fileURLToPath(import.meta.url)); // packages/embedded-react/assets
|
|
33
|
+
const repoRoot = resolve(here, '../../..');
|
|
34
34
|
const FONT = resolve(repoRoot, 'assets/fonts/Inter-Regular.ttf');
|
|
35
35
|
const OUT = resolve(repoRoot, 'engine/font/font_data.c');
|
|
36
36
|
|
package/assets/emit-c.mjs
CHANGED
|
@@ -55,7 +55,7 @@ function glyphInit(g) {
|
|
|
55
55
|
export function emitAssetsC({headerName, images = [], fonts = []}) {
|
|
56
56
|
const guard = 'ER_' + cIdent(headerName).toUpperCase();
|
|
57
57
|
const h =
|
|
58
|
-
`/* Generated by
|
|
58
|
+
`/* Generated by packages/embedded-react/assets — DO NOT EDIT. */\n` +
|
|
59
59
|
`#ifndef ${guard}\n#define ${guard}\n\n` +
|
|
60
60
|
`#ifdef __cplusplus\nextern "C"\n{\n#endif\n\n` +
|
|
61
61
|
` /** @brief Registers every baked image and font with the engine (call once at boot, after\n` +
|
|
@@ -65,7 +65,9 @@ export function emitAssetsC({headerName, images = [], fonts = []}) {
|
|
|
65
65
|
`#endif\n`;
|
|
66
66
|
|
|
67
67
|
const lines = [];
|
|
68
|
-
lines.push(
|
|
68
|
+
lines.push(
|
|
69
|
+
`/* Generated by packages/embedded-react/assets — DO NOT EDIT. */`,
|
|
70
|
+
);
|
|
69
71
|
lines.push(
|
|
70
72
|
`/* Images: premultiplied ARGB8888 (or RGB565 when baked 16-bit), referenced by pointer. Fonts: baked BitmapFont per size. */`,
|
|
71
73
|
);
|
|
@@ -206,12 +208,12 @@ export function emitBuiltinFont({font, symbol = 'inter', sourceName = ''}) {
|
|
|
206
208
|
const bpp = font.sizes[0] ? font.sizes[0].bpp : 4;
|
|
207
209
|
const lines = [];
|
|
208
210
|
lines.push(
|
|
209
|
-
`/* AUTO-GENERATED by
|
|
211
|
+
`/* AUTO-GENERATED by packages/embedded-react/assets/build-builtin-font.mjs — do not edit by hand.`,
|
|
210
212
|
);
|
|
211
213
|
lines.push(` * Source : ${sourceName}`);
|
|
212
214
|
lines.push(` * Sizes : ${sizesStr} (bpp ${bpp}, family "${font.family}")`);
|
|
213
215
|
lines.push(
|
|
214
|
-
` * Regenerate: cd
|
|
216
|
+
` * Regenerate: cd packages/embedded-react && npm run build:builtin-font`,
|
|
215
217
|
);
|
|
216
218
|
lines.push(` */`);
|
|
217
219
|
lines.push(`#include "font_bitmap.h"`);
|
|
@@ -57,7 +57,7 @@ export const SECTION_VENDOR_BYTECODE = 3;
|
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* CRC-32/IEEE (zlib polynomial 0xEDB88320), computed without a lookup table to match er_crc32() in
|
|
60
|
-
*
|
|
60
|
+
* runtime/er_container.c byte-for-byte — the one checksum of the whole delivery pipeline (this
|
|
61
61
|
* container, the hot-reload transport frame that carries it, and the device's verification of both).
|
|
62
62
|
* hotreload/protocol.mjs imports this rather than keeping its own.
|
|
63
63
|
*
|
package/build.mjs
CHANGED
|
@@ -35,8 +35,8 @@ import {resolveFontJobs} from './assets/font-config.mjs';
|
|
|
35
35
|
import {analyzeFontSizes} from './assets/font-sizes.mjs';
|
|
36
36
|
import {registerSvgVectorLoader} from './assets/svg-loader.mjs';
|
|
37
37
|
|
|
38
|
-
const here = dirname(fileURLToPath(import.meta.url)); //
|
|
39
|
-
const repoRoot = resolve(here, '
|
|
38
|
+
const here = dirname(fileURLToPath(import.meta.url)); // packages/embedded-react
|
|
39
|
+
const repoRoot = resolve(here, '../..');
|
|
40
40
|
const demosDir = resolve(repoRoot, 'demos');
|
|
41
41
|
const libEntry = resolve(here, 'src/embedded-react/index.js');
|
|
42
42
|
const nodeModules = resolve(here, 'node_modules');
|
package/compile-bin.mjs
CHANGED
|
@@ -24,8 +24,8 @@ import {existsSync} from 'node:fs';
|
|
|
24
24
|
import {dirname, resolve} from 'node:path';
|
|
25
25
|
import {fileURLToPath} from 'node:url';
|
|
26
26
|
|
|
27
|
-
const here = dirname(fileURLToPath(import.meta.url)); //
|
|
28
|
-
const repoRoot = resolve(here, '
|
|
27
|
+
const here = dirname(fileURLToPath(import.meta.url)); // packages/embedded-react
|
|
28
|
+
const repoRoot = resolve(here, '../..');
|
|
29
29
|
const exe = process.platform === 'win32' ? '.exe' : '';
|
|
30
30
|
|
|
31
31
|
const SEARCH_DIRS = [
|
package/hotreload/protocol.mjs
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
// payload_crc u32 — CRC-32/IEEE over the payload (same polynomial as ERCF / the C loader)
|
|
35
35
|
// payload bytes[payload_len] — the .erpkg (ERCF container)
|
|
36
36
|
//
|
|
37
|
-
// The mirror of this lives in the firmware parser (
|
|
37
|
+
// The mirror of this lives in the firmware parser (runtime/er_hotreload.c); the two MUST stay
|
|
38
38
|
// byte-compatible. crc32 is shared with emit-container.mjs so all three CRCs are the one algorithm.
|
|
39
39
|
|
|
40
40
|
import {crc32} from '../assets/emit-container.mjs';
|
package/pack-container.mjs
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
// bytecode (so the device never ships the parser or source text), bake the imported images/fonts into
|
|
21
21
|
// an ERPK pack, and wrap both — with a QuickJS version stamp and an integrity CRC — into a single
|
|
22
22
|
// .erpkg. That one file is "the config": load it with er_runtime_load_container() on the desktop, or
|
|
23
|
-
// upload it to a device's config region. See
|
|
23
|
+
// upload it to a device's config region. See packages/embedded-react/assets/emit-container.mjs for the
|
|
24
24
|
// format, and er_runtime.h for the loader.
|
|
25
25
|
//
|
|
26
26
|
// npm run pack # default demo (thermostat)
|
|
@@ -53,8 +53,8 @@ import {findCompileBin, compileBinHelp} from './compile-bin.mjs';
|
|
|
53
53
|
// bridges/quickjs/CMakeLists.txt and ER_QUICKJS_TAG in er_runtime.c. The loader rejects a mismatch.
|
|
54
54
|
const QJS_TAG = 'v0.15.0';
|
|
55
55
|
|
|
56
|
-
const here = dirname(fileURLToPath(import.meta.url)); //
|
|
57
|
-
const repoRoot = resolve(here, '
|
|
56
|
+
const here = dirname(fileURLToPath(import.meta.url)); // packages/embedded-react
|
|
57
|
+
const repoRoot = resolve(here, '../..');
|
|
58
58
|
const demosDir = resolve(repoRoot, 'demos');
|
|
59
59
|
const libEntry = resolve(here, 'src/embedded-react/index.js');
|
|
60
60
|
const nodeModules = resolve(here, 'node_modules');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "embedded-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React Native-style component package + reconciler that drives the embedded-react C engine through the QuickJS NativeUI bridge (Flow A).",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/TheMasterCoder007/embedded-react.git",
|
|
12
|
-
"directory": "
|
|
12
|
+
"directory": "packages/embedded-react"
|
|
13
13
|
},
|
|
14
14
|
"bugs": {
|
|
15
15
|
"url": "https://github.com/TheMasterCoder007/embedded-react/issues"
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"aot:baseline": "node test/aot-same/aot-same.mjs baseline",
|
|
69
69
|
"aot:same": "node test/aot-same/aot-same.mjs check",
|
|
70
70
|
"parity": "node parity.mjs",
|
|
71
|
-
"version:sync": "node
|
|
72
|
-
"version:check": "node
|
|
73
|
-
"release": "node
|
|
71
|
+
"version:sync": "node ../../tools/sync-version.mjs",
|
|
72
|
+
"version:check": "node ../../tools/sync-version.mjs --check",
|
|
73
|
+
"release": "node ../../tools/release.mjs",
|
|
74
74
|
"build:builtin-font": "node assets/build-builtin-font.mjs",
|
|
75
75
|
"sim": "node sim.mjs",
|
|
76
76
|
"dev": "node cli.mjs dev",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"test:bytecode": "node test/runtime/run.mjs --bytecode",
|
|
82
82
|
"test:split": "node test/runtime/split-roundtrip.mjs",
|
|
83
83
|
"typecheck": "tsc -p tsconfig.types.json && tsc -p tsconfig.aot.json",
|
|
84
|
-
"format": "cd
|
|
85
|
-
"format:check": "cd
|
|
84
|
+
"format": "cd ../.. && prettier --write \"**/*.{js,jsx,mjs,cjs,mts}\"",
|
|
85
|
+
"format:check": "cd ../.. && prettier --check \"**/*.{js,jsx,mjs,cjs,mts}\""
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"@babel/code-frame": "^7.29.7",
|
package/sim/embedded-react.wasm
CHANGED
|
Binary file
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
// data.length x (nodes per row) slots out of the fixed ERUI_MAX_NODES pool. See "FlatList is a
|
|
29
29
|
// ScrollView alias" in the top-level README for the limits and when to reach for something else.
|
|
30
30
|
//
|
|
31
|
-
// This mirrors the AOT's emitFlatList (
|
|
31
|
+
// This mirrors the AOT's emitFlatList (packages/embedded-react/aot/compiler/elements/flat-list.mts),
|
|
32
32
|
// which performs the same rewrite at compile time. The two flows accept the SAME four props on
|
|
33
33
|
// purpose — a list that renders in the simulator must also compile for the device, so anything
|
|
34
34
|
// Flow B rejects is warned about here rather than silently forwarded.
|