vite-plugin-taro 0.6.20 → 0.7.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 +4 -4
- package/README.md +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +147 -136
- package/dist/node/plugins/mini/dev/dev-host.d.ts +29 -0
- package/dist/node/plugins/{wx → mini}/dev/hmr-files.d.ts +1 -3
- package/dist/node/plugins/mini/dev/hmr-mode.d.ts +32 -0
- package/dist/node/plugins/{wx → mini}/dev/hmr-protocol.d.ts +1 -1
- package/dist/node/plugins/{wx/dev/wx-dev-options.d.ts → mini/dev/mini-dev-options.d.ts} +7 -7
- package/dist/node/plugins/{wx → mini}/dev/modes/devtools/devtools-hmr-mode.d.ts +4 -3
- package/dist/node/plugins/mini/dev/modes/interpreter/interpreter-hmr-mode.d.ts +4 -0
- package/dist/node/plugins/mini/dev/modes/rebuild/rebuild-hmr-mode.d.ts +4 -0
- package/dist/node/plugins/mini/dev/plugins.d.ts +35 -0
- package/dist/node/plugins/{wx → mini}/dev/react-refresh.d.ts +7 -7
- package/dist/node/plugins/mini/mini-contract.d.ts +66 -0
- package/dist/node/plugins/mini/module/module.d.ts +38 -0
- package/dist/node/plugins/{wx → mini}/output/files.d.ts +4 -4
- package/dist/node/plugins/{wx → mini}/placer/placement.d.ts +5 -11
- package/dist/node/plugins/{wx → mini}/placer/placer.d.ts +14 -11
- package/dist/node/plugins/mini/plugins.d.ts +4 -0
- package/dist/node/plugins/{wx → mini}/render/capsule.d.ts +5 -5
- package/dist/node/plugins/{wx → mini}/render/native.d.ts +6 -4
- package/dist/node/plugins/{wx → mini}/render/system-js/string-editor.d.ts +1 -1
- package/dist/node/plugins/{wx → mini}/render/system-js/system-js.d.ts +1 -1
- package/dist/node/plugins/{wx → mini}/render/transport.d.ts +3 -1
- package/dist/node/plugins/{wx → mini}/resolve/resolver.d.ts +3 -3
- package/dist/node/plugins/{wx → mini}/resolve/specialize-app-capsule.d.ts +2 -2
- package/dist/node/plugins/{wx → mini}/resolve/specialize-page-capsule.d.ts +2 -2
- package/dist/node/plugins/mini/skeleton/skeleton-utils.d.ts +33 -0
- package/dist/node/plugins/{wx/styles/create-wx-transformer.d.ts → mini/styles/create-mini-transformer.d.ts} +3 -3
- package/dist/node/plugins/{wx → mini}/styles/plugins.d.ts +32 -32
- package/dist/node/plugins/wx/create-wx-skeleton.d.ts +57 -0
- package/dist/node/plugins/wx/plugins.d.ts +5 -2
- package/dist/node/plugins/zfb/create-zfb-skeleton.d.ts +59 -0
- package/dist/node/plugins/zfb/plugins.d.ts +7 -0
- package/dist/node/utils/modules.d.ts +2 -0
- package/dist/node/utils/project-config.d.ts +3 -1
- package/dist/options.d.ts +44 -26
- package/dist/runtime/{wx → mini}/amphibious/bootstrap.js +4 -4
- package/dist/runtime/{wx → mini}/capsule/app.js +1 -1
- package/dist/runtime/mini/capsule/page.js +18 -0
- package/dist/runtime/{wx → mini}/capsule/taro-runtime.d.ts +2 -2
- package/dist/runtime/{wx → mini}/capsule/taro-runtime.js +5 -4
- package/dist/runtime/{wx/dev/wx-hmr-protocol.d.ts → mini/dev/hmr-protocol.d.ts} +2 -2
- package/dist/runtime/{wx/dev/wx-hmr-protocol.js → mini/dev/hmr-protocol.js} +2 -2
- package/dist/runtime/{wx/dev/wx-hmr-runtime.d.ts → mini/dev/mini-hmr-runtime.d.ts} +24 -7
- package/dist/runtime/{wx/dev/wx-hmr-runtime.js → mini/dev/mini-hmr-runtime.js} +21 -13
- package/dist/runtime/mini/dev/modes/devtools/devtools-runtime.d.ts +23 -0
- package/dist/runtime/{wx → mini}/dev/modes/devtools/devtools-runtime.js +8 -8
- package/dist/runtime/{wx → mini}/dev/modes/devtools/page-hmr.js +5 -5
- package/dist/runtime/{wx → mini}/dev/modes/interpreter/interpreter-protocol.d.ts +2 -2
- package/dist/runtime/mini/dev/modes/interpreter/interpreter-protocol.js +1 -0
- package/dist/runtime/mini/dev/modes/interpreter/interpreter-runtime.d.ts +12 -0
- package/dist/runtime/{wx → mini}/dev/modes/interpreter/interpreter-runtime.js +14 -7
- package/dist/runtime/mini/dev/polyfill/polyfill-queue-microtask.d.ts +14 -0
- package/dist/runtime/mini/dev/polyfill/polyfill-queue-microtask.js +18 -0
- package/dist/runtime/{wx → mini}/native/page.js +1 -1
- package/dist/runtime/{wx → mini}/systemjs/system-core.js +2 -3
- package/dist/runtime/wx/dev/connect-wx-socket.d.ts +3 -0
- package/dist/runtime/wx/dev/connect-wx-socket.js +2 -0
- package/dist/runtime/wx/dev/devtools-runtime.js +5 -0
- package/dist/runtime/wx/dev/interpreter-runtime.js +5 -0
- package/dist/runtime/zfb/dev/connect-zfb-socket.d.ts +10 -0
- package/dist/runtime/zfb/dev/connect-zfb-socket.js +18 -0
- package/dist/runtime/zfb/dev/devtools-runtime.d.ts +1 -0
- package/dist/runtime/zfb/dev/devtools-runtime.js +5 -0
- package/dist/runtime/zfb/dev/interpreter-runtime.d.ts +1 -0
- package/dist/runtime/zfb/dev/interpreter-runtime.js +5 -0
- package/package.json +10 -8
- package/dist/node/plugins/wx/dev/dev-host.d.ts +0 -29
- package/dist/node/plugins/wx/dev/hmr-mode.d.ts +0 -31
- package/dist/node/plugins/wx/dev/modes/interpreter/interpreter-hmr-mode.d.ts +0 -3
- package/dist/node/plugins/wx/dev/plugins.d.ts +0 -32
- package/dist/node/plugins/wx/module/module.d.ts +0 -51
- package/dist/node/plugins/wx/output/relative-root.d.ts +0 -2
- package/dist/node/plugins/wx/output/templates.d.ts +0 -124
- package/dist/runtime/wx/capsule/page.js +0 -18
- package/dist/runtime/wx/dev/modes/interpreter/interpreter-protocol.js +0 -1
- /package/dist/node/plugins/{wx → mini}/dev/create-hmr-results-stream.d.ts +0 -0
- /package/dist/node/plugins/{wx → mini}/dev/host-actions.d.ts +0 -0
- /package/dist/node/plugins/{wx → mini}/dev/patch-journal.d.ts +0 -0
- /package/dist/node/plugins/{wx → mini}/module/chunk-path.d.ts +0 -0
- /package/dist/node/plugins/{wx → mini}/native/compile-native-component-interface.d.ts +0 -0
- /package/dist/node/plugins/{wx → mini}/native/create-native-component-output.d.ts +0 -0
- /package/dist/node/plugins/{wx → mini}/native/native-component-assets.d.ts +0 -0
- /package/dist/node/plugins/{wx → mini}/native/native-component-interface.d.ts +0 -0
- /package/dist/runtime/{wx → mini}/amphibious/bootstrap.d.ts +0 -0
- /package/dist/runtime/{wx → mini}/amphibious/transport.d.ts +0 -0
- /package/dist/runtime/{wx → mini}/amphibious/transport.js +0 -0
- /package/dist/runtime/{wx → mini}/capsule/app.d.ts +0 -0
- /package/dist/runtime/{wx → mini}/capsule/component.d.ts +0 -0
- /package/dist/runtime/{wx → mini}/capsule/component.js +0 -0
- /package/dist/runtime/{wx → mini}/capsule/page.d.ts +0 -0
- /package/dist/runtime/{wx → mini}/dev/modes/devtools/page-hmr.d.ts +0 -0
- /package/dist/runtime/{wx → mini}/native/app.d.ts +0 -0
- /package/dist/runtime/{wx → mini}/native/app.js +0 -0
- /package/dist/runtime/{wx → mini}/native/component.d.ts +0 -0
- /package/dist/runtime/{wx → mini}/native/component.js +0 -0
- /package/dist/runtime/{wx → mini}/native/custom-wrapper.d.ts +0 -0
- /package/dist/runtime/{wx → mini}/native/custom-wrapper.js +0 -0
- /package/dist/runtime/{wx → mini}/native/page.d.ts +0 -0
- /package/dist/runtime/{wx → mini}/systemjs/system-core.d.ts +0 -0
- /package/dist/runtime/wx/dev/{modes/devtools/devtools-runtime.d.ts → devtools-runtime.d.ts} +0 -0
- /package/dist/runtime/wx/dev/{modes/interpreter/interpreter-runtime.d.ts → interpreter-runtime.d.ts} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Rolldown } from 'vite';
|
|
2
|
+
import type { VptOptions } from '../../../../options.ts';
|
|
3
|
+
import type { MiniJsonObject, MiniNativeComponentRegistration, MiniPage } from '../mini-contract.ts';
|
|
4
|
+
/** Component-selection input accepted by each pinned native template implementation. */
|
|
5
|
+
export type SkeletonTemplateComponentConfig = {
|
|
6
|
+
includes: Set<string>;
|
|
7
|
+
exclude: Set<string>;
|
|
8
|
+
thirdPartyComponents: Map<string, Set<string>>;
|
|
9
|
+
includeAll: boolean;
|
|
10
|
+
};
|
|
11
|
+
/** Native registrations shared by Page, recursive-component, and CustomWrapper configuration. */
|
|
12
|
+
export type SkeletonNativeComponentConfig = {
|
|
13
|
+
usingComponents: Record<string, string>;
|
|
14
|
+
componentPlaceholder: Record<string, string>;
|
|
15
|
+
};
|
|
16
|
+
/** Creates application configuration with generated package declarations appended by the target skeleton. */
|
|
17
|
+
export declare function createSkeletonAppJson(options: VptOptions, subpackages: readonly MiniJsonObject[]): MiniJsonObject;
|
|
18
|
+
/** Creates a Page config while preserving caller fields and registering every generated rendering boundary. */
|
|
19
|
+
export declare function createSkeletonPageJson(page: MiniPage, nativeComponents: SkeletonNativeComponentConfig): MiniJsonObject;
|
|
20
|
+
/** Creates the recursive component config shared by comp and CustomWrapper. */
|
|
21
|
+
export declare function createRecursiveComponentJson(nativeComponents: SkeletonNativeComponentConfig): MiniJsonObject;
|
|
22
|
+
/** Creates native registrations and asynchronous-package placeholders from discovered component interfaces. */
|
|
23
|
+
export declare function createNativeComponentConfig(nativeComponents: readonly MiniNativeComponentRegistration[]): SkeletonNativeComponentConfig;
|
|
24
|
+
/** Collects reachable host exports and native JSX fields for one native template implementation. */
|
|
25
|
+
export declare function collectTemplateComponentConfig(bundle: Rolldown.OutputBundle, componentsModulePath: string, nativeComponents: readonly MiniNativeComponentRegistration[]): SkeletonTemplateComponentConfig;
|
|
26
|
+
/** Creates compact production JSON and readable development JSON. */
|
|
27
|
+
export declare function createJsonAsset(fileName: string, value: MiniJsonObject, isProduction: boolean): Rolldown.EmittedAsset;
|
|
28
|
+
/** Creates one emitted text asset. */
|
|
29
|
+
export declare function createTextAsset(fileName: string, source: string): Rolldown.EmittedAsset;
|
|
30
|
+
/** Replaces one pinned upstream fragment and rejects absent or duplicated source contracts. */
|
|
31
|
+
export declare function replaceExactlyOnce(source: string, current: string, replacement: string, description: string): string;
|
|
32
|
+
/** Creates a Page-relative path to a file emitted at the Mini Program output root. */
|
|
33
|
+
export declare function toRootRelativePath(pagePath: string, rootFileName: string): string;
|
|
@@ -3,10 +3,10 @@ type JavaScriptTransformInput = Readonly<{
|
|
|
3
3
|
code: string;
|
|
4
4
|
filename: string;
|
|
5
5
|
}>;
|
|
6
|
-
type
|
|
6
|
+
type MiniTransformer = Readonly<{
|
|
7
7
|
transformJavaScript: (input: JavaScriptTransformInput) => string;
|
|
8
8
|
transformStylesheet: (css: string) => Promise<string>;
|
|
9
9
|
}>;
|
|
10
|
-
/** Creates VPT's fixed Tailwind-v4
|
|
11
|
-
export declare function
|
|
10
|
+
/** Creates VPT's fixed Tailwind-v4 Mini Program transformer without loading a framework project context. */
|
|
11
|
+
export declare function createMiniTransformer(): MiniTransformer;
|
|
12
12
|
export {};
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { type Plugin } from 'vite';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import type { MiniContract } from '../mini-contract.ts';
|
|
3
|
+
import { createMiniTransformer } from './create-mini-transformer.ts';
|
|
4
|
+
/** JavaScript code plus the physical filename required by the Mini Program class-name transformer. */
|
|
4
5
|
type JavaScriptArtifact = Readonly<{
|
|
5
6
|
code: string;
|
|
6
7
|
filename: string;
|
|
7
8
|
}>;
|
|
8
|
-
type
|
|
9
|
-
/** Vite plugin with the
|
|
10
|
-
export type
|
|
11
|
-
/** Neutralizes browser CSS payloads and publishes
|
|
12
|
-
finalizeUpdate: <Artifact extends JavaScriptArtifact>(artifacts: readonly Artifact[],
|
|
9
|
+
type MiniTransformer = ReturnType<typeof createMiniTransformer>;
|
|
10
|
+
/** Vite plugin with the host operation that finalizes one coherent native-style/JavaScript transaction. */
|
|
11
|
+
export type MiniStylePlugin = Plugin & Readonly<{
|
|
12
|
+
/** Neutralizes browser CSS payloads and atomically publishes the matching global native stylesheet. */
|
|
13
|
+
finalizeUpdate: <Artifact extends JavaScriptArtifact>(artifacts: readonly Artifact[], writeStylesheet: (stylesheet: string) => Promise<void>) => Promise<readonly Artifact[]>;
|
|
13
14
|
}>;
|
|
14
15
|
/**
|
|
15
|
-
* Creates the single owner of global
|
|
16
|
+
* Creates the single owner of global native-style compilation, graph projection, class rewriting, and publication.
|
|
16
17
|
*
|
|
17
18
|
* ## Architectural invariant
|
|
18
19
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
20
|
+
* One Mini Program transaction must expose JavaScript and native CSS produced from one class-identity snapshot. Tailwind utility
|
|
21
|
+
* names can be escaped—for example, `py-5.5` becomes `py-5_d5`—so publishing either side independently can leave running code
|
|
21
22
|
* referring to selectors that do not yet exist. This plugin therefore treats reachable CSS, Tailwind candidates, converted
|
|
22
|
-
*
|
|
23
|
+
* native CSS, and converted JavaScript as one output. Complete builds and HMR updates both call `finalizeOutput()`; they differ only
|
|
23
24
|
* in how the returned bytes are materialized.
|
|
24
25
|
*
|
|
25
26
|
* ## Ownership boundaries
|
|
@@ -32,13 +33,13 @@ export type WxStylePlugin = Plugin & Readonly<{
|
|
|
32
33
|
* the owning CSS root's Rolldown transform and never rescans the project during output publication.
|
|
33
34
|
* 3. Vite owns preprocessors, PostCSS, CSS Modules, and final module CSS semantics. VPT observes the input to the resolved
|
|
34
35
|
* `vite:css-post` hook only after the original hook succeeds; it never rereads source files or repeats CSS preprocessing.
|
|
35
|
-
* 4. The fixed
|
|
36
|
-
* transformer and one projected candidate set drive both operations without loading
|
|
37
|
-
* 5. VPT owns physical global
|
|
38
|
-
* removed before VPT emits
|
|
36
|
+
* 4. The fixed Mini transformer owns selector conversion and Oxc-based JavaScript class-string conversion. One retained
|
|
37
|
+
* transformer and one projected candidate set drive both operations without loading a framework project context.
|
|
38
|
+
* 5. VPT owns physical global native CSS and patch publication. Vite's browser CSS asset is only an intermediate carrier and is
|
|
39
|
+
* removed before VPT emits the contract-selected global stylesheet.
|
|
39
40
|
*
|
|
40
|
-
* Native Page and component
|
|
41
|
-
* and emits those opaque companions later.
|
|
41
|
+
* Native Page and component styles are outside this global pipeline. The target skeleton is generated after this style plugin
|
|
42
|
+
* and emits those opaque companions later. Mini output also enforces `cssCodeSplit: false`, so Vite contributes at
|
|
42
43
|
* most one browser compiler stylesheet for this plugin to replace.
|
|
43
44
|
*
|
|
44
45
|
* ## Compilation phases
|
|
@@ -74,9 +75,9 @@ export type WxStylePlugin = Plugin & Readonly<{
|
|
|
74
75
|
* and Tailwind candidates without a separate prune protocol or persistent topology cache. Candidate sets are unioned only from
|
|
75
76
|
* the Tailwind roots whose captured CSS survives that exact traversal, preserving the CSS/class identity invariant.
|
|
76
77
|
*
|
|
77
|
-
* ### 4. Shared
|
|
78
|
+
* ### 4. Shared native-style finalization
|
|
78
79
|
*
|
|
79
|
-
* `finalizeOutput()` first converts the concatenated reachable CSS to
|
|
80
|
+
* `finalizeOutput()` first converts the concatenated reachable CSS to native CSS, then transforms each JavaScript artifact
|
|
80
81
|
* with the same projected class set. It returns data and performs no bundle mutation or filesystem publication. If either
|
|
81
82
|
* transformation fails, the promise rejects before callers expose partial output. JavaScript conversion is skipped when the
|
|
82
83
|
* projection contains no Tailwind candidates, preserving ordinary bundle bytes.
|
|
@@ -85,18 +86,17 @@ export type WxStylePlugin = Plugin & Readonly<{
|
|
|
85
86
|
*
|
|
86
87
|
* The post-order `generateBundle` hook gathers all JavaScript chunks, finalizes them as one operation, and only then mutates the
|
|
87
88
|
* bundle. It assigns converted code, clears invalid source maps, removes Vite's intermediate browser stylesheet, and always
|
|
88
|
-
* emits
|
|
89
|
+
* emits the contract-selected global file. An empty file is required because the App stylesheet imports it even when the application
|
|
89
90
|
* currently has no styles. Native output hooks run afterward and emit Page/component companion files independently.
|
|
90
91
|
*
|
|
91
92
|
* ### 5b. Development commit
|
|
92
93
|
*
|
|
93
94
|
* The development host calls `finalizeUpdate()` after Rolldown produces patch factories or a complete-output notification.
|
|
94
95
|
* Finalization uses the `PluginContext` captured by `buildStart`, so it observes the same current graph as the compiler. After
|
|
95
|
-
* all conversion succeeds, the host's atomic writer publishes changed
|
|
96
|
-
* factories. Their captured Vite CSS literals are emptied first; factories, exports, changed IDs, and sequences remain
|
|
97
|
-
* The patch publisher therefore cannot expose newer JavaScript class identities before matching selectors exist.
|
|
98
|
-
* `
|
|
99
|
-
* unnecessary WeChat DevTools reload events.
|
|
96
|
+
* all conversion succeeds, the host's atomic writer publishes changed native CSS before `finalizeUpdate()` returns converted
|
|
97
|
+
* patch factories. Their captured Vite CSS literals are emptied first; factories, exports, changed IDs, and sequences remain
|
|
98
|
+
* intact. The patch publisher therefore cannot expose newer JavaScript class identities before matching selectors exist.
|
|
99
|
+
* `publishedStylesheet` advances only after a successful write and suppresses byte-identical native-tool reload events.
|
|
100
100
|
*
|
|
101
101
|
* ## Retained state and lifecycle
|
|
102
102
|
*
|
|
@@ -105,8 +105,8 @@ export type WxStylePlugin = Plugin & Readonly<{
|
|
|
105
105
|
* - `entryIds`: graph-exact App/Page entry identities resolved at the start of each build;
|
|
106
106
|
* - `graphContext`: the active Rolldown graph reader needed by host calls made outside plugin hooks;
|
|
107
107
|
* - `styleByModuleId`: the latest successful Vite CSS plus optional Tailwind state at one normalized module identity;
|
|
108
|
-
* - `
|
|
109
|
-
* - `
|
|
108
|
+
* - `publishedStylesheet`: the last durably published development stylesheet used for unchanged-write suppression;
|
|
109
|
+
* - `miniTransformer`: fixed stylesheet options and escaped-class cache shared by CSS and JavaScript conversion.
|
|
110
110
|
*
|
|
111
111
|
* The state owners remain scoped to one plugin instance; `entryIds` is atomically replaced after each complete resolution.
|
|
112
112
|
* A development watcher retains them across updates; build and watcher shutdown clear the complete style store.
|
|
@@ -120,12 +120,12 @@ export type WxStylePlugin = Plugin & Readonly<{
|
|
|
120
120
|
* compiler dependencies, and watched file identities; no second application graph is retained. The Tailwind generator stays
|
|
121
121
|
* alive across candidate edits to avoid repeating source normalization and compiler initialization.
|
|
122
122
|
*/
|
|
123
|
-
export declare function
|
|
123
|
+
export declare function createMiniStylePlugin(contract: Pick<MiniContract, 'styles'>, applicationEntryIds: readonly string[]): MiniStylePlugin;
|
|
124
124
|
/**
|
|
125
|
-
* Produces
|
|
125
|
+
* Produces native CSS and JavaScript from one live-graph projection.
|
|
126
126
|
*
|
|
127
127
|
* The function receives every stateful dependency explicitly so tests and both output modes execute the same algorithm. It
|
|
128
|
-
* completes
|
|
128
|
+
* completes stylesheet conversion before JavaScript conversion and returns bytes without publishing or mutating caller artifacts.
|
|
129
129
|
*/
|
|
130
130
|
export declare function finalizeOutput(entryIds: readonly string[], styleByModuleId: ReadonlyMap<string, Readonly<{
|
|
131
131
|
css: string | undefined;
|
|
@@ -135,8 +135,8 @@ export declare function finalizeOutput(entryIds: readonly string[], styleByModul
|
|
|
135
135
|
}>>, getModuleInfo: (moduleId: string) => Readonly<{
|
|
136
136
|
importedIds: readonly string[];
|
|
137
137
|
dynamicallyImportedIds: readonly string[];
|
|
138
|
-
}> | null | undefined,
|
|
138
|
+
}> | null | undefined, miniTransformer: MiniTransformer, javaScript: readonly JavaScriptArtifact[]): Promise<{
|
|
139
139
|
javaScript: string[];
|
|
140
|
-
|
|
140
|
+
stylesheet: string;
|
|
141
141
|
}>;
|
|
142
142
|
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Rolldown } from 'vite';
|
|
2
|
+
import type { VptOptions } from '../../../options.ts';
|
|
3
|
+
import type { MiniProjectSkeletonInput } from '../mini/mini-contract.ts';
|
|
4
|
+
type WxSkeletonInput = MiniProjectSkeletonInput & Readonly<{
|
|
5
|
+
options: VptOptions;
|
|
6
|
+
componentsModulePath: string;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* Generates the WX templates that project one React ownership tree through two native Page data roots.
|
|
10
|
+
*
|
|
11
|
+
* ## Data ownership
|
|
12
|
+
*
|
|
13
|
+
* Each native Page starts with `app = { nn: 'vpt_fragment', cn: [] }` and `page = { cn: [] }`. The patched App document broadcasts
|
|
14
|
+
* compact App mutations under `app.*`; the Page root writes only `page.*`. React still owns one tree from the App component,
|
|
15
|
+
* through its `children`, to the independently scheduled Page root. Native templates join those projections only where React
|
|
16
|
+
* placed `vpt_page_outlet`, so context, lifecycle, refs, events, effects, removal, and HMR ownership remain in memory rather than
|
|
17
|
+
* being serialized from one root into the other.
|
|
18
|
+
*
|
|
19
|
+
* ## Template execution
|
|
20
|
+
*
|
|
21
|
+
* ```text
|
|
22
|
+
* Page WXML (owns app, page, Page event handler, and Page light DOM)
|
|
23
|
+
* -> <comp i="{{app}}"> crosses into the recursive component scope
|
|
24
|
+
* -> comp.wxml imports base.wxml owns App event dispatch and named-template lookup
|
|
25
|
+
* -> tmpl_0_vpt_fragment iterates the real compact roots in app.cn
|
|
26
|
+
* -> stock host templates recursively render each App branch
|
|
27
|
+
* -> depth-reset <comp> forwards light DOM only on the marked outlet spine
|
|
28
|
+
* -> tmpl_0_vpt_page_outlet consumes the forwarded default slot
|
|
29
|
+
* -> taro_tmpl(page) renders this Page's page.cn in caller scope
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* `vpt_fragment` adapts zero, one, or many App roots to `comp`'s one-node `i` contract. It is template-only: it has no Fiber, sid,
|
|
33
|
+
* event source, ref, lifecycle, or native layout. Its `cn` entries remain real Taro compact nodes, and `wx:key="sid"` preserves
|
|
34
|
+
* native component instances, sibling identity, and event routing during insertion and reorder. The outer `comp` exists once, so
|
|
35
|
+
* exactly one Page slot is owned regardless of App root cardinality.
|
|
36
|
+
*
|
|
37
|
+
* ## Scope and slot forwarding
|
|
38
|
+
*
|
|
39
|
+
* WXML slots transfer caller-owned light DOM but not the caller's named-template table or WXS module scope. App dispatch occurs
|
|
40
|
+
* after entering `comp.wxml`; therefore `vpt_fragment` and `vpt_page_outlet` must be defined in shared `base.wxml`, which every
|
|
41
|
+
* recursive component imports. Defining them only in Page WXML can compile but fails when component-local dispatch cannot resolve
|
|
42
|
+
* the names. `utils.wxs`, `comp.wxml`, and CustomWrapper otherwise remain Taro's stock products.
|
|
43
|
+
*
|
|
44
|
+
* Taro resets recursion depth through nested `comp` components. The renderer marks only the outlet-to-App-root compact ancestor
|
|
45
|
+
* spine with `vo`; each generated depth-reset call checks that local marker before forwarding `<slot>`. This is O(1) per boundary,
|
|
46
|
+
* requires no descendant search or App/Page mode property, and prevents unrelated App branches from instantiating Page content.
|
|
47
|
+
* App events continue through `comp.eh`; slotted Page events retain the native Page's handler and original sid source.
|
|
48
|
+
*
|
|
49
|
+
* ## Updates and navigation
|
|
50
|
+
*
|
|
51
|
+
* A `page.*` update changes only caller-owned Page rendering because `app` is never passed into `taro_tmpl(page)`. App updates and
|
|
52
|
+
* outlet-spine marker changes remain granular `app.*` payloads broadcast before mounted Pages render them. Adding or removing a
|
|
53
|
+
* Page root mutates the in-memory outlet but does not serialize that root into App data. A newly pushed native Page receives the
|
|
54
|
+
* current complete App snapshot with its initial Page batch; retained and hidden Pages need no navigation synchronization.
|
|
55
|
+
*/
|
|
56
|
+
export declare function createWxSkeleton({ bundle, subpackages, nativeComponents, isProduction, options, componentsModulePath }: WxSkeletonInput): Rolldown.EmittedAsset[];
|
|
57
|
+
export {};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { PluginOption } from 'vite';
|
|
2
2
|
import type { VptOptions } from '../../../options.ts';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import type { MiniContract } from '../mini/mini-contract.ts';
|
|
4
|
+
/** Adapts the shared Mini Program pipeline to the WX public target. */
|
|
5
|
+
export declare function createWxMiniPlugins(vptOptions: VptOptions): PluginOption[];
|
|
6
|
+
/** Binds the shared Mini Program core to WeChat runtime and output conventions. */
|
|
7
|
+
export declare function createWxMiniContract(vptOptions: VptOptions): MiniContract;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Rolldown } from 'vite';
|
|
2
|
+
import type { VptOptions } from '../../../options.ts';
|
|
3
|
+
import type { MiniProjectSkeletonInput } from '../mini/mini-contract.ts';
|
|
4
|
+
type ZfbSkeletonInput = MiniProjectSkeletonInput & Readonly<{
|
|
5
|
+
options: VptOptions;
|
|
6
|
+
componentsModulePath: string;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* Generates the Alipay templates that project one React ownership tree through two independent native Page data roots.
|
|
10
|
+
*
|
|
11
|
+
* ## Native data ownership
|
|
12
|
+
*
|
|
13
|
+
* Every native Page owns `app`, the latest singleton App projection, and `page`, that Page instance's compact React root. The App
|
|
14
|
+
* document broadcasts granular `app.*` payloads to mounted Pages while each Page writes only `page.*`. The two projections meet
|
|
15
|
+
* at `vpt_page_outlet`; the Page Fiber remains beneath App `children` in React memory for context, lifecycle, refs, effects,
|
|
16
|
+
* removal, and HMR, but Page compact nodes never enter the App payload.
|
|
17
|
+
*
|
|
18
|
+
* ## AXML execution
|
|
19
|
+
*
|
|
20
|
+
* ```text
|
|
21
|
+
* Page AXML (owns app, page, and optional page-meta)
|
|
22
|
+
* -> <comp i="{{app}}" p="{{page}}"> crosses both roots into one recursive component scope
|
|
23
|
+
* -> comp.axml imports base.axml owns named-template lookup and event dispatch
|
|
24
|
+
* -> tmpl_0_vpt_fragment(i, p) iterates the real compact App roots
|
|
25
|
+
* -> stock templates(i, p) recursively render App descendants while forwarding p
|
|
26
|
+
* -> tmpl_0_vpt_page_outlet(p)
|
|
27
|
+
* -> taro_tmpl(root: p) renders this Page's compact children at the exact outlet
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* Alipay supports recursive named-template calls, so both trees stay inside one `comp` instance and need neither WX's depth-reset
|
|
31
|
+
* components nor a second Page-renderer component. `vpt_fragment` adapts zero, one, or many App roots to `comp`'s one-node `i`
|
|
32
|
+
* contract. It has no Fiber, sid, event source, ref, lifecycle, or native layout; only its real `cn` entries are keyed by sid.
|
|
33
|
+
* The outlet is equally transparent and adds no native layout node.
|
|
34
|
+
*
|
|
35
|
+
* Every named `<template>` receives a fresh explicit `data` object. Consequently `p` must be copied through each App recursion
|
|
36
|
+
* edge even though no stock host template reads it; otherwise the outlet can see `i` but not the Page root. The ordinary `p`
|
|
37
|
+
* component attribute also avoids Alipay's slot-wrapper trap: a named template reached through an imported recursive table is
|
|
38
|
+
* represented as another template component, which creates a fresh slot collection and loses the outer component's default slot.
|
|
39
|
+
* Passing Page data directly preserves the required location without duplicating the Page tree or rendering it beside the App.
|
|
40
|
+
*
|
|
41
|
+
* ## Why the Page has no base import
|
|
42
|
+
*
|
|
43
|
+
* Taro 4.2.1 removes `base.axml` imports from Alipay Pages that register custom components. Every VPT Page registers `comp`, so its
|
|
44
|
+
* AXML contains only optional PageMeta output and the `comp` bridge. The Page does not need an inlined copy either: `comp.axml` may
|
|
45
|
+
* import the shared table legally, and that table renders both `i` and `p`. This keeps each Page small, gives every named template
|
|
46
|
+
* one `utils.sjs` binding, and follows Taro's platform restriction without inventing a Page renderer.
|
|
47
|
+
*
|
|
48
|
+
* Both App and Page host events execute through `comp.eh` and resolve the original sid in Taro's shared event source. A `page.*`
|
|
49
|
+
* update changes only the `p` property; an `app.*` update changes only `i`. Newly pushed Pages receive the current complete App
|
|
50
|
+
* snapshot with their initial Page batch, while retained Pages require no navigation synchronization.
|
|
51
|
+
*
|
|
52
|
+
* Generated subpackages contain asynchronously loaded code rather than native routes. Alipay requires the `pages` field in each
|
|
53
|
+
* declaration, but accepts an empty array and still packages the files beneath that root. Keeping `pages: []` preserves the real
|
|
54
|
+
* model: no synthetic Page, native lifecycle, route, or template exists merely to make code eligible for asynchronous loading.
|
|
55
|
+
*/
|
|
56
|
+
export declare function createZfbSkeleton({ bundle, subpackages, nativeComponents, isProduction, options, componentsModulePath }: ZfbSkeletonInput): Rolldown.EmittedAsset[];
|
|
57
|
+
/** Adds Alipay's transparent App collection and threads the independent Page root through every recursive data scope. */
|
|
58
|
+
export declare function buildZfbBaseTemplate(source: string): string;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PluginOption } from 'vite';
|
|
2
|
+
import type { VptOptions } from '../../../options.ts';
|
|
3
|
+
import type { MiniContract } from '../mini/mini-contract.ts';
|
|
4
|
+
/** Adapts the shared Mini Program pipeline to the zfb public target. */
|
|
5
|
+
export declare function createZfbMiniPlugins(vptOptions: VptOptions): PluginOption[];
|
|
6
|
+
/** Binds the shared Mini Program core to Alipay runtime and output conventions. */
|
|
7
|
+
export declare function createZfbMiniContract(vptOptions: VptOptions): MiniContract;
|
|
@@ -12,6 +12,8 @@ export declare function resolveAppComponentPath({ appPath, projectRoot }: AppCom
|
|
|
12
12
|
export declare function resolvePageComponentPath({ pagePath, projectRoot }: PageComponentPathOptions): string;
|
|
13
13
|
/** Creates a portable import for one configured Page component. */
|
|
14
14
|
export declare function createPageComponentImportPath(options: PageComponentPathOptions): string;
|
|
15
|
+
/** Creates an exact normalized module-ID filter while admitting Vite query parameters. */
|
|
16
|
+
export declare function createExactModuleIdFilter(moduleId: string): RegExp;
|
|
15
17
|
/** Converts a file-backed Vite request ID to its normalized physical path for stable comparisons. */
|
|
16
18
|
export declare function normalizeModuleId(id: string): string;
|
|
17
19
|
/** Converts a local file path into Vite's portable file-system import form. */
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import type { VptJsonObject, VptOptions } from '../../options.ts';
|
|
1
|
+
import type { VptJsonObject, VptOptions, VptPageConfig, VptPageOption } from '../../options.ts';
|
|
2
|
+
/** Resolves an omitted Page configuration to its empty native representation. */
|
|
3
|
+
export declare function getPageConfig(page: VptPageOption): VptPageConfig;
|
|
2
4
|
/** Creates shared App configuration with configured Page order as the authoritative value. */
|
|
3
5
|
export declare function createAppConfig(options: VptOptions): VptJsonObject;
|
package/dist/options.d.ts
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export type
|
|
1
|
+
/** One immutable JSON value accepted by generated target configuration files. */
|
|
2
|
+
export type VptJsonValue = string | number | boolean | null | VptJsonObject | readonly VptJsonValue[];
|
|
3
|
+
/** An immutable JSON object accepted by vpt configuration. */
|
|
4
|
+
export interface VptJsonObject {
|
|
5
|
+
readonly [key: string]: VptJsonValue | undefined;
|
|
6
|
+
}
|
|
7
|
+
/** Application configuration written in the selected target's native schema. */
|
|
8
|
+
export type VptAppConfig = VptJsonObject;
|
|
9
|
+
/** Page configuration written in the selected target's native schema. */
|
|
10
|
+
export type VptPageConfig = VptJsonObject;
|
|
3
11
|
/** Build target handled by this plugin. */
|
|
4
|
-
export type VptTarget = 'wx' | 'h5';
|
|
5
|
-
/** Selects one implemented
|
|
12
|
+
export type VptTarget = 'wx' | 'zfb' | 'h5';
|
|
13
|
+
/** Selects one implemented Mini Program development update mechanism. */
|
|
6
14
|
export type VptHmrOptions = Readonly<{
|
|
7
|
-
/**
|
|
8
|
-
|
|
15
|
+
/**
|
|
16
|
+
* `devtools` executes native patch files; `interpreter` evaluates pushed source without native Page reload; `rebuild`
|
|
17
|
+
* replaces the complete native output after every valid source change.
|
|
18
|
+
*/
|
|
19
|
+
mode: 'devtools' | 'interpreter' | 'rebuild';
|
|
9
20
|
}>;
|
|
10
21
|
/** Configures one Taro page. */
|
|
11
22
|
export type VptPageOption = {
|
|
@@ -13,24 +24,26 @@ export type VptPageOption = {
|
|
|
13
24
|
* Taro route and output path without a file extension.
|
|
14
25
|
*
|
|
15
26
|
* The plugin resolves the page component from `src/${path}.tsx`, relative to the Vite project root. For example,
|
|
16
|
-
* `pages/home/index` resolves to `src/pages/home/index.tsx` and
|
|
27
|
+
* `pages/home/index` resolves to `src/pages/home/index.tsx` and keeps that output route for every target.
|
|
17
28
|
*/
|
|
18
29
|
path: string;
|
|
19
30
|
/**
|
|
20
|
-
*
|
|
31
|
+
* Optional native Page configuration for the selected target.
|
|
21
32
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
33
|
+
* Use Taro/WeChat keys for WX and H5, and Alipay keys for ZFB. The plugin preserves these fields in the Page runtime capsule
|
|
34
|
+
* and `<path>.json`, adding generated native-component registrations separately. It does not translate configuration names
|
|
35
|
+
* between platforms.
|
|
24
36
|
*/
|
|
25
|
-
config
|
|
37
|
+
config?: VptPageConfig;
|
|
26
38
|
};
|
|
27
39
|
/** Configures vpt for one build target. */
|
|
28
40
|
export interface VptOptions {
|
|
29
41
|
/**
|
|
30
42
|
* Platform produced by the current Vite invocation.
|
|
31
43
|
*
|
|
32
|
-
* Use `wx` to emit a WeChat Mini Program or `h5` to emit a browser application.
|
|
33
|
-
* module resolution, conditional compilation, runtime bootstrapping, style processing,
|
|
44
|
+
* Use `wx` to emit a WeChat Mini Program, `zfb` to emit an Alipay Mini Program, or `h5` to emit a browser application.
|
|
45
|
+
* The selected target controls Taro module resolution, conditional compilation, runtime bootstrapping, style processing,
|
|
46
|
+
* and output generation.
|
|
34
47
|
*/
|
|
35
48
|
target: VptTarget;
|
|
36
49
|
/**
|
|
@@ -48,36 +61,41 @@ export interface VptOptions {
|
|
|
48
61
|
*/
|
|
49
62
|
pages: VptPageOption[];
|
|
50
63
|
/**
|
|
51
|
-
*
|
|
64
|
+
* Native application configuration for the selected target.
|
|
52
65
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
66
|
+
* Use Taro/WeChat keys for WX and H5, and Alipay keys for ZFB. The plugin otherwise preserves the supplied configuration for
|
|
67
|
+
* runtime specialization and `app.json`; it does not translate configuration names between platforms. The plugin always
|
|
68
|
+
* derives `pages` from {@link pages}; caller-provided `pages`, `subPackages`, and `subpackages` values are discarded because
|
|
69
|
+
* the build pipeline owns page order and generated package placement.
|
|
56
70
|
*/
|
|
57
|
-
appJson:
|
|
71
|
+
appJson: VptAppConfig;
|
|
58
72
|
/**
|
|
59
|
-
*
|
|
73
|
+
* Native development-tool project configuration written without merging.
|
|
60
74
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
75
|
+
* WX emits this object as `project.config.json`; ZFB emits it as `mini.project.json`; H5 ignores it. Supply the schema
|
|
76
|
+
* expected by the selected target rather than sharing one project's platform-specific values across invocations. ZFB must
|
|
77
|
+
* use format 2 with `compileOptions.globalObjectMode: 'enable'` because the upstream Taro runtime reads the platform `global`;
|
|
78
|
+
* its Taro-style ES6 output also relies on `compileOptions.transpile` for the developer tool's final syntax conversion.
|
|
63
79
|
*/
|
|
64
80
|
projectConfigJson: VptJsonObject;
|
|
65
81
|
/**
|
|
66
|
-
* Local
|
|
82
|
+
* Local development-tool preferences written without merging.
|
|
67
83
|
*
|
|
68
|
-
*
|
|
84
|
+
* WX emits this object as `project.private.config.json`; ZFB emits it as `.mini-ide/project-ide.json`; H5 ignores it.
|
|
85
|
+
* These files control local IDE behavior rather than portable application metadata. In particular, the ZFB file does not
|
|
86
|
+
* associate the project with an Alipay App ID; Alipay Mini Program Studio keeps that selection in its workspace storage.
|
|
69
87
|
*/
|
|
70
88
|
projectPrivateConfigJson?: VptJsonObject;
|
|
71
89
|
/**
|
|
72
90
|
* WeChat Mini Program indexing rules written to `sitemap.json` without merging.
|
|
73
91
|
*
|
|
74
|
-
* The file is emitted only when this value is provided for a `wx` build. It is ignored for
|
|
92
|
+
* The file is emitted only when this value is provided for a `wx` build. It is ignored for ZFB and H5.
|
|
75
93
|
*/
|
|
76
94
|
sitemapJson?: VptJsonObject;
|
|
77
95
|
/**
|
|
78
|
-
* Selects the
|
|
96
|
+
* Selects the Mini Program development update mode. Omission uses `devtools`.
|
|
79
97
|
*
|
|
80
|
-
* This option affects only `vite serve` for
|
|
98
|
+
* This option affects only `vite serve` for `wx` and `zfb` targets and never changes H5 or production output.
|
|
81
99
|
*/
|
|
82
100
|
hmr?: VptHmrOptions;
|
|
83
101
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Install the minimal SystemJS loader and its synchronous-import extension before any native entry requests a capsule.
|
|
2
2
|
import '../systemjs/system-core.js';
|
|
3
3
|
import { transport } from './transport.js';
|
|
4
|
-
//
|
|
4
|
+
// Mini Program hosts have no modulepreload transport. Application import() boundaries retain System.import() and may load
|
|
5
5
|
// asynchronous subpackage or top-level-await graphs through this identity wrapper.
|
|
6
6
|
export const __vitePreload = (load) => load();
|
|
7
|
-
// SystemJS installs on
|
|
8
|
-
const installedSystem =
|
|
7
|
+
// SystemJS installs on the language global before this dependent module evaluates.
|
|
8
|
+
const installedSystem = globalThis.System;
|
|
9
9
|
if (!installedSystem) {
|
|
10
|
-
throw new Error('SystemJS failed to initialize in the
|
|
10
|
+
throw new Error('SystemJS failed to initialize in the Mini Program runtime');
|
|
11
11
|
}
|
|
12
12
|
// Transport returns synchronous registrations for main-package capsules and amphibious modules, and promise-like
|
|
13
13
|
// registrations only for capsules that physically live in generated subpackages.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// biome-ignore assist/source/organizeImports: Taro must initialize before the App component.
|
|
2
2
|
import { createReactApp, ReactDOM } from './taro-runtime.js';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
// @ts-expect-error: The
|
|
4
|
+
// @ts-expect-error: The active Mini contract resolves this private App component.
|
|
5
5
|
import AppComponent from '\0vpt:app-component';
|
|
6
6
|
const config = createReactApp(AppComponent, React, ReactDOM, __VPT_APP_CONFIG__);
|
|
7
7
|
export default config;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// App and Page shells activate independently; make Current.app initialization an explicit prerequisite for Page mount.
|
|
2
|
+
import './app.js';
|
|
3
|
+
// @ts-expect-error: The Mini Program build replaces this private import with the configured Page component.
|
|
4
|
+
import PageComponent from '\0vpt:page-component';
|
|
5
|
+
import { createPageConfig } from './taro-runtime.js';
|
|
6
|
+
/*
|
|
7
|
+
* Generated Page templates invoke Taro's unchanged recursive component, whose input is one compact node selected by i.nn.
|
|
8
|
+
* App JSX does not have that cardinality: it may return one or many top-level hosts, and the private Page outlet may occur at
|
|
9
|
+
* any depth within them. vpt_fragment is therefore a native-template-only collection adapter. Its fixed nn selects a transparent
|
|
10
|
+
* template that iterates cn while one surrounding component owns the Page-content boundary. Runtime projection markers relay
|
|
11
|
+
* that content only through the App branch containing the outlet. Without the fragment, each App root would need a separate
|
|
12
|
+
* recursive component and potential Page-content copy, or the component would need an App-specific collection mode.
|
|
13
|
+
*
|
|
14
|
+
* This record is not a Taro host: it has no Fiber, event source, ref, lifecycle, native element, or keyed parent collection.
|
|
15
|
+
* It consequently needs no sid. Only cn is seeded and updated; nn remains the stable generic-template discriminator.
|
|
16
|
+
*/
|
|
17
|
+
const config = createPageConfig(PageComponent, __VPT_PAGE_PATH__, { app: { nn: 'vpt_fragment', cn: [] }, page: { cn: [] } }, __VPT_PAGE_CONFIG__);
|
|
18
|
+
export default config;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** biome-ignore-all assist/source/organizeImports: keep side effect
|
|
1
|
+
/** biome-ignore-all assist/source/organizeImports: keep side effect order */
|
|
2
2
|
/** Taro runtime exports shared by the App, Page, and generated recursive component capsules. */
|
|
3
|
-
import '
|
|
3
|
+
import '\0vpt:taro-platform-runtime';
|
|
4
4
|
export { createReactApp } from '@tarojs/plugin-framework-react/dist/runtime';
|
|
5
5
|
export { default as ReactDOM } from '@tarojs/react';
|
|
6
6
|
export { createPageConfig, createRecursiveComponentConfig } from '@tarojs/runtime';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
/** biome-ignore-all assist/source/organizeImports: keep side effect
|
|
1
|
+
/** biome-ignore-all assist/source/organizeImports: keep side effect order */
|
|
2
2
|
/** Taro runtime exports shared by the App, Page, and generated recursive component capsules. */
|
|
3
|
-
|
|
3
|
+
// @ts-expect-error: The active Mini contract resolves its Taro platform initialization module.
|
|
4
|
+
import '\0vpt:taro-platform-runtime';
|
|
4
5
|
export { createReactApp } from '@tarojs/plugin-framework-react/dist/runtime';
|
|
5
6
|
export { default as ReactDOM } from '@tarojs/react';
|
|
6
7
|
export { createPageConfig, createRecursiveComponentConfig } from '@tarojs/runtime';
|
|
7
8
|
import { customWrapperCache } from '@tarojs/runtime';
|
|
8
|
-
// DevTools HMR runs in the bootstrap chunk, so publish the application graph's cache once on
|
|
9
|
+
// DevTools HMR runs in the bootstrap chunk, so publish the application graph's cache once on the language global.
|
|
9
10
|
if (process.env.NODE_ENV === 'development') {
|
|
10
|
-
Reflect.set(
|
|
11
|
+
Reflect.set(globalThis, Symbol.for('customWrapperCache'), customWrapperCache);
|
|
11
12
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Host-to-App terminal control over the App heap's authenticated Vite socket. */
|
|
2
|
-
export declare const runtimeControlEvent = "vpt:
|
|
2
|
+
export declare const runtimeControlEvent = "vpt:mini-hmr:control";
|
|
3
3
|
/** App-to-host application frontier and rebuild reports over the same socket. */
|
|
4
|
-
export declare const runtimeReportEvent = "vpt:
|
|
4
|
+
export declare const runtimeReportEvent = "vpt:mini-hmr:report";
|
|
5
5
|
/** Build identity and authenticated socket endpoint fixed for one App heap. */
|
|
6
6
|
export type HmrInfo = Readonly<{
|
|
7
7
|
buildId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Host-to-App terminal control over the App heap's authenticated Vite socket. */
|
|
2
|
-
export const runtimeControlEvent = 'vpt:
|
|
2
|
+
export const runtimeControlEvent = 'vpt:mini-hmr:control';
|
|
3
3
|
/** App-to-host application frontier and rebuild reports over the same socket. */
|
|
4
|
-
export const runtimeReportEvent = 'vpt:
|
|
4
|
+
export const runtimeReportEvent = 'vpt:mini-hmr:report';
|