mithril-lynx 0.0.8 → 2.0.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/.omo/plans/m-request-fetch-lynx.md +306 -0
- package/.omo/plans/m-route-en-memoria.md +397 -0
- package/.omo/plans/mithril-lynx-v2-desde-cero.md +548 -0
- package/FETCH_INVESTIGATION.md +307 -0
- package/README.md +32 -284
- package/REQUEST.md +71 -0
- package/ROUTE.md +71 -0
- package/package.json +24 -80
- package/plugin.d.ts +4 -27
- package/plugin.js +142 -359
- package/rstest.config.ts +27 -0
- package/src/apply-patch.js +179 -0
- package/src/backends/virtual-backend.js +80 -0
- package/src/background.d.ts +11 -0
- package/src/background.js +79 -0
- package/src/channel.js +41 -0
- package/src/commit.js +67 -0
- package/src/dev-reload-client.js +245 -0
- package/src/dev-transport-noop.js +10 -0
- package/src/fake-dom.js +374 -0
- package/src/main-thread.d.ts +1 -0
- package/src/main-thread.js +68 -0
- package/src/mount-redraw.js +67 -0
- package/src/patch-protocol.js +40 -0
- package/src/reload/version.js +28 -0
- package/src/request.d.ts +37 -0
- package/src/request.js +181 -0
- package/src/route.d.ts +33 -0
- package/src/route.js +207 -0
- package/test/end-to-end.test.ts +86 -0
- package/test/reload-version.test.ts +17 -0
- package/test/request.test.ts +182 -0
- package/test/route-hot-reload.test.ts +40 -0
- package/test/route.test.ts +152 -0
- package/test/setup.ts +25 -0
- package/test/structural-reload.test.ts +95 -0
- package/CONTRACT.md +0 -151
- package/LICENSE +0 -21
- package/background.d.ts +0 -54
- package/background.js +0 -169
- package/element.d.ts +0 -34
- package/element.js +0 -83
- package/gesture.d.ts +0 -40
- package/gesture.js +0 -117
- package/internal/constants.js +0 -26
- package/internal/virtual-node.js +0 -388
- package/list.d.ts +0 -31
- package/list.js +0 -185
- package/main-thread.d.ts +0 -43
- package/main-thread.js +0 -165
- package/navigation.d.ts +0 -35
- package/navigation.js +0 -76
- package/renderer/background.d.ts +0 -21
- package/renderer/background.js +0 -84
- package/renderer/main-thread.d.ts +0 -12
- package/renderer/main-thread.js +0 -175
- package/src/lynx-mithril-shim.d.ts +0 -16
- package/src/lynx-mithril-shim.js +0 -1505
- package/src/worklet-runtime.js +0 -82
- package/testing.d.ts +0 -10
- package/testing.js +0 -91
package/package.json
CHANGED
|
@@ -1,107 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mithril-lynx",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "Mithril.js
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Mithril.js on Lynx: real mithril/render/render.js driven through a Lynx-backed fake DOM, with an explicit single commit hook (no conditional global flush) and three reload modes (data-light, structural-light, full). A complete rewrite of the previous mithril-lynx (0.0.x).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/carlos-sweb/mithril-lynx.git"
|
|
10
|
-
},
|
|
11
|
-
"homepage": "https://github.com/carlos-sweb/mithril-lynx#readme",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/carlos-sweb/mithril-lynx/issues"
|
|
14
|
-
},
|
|
15
7
|
"exports": {
|
|
16
|
-
"
|
|
17
|
-
"types": "./src/
|
|
18
|
-
"default": "./src/
|
|
8
|
+
"./background": {
|
|
9
|
+
"types": "./src/background.d.ts",
|
|
10
|
+
"default": "./src/background.js"
|
|
11
|
+
},
|
|
12
|
+
"./main-thread": {
|
|
13
|
+
"types": "./src/main-thread.d.ts",
|
|
14
|
+
"default": "./src/main-thread.js"
|
|
19
15
|
},
|
|
20
16
|
"./plugin": {
|
|
21
17
|
"types": "./plugin.d.ts",
|
|
22
18
|
"default": "./plugin.js"
|
|
23
19
|
},
|
|
24
|
-
"./
|
|
25
|
-
"types": "./
|
|
26
|
-
"default": "./
|
|
27
|
-
},
|
|
28
|
-
"./background": {
|
|
29
|
-
"types": "./background.d.ts",
|
|
30
|
-
"default": "./background.js"
|
|
31
|
-
},
|
|
32
|
-
"./renderer/main-thread": {
|
|
33
|
-
"types": "./renderer/main-thread.d.ts",
|
|
34
|
-
"default": "./renderer/main-thread.js"
|
|
35
|
-
},
|
|
36
|
-
"./renderer/background": {
|
|
37
|
-
"types": "./renderer/background.d.ts",
|
|
38
|
-
"default": "./renderer/background.js"
|
|
39
|
-
},
|
|
40
|
-
"./element": {
|
|
41
|
-
"types": "./element.d.ts",
|
|
42
|
-
"default": "./element.js"
|
|
43
|
-
},
|
|
44
|
-
"./gesture": {
|
|
45
|
-
"types": "./gesture.d.ts",
|
|
46
|
-
"default": "./gesture.js"
|
|
47
|
-
},
|
|
48
|
-
"./list": {
|
|
49
|
-
"types": "./list.d.ts",
|
|
50
|
-
"default": "./list.js"
|
|
20
|
+
"./route": {
|
|
21
|
+
"types": "./src/route.d.ts",
|
|
22
|
+
"default": "./src/route.js"
|
|
51
23
|
},
|
|
52
|
-
"./
|
|
53
|
-
"types": "./
|
|
54
|
-
"default": "./
|
|
55
|
-
},
|
|
56
|
-
"./testing": {
|
|
57
|
-
"types": "./testing.d.ts",
|
|
58
|
-
"default": "./testing.js"
|
|
24
|
+
"./request": {
|
|
25
|
+
"types": "./src/request.d.ts",
|
|
26
|
+
"default": "./src/request.js"
|
|
59
27
|
}
|
|
60
28
|
},
|
|
61
|
-
"files": [
|
|
62
|
-
"src",
|
|
63
|
-
"internal",
|
|
64
|
-
"renderer",
|
|
65
|
-
"plugin.js",
|
|
66
|
-
"plugin.d.ts",
|
|
67
|
-
"main-thread.js",
|
|
68
|
-
"main-thread.d.ts",
|
|
69
|
-
"background.js",
|
|
70
|
-
"background.d.ts",
|
|
71
|
-
"element.js",
|
|
72
|
-
"element.d.ts",
|
|
73
|
-
"gesture.js",
|
|
74
|
-
"gesture.d.ts",
|
|
75
|
-
"list.js",
|
|
76
|
-
"list.d.ts",
|
|
77
|
-
"navigation.js",
|
|
78
|
-
"navigation.d.ts",
|
|
79
|
-
"testing.js",
|
|
80
|
-
"testing.d.ts",
|
|
81
|
-
"CONTRACT.md"
|
|
82
|
-
],
|
|
83
|
-
"engines": {
|
|
84
|
-
"node": "^20.19.0 || >=22.12.0"
|
|
85
|
-
},
|
|
86
29
|
"scripts": {
|
|
87
30
|
"test": "rstest run"
|
|
88
31
|
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@lynx-js/rspeedy": "^0.17.0",
|
|
34
|
+
"@lynx-js/types": "4.1.0",
|
|
35
|
+
"mithril-runtime": "^1.1.0"
|
|
36
|
+
},
|
|
89
37
|
"dependencies": {
|
|
90
|
-
"@lynx-js/devtool-connector": "^0.13.2",
|
|
91
38
|
"@lynx-js/runtime-wrapper-webpack-plugin": "^0.2.4",
|
|
92
39
|
"@lynx-js/template-webpack-plugin": "^0.16.0"
|
|
93
40
|
},
|
|
94
|
-
"peerDependencies": {
|
|
95
|
-
"mithril": "2.3.8",
|
|
96
|
-
"@lynx-js/type-element-api": "0.0.9",
|
|
97
|
-
"@lynx-js/types": "4.1.0",
|
|
98
|
-
"@lynx-js/rspeedy": "^0.17.0"
|
|
99
|
-
},
|
|
100
41
|
"devDependencies": {
|
|
101
|
-
"mithril": "2.3.8",
|
|
102
42
|
"@lynx-js/testing-environment": "npm:@lynx-js/testing-environment-canary@0.3.2-canary-20260803-5a891c73",
|
|
103
43
|
"@rstest/core": "^0.11.3",
|
|
104
44
|
"jsdom": "^28.0.0",
|
|
45
|
+
"mithril-runtime": "^1.1.0",
|
|
105
46
|
"typescript": "~6.0.3"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
106
50
|
}
|
|
107
51
|
}
|
package/plugin.d.ts
CHANGED
|
@@ -1,31 +1,8 @@
|
|
|
1
|
-
// Ambient declaration for the ESM plugin.js (the file itself is not
|
|
2
|
-
// type-checked; this describes its runtime export shape for lynx.config.ts).
|
|
3
|
-
|
|
4
1
|
import type { RsbuildPlugin } from "@lynx-js/rspeedy";
|
|
5
2
|
|
|
6
|
-
export interface
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Opt back into module-level HMR. Defaults to false, which the plugin forces
|
|
11
|
-
* because rspack's hot runtime can only patch modules on the background
|
|
12
|
-
* thread, while Mithril view code always runs on the main thread — so HMR
|
|
13
|
-
* adds hot-update error noise without ever being able to update anything.
|
|
14
|
-
*/
|
|
15
|
-
hmr?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Reload the running page after each successful dev rebuild. Defaults to
|
|
18
|
-
* true. Reloading goes through the Lynx DevTool connector, which reaches the
|
|
19
|
-
* device over adb, so a device connected only over Wi-Fi must be reloaded
|
|
20
|
-
* manually.
|
|
21
|
-
*/
|
|
22
|
-
liveReload?: boolean;
|
|
3
|
+
export interface PluginMithrilLynxV2Options {
|
|
4
|
+
targetSdkVersion?: string;
|
|
5
|
+
liveReload?: boolean;
|
|
23
6
|
}
|
|
24
7
|
|
|
25
|
-
|
|
26
|
-
* Dual-bundle build plugin: for each configured entry, compiles the entry
|
|
27
|
-
* file as the main-thread/Lepus bundle, and — if a sibling `background.ts`
|
|
28
|
-
* or `background.js` file exists next to it — compiles that as the
|
|
29
|
-
* background/JS-thread bundle. Pure multi-entry bundling, no code transform.
|
|
30
|
-
*/
|
|
31
|
-
export function pluginMithrilLynx(options?: PluginMithrilLynxOptions): RsbuildPlugin;
|
|
8
|
+
export function pluginMithrilLynxV2(options?: PluginMithrilLynxV2Options): RsbuildPlugin;
|