@tamagui/static 1.0.0-beta.153 → 1.0.0-beta.181
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/cjs/constants.js +8 -0
- package/dist/cjs/extractor/accessSafe.js +4 -0
- package/dist/cjs/extractor/babelParse.js +5 -0
- package/dist/cjs/extractor/babelParse.js.map +2 -2
- package/dist/cjs/extractor/buildClassName.js +4 -0
- package/dist/cjs/extractor/createEvaluator.js +5 -0
- package/dist/cjs/extractor/createExtractor.js +120 -72
- package/dist/cjs/extractor/createExtractor.js.map +2 -2
- package/dist/cjs/extractor/ensureImportingConcat.js +4 -0
- package/dist/cjs/extractor/evaluateAstNode.js +4 -0
- package/dist/cjs/extractor/extractHelpers.js +11 -0
- package/dist/cjs/extractor/extractMediaStyle.js +5 -0
- package/dist/cjs/extractor/extractMediaStyle.js.map +2 -2
- package/dist/cjs/extractor/extractToClassNames.js +12 -4
- package/dist/cjs/extractor/extractToClassNames.js.map +2 -2
- package/dist/cjs/extractor/findTopmostFunction.js +4 -0
- package/dist/cjs/extractor/generatedUid.js +4 -0
- package/dist/cjs/extractor/getPrefixLogs.js +4 -0
- package/dist/cjs/extractor/getPropValueFromAttributes.js +4 -0
- package/dist/cjs/extractor/getSourceModule.js +4 -0
- package/dist/cjs/extractor/getStaticBindingsForScope.js +4 -0
- package/dist/cjs/extractor/hoistClassNames.js +4 -0
- package/dist/cjs/extractor/literalToAst.js +5 -0
- package/dist/cjs/extractor/loadTamagui.js +67 -47
- package/dist/cjs/extractor/loadTamagui.js.map +2 -2
- package/dist/cjs/extractor/logLines.js +4 -0
- package/dist/cjs/extractor/normalizeTernaries.js +4 -0
- package/dist/cjs/extractor/removeUnusedHooks.js +4 -0
- package/dist/cjs/extractor/timer.js +46 -0
- package/dist/cjs/extractor/timer.js.map +7 -0
- package/dist/cjs/extractor/validHTMLAttributes.js +4 -0
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/patchReactNativeWeb.js +23 -7
- package/dist/cjs/patchReactNativeWeb.js.map +2 -2
- package/dist/esm/extractor/babelParse.js.map +2 -2
- package/dist/esm/extractor/createExtractor.js +123 -79
- package/dist/esm/extractor/createExtractor.js.map +2 -2
- package/dist/esm/extractor/extractMediaStyle.js.map +2 -2
- package/dist/esm/extractor/extractToClassNames.js +8 -4
- package/dist/esm/extractor/extractToClassNames.js.map +2 -2
- package/dist/esm/extractor/loadTamagui.js +63 -47
- package/dist/esm/extractor/loadTamagui.js.map +2 -2
- package/dist/esm/extractor/timer.js +24 -0
- package/dist/esm/extractor/timer.js.map +7 -0
- package/dist/esm/patchReactNativeWeb.js +19 -7
- package/dist/esm/patchReactNativeWeb.js.map +2 -2
- package/dist/jsx/extractor/createExtractor.js +123 -79
- package/dist/jsx/extractor/extractToClassNames.js +8 -4
- package/dist/jsx/extractor/loadTamagui.js +63 -47
- package/dist/jsx/extractor/timer.js +23 -0
- package/dist/jsx/patchReactNativeWeb.js +19 -7
- package/package.json +9 -9
- package/types/extractor/babelParse.d.ts.map +1 -1
- package/types/extractor/createExtractor.d.ts.map +1 -1
- package/types/extractor/extractMediaStyle.d.ts +1 -1
- package/types/extractor/extractMediaStyle.d.ts.map +1 -1
- package/types/extractor/extractToClassNames.d.ts +2 -1
- package/types/extractor/extractToClassNames.d.ts.map +1 -1
- package/types/extractor/loadTamagui.d.ts.map +1 -1
- package/types/extractor/timer.d.ts +5 -0
- package/types/extractor/timer.d.ts.map +1 -0
- package/types/patchReactNativeWeb.d.ts.map +1 -1
|
@@ -5,6 +5,7 @@ import * as t from "@babel/types";
|
|
|
5
5
|
import {
|
|
6
6
|
getSplitStyles,
|
|
7
7
|
mediaQueryConfig,
|
|
8
|
+
normalizeStyleObject,
|
|
8
9
|
pseudos,
|
|
9
10
|
rnw
|
|
10
11
|
} from "@tamagui/core-node";
|
|
@@ -20,6 +21,7 @@ import { loadTamagui } from "./loadTamagui";
|
|
|
20
21
|
import { logLines } from "./logLines";
|
|
21
22
|
import { normalizeTernaries } from "./normalizeTernaries";
|
|
22
23
|
import { removeUnusedHooks } from "./removeUnusedHooks";
|
|
24
|
+
import { timer } from "./timer";
|
|
23
25
|
import { validHTMLAttributes } from "./validHTMLAttributes";
|
|
24
26
|
const UNTOUCHED_PROPS = {
|
|
25
27
|
key: true,
|
|
@@ -47,10 +49,6 @@ function createExtractor() {
|
|
|
47
49
|
process.exit(1);
|
|
48
50
|
}
|
|
49
51
|
const shouldAddDebugProp = !process.env.npm_package_dependencies_next && process.env.TAMAGUI_TARGET !== "native" && process.env.IDENTIFY_TAGS !== "false" && (process.env.NODE_ENV === "development" || process.env.DEBUG || process.env.IDENTIFY_TAGS);
|
|
50
|
-
require("esbuild-register/dist/node").register({
|
|
51
|
-
target: "es2019",
|
|
52
|
-
format: "cjs"
|
|
53
|
-
});
|
|
54
52
|
let loadedTamaguiConfig;
|
|
55
53
|
let hasLogged = false;
|
|
56
54
|
return {
|
|
@@ -83,10 +81,15 @@ function createExtractor() {
|
|
|
83
81
|
if (!Array.isArray(props.components)) {
|
|
84
82
|
throw new Error(`Must provide components array with list of Tamagui component modules`);
|
|
85
83
|
}
|
|
84
|
+
const tm = timer();
|
|
86
85
|
const { components, tamaguiConfig } = loadTamagui({
|
|
87
86
|
config,
|
|
88
87
|
components: props.components || ["tamagui"]
|
|
89
88
|
});
|
|
89
|
+
if (shouldPrintDebug === "verbose") {
|
|
90
|
+
console.log("tamagui.config.ts:", { components, config });
|
|
91
|
+
}
|
|
92
|
+
tm.mark("load-tamagui", shouldPrintDebug === "verbose");
|
|
90
93
|
loadedTamaguiConfig = tamaguiConfig;
|
|
91
94
|
const defaultTheme = tamaguiConfig.themes[Object.keys(tamaguiConfig.themes)[0]];
|
|
92
95
|
const body = fileOrPath.type === "Program" ? fileOrPath.get("body") : fileOrPath.program.body;
|
|
@@ -100,6 +103,9 @@ function createExtractor() {
|
|
|
100
103
|
obj[name] = components[name];
|
|
101
104
|
return obj;
|
|
102
105
|
}, {});
|
|
106
|
+
if (shouldPrintDebug === "verbose") {
|
|
107
|
+
console.log("validComponents", Object.keys(validComponents));
|
|
108
|
+
}
|
|
103
109
|
let doesUseValidImport = false;
|
|
104
110
|
let hasImportedTheme = false;
|
|
105
111
|
for (const bodyPath of body) {
|
|
@@ -107,11 +113,16 @@ function createExtractor() {
|
|
|
107
113
|
continue;
|
|
108
114
|
const node = "node" in bodyPath ? bodyPath.node : bodyPath;
|
|
109
115
|
const from = node.source.value;
|
|
110
|
-
|
|
111
|
-
|
|
116
|
+
const isValidImport = props.components.includes(from) || isInternalImport(from);
|
|
117
|
+
if (isValidImport) {
|
|
118
|
+
const isValidComponent = node.specifiers.some((specifier) => {
|
|
112
119
|
const name = specifier.local.name;
|
|
113
120
|
return validComponents[name] || validHooks[name];
|
|
114
|
-
})
|
|
121
|
+
});
|
|
122
|
+
if (shouldPrintDebug === "verbose") {
|
|
123
|
+
console.log("import from", from, { isValidComponent });
|
|
124
|
+
}
|
|
125
|
+
if (isValidComponent) {
|
|
115
126
|
doesUseValidImport = true;
|
|
116
127
|
break;
|
|
117
128
|
}
|
|
@@ -123,6 +134,7 @@ function createExtractor() {
|
|
|
123
134
|
if (!doesUseValidImport) {
|
|
124
135
|
return null;
|
|
125
136
|
}
|
|
137
|
+
tm.mark("import-check", shouldPrintDebug === "verbose");
|
|
126
138
|
let couldntParse = false;
|
|
127
139
|
const modifiedComponents = /* @__PURE__ */ new Set();
|
|
128
140
|
const bindingCache = {};
|
|
@@ -144,6 +156,7 @@ function createExtractor() {
|
|
|
144
156
|
},
|
|
145
157
|
JSXElement(traversePath) {
|
|
146
158
|
var _a, _b, _c, _d, _e;
|
|
159
|
+
tm.mark("jsx-element", shouldPrintDebug === "verbose");
|
|
147
160
|
const node = traversePath.node.openingElement;
|
|
148
161
|
const ogAttributes = node.attributes;
|
|
149
162
|
const componentName = findComponentName(traversePath.scope);
|
|
@@ -571,6 +584,11 @@ function createExtractor() {
|
|
|
571
584
|
for (const key in next) {
|
|
572
585
|
if (pseudos[key]) {
|
|
573
586
|
prev2[key] = prev2[key] || {};
|
|
587
|
+
if (shouldPrintDebug) {
|
|
588
|
+
if (!next[key] || !prev2[key]) {
|
|
589
|
+
console.log("warn: missing", key, prev2, next);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
574
592
|
Object.assign(prev2[key], next[key]);
|
|
575
593
|
} else {
|
|
576
594
|
prev2[key] = next[key];
|
|
@@ -680,6 +698,7 @@ function createExtractor() {
|
|
|
680
698
|
if (couldntParse) {
|
|
681
699
|
return;
|
|
682
700
|
}
|
|
701
|
+
tm.mark("jsx-element-flattened", shouldPrintDebug === "verbose");
|
|
683
702
|
node.attributes = flattenedAttrs;
|
|
684
703
|
if (staticConfig.defaultProps) {
|
|
685
704
|
for (const key in staticConfig.defaultProps) {
|
|
@@ -705,6 +724,7 @@ function createExtractor() {
|
|
|
705
724
|
attrs = traversePath.get("openingElement").get("attributes").flatMap((path) => {
|
|
706
725
|
try {
|
|
707
726
|
const res2 = evaluateAttribute(path);
|
|
727
|
+
tm.mark("jsx-element-evaluate-attr", shouldPrintDebug === "verbose");
|
|
708
728
|
if (!res2) {
|
|
709
729
|
path.remove();
|
|
710
730
|
}
|
|
@@ -767,45 +787,25 @@ function createExtractor() {
|
|
|
767
787
|
out.push(cur);
|
|
768
788
|
return out;
|
|
769
789
|
}, []).flat();
|
|
770
|
-
const completeStaticProps = {
|
|
771
|
-
...Object.keys(attrs).reduce((acc, index) => {
|
|
772
|
-
const cur = attrs[index];
|
|
773
|
-
if (cur.type === "style") {
|
|
774
|
-
Object.assign(acc, cur.value);
|
|
775
|
-
}
|
|
776
|
-
if (cur.type === "attr") {
|
|
777
|
-
if (t.isJSXSpreadAttribute(cur.value)) {
|
|
778
|
-
return acc;
|
|
779
|
-
}
|
|
780
|
-
if (!t.isJSXIdentifier(cur.value.name)) {
|
|
781
|
-
return acc;
|
|
782
|
-
}
|
|
783
|
-
const key = cur.value.name.name;
|
|
784
|
-
const value = attemptEvalSafe(cur.value.value || t.booleanLiteral(true));
|
|
785
|
-
if (value === FAILED_EVAL) {
|
|
786
|
-
return acc;
|
|
787
|
-
}
|
|
788
|
-
acc[key] = value;
|
|
789
|
-
}
|
|
790
|
-
return acc;
|
|
791
|
-
}, {})
|
|
792
|
-
};
|
|
793
790
|
const hasSpread = node.attributes.some((x) => t.isJSXSpreadAttribute(x));
|
|
794
791
|
const hasOnlyStringChildren = !hasSpread && (node.selfClosing || traversePath.node.children && traversePath.node.children.every((x) => x.type === "JSXText"));
|
|
795
792
|
const themeVal = inlined.get("theme");
|
|
796
793
|
inlined.delete("theme");
|
|
797
794
|
const allOtherPropsExtractable = [...inlined].every(([k, v]) => INLINE_EXTRACTABLE[k]);
|
|
798
|
-
const
|
|
799
|
-
const canFlattenProps = inlined.size === 0 ||
|
|
795
|
+
const shouldWrapThme = allOtherPropsExtractable && !!themeVal;
|
|
796
|
+
const canFlattenProps = inlined.size === 0 || shouldWrapThme || allOtherPropsExtractable;
|
|
800
797
|
let shouldFlatten = !shouldDeopt && canFlattenProps && !hasSpread && staticConfig.neverFlatten !== true && (staticConfig.neverFlatten === "jsx" ? hasOnlyStringChildren : true);
|
|
801
|
-
if (
|
|
798
|
+
if (shouldPrintDebug) {
|
|
799
|
+
console.log(" >>", { hasSpread, shouldDeopt, shouldFlatten, canFlattenProps, shouldWrapThme, allOtherPropsExtractable, hasOnlyStringChildren });
|
|
800
|
+
}
|
|
801
|
+
if (shouldFlatten && shouldWrapThme) {
|
|
802
802
|
if (typeof themeVal !== "string") {
|
|
803
|
-
console.warn("??");
|
|
804
803
|
return;
|
|
805
804
|
}
|
|
806
805
|
if (shouldPrintDebug) {
|
|
807
806
|
console.log(" - wrapping theme", allOtherPropsExtractable, themeVal);
|
|
808
807
|
}
|
|
808
|
+
attrs = attrs.filter((x) => x.type === "attr" && t.isJSXAttribute(x.value) && x.value.name.name === "theme" ? false : true);
|
|
809
809
|
if (!hasImportedTheme) {
|
|
810
810
|
hasImportedTheme = true;
|
|
811
811
|
programPath.node.body.push(t.importDeclaration([t.importSpecifier(t.identifier("_TamaguiTheme"), t.identifier("Theme"))], t.stringLiteral("@tamagui/core")));
|
|
@@ -817,23 +817,21 @@ function createExtractor() {
|
|
|
817
817
|
if (shouldFlatten && staticConfig.defaultProps) {
|
|
818
818
|
const defaultStyleAttrs = Object.keys(staticConfig.defaultProps).flatMap((key) => {
|
|
819
819
|
if (!isValidStyleKey(key)) {
|
|
820
|
-
return;
|
|
820
|
+
return [];
|
|
821
821
|
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
const name = tamaguiConfig.shorthands[key] || key;
|
|
827
|
-
return {
|
|
828
|
-
type: "style",
|
|
829
|
-
name,
|
|
830
|
-
value
|
|
831
|
-
};
|
|
832
|
-
} catch (err) {
|
|
833
|
-
console.warn(`\u26A0\uFE0F Error evaluating default style for component, prop ${key}
|
|
834
|
-
error: ${err}`);
|
|
822
|
+
const value = staticConfig.defaultProps[key];
|
|
823
|
+
const name = tamaguiConfig.shorthands[key] || key;
|
|
824
|
+
if (value === void 0) {
|
|
825
|
+
console.warn(`\u26A0\uFE0F Error evaluating default style for component, prop ${key} ${value}`);
|
|
835
826
|
shouldDeopt = true;
|
|
827
|
+
return;
|
|
836
828
|
}
|
|
829
|
+
const attr = {
|
|
830
|
+
type: "style",
|
|
831
|
+
name,
|
|
832
|
+
value: { [name]: value }
|
|
833
|
+
};
|
|
834
|
+
return attr;
|
|
837
835
|
});
|
|
838
836
|
if (defaultStyleAttrs.length) {
|
|
839
837
|
attrs = [...defaultStyleAttrs, ...attrs];
|
|
@@ -901,6 +899,7 @@ function createExtractor() {
|
|
|
901
899
|
acc.push(cur);
|
|
902
900
|
return acc;
|
|
903
901
|
}, []);
|
|
902
|
+
tm.mark("jsx-element-expanded", shouldPrintDebug === "verbose");
|
|
904
903
|
if (shouldPrintDebug) {
|
|
905
904
|
console.log(" - attrs (expanded): \n", logLines(attrs.map(attrStr).join(", ")));
|
|
906
905
|
}
|
|
@@ -937,54 +936,91 @@ function createExtractor() {
|
|
|
937
936
|
acc.push(cur);
|
|
938
937
|
return acc;
|
|
939
938
|
}, []);
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
939
|
+
const state = {
|
|
940
|
+
noClassNames: true,
|
|
941
|
+
focus: false,
|
|
942
|
+
hover: false,
|
|
943
|
+
mounted: true,
|
|
944
|
+
press: false,
|
|
945
|
+
pressIn: false
|
|
946
|
+
};
|
|
947
|
+
const completeStaticProps = Object.keys(attrs).reduce((acc, index) => {
|
|
948
|
+
const cur = attrs[index];
|
|
949
|
+
if (cur.type === "style") {
|
|
950
|
+
normalizeStyleObject(cur.value);
|
|
951
|
+
Object.assign(acc, cur.value);
|
|
952
|
+
}
|
|
953
|
+
if (cur.type === "attr") {
|
|
954
|
+
if (t.isJSXSpreadAttribute(cur.value)) {
|
|
955
|
+
return acc;
|
|
956
|
+
}
|
|
957
|
+
if (!t.isJSXIdentifier(cur.value.name)) {
|
|
958
|
+
return acc;
|
|
959
|
+
}
|
|
960
|
+
const key = cur.value.name.name;
|
|
961
|
+
const value = attemptEvalSafe(cur.value.value || t.booleanLiteral(true));
|
|
962
|
+
if (value === FAILED_EVAL) {
|
|
963
|
+
return acc;
|
|
964
|
+
}
|
|
965
|
+
acc[key] = value;
|
|
966
|
+
}
|
|
967
|
+
return acc;
|
|
968
|
+
}, {});
|
|
943
969
|
const completeProps = {
|
|
944
970
|
...staticConfig.defaultProps,
|
|
945
971
|
...completeStaticProps
|
|
946
972
|
};
|
|
973
|
+
if (shouldPrintDebug) {
|
|
974
|
+
console.log(" - attrs (combined \u{1F500}): \n", logLines(attrs.map(attrStr).join(", ")));
|
|
975
|
+
console.log(" - defaultProps: \n", logLines(objToStr(staticConfig.defaultProps)));
|
|
976
|
+
console.log(" - completeStaticProps: \n", logLines(objToStr(completeStaticProps)));
|
|
977
|
+
}
|
|
947
978
|
const getStyles = /* @__PURE__ */ __name((props2, debugName = "") => {
|
|
948
|
-
if (!props2)
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
return;
|
|
979
|
+
if (!props2 || !Object.keys(props2).length) {
|
|
980
|
+
if (shouldPrintDebug)
|
|
981
|
+
console.log(" getStyles() no props");
|
|
982
|
+
return {};
|
|
983
|
+
}
|
|
952
984
|
if (excludeProps && !!excludeProps.size) {
|
|
953
985
|
for (const key in props2) {
|
|
954
986
|
if (excludeProps.has(key)) {
|
|
987
|
+
if (shouldPrintDebug)
|
|
988
|
+
console.log(" delete excluded", key);
|
|
955
989
|
delete props2[key];
|
|
956
990
|
}
|
|
957
991
|
}
|
|
958
992
|
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
const outStyle = {
|
|
969
|
-
...out.style,
|
|
970
|
-
...out.pseudos
|
|
971
|
-
};
|
|
972
|
-
for (const key in outStyle) {
|
|
993
|
+
try {
|
|
994
|
+
const out = getSplitStyles(props2, staticConfig, defaultTheme, {
|
|
995
|
+
...state,
|
|
996
|
+
fallbackProps: completeProps
|
|
997
|
+
});
|
|
998
|
+
const outStyle = {
|
|
999
|
+
...out.style,
|
|
1000
|
+
...out.pseudos
|
|
1001
|
+
};
|
|
973
1002
|
if (staticConfig.validStyles) {
|
|
974
|
-
|
|
975
|
-
|
|
1003
|
+
for (const key in outStyle) {
|
|
1004
|
+
if (!staticConfig.validStyles[key] && !pseudos[key] && !/(hover|focus|press)Style$/.test(key)) {
|
|
1005
|
+
if (shouldPrintDebug)
|
|
1006
|
+
console.log(" delete invalid style", key);
|
|
1007
|
+
delete outStyle[key];
|
|
1008
|
+
}
|
|
976
1009
|
}
|
|
977
1010
|
}
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
console.log(` getStyles ${debugName} (props):
|
|
1011
|
+
if (shouldPrintDebug) {
|
|
1012
|
+
console.log(` getStyles ${debugName} (props):
|
|
981
1013
|
`, logLines(objToStr(props2)));
|
|
982
|
-
|
|
1014
|
+
console.log(` getStyles ${debugName} (out.viewProps):
|
|
983
1015
|
`, logLines(objToStr(out.viewProps)));
|
|
984
|
-
|
|
1016
|
+
console.log(` getStyles ${debugName} (out.style):
|
|
985
1017
|
`, logLines(objToStr(outStyle || {}), true));
|
|
1018
|
+
}
|
|
1019
|
+
return outStyle;
|
|
1020
|
+
} catch (err) {
|
|
1021
|
+
console.log("error", err.message, err.stack);
|
|
1022
|
+
return {};
|
|
986
1023
|
}
|
|
987
|
-
return outStyle;
|
|
988
1024
|
}, "getStyles");
|
|
989
1025
|
const completeStylesProcessed = getStyles(completeProps, "completeStylesProcessed");
|
|
990
1026
|
if (!completeStylesProcessed) {
|
|
@@ -1025,11 +1061,13 @@ function createExtractor() {
|
|
|
1025
1061
|
console.log(" => tern ", attrStr(attr));
|
|
1026
1062
|
continue;
|
|
1027
1063
|
case "style":
|
|
1064
|
+
if (shouldPrintDebug)
|
|
1065
|
+
console.log(" * styles in", logLines(objToStr(attr.value)));
|
|
1028
1066
|
const styles = getStyles(attr.value, "style");
|
|
1067
|
+
if (shouldPrintDebug)
|
|
1068
|
+
console.log(" * styles out", logLines(objToStr(styles)));
|
|
1029
1069
|
if (styles) {
|
|
1030
1070
|
attr.value = Object.fromEntries(Object.keys(styles).map((k) => [k, completeStylesProcessed[k]]));
|
|
1031
|
-
} else {
|
|
1032
|
-
console.warn("?????????");
|
|
1033
1071
|
}
|
|
1034
1072
|
continue;
|
|
1035
1073
|
}
|
|
@@ -1037,6 +1075,7 @@ function createExtractor() {
|
|
|
1037
1075
|
getStyleError = err;
|
|
1038
1076
|
}
|
|
1039
1077
|
}
|
|
1078
|
+
tm.mark("jsx-element-styles", shouldPrintDebug === "verbose");
|
|
1040
1079
|
if (getStyleError) {
|
|
1041
1080
|
console.log(" \u26A0\uFE0F postprocessing error, deopt", getStyleError);
|
|
1042
1081
|
node.attributes = ogAttributes;
|
|
@@ -1060,6 +1099,9 @@ function createExtractor() {
|
|
|
1060
1099
|
if (attr.type === "style") {
|
|
1061
1100
|
for (const key in attr.value) {
|
|
1062
1101
|
if (existingStyleKeys.has(key)) {
|
|
1102
|
+
if (shouldPrintDebug) {
|
|
1103
|
+
console.log(" >> delete existing", key);
|
|
1104
|
+
}
|
|
1063
1105
|
delete attr.value[key];
|
|
1064
1106
|
} else {
|
|
1065
1107
|
existingStyleKeys.add(key);
|
|
@@ -1101,6 +1143,7 @@ function createExtractor() {
|
|
|
1101
1143
|
}
|
|
1102
1144
|
}
|
|
1103
1145
|
});
|
|
1146
|
+
tm.mark("jsx-done", shouldPrintDebug === "verbose");
|
|
1104
1147
|
if (modifiedComponents.size) {
|
|
1105
1148
|
const all = Array.from(modifiedComponents);
|
|
1106
1149
|
if (shouldPrintDebug) {
|
|
@@ -1110,6 +1153,7 @@ function createExtractor() {
|
|
|
1110
1153
|
removeUnusedHooks(comp, shouldPrintDebug);
|
|
1111
1154
|
}
|
|
1112
1155
|
}
|
|
1156
|
+
tm.done(shouldPrintDebug === "verbose");
|
|
1113
1157
|
return res;
|
|
1114
1158
|
}
|
|
1115
1159
|
};
|