vite-plugin-taro-runtime 0.7.3-beta.2 → 0.7.3
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isEnableTTDom, DEFAULT_COMPONENTS, TT_SPECIFIC_COMPONENTS } from '@tarojs/shared';
|
|
2
2
|
import { HTML, HEAD, BODY, APP, CONTAINER, ROOT_STR } from '../constants/index.js';
|
|
3
3
|
import { TaroDocument } from '../dom/document.js';
|
|
4
|
+
import { eventSource } from '../dom/event-source.js';
|
|
4
5
|
import env from '../env.js';
|
|
5
6
|
|
|
6
7
|
function createDocument() {
|
|
@@ -34,7 +35,11 @@ function createDocument() {
|
|
|
34
35
|
* runtime.esm.js entry and therefore retains the upstream <app> element.
|
|
35
36
|
*/
|
|
36
37
|
const app = documentCreateElement(ROOT_STR);
|
|
37
|
-
|
|
38
|
+
// Bootstrap identity without serializing an update: this root has no native host yet. The id setter would
|
|
39
|
+
// eagerly cache component aliases before the target runtime merges its component definitions, because a
|
|
40
|
+
// TaroRootElement is its own _root even while detached. Preserve both the DOM id and event-source lookup.
|
|
41
|
+
app.props.id = app.uid = APP;
|
|
42
|
+
eventSource.set(APP, app);
|
|
38
43
|
const container = documentCreateElement(CONTAINER); // 多包一层主要为了兼容 vue
|
|
39
44
|
doc.appendChild(html);
|
|
40
45
|
html.appendChild(head);
|