miaoda-expo-devkit 0.1.1-beta.73 → 0.1.1-beta.75
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/dist/babel/plugin-jsx-source.d.ts +2 -0
- package/dist/babel/plugin-jsx-source.js +20 -0
- package/dist/metro.js +10 -8
- package/dist/metro.mjs +10 -8
- package/package.json +1 -1
|
@@ -23,6 +23,7 @@ __export(plugin_jsx_source_exports, {
|
|
|
23
23
|
default: () => babelPluginJsxSource
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(plugin_jsx_source_exports);
|
|
26
|
+
var DEFAULT_EXCLUDE_PACKAGES = ["react-native-gifted-charts"];
|
|
26
27
|
var DATASET_PROP_NAME = "dataSet";
|
|
27
28
|
var MD_ID_KEY = "mdId";
|
|
28
29
|
var MD_CONTENT_KEY = "componentContent";
|
|
@@ -103,15 +104,34 @@ function shouldSkipElement(t, name) {
|
|
|
103
104
|
function babelPluginJsxSource({
|
|
104
105
|
types: t
|
|
105
106
|
}) {
|
|
107
|
+
let excludedIdentifiers;
|
|
106
108
|
return {
|
|
107
109
|
name: "babel-plugin-jsx-source",
|
|
108
110
|
visitor: {
|
|
111
|
+
Program(_path, state) {
|
|
112
|
+
excludedIdentifiers = /* @__PURE__ */ new Set();
|
|
113
|
+
const excludePackages = [
|
|
114
|
+
...DEFAULT_EXCLUDE_PACKAGES,
|
|
115
|
+
...state.opts.excludePackages || []
|
|
116
|
+
];
|
|
117
|
+
const programBody = _path.node.body;
|
|
118
|
+
for (const node of programBody) {
|
|
119
|
+
if (t.isImportDeclaration(node) && excludePackages.some((pkg) => node.source.value === pkg || node.source.value.startsWith(pkg + "/"))) {
|
|
120
|
+
for (const specifier of node.specifiers) {
|
|
121
|
+
excludedIdentifiers.add(specifier.local.name);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
109
126
|
JSXOpeningElement(path, state) {
|
|
110
127
|
const { opts, filename } = state;
|
|
111
128
|
if (!filename) return;
|
|
112
129
|
if (filename.includes("node_modules")) return;
|
|
113
130
|
if (opts.excludePaths?.some((p) => filename.includes(p))) return;
|
|
114
131
|
if (shouldSkipElement(t, path.node.name)) return;
|
|
132
|
+
const elementName = path.node.name;
|
|
133
|
+
if (t.isJSXIdentifier(elementName) && excludedIdentifiers.has(elementName.name)) return;
|
|
134
|
+
if (t.isJSXMemberExpression(elementName) && t.isJSXIdentifier(elementName.object) && excludedIdentifiers.has(elementName.object.name)) return;
|
|
115
135
|
const loc = path.node.loc;
|
|
116
136
|
if (!loc) return;
|
|
117
137
|
let filePath = filename;
|
package/dist/metro.js
CHANGED
|
@@ -616,14 +616,16 @@ function withPersistentCache(config, options = {}) {
|
|
|
616
616
|
return {
|
|
617
617
|
...config,
|
|
618
618
|
// transform cache:JS/TS 编译结果
|
|
619
|
-
cacheStores: [new StoreClass({ root: cacheRoot })]
|
|
620
|
-
// FileMap cache
|
|
621
|
-
//
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
619
|
+
cacheStores: [new StoreClass({ root: cacheRoot })],
|
|
620
|
+
// FileMap cache:文件系统索引快照 + Watchman clock
|
|
621
|
+
// 与 transform cache 放同一目录,文件名由 Metro 按 projectRoot+config hash 自动区分
|
|
622
|
+
fileMapCacheDirectory: cacheRoot,
|
|
623
|
+
watcher: {
|
|
624
|
+
...config.watcher,
|
|
625
|
+
// 运行时文件变化后自动将 FileMap cache 写回磁盘(debounce 5s)
|
|
626
|
+
// 保证进程意外退出后下次启动仍能命中缓存
|
|
627
|
+
unstable_autoSaveCache: { enabled: true }
|
|
628
|
+
}
|
|
627
629
|
};
|
|
628
630
|
}
|
|
629
631
|
|
package/dist/metro.mjs
CHANGED
|
@@ -567,14 +567,16 @@ function withPersistentCache(config, options = {}) {
|
|
|
567
567
|
return {
|
|
568
568
|
...config,
|
|
569
569
|
// transform cache:JS/TS 编译结果
|
|
570
|
-
cacheStores: [new StoreClass({ root: cacheRoot })]
|
|
571
|
-
// FileMap cache
|
|
572
|
-
//
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
570
|
+
cacheStores: [new StoreClass({ root: cacheRoot })],
|
|
571
|
+
// FileMap cache:文件系统索引快照 + Watchman clock
|
|
572
|
+
// 与 transform cache 放同一目录,文件名由 Metro 按 projectRoot+config hash 自动区分
|
|
573
|
+
fileMapCacheDirectory: cacheRoot,
|
|
574
|
+
watcher: {
|
|
575
|
+
...config.watcher,
|
|
576
|
+
// 运行时文件变化后自动将 FileMap cache 写回磁盘(debounce 5s)
|
|
577
|
+
// 保证进程意外退出后下次启动仍能命中缓存
|
|
578
|
+
unstable_autoSaveCache: { enabled: true }
|
|
579
|
+
}
|
|
578
580
|
};
|
|
579
581
|
}
|
|
580
582
|
|