@mentra/jspolyfill 0.1.0-dev.0 → 3.1.0-dev.2
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 +31 -0
- package/package.json +6 -2
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# @mentra/jspolyfill
|
|
2
|
+
|
|
3
|
+
The MentraJS polyfill bundle. MentraOS runs each miniapp in its own bare JS
|
|
4
|
+
context (JavaScriptCore on iOS, QuickJS on Android); this package provides the
|
|
5
|
+
browser-like standard library those contexts lack — `console`, timers,
|
|
6
|
+
`fetch`, `WebSocket`, `localStorage`, `crypto.getRandomValues`, and
|
|
7
|
+
`crypto.randomUUID` — implemented over a single `__dispatch` native bridge,
|
|
8
|
+
plus the `__deliver` / `signalReady` plumbing the host runtime relies on.
|
|
9
|
+
`crypto.subtle` is not implemented.
|
|
10
|
+
|
|
11
|
+
You don't import this package from app code: it's a **peer of the runtime
|
|
12
|
+
stack**. [`@mentra/crust`](https://www.npmjs.com/package/@mentra/crust)'s
|
|
13
|
+
Android build reads the bundle from this package's `assets/` at build time,
|
|
14
|
+
and the engine injects it into each miniapp context at spawn.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
Installed automatically alongside
|
|
19
|
+
[`@mentra/engine`](https://www.npmjs.com/package/@mentra/engine) /
|
|
20
|
+
`@mentra/crust`. For direct use:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm install @mentra/jspolyfill@dev
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> Currently published on the `dev` dist-tag (prerelease channel).
|
|
27
|
+
|
|
28
|
+
## Part of MentraOS
|
|
29
|
+
|
|
30
|
+
Source lives in the [MentraOS monorepo](https://github.com/Mentra-Community/MentraOS)
|
|
31
|
+
under `mobile/modules/jspolyfill`. Issues and contributions welcome there.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mentra/jspolyfill",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "MentraJS polyfill bundle
|
|
3
|
+
"version": "3.1.0-dev.2",
|
|
4
|
+
"description": "MentraJS polyfill bundle — installed into each per-miniapp JSContext (iOS-JSC, Android-QuickJS) at spawn time. Provides browser-like globals (console, timers, fetch, WebSocket, localStorage, crypto.subtle) over a single __dispatch native bridge, plus the __deliver / signalReady plumbing the host runtime relies on.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -32,5 +32,9 @@
|
|
|
32
32
|
"type": "git",
|
|
33
33
|
"url": "git+https://github.com/Mentra-Community/MentraOS.git",
|
|
34
34
|
"directory": "mobile/modules/jspolyfill"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/Mentra-Community/MentraOS/tree/dev/mobile/modules/jspolyfill#readme",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/Mentra-Community/MentraOS/issues"
|
|
35
39
|
}
|
|
36
40
|
}
|