vite-plugin-taro 0.7.4 → 0.7.5-beta.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.en.md +2 -2
- package/README.md +2 -2
- package/dist/index.js +93 -101
- package/dist/node/plugins/h5/resolver/module-resolver.d.ts +1 -1
- package/dist/node/plugins/h5/transform-app.d.ts +2 -2
- package/dist/node/plugins/mini/dev/modes/devtools/devtools-hmr-mode.d.ts +1 -0
- package/dist/node/plugins/mini/dev/react-refresh.d.ts +3 -3
- package/dist/node/plugins/mini/global/create-mini-global-plugin.d.ts +4 -0
- package/dist/node/plugins/mini/module/module.d.ts +8 -4
- package/dist/node/plugins/mini/native/create-mini-native-component-plugin.d.ts +3 -0
- package/dist/node/plugins/mini/placer/placement.d.ts +2 -1
- package/dist/node/plugins/mini/placer/placer.d.ts +1 -1
- package/dist/node/plugins/mini/polyfill/create-mini-polyfill-plugin.d.ts +2 -2
- package/dist/node/plugins/mini/polyfill/mini-browser-bindings.d.ts +1 -2
- package/dist/node/plugins/mini/render/capsule.d.ts +2 -2
- package/dist/node/plugins/mini/render/native.d.ts +4 -2
- package/dist/node/plugins/mini/render/system-js/string-editor.d.ts +23 -11
- package/dist/node/plugins/mini/render/transport.d.ts +16 -4
- package/dist/node/plugins/mini/resolve/resolver.d.ts +1 -1
- package/dist/node/plugins/mini/resolve/specialize-app-capsule.d.ts +1 -1
- package/dist/node/plugins/mini/resolve/specialize-page-capsule.d.ts +1 -1
- package/dist/node/plugins/mini/skeleton/recursive-page-templates.d.ts +6 -0
- package/dist/node/plugins/mini/styles/plugins.d.ts +12 -27
- package/dist/node/plugins/tt/create-tt-skeleton.d.ts +14 -0
- package/dist/node/plugins/tt/create-tt-template.d.ts +3 -0
- package/dist/node/plugins/tt/plugins.d.ts +7 -0
- package/dist/node/utils/transform.d.ts +7 -4
- package/dist/options.d.ts +13 -11
- package/dist/runtime/global/vpt-global.d.ts +5 -0
- package/dist/runtime/global/vpt-global.js +62 -0
- package/dist/runtime/mini/amphibious/bootstrap.d.ts +1 -1
- package/dist/runtime/mini/amphibious/bootstrap.js +12 -9
- package/dist/runtime/mini/dev/modes/devtools/devtools-runtime.d.ts +1 -1
- package/dist/runtime/mini/dev/modes/devtools/devtools-runtime.js +4 -6
- package/dist/runtime/mini/dev/modes/interpreter/interpreter-runtime.js +2 -0
- package/dist/runtime/mini/systemjs/system-core.d.ts +1 -0
- package/dist/runtime/mini/systemjs/system-core.js +1 -1
- package/dist/runtime/tt/dev/connect-tt-socket.d.ts +3 -0
- package/dist/runtime/tt/dev/connect-tt-socket.js +2 -0
- package/dist/runtime/tt/dev/devtools-runtime.d.ts +1 -0
- package/dist/runtime/tt/dev/devtools-runtime.js +4 -0
- package/dist/runtime/tt/dev/interpreter-runtime.d.ts +1 -0
- package/dist/runtime/tt/dev/interpreter-runtime.js +4 -0
- package/dist/runtime/tt/taro-runtime.d.ts +1 -0
- package/dist/runtime/tt/taro-runtime.js +15 -0
- package/package.json +4 -4
- /package/dist/node/plugins/{mini/skeleton/platform → wx}/create-wx-template.d.ts +0 -0
- /package/dist/node/plugins/{mini/skeleton/platform → zfb}/create-zfb-template.d.ts +0 -0
|
@@ -11,19 +11,17 @@ class DevtoolsHmrRuntime extends MiniHmrRuntime {
|
|
|
11
11
|
applyPatches(payload) {
|
|
12
12
|
// The initial physical dependency exports undefined until the host has a patch range. Once present, apply synchronously:
|
|
13
13
|
// imports below the Page banner must resolve against the new registry during this same native Page evaluation.
|
|
14
|
-
if (!payload)
|
|
14
|
+
if (!payload) {
|
|
15
15
|
return;
|
|
16
|
-
|
|
16
|
+
}
|
|
17
|
+
// The wrapper's lexical parameter replaces the generated patch's assumption of a host-global runtime binding.
|
|
18
|
+
this.applyPatchPayload(payload, (patch) => patch.factory(this));
|
|
17
19
|
}
|
|
18
20
|
/** Preserves the mounted Page connection while DevTools re-registers its static config. */
|
|
19
21
|
injectPageHmr(config) {
|
|
20
22
|
return injectDevtoolsPageHmr(config);
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
|
-
/** Executes only the native registration program; graph application remains owned by `MiniHmrRuntime`. */
|
|
24
|
-
function installDevtoolsPatch(patch) {
|
|
25
|
-
patch.factory();
|
|
26
|
-
}
|
|
27
25
|
/** Creates one platform-connected adapter for installation by a thin target runtime entry. */
|
|
28
26
|
export function createDevtoolsHmrRuntime(connectSocket) {
|
|
29
27
|
return new DevtoolsHmrRuntime(connectSocket);
|
|
@@ -14,6 +14,8 @@ class InterpreterHmrRuntime extends MiniHmrRuntime {
|
|
|
14
14
|
// Trusted application patches share live host globals, including APIs installed during app startup, rather than Sval's
|
|
15
15
|
// module-time sandbox snapshot. A function scope keeps patch-local declarations isolated, as in native HMR factories.
|
|
16
16
|
const interpreter = new Sval({ sandBox: false });
|
|
17
|
+
// Bind this interpreter's runtime once; Sval also publishes the same singleton on its selected global object.
|
|
18
|
+
interpreter.import({ __rolldown_runtime__: this });
|
|
17
19
|
this.installPatch = (patch) => interpreter.run(`(() => {\n${patch.code}\n})();`);
|
|
18
20
|
}
|
|
19
21
|
onSocketEvent(info, event, data) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createDevtoolsHmrRuntime } from '../../mini/dev/modes/devtools/devtools-runtime.js';
|
|
2
|
+
import { connectTtSocket } from './connect-tt-socket.js';
|
|
3
|
+
// The language-global singleton retains Rolldown's module graph across native Page shell execution.
|
|
4
|
+
Reflect.set(globalThis, '__rolldown_runtime__', createDevtoolsHmrRuntime(connectTtSocket));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createInterpreterHmrRuntime } from '../../mini/dev/modes/interpreter/interpreter-runtime.js';
|
|
2
|
+
import { connectTtSocket } from './connect-tt-socket.js';
|
|
3
|
+
// One retained runtime owns the socket, interpreted factories, module cache, and Refresh boundaries.
|
|
4
|
+
Reflect.set(globalThis, '__rolldown_runtime__', createInterpreterHmrRuntime(connectTtSocket));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'vite-plugin-taro-runtime/plugin-platform-tt/runtime';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { mergeReconciler } from '@tarojs/shared';
|
|
2
|
+
import 'vite-plugin-taro-runtime/plugin-platform-tt/runtime';
|
|
3
|
+
// TT requires declared native properties. Retain the stock lifecycle/events/options and add the independent Page root
|
|
4
|
+
// to both comp and CustomWrapper; recursive TTML forwards p without placing Page nodes inside the shared App tree.
|
|
5
|
+
mergeReconciler({
|
|
6
|
+
modifyRecursiveComponentConfig(config) {
|
|
7
|
+
return {
|
|
8
|
+
...config,
|
|
9
|
+
properties: {
|
|
10
|
+
...config.properties,
|
|
11
|
+
p: { type: Object, value: { cn: [] } }
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-taro",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5-beta.0",
|
|
4
4
|
"author": "sep2",
|
|
5
|
-
"description": "Vite 8 plugin for building one React/Taro codebase for WeChat, Alipay, and H5 targets.",
|
|
5
|
+
"description": "Vite 8 plugin for building one React/Taro codebase for WeChat, Alipay, TikTok, and H5 targets.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"taro",
|
|
44
44
|
"wechat",
|
|
45
45
|
"alipay",
|
|
46
|
+
"tiktok",
|
|
46
47
|
"mini-program",
|
|
47
48
|
"react"
|
|
48
49
|
],
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
"rolldown": "1.2.8",
|
|
66
67
|
"sval": "0.6.12",
|
|
67
68
|
"tailwindcss": "^4.3.3",
|
|
68
|
-
"vite-plugin-taro-runtime": "0.7.
|
|
69
|
+
"vite-plugin-taro-runtime": "0.7.5-beta.0"
|
|
69
70
|
},
|
|
70
71
|
"peerDependencies": {
|
|
71
72
|
"react": "^19.3.0",
|
|
@@ -78,7 +79,6 @@
|
|
|
78
79
|
"@babel/plugin-transform-dynamic-import": "^8.0.1",
|
|
79
80
|
"@babel/plugin-transform-modules-commonjs": "^8.0.1",
|
|
80
81
|
"@babel/plugin-transform-modules-systemjs": "^8.0.1",
|
|
81
|
-
"@babel/types": "^8.0.5",
|
|
82
82
|
"@oxc-project/types": "0.149.0",
|
|
83
83
|
"@tailwindcss-mangle/engine": "0.2.0",
|
|
84
84
|
"@types/node": "^26.5.1",
|
|
File without changes
|
|
File without changes
|