react-native-boost 0.4.1 → 0.5.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.md +3 -5
- package/dist/esm/index.mjs +39 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin/esm/index.mjs +168 -44
- package/dist/plugin/esm/index.mjs.map +1 -1
- package/dist/plugin/index.js +168 -44
- package/dist/plugin/index.js.map +1 -1
- package/package.json +5 -5
- package/src/plugin/optimizers/text/index.ts +99 -46
- package/src/plugin/optimizers/view/index.ts +9 -11
- package/src/plugin/types/index.ts +23 -0
- package/src/plugin/utils/common.ts +154 -1
- package/src/runtime/index.ts +56 -0
package/dist/plugin/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var helperPluginUtils = require('@babel/helper-plugin-utils');
|
|
4
4
|
var core = require('@babel/core');
|
|
5
|
-
var helperModuleImports = require('@babel/helper-module-imports');
|
|
6
5
|
var minimatch = require('minimatch');
|
|
7
6
|
var path = require('node:path');
|
|
7
|
+
var helperModuleImports = require('@babel/helper-module-imports');
|
|
8
8
|
|
|
9
9
|
class PluginError extends Error {
|
|
10
10
|
constructor(message) {
|
|
@@ -18,6 +18,21 @@ const ensureArray = (value) => {
|
|
|
18
18
|
return [value];
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
function addFileImportHint({
|
|
22
|
+
file,
|
|
23
|
+
nameHint,
|
|
24
|
+
path: path2,
|
|
25
|
+
importName,
|
|
26
|
+
moduleName,
|
|
27
|
+
importType = "named"
|
|
28
|
+
}) {
|
|
29
|
+
var _a;
|
|
30
|
+
if (!((_a = file.__hasImports) == null ? void 0 : _a[nameHint])) {
|
|
31
|
+
file.__hasImports = file.__hasImports || {};
|
|
32
|
+
file.__hasImports[nameHint] = importType === "default" ? helperModuleImports.addDefault(path2, moduleName, { nameHint }) : helperModuleImports.addNamed(path2, importName, moduleName, { nameHint });
|
|
33
|
+
}
|
|
34
|
+
return file.__hasImports[nameHint];
|
|
35
|
+
}
|
|
21
36
|
const isIgnoredFile = (p, ignores) => {
|
|
22
37
|
const hub = p.hub;
|
|
23
38
|
const file = typeof hub === "object" && hub !== null && "file" in hub ? hub.file : void 0;
|
|
@@ -104,18 +119,85 @@ const hasBlacklistedProperty = (path2, blacklist) => {
|
|
|
104
119
|
return false;
|
|
105
120
|
});
|
|
106
121
|
};
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
122
|
+
const buildPropertiesFromAttributes = (attributes) => {
|
|
123
|
+
const arguments_ = [];
|
|
124
|
+
for (const attribute of attributes) {
|
|
125
|
+
if (core.types.isJSXSpreadAttribute(attribute)) {
|
|
126
|
+
arguments_.push(attribute.argument);
|
|
127
|
+
} else if (core.types.isJSXAttribute(attribute)) {
|
|
128
|
+
const key = attribute.name.name;
|
|
129
|
+
let value;
|
|
130
|
+
if (!attribute.value) {
|
|
131
|
+
value = core.types.booleanLiteral(true);
|
|
132
|
+
} else if (core.types.isStringLiteral(attribute.value)) {
|
|
133
|
+
value = attribute.value;
|
|
134
|
+
} else if (core.types.isJSXExpressionContainer(attribute.value)) {
|
|
135
|
+
value = core.types.isJSXEmptyExpression(attribute.value.expression) ? core.types.booleanLiteral(true) : attribute.value.expression;
|
|
136
|
+
} else {
|
|
137
|
+
value = core.types.nullLiteral();
|
|
138
|
+
}
|
|
139
|
+
const validIdentifierRegex = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
|
|
140
|
+
const keyNode = typeof key === "string" && validIdentifierRegex.test(key) ? core.types.identifier(key) : core.types.stringLiteral(key.toString());
|
|
141
|
+
arguments_.push(core.types.objectExpression([core.types.objectProperty(keyNode, value)]));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (arguments_.length === 0) {
|
|
145
|
+
return core.types.objectExpression([]);
|
|
146
|
+
}
|
|
147
|
+
return core.types.callExpression(core.types.memberExpression(core.types.identifier("Object"), core.types.identifier("assign")), [
|
|
148
|
+
core.types.objectExpression([]),
|
|
149
|
+
...arguments_
|
|
150
|
+
]);
|
|
151
|
+
};
|
|
152
|
+
const accessibilityProperties = /* @__PURE__ */ new Set([
|
|
110
153
|
"accessibilityLabel",
|
|
154
|
+
"aria-label",
|
|
111
155
|
"accessibilityState",
|
|
112
|
-
"allowFontScaling",
|
|
113
156
|
"aria-busy",
|
|
114
157
|
"aria-checked",
|
|
115
158
|
"aria-disabled",
|
|
116
159
|
"aria-expanded",
|
|
117
|
-
"aria-label",
|
|
118
160
|
"aria-selected",
|
|
161
|
+
"accessible"
|
|
162
|
+
]);
|
|
163
|
+
const hasAccessibilityProperty = (path2, attributes) => {
|
|
164
|
+
for (const attribute of attributes) {
|
|
165
|
+
if (core.types.isJSXAttribute(attribute)) {
|
|
166
|
+
const key = attribute.name.name;
|
|
167
|
+
if (typeof key === "string" && accessibilityProperties.has(key)) {
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
} else if (core.types.isJSXSpreadAttribute(attribute)) {
|
|
171
|
+
if (core.types.isObjectExpression(attribute.argument)) {
|
|
172
|
+
for (const property of attribute.argument.properties) {
|
|
173
|
+
if (core.types.isObjectProperty(property) && core.types.isIdentifier(property.key) && accessibilityProperties.has(property.key.name)) {
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
} else if (core.types.isIdentifier(attribute.argument)) {
|
|
178
|
+
const binding = path2.scope.getBinding(attribute.argument.name);
|
|
179
|
+
if (binding && core.types.isVariableDeclarator(binding.path.node)) {
|
|
180
|
+
const declarator = binding.path.node;
|
|
181
|
+
if (declarator.init && core.types.isObjectExpression(declarator.init)) {
|
|
182
|
+
for (const property of declarator.init.properties) {
|
|
183
|
+
if (core.types.isObjectProperty(property) && core.types.isIdentifier(property.key) && accessibilityProperties.has(property.key.name)) {
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return true;
|
|
191
|
+
} else {
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return false;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const textBlacklistedProperties = /* @__PURE__ */ new Set([
|
|
200
|
+
"allowFontScaling",
|
|
119
201
|
"ellipsizeMode",
|
|
120
202
|
"id",
|
|
121
203
|
"nativeID",
|
|
@@ -165,14 +247,72 @@ const textOptimizer = (path, log = () => {
|
|
|
165
247
|
const lineNumber = (_c = (_b = path.node.loc) == null ? void 0 : _b.start.line) != null ? _c : "unknown line";
|
|
166
248
|
log(`Optimizing Text component in ${filename}:${lineNumber}`);
|
|
167
249
|
fixNegativeNumberOfLines({ path, log });
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
250
|
+
const originalAttributes = [...path.node.attributes];
|
|
251
|
+
let styleAttribute, styleExpr;
|
|
252
|
+
for (const attribute of originalAttributes) {
|
|
253
|
+
if (core.types.isJSXAttribute(attribute) && core.types.isJSXIdentifier(attribute.name, { name: "style" })) {
|
|
254
|
+
styleAttribute = attribute;
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
171
257
|
}
|
|
172
|
-
if (!
|
|
173
|
-
|
|
258
|
+
if (styleAttribute && styleAttribute.value && core.types.isJSXExpressionContainer(styleAttribute.value) && !core.types.isJSXEmptyExpression(styleAttribute.value.expression)) {
|
|
259
|
+
styleExpr = styleAttribute.value.expression;
|
|
174
260
|
}
|
|
175
|
-
const
|
|
261
|
+
const hasA11y = hasAccessibilityProperty(path, originalAttributes);
|
|
262
|
+
if (styleExpr && hasA11y) {
|
|
263
|
+
const accessibilityAttributes = originalAttributes.filter((attribute) => {
|
|
264
|
+
if (core.types.isJSXAttribute(attribute) && core.types.isJSXIdentifier(attribute.name, { name: "style" })) {
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
return true;
|
|
268
|
+
});
|
|
269
|
+
const normalizeIdentifier = addFileImportHint({
|
|
270
|
+
file,
|
|
271
|
+
nameHint: "normalizeAccessibilityProps",
|
|
272
|
+
path,
|
|
273
|
+
importName: "normalizeAccessibilityProps",
|
|
274
|
+
moduleName: "react-native-boost"
|
|
275
|
+
});
|
|
276
|
+
const accessibilityObject = buildPropertiesFromAttributes(accessibilityAttributes);
|
|
277
|
+
const accessibilityExpr = core.types.callExpression(core.types.identifier(normalizeIdentifier.name), [accessibilityObject]);
|
|
278
|
+
const flattenIdentifier = addFileImportHint({
|
|
279
|
+
file,
|
|
280
|
+
nameHint: "flattenTextStyle",
|
|
281
|
+
path,
|
|
282
|
+
importName: "flattenTextStyle",
|
|
283
|
+
moduleName: "react-native-boost"
|
|
284
|
+
});
|
|
285
|
+
const flattenedStyleExpr = core.types.callExpression(core.types.identifier(flattenIdentifier.name), [styleExpr]);
|
|
286
|
+
path.node.attributes = [core.types.jsxSpreadAttribute(accessibilityExpr), core.types.jsxSpreadAttribute(flattenedStyleExpr)];
|
|
287
|
+
} else if (styleExpr) {
|
|
288
|
+
const flattenIdentifier = addFileImportHint({
|
|
289
|
+
file,
|
|
290
|
+
nameHint: "flattenTextStyle",
|
|
291
|
+
path,
|
|
292
|
+
importName: "flattenTextStyle",
|
|
293
|
+
moduleName: "react-native-boost"
|
|
294
|
+
});
|
|
295
|
+
const flattened = core.types.callExpression(core.types.identifier(flattenIdentifier.name), [styleExpr]);
|
|
296
|
+
path.node.attributes = [core.types.jsxSpreadAttribute(flattened)];
|
|
297
|
+
} else if (hasA11y) {
|
|
298
|
+
const normalizeIdentifier = addFileImportHint({
|
|
299
|
+
file,
|
|
300
|
+
nameHint: "normalizeAccessibilityProps",
|
|
301
|
+
path,
|
|
302
|
+
importName: "normalizeAccessibilityProps",
|
|
303
|
+
moduleName: "react-native-boost"
|
|
304
|
+
});
|
|
305
|
+
const propsObject = buildPropertiesFromAttributes(originalAttributes);
|
|
306
|
+
const normalized = core.types.callExpression(core.types.identifier(normalizeIdentifier.name), [propsObject]);
|
|
307
|
+
path.node.attributes = [core.types.jsxSpreadAttribute(normalized)];
|
|
308
|
+
}
|
|
309
|
+
const nativeTextIdentifier = addFileImportHint({
|
|
310
|
+
file,
|
|
311
|
+
nameHint: "NativeText",
|
|
312
|
+
path,
|
|
313
|
+
importName: "NativeText",
|
|
314
|
+
moduleName: "react-native/Libraries/Text/TextNativeComponent"
|
|
315
|
+
});
|
|
176
316
|
path.node.name.name = nativeTextIdentifier.name;
|
|
177
317
|
if (!path.node.selfClosing && parent.closingElement && core.types.isJSXIdentifier(parent.closingElement.name) && parent.closingElement.name.name === "Text") {
|
|
178
318
|
parent.closingElement.name.name = nativeTextIdentifier.name;
|
|
@@ -182,13 +322,14 @@ function hasOnlyStringChildren(path, node) {
|
|
|
182
322
|
return node.children.every((child) => isStringNode(path, child));
|
|
183
323
|
}
|
|
184
324
|
function isStringNode(path, child) {
|
|
185
|
-
if (core.types.isJSXText(child)) return true;
|
|
325
|
+
if (core.types.isJSXText(child) || core.types.isStringLiteral(child)) return true;
|
|
186
326
|
if (core.types.isJSXExpressionContainer(child)) {
|
|
187
327
|
const expression = child.expression;
|
|
188
328
|
if (core.types.isIdentifier(expression)) {
|
|
189
329
|
const binding = path.scope.getBinding(expression.name);
|
|
190
330
|
return binding ? core.types.isStringLiteral(binding.path.node) : false;
|
|
191
331
|
}
|
|
332
|
+
if (core.types.isStringLiteral(expression)) return true;
|
|
192
333
|
}
|
|
193
334
|
return false;
|
|
194
335
|
}
|
|
@@ -213,33 +354,17 @@ function fixNegativeNumberOfLines({
|
|
|
213
354
|
}
|
|
214
355
|
}
|
|
215
356
|
}
|
|
216
|
-
function optimizeStyleTag({ path, file }) {
|
|
217
|
-
var _a;
|
|
218
|
-
let shouldImportFlattenTextStyle = false;
|
|
219
|
-
const nameHint = "_flattenTextStyle";
|
|
220
|
-
for (const [index, attribute] of path.node.attributes.entries()) {
|
|
221
|
-
if (core.types.isJSXAttribute(attribute) && core.types.isJSXIdentifier(attribute.name, { name: "style" })) {
|
|
222
|
-
shouldImportFlattenTextStyle = true;
|
|
223
|
-
if (core.types.isJSXExpressionContainer(attribute.value) && !core.types.isJSXEmptyExpression(attribute.value.expression)) {
|
|
224
|
-
path.node.attributes[index] = core.types.jsxSpreadAttribute(
|
|
225
|
-
core.types.callExpression(core.types.identifier(nameHint), [attribute.value.expression])
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
if (shouldImportFlattenTextStyle && !((_a = file.__hasImports) == null ? void 0 : _a.flattenTextStyle)) {
|
|
231
|
-
if (!file.__hasImports) file.__hasImports = {};
|
|
232
|
-
file.__hasImports.flattenTextStyle = helperModuleImports.addNamed(path, "flattenTextStyle", "react-native-boost", { nameHint });
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
357
|
function hasInvalidChildren(path) {
|
|
236
358
|
for (const attribute of path.node.attributes) {
|
|
237
|
-
if (core.types.isJSXSpreadAttribute(attribute))
|
|
359
|
+
if (core.types.isJSXSpreadAttribute(attribute)) continue;
|
|
238
360
|
if (core.types.isJSXIdentifier(attribute.name) && attribute.value) {
|
|
239
361
|
if (attribute.name.name === "children") {
|
|
240
|
-
|
|
362
|
+
if (!isStringNode(path, attribute.value)) {
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
} else if (textBlacklistedProperties.has(attribute.name.name)) {
|
|
366
|
+
return true;
|
|
241
367
|
}
|
|
242
|
-
return textBlacklistedProperties.has(attribute.name.name);
|
|
243
368
|
}
|
|
244
369
|
}
|
|
245
370
|
return false;
|
|
@@ -308,15 +433,14 @@ const viewOptimizer = (path, log = () => {
|
|
|
308
433
|
const filename = ((_a = file.opts) == null ? void 0 : _a.filename) || "unknown file";
|
|
309
434
|
const lineNumber = (_c = (_b = path.node.loc) == null ? void 0 : _b.start.line) != null ? _c : "unknown line";
|
|
310
435
|
log(`Optimizing View component in ${filename}:${lineNumber}`);
|
|
311
|
-
|
|
312
|
-
file
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
319
|
-
const viewNativeIdentifier = file.__hasImports.NativeView;
|
|
436
|
+
const viewNativeIdentifier = addFileImportHint({
|
|
437
|
+
file,
|
|
438
|
+
path,
|
|
439
|
+
importName: "ViewNativeComponent",
|
|
440
|
+
moduleName: "react-native/Libraries/Components/View/ViewNativeComponent",
|
|
441
|
+
importType: "default",
|
|
442
|
+
nameHint: "NativeView"
|
|
443
|
+
});
|
|
320
444
|
path.node.name.name = viewNativeIdentifier.name;
|
|
321
445
|
if (!path.node.selfClosing && parent.closingElement && core.types.isJSXIdentifier(parent.closingElement.name) && parent.closingElement.name.name === "View") {
|
|
322
446
|
parent.closingElement.name.name = viewNativeIdentifier.name;
|
package/dist/plugin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/plugin/utils/plugin-error.ts","../../src/plugin/utils/helpers.ts","../../src/plugin/utils/common.ts","../../src/plugin/optimizers/text/index.ts","../../src/plugin/utils/logger.ts","../../src/plugin/optimizers/view/index.ts","../../src/plugin/index.ts"],"sourcesContent":["export default class PluginError extends Error {\n constructor(message: string) {\n super(`[react-native-boost] Babel plugin exception: ${message}`);\n this.name = 'PluginError';\n }\n}\n","export const ensureArray = <T>(value: T | T[]): T[] => {\n if (Array.isArray(value)) return value;\n return [value];\n};\n","import { NodePath, types as t } from '@babel/core';\nimport { ensureArray } from './helpers';\nimport { HubFile } from '../types';\nimport { minimatch } from 'minimatch';\nimport path from 'node:path';\nimport PluginError from './plugin-error';\n\n/**\n * Checks if the file is in the list of ignored files.\n *\n * @param p - The path to the JSXOpeningElement.\n * @param ignores - List of glob paths (absolute or relative to import.meta.dirname).\n * @returns true if the file matches any of the ignore patterns.\n */\nexport const isIgnoredFile = (p: NodePath<t.JSXOpeningElement>, ignores: string[]): boolean => {\n const hub = p.hub as unknown;\n const file = typeof hub === 'object' && hub !== null && 'file' in hub ? (hub.file as HubFile) : undefined;\n\n if (!file) {\n throw new PluginError('No file found in Babel hub');\n }\n\n const fileName = file.opts.filename;\n\n // Use the current working directory which typically corresponds to the user's project root.\n const baseDirectory = 'cwd' in file.opts ? (file.opts.cwd as string) : process.cwd();\n\n // Iterate through the ignore patterns.\n for (const pattern of ignores) {\n // If the pattern is not absolute, join it with the baseDir\n const absolutePattern = path.isAbsolute(pattern) ? pattern : path.join(baseDirectory, pattern);\n\n // Check if the file name matches the glob pattern.\n if (minimatch(fileName, absolutePattern, { dot: true })) {\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * Checks if the JSX element should be ignored based on a preceding comment.\n *\n * The function looks up the JSXOpeningElement's own leading comments as well as\n * the parent element's comments before falling back to inspect siblings.\n */\nexport const shouldIgnoreOptimization = (path: NodePath<t.JSXOpeningElement>): boolean => {\n // Check for @boost-ignore in the leading comments on the JSX opening element.\n if (path.node.leadingComments?.some((comment) => comment.value.includes('@boost-ignore'))) {\n return true;\n }\n\n // Check for @boost-ignore in the leading comments on the parent JSX element.\n const jsxElementPath = path.parentPath;\n if (jsxElementPath.node.leadingComments?.some((comment) => comment.value.includes('@boost-ignore'))) {\n return true;\n }\n\n // NEW: Check for @boost-ignore in the leading comments on the ObjectProperty (if it exists)\n // This handles cases where the JSX element is used as a value inside an object literal.\n const propertyPath = jsxElementPath.parentPath;\n if (\n propertyPath &&\n propertyPath.isObjectProperty() &&\n propertyPath.node.leadingComments?.some((comment) => comment.value.includes('@boost-ignore'))\n ) {\n return true;\n }\n\n if (!jsxElementPath.parentPath) return false;\n\n // Get the container that holds this element (for example, a JSX fragment or JSX element)\n const containerPath = jsxElementPath.parentPath;\n const siblings = ensureArray(containerPath.get('children'));\n const index = siblings.findIndex((sibling) => sibling.node === jsxElementPath.node);\n if (index === -1) return false;\n\n // Look backward from the current element for a non-empty node.\n for (let index_ = index - 1; index_ >= 0; index_--) {\n const sibling = siblings[index_];\n // Skip over any whitespace (only in JSXText nodes)\n if (sibling.isJSXText() && sibling.node.value.trim() === '') {\n continue;\n }\n // If the sibling is a JSX expression container, check its empty expression's comments.\n if (sibling.isJSXExpressionContainer()) {\n const expression = sibling.get('expression');\n if (expression && expression.node) {\n const comments = [\n ...(expression.node.leadingComments || []),\n ...(expression.node.trailingComments || []),\n ...(expression.node.innerComments || []),\n ].map((comment) => comment.value.trim());\n if (comments.some((comment) => comment.includes('@boost-ignore'))) {\n return true;\n }\n }\n }\n // Also check if the node itself carries a leadingComments property.\n if (\n sibling.node.leadingComments &&\n sibling.node.leadingComments.some((comment) => comment.value.includes('@boost-ignore'))\n ) {\n return true;\n }\n break; // if the immediate non-whitespace node is not our ignore marker, stop\n }\n return false;\n};\n\nexport const hasBlacklistedProperty = (path: NodePath<t.JSXOpeningElement>, blacklist: Set<string>): boolean => {\n return path.node.attributes.some((attribute) => {\n // Check if we can resolve the spread attribute\n if (t.isJSXSpreadAttribute(attribute)) {\n if (t.isIdentifier(attribute.argument)) {\n const binding = path.scope.getBinding(attribute.argument.name);\n let objectExpression: t.ObjectExpression | undefined;\n if (binding) {\n // If the binding node is a VariableDeclarator, use its initializer\n if (t.isVariableDeclarator(binding.path.node)) {\n objectExpression = binding.path.node.init as t.ObjectExpression;\n } else if (t.isObjectExpression(binding.path.node)) {\n objectExpression = binding.path.node;\n }\n }\n if (objectExpression && t.isObjectExpression(objectExpression)) {\n return objectExpression.properties.some((property) => {\n if (t.isObjectProperty(property) && t.isIdentifier(property.key)) {\n return blacklist.has(property.key.name);\n }\n return false;\n });\n }\n }\n // Bail if we can't resolve the spread attribute\n return true;\n }\n\n // For other attribute types (e.g. namespaced), assume no blacklisting\n return false;\n });\n};\n","import { NodePath, types as t } from '@babel/core';\nimport { addNamed } from '@babel/helper-module-imports';\nimport { HubFile, Optimizer } from '../../types';\nimport PluginError from '../../utils/plugin-error';\nimport { hasBlacklistedProperty, shouldIgnoreOptimization } from '../../utils/common';\n\nexport const textBlacklistedProperties = new Set([\n 'accessible',\n 'accessibilityLabel',\n 'accessibilityState',\n 'allowFontScaling',\n 'aria-busy',\n 'aria-checked',\n 'aria-disabled',\n 'aria-expanded',\n 'aria-label',\n 'aria-selected',\n 'ellipsizeMode',\n 'id',\n 'nativeID',\n 'onLongPress',\n 'onPress',\n 'onPressIn',\n 'onPressOut',\n 'onResponderGrant',\n 'onResponderMove',\n 'onResponderRelease',\n 'onResponderTerminate',\n 'onResponderTerminationRequest',\n 'onStartShouldSetResponder',\n 'pressRetentionOffset',\n 'suppressHighlighting',\n 'selectable',\n 'selectionColor',\n]);\n\nexport const textOptimizer: Optimizer = (path, log = () => {}) => {\n // Ensure we're processing a JSX Text element\n if (!t.isJSXIdentifier(path.node.name)) return;\n\n const parent = path.parent;\n if (!t.isJSXElement(parent)) return;\n\n const elementName = path.node.name.name;\n if (elementName !== 'Text') return;\n\n // If the component is preceded by an ignore comment, do not optimize.\n if (shouldIgnoreOptimization(path)) {\n return;\n }\n\n // Ensure Text element comes from react-native\n const binding = path.scope.getBinding(elementName);\n if (!binding) return;\n if (binding.kind === 'module') {\n const parentNode = binding.path.parent;\n if (!t.isImportDeclaration(parentNode) || parentNode.source.value !== 'react-native') {\n return;\n }\n }\n\n // Bail if the element has any blacklisted properties or non-string children props\n if (hasBlacklistedProperty(path, textBlacklistedProperties)) return;\n if (hasInvalidChildren(path)) return;\n if (!hasOnlyStringChildren(path, parent)) return;\n\n // Extract the file from the Babel hub and add flags for logging & import caching\n const hub = path.hub as unknown;\n const file = typeof hub === 'object' && hub !== null && 'file' in hub ? (hub.file as HubFile) : undefined;\n\n if (!file) {\n throw new PluginError('No file found in Babel hub');\n }\n\n const filename = file.opts?.filename || 'unknown file';\n const lineNumber = path.node.loc?.start.line ?? 'unknown line';\n log(`Optimizing Text component in ${filename}:${lineNumber}`);\n\n // Optimize props\n fixNegativeNumberOfLines({ path, log });\n optimizeStyleTag({ path, file });\n\n // Add TextNativeComponent import (cached on file) so we only add it once per file\n if (!file.__hasImports) {\n file.__hasImports = {};\n }\n if (!file.__hasImports.NativeText) {\n file.__hasImports.NativeText = addNamed(path, 'NativeText', 'react-native/Libraries/Text/TextNativeComponent');\n }\n const nativeTextIdentifier = file.__hasImports.NativeText;\n path.node.name.name = nativeTextIdentifier.name;\n\n // If the element is not self-closing, update the closing element as well\n if (\n !path.node.selfClosing &&\n parent.closingElement &&\n t.isJSXIdentifier(parent.closingElement.name) &&\n parent.closingElement.name.name === 'Text'\n ) {\n parent.closingElement.name.name = nativeTextIdentifier.name;\n }\n};\n\nfunction hasOnlyStringChildren(path: NodePath<t.JSXOpeningElement>, node: t.JSXElement): boolean {\n return node.children.every((child) => isStringNode(path, child));\n}\n\nfunction isStringNode(path: NodePath<t.JSXOpeningElement>, child: t.Node): boolean {\n if (t.isJSXText(child)) return true;\n\n // Check for JSX expressions\n if (t.isJSXExpressionContainer(child)) {\n const expression = child.expression;\n\n // If the expression is an identifier, look it up in the current scope\n if (t.isIdentifier(expression)) {\n const binding = path.scope.getBinding(expression.name);\n return binding ? t.isStringLiteral(binding.path.node) : false;\n }\n }\n return false;\n}\n\nfunction fixNegativeNumberOfLines({\n path,\n log,\n}: {\n path: NodePath<t.JSXOpeningElement>;\n log: (message: string) => void;\n}) {\n for (const attribute of path.node.attributes) {\n if (\n t.isJSXAttribute(attribute) &&\n t.isJSXIdentifier(attribute.name, { name: 'numberOfLines' }) &&\n attribute.value &&\n t.isJSXExpressionContainer(attribute.value)\n ) {\n let originalValue: number | undefined;\n if (t.isNumericLiteral(attribute.value.expression)) {\n originalValue = attribute.value.expression.value;\n } else if (\n t.isUnaryExpression(attribute.value.expression) &&\n attribute.value.expression.operator === '-' &&\n t.isNumericLiteral(attribute.value.expression.argument)\n ) {\n originalValue = -attribute.value.expression.argument.value;\n }\n if (originalValue !== undefined && originalValue < 0) {\n log(\n `Warning: 'numberOfLines' in <Text> must be a non-negative number, received: ${originalValue}. The value will be set to 0.`\n );\n attribute.value.expression = t.numericLiteral(0);\n }\n }\n }\n}\n\nfunction optimizeStyleTag({ path, file }: { path: NodePath<t.JSXOpeningElement>; file: HubFile }) {\n let shouldImportFlattenTextStyle = false;\n const nameHint = '_flattenTextStyle';\n\n for (const [index, attribute] of path.node.attributes.entries()) {\n if (t.isJSXAttribute(attribute) && t.isJSXIdentifier(attribute.name, { name: 'style' })) {\n shouldImportFlattenTextStyle = true;\n\n if (t.isJSXExpressionContainer(attribute.value) && !t.isJSXEmptyExpression(attribute.value.expression)) {\n path.node.attributes[index] = t.jsxSpreadAttribute(\n t.callExpression(t.identifier(nameHint), [attribute.value.expression])\n );\n }\n }\n }\n\n if (shouldImportFlattenTextStyle && !file.__hasImports?.flattenTextStyle) {\n if (!file.__hasImports) file.__hasImports = {};\n file.__hasImports.flattenTextStyle = addNamed(path, 'flattenTextStyle', 'react-native-boost', { nameHint });\n }\n}\n\nfunction hasInvalidChildren(path: NodePath<t.JSXOpeningElement>): boolean {\n for (const attribute of path.node.attributes) {\n if (t.isJSXSpreadAttribute(attribute)) return false; // spread attributes are handled in hasBlacklistedProperty\n\n if (t.isJSXIdentifier(attribute.name) && attribute.value) {\n // For a \"children\" attribute, optimization is allowed only if it is a string\n if (attribute.name.name === 'children') {\n return isStringNode(path, attribute.value);\n }\n return textBlacklistedProperties.has(attribute.name.name);\n }\n }\n return false;\n}\n","export const log = (message: string) => {\n console.log(`[react-native-boost] ${message}`);\n};\n","import { NodePath, types as t } from '@babel/core';\nimport { addDefault } from '@babel/helper-module-imports';\nimport { HubFile, Optimizer } from '../../types';\nimport PluginError from '../../utils/plugin-error';\nimport { hasBlacklistedProperty, shouldIgnoreOptimization } from '../../utils/common';\n\nexport const viewBlacklistedProperties = new Set([\n 'accessible',\n 'accessibilityLabel',\n 'accessibilityState',\n 'allowFontScaling',\n 'aria-busy',\n 'aria-checked',\n 'aria-disabled',\n 'aria-expanded',\n 'aria-label',\n 'aria-selected',\n 'ellipsizeMode',\n 'disabled',\n 'id',\n 'nativeID',\n 'numberOfLines',\n 'onLongPress',\n 'onPress',\n 'onPressIn',\n 'onPressOut',\n 'onResponderGrant',\n 'onResponderMove',\n 'onResponderRelease',\n 'onResponderTerminate',\n 'onResponderTerminationRequest',\n 'onStartShouldSetResponder',\n 'pressRetentionOffset',\n 'selectable',\n 'selectionColor',\n 'suppressHighlighting',\n 'style',\n]);\n\nexport const viewOptimizer: Optimizer = (path, log = () => {}) => {\n // Ensure we're processing a JSX element identifier.\n if (!t.isJSXIdentifier(path.node.name)) return;\n\n const parent = path.parent;\n if (!t.isJSXElement(parent)) return;\n\n const elementName = path.node.name.name;\n if (elementName !== 'View') return;\n\n // Respect comments that disable optimization.\n if (shouldIgnoreOptimization(path)) return;\n\n // Ensure the View element comes from react-native.\n const binding = path.scope.getBinding(elementName);\n if (!binding) return;\n if (binding.kind === 'module') {\n const parentNode = binding.path.parent;\n if (!t.isImportDeclaration(parentNode) || parentNode.source.value !== 'react-native') {\n return;\n }\n }\n\n // Bail if any blacklisted props are present.\n if (hasBlacklistedProperty(path, viewBlacklistedProperties)) return;\n\n // Bail if a <TextAncestor /> component exists as an ancestor.\n if (hasTextAncestor(path)) return;\n\n // Extract the file from the Babel hub and add flags for logging & import caching.\n const hub = path.hub as unknown;\n const file = typeof hub === 'object' && hub !== null && 'file' in hub ? (hub.file as HubFile) : undefined;\n\n if (!file) {\n throw new PluginError('No file found in Babel hub');\n }\n\n const filename = file.opts?.filename || 'unknown file';\n const lineNumber = path.node.loc?.start.line ?? 'unknown line';\n log(`Optimizing View component in ${filename}:${lineNumber}`);\n\n // Add ViewNativeComponent import (cached on the file) to prevent duplicate imports.\n if (!file.__hasImports) {\n file.__hasImports = {};\n }\n if (!file.__hasImports.ViewNativeComponent) {\n file.__hasImports.NativeView = addDefault(path, 'react-native/Libraries/Components/View/ViewNativeComponent', {\n nameHint: 'NativeView',\n });\n }\n const viewNativeIdentifier = file.__hasImports.NativeView;\n\n // Replace the component with its native counterpart.\n path.node.name.name = viewNativeIdentifier.name;\n\n // If the element is not self-closing, update the closing element as well.\n if (\n !path.node.selfClosing &&\n parent.closingElement &&\n t.isJSXIdentifier(parent.closingElement.name) &&\n parent.closingElement.name.name === 'View'\n ) {\n parent.closingElement.name.name = viewNativeIdentifier.name;\n }\n};\n\n/**\n * Returns true if any ancestor element is a <Text />.\n * TODO: This is dangerous as we can't resolve custom components and check if they have a <Text /> ancestor in the tree\n */\nfunction hasTextAncestor(path: NodePath<t.JSXOpeningElement>): boolean {\n return !!path.findParent((parentPath) => {\n return t.isJSXElement(parentPath.node) && t.isJSXIdentifier(parentPath.node.openingElement.name, { name: 'Text' });\n });\n}\n","import { declare } from '@babel/helper-plugin-utils';\nimport { textOptimizer } from './optimizers/text';\nimport { PluginOptions } from './types';\nimport { log } from './utils/logger';\nimport { viewOptimizer } from './optimizers/view';\nimport { isIgnoredFile } from './utils/common';\n\nexport default declare((api) => {\n api.assertVersion(7);\n\n return {\n name: 'react-native-boost',\n visitor: {\n JSXOpeningElement(path, state) {\n const options = (state.opts ?? {}) as PluginOptions;\n const logger = options.verbose ? log : () => {};\n if (isIgnoredFile(path, options.ignores ?? [])) return;\n if (options.optimizations?.text !== false) textOptimizer(path, logger);\n if (options.optimizations?.view !== false) viewOptimizer(path, logger);\n },\n },\n };\n});\n"],"names":["minimatch","path","t","addNamed","addDefault","declare"],"mappings":";;;;;;;;AAAA,MAAqB,oBAAoB,KAAM,CAAA;AAAA,EAC7C,YAAY,OAAiB,EAAA;AAC3B,IAAM,KAAA,CAAA,CAAA,6CAAA,EAAgD,OAAO,CAAE,CAAA,CAAA;AAC/D,IAAA,IAAA,CAAK,IAAO,GAAA,aAAA;AAAA;AAEhB;;ACLa,MAAA,WAAA,GAAc,CAAI,KAAwB,KAAA;AACrD,EAAA,IAAI,KAAM,CAAA,OAAA,CAAQ,KAAK,CAAA,EAAU,OAAA,KAAA;AACjC,EAAA,OAAO,CAAC,KAAK,CAAA;AACf,CAAA;;ACWa,MAAA,aAAA,GAAgB,CAAC,CAAA,EA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I,aAAQ,aAAR,KAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAAuB,UAAS,KAAO,EAAA,aAAA,CAAc,MAAM,MAAM,CAAA;AACrE,QAAA,IAAA,CAAA,CAAI,aAAQ,aAAR,KAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAAuB,UAAS,KAAO,EAAA,aAAA,CAAc,MAAM,MAAM,CAAA;AAAA;AACvE;AACF,GACF;AACF,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/plugin/utils/plugin-error.ts","../../src/plugin/utils/helpers.ts","../../src/plugin/utils/common.ts","../../src/plugin/optimizers/text/index.ts","../../src/plugin/utils/logger.ts","../../src/plugin/optimizers/view/index.ts","../../src/plugin/index.ts"],"sourcesContent":["export default class PluginError extends Error {\n constructor(message: string) {\n super(`[react-native-boost] Babel plugin exception: ${message}`);\n this.name = 'PluginError';\n }\n}\n","export const ensureArray = <T>(value: T | T[]): T[] => {\n if (Array.isArray(value)) return value;\n return [value];\n};\n","import { NodePath, types as t } from '@babel/core';\nimport { ensureArray } from './helpers';\nimport { FileImportOptions, HubFile } from '../types';\nimport { minimatch } from 'minimatch';\nimport path from 'node:path';\nimport PluginError from './plugin-error';\nimport { addDefault, addNamed } from '@babel/helper-module-imports';\n\n/**\n * Adds a hint to the file object to ensure that a specific import is added only once and cached on the file object.\n *\n * @param opts - Object containing the function arguments:\n * - file: The Babel file object (e.g. HubFile)\n * - nameHint: The name hint which also acts as the cache key to ensure the import is only added once (e.g. 'normalizeAccessibilityProps')\n * - path: The current Babel NodePath\n * - importName: The named import string (e.g. 'normalizeAccessibilityProps'), used when importType is 'named'\n * - moduleName: The module to import from (e.g. 'react-native-boost')\n * - importType: Either 'named' (default) or 'default' to determine the type of import to use.\n *\n * @returns The identifier returned by addNamed or addDefault.\n */\nexport function addFileImportHint({\n file,\n nameHint,\n path,\n importName,\n moduleName,\n importType = 'named',\n}: FileImportOptions): t.Identifier {\n if (!file.__hasImports?.[nameHint]) {\n file.__hasImports = file.__hasImports || {};\n file.__hasImports[nameHint] =\n importType === 'default'\n ? addDefault(path, moduleName, { nameHint })\n : addNamed(path, importName, moduleName, { nameHint });\n }\n return file.__hasImports[nameHint];\n}\n/**\n * Checks if the file is in the list of ignored files.\n *\n * @param p - The path to the JSXOpeningElement.\n * @param ignores - List of glob paths (absolute or relative to import.meta.dirname).\n * @returns true if the file matches any of the ignore patterns.\n */\nexport const isIgnoredFile = (p: NodePath<t.JSXOpeningElement>, ignores: string[]): boolean => {\n const hub = p.hub as unknown;\n const file = typeof hub === 'object' && hub !== null && 'file' in hub ? (hub.file as HubFile) : undefined;\n\n if (!file) {\n throw new PluginError('No file found in Babel hub');\n }\n\n const fileName = file.opts.filename;\n\n // Use the current working directory which typically corresponds to the user's project root.\n const baseDirectory = 'cwd' in file.opts ? (file.opts.cwd as string) : process.cwd();\n\n // Iterate through the ignore patterns.\n for (const pattern of ignores) {\n // If the pattern is not absolute, join it with the baseDir\n const absolutePattern = path.isAbsolute(pattern) ? pattern : path.join(baseDirectory, pattern);\n\n // Check if the file name matches the glob pattern.\n if (minimatch(fileName, absolutePattern, { dot: true })) {\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * Checks if the JSX element should be ignored based on a preceding comment.\n *\n * The function looks up the JSXOpeningElement's own leading comments as well as\n * the parent element's comments before falling back to inspect siblings.\n *\n * @param path - The path to the JSXOpeningElement.\n * @returns true if the JSX element should be ignored.\n */\nexport const shouldIgnoreOptimization = (path: NodePath<t.JSXOpeningElement>): boolean => {\n // Check for @boost-ignore in the leading comments on the JSX opening element.\n if (path.node.leadingComments?.some((comment) => comment.value.includes('@boost-ignore'))) {\n return true;\n }\n\n // Check for @boost-ignore in the leading comments on the parent JSX element.\n const jsxElementPath = path.parentPath;\n if (jsxElementPath.node.leadingComments?.some((comment) => comment.value.includes('@boost-ignore'))) {\n return true;\n }\n\n // NEW: Check for @boost-ignore in the leading comments on the ObjectProperty (if it exists)\n // This handles cases where the JSX element is used as a value inside an object literal.\n const propertyPath = jsxElementPath.parentPath;\n if (\n propertyPath &&\n propertyPath.isObjectProperty() &&\n propertyPath.node.leadingComments?.some((comment) => comment.value.includes('@boost-ignore'))\n ) {\n return true;\n }\n\n if (!jsxElementPath.parentPath) return false;\n\n // Get the container that holds this element (for example, a JSX fragment or JSX element)\n const containerPath = jsxElementPath.parentPath;\n const siblings = ensureArray(containerPath.get('children'));\n const index = siblings.findIndex((sibling) => sibling.node === jsxElementPath.node);\n if (index === -1) return false;\n\n // Look backward from the current element for a non-empty node.\n for (let index_ = index - 1; index_ >= 0; index_--) {\n const sibling = siblings[index_];\n // Skip over any whitespace (only in JSXText nodes)\n if (sibling.isJSXText() && sibling.node.value.trim() === '') {\n continue;\n }\n // If the sibling is a JSX expression container, check its empty expression's comments.\n if (sibling.isJSXExpressionContainer()) {\n const expression = sibling.get('expression');\n if (expression && expression.node) {\n const comments = [\n ...(expression.node.leadingComments || []),\n ...(expression.node.trailingComments || []),\n ...(expression.node.innerComments || []),\n ].map((comment) => comment.value.trim());\n if (comments.some((comment) => comment.includes('@boost-ignore'))) {\n return true;\n }\n }\n }\n // Also check if the node itself carries a leadingComments property.\n if (\n sibling.node.leadingComments &&\n sibling.node.leadingComments.some((comment) => comment.value.includes('@boost-ignore'))\n ) {\n return true;\n }\n break; // if the immediate non-whitespace node is not our ignore marker, stop\n }\n return false;\n};\n\n/**\n * Checks if the JSX element has a blacklisted property.\n *\n * @param path - The path to the JSXOpeningElement.\n * @param blacklist - The set of blacklisted properties.\n * @returns true if the JSX element has a blacklisted property.\n */\nexport const hasBlacklistedProperty = (path: NodePath<t.JSXOpeningElement>, blacklist: Set<string>): boolean => {\n return path.node.attributes.some((attribute) => {\n // Check if we can resolve the spread attribute\n if (t.isJSXSpreadAttribute(attribute)) {\n if (t.isIdentifier(attribute.argument)) {\n const binding = path.scope.getBinding(attribute.argument.name);\n let objectExpression: t.ObjectExpression | undefined;\n if (binding) {\n // If the binding node is a VariableDeclarator, use its initializer\n if (t.isVariableDeclarator(binding.path.node)) {\n objectExpression = binding.path.node.init as t.ObjectExpression;\n } else if (t.isObjectExpression(binding.path.node)) {\n objectExpression = binding.path.node;\n }\n }\n if (objectExpression && t.isObjectExpression(objectExpression)) {\n return objectExpression.properties.some((property) => {\n if (t.isObjectProperty(property) && t.isIdentifier(property.key)) {\n return blacklist.has(property.key.name);\n }\n return false;\n });\n }\n }\n // Bail if we can't resolve the spread attribute\n return true;\n }\n\n // For other attribute types (e.g. namespaced), assume no blacklisting\n return false;\n });\n};\n\n/**\n * Helper that builds an Object.assign expression out of the existing JSX attributes.\n * It handles both plain JSXAttributes and spread attributes.\n *\n * @param attributes - The attributes to build the expression from.\n * @returns The Object.assign expression.\n */\nexport const buildPropertiesFromAttributes = (attributes: (t.JSXAttribute | t.JSXSpreadAttribute)[]): t.Expression => {\n const arguments_: t.Expression[] = [];\n for (const attribute of attributes) {\n if (t.isJSXSpreadAttribute(attribute)) {\n arguments_.push(attribute.argument);\n } else if (t.isJSXAttribute(attribute)) {\n const key = attribute.name.name;\n let value: t.Expression;\n if (!attribute.value) {\n value = t.booleanLiteral(true);\n } else if (t.isStringLiteral(attribute.value)) {\n value = attribute.value;\n } else if (t.isJSXExpressionContainer(attribute.value)) {\n value = t.isJSXEmptyExpression(attribute.value.expression)\n ? t.booleanLiteral(true)\n : attribute.value.expression;\n } else {\n value = t.nullLiteral();\n }\n // If the key is not a valid JavaScript identifier (e.g. \"aria-label\"), use a string literal.\n const validIdentifierRegex = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;\n const keyNode =\n typeof key === 'string' && validIdentifierRegex.test(key) ? t.identifier(key) : t.stringLiteral(key.toString());\n\n arguments_.push(t.objectExpression([t.objectProperty(keyNode, value)]));\n }\n }\n if (arguments_.length === 0) {\n return t.objectExpression([]);\n }\n return t.callExpression(t.memberExpression(t.identifier('Object'), t.identifier('assign')), [\n t.objectExpression([]),\n ...arguments_,\n ]);\n};\n\n/**\n * The set of accessibility properties that need to be normalized.\n */\nexport const accessibilityProperties = new Set([\n 'accessibilityLabel',\n 'aria-label',\n 'accessibilityState',\n 'aria-busy',\n 'aria-checked',\n 'aria-disabled',\n 'aria-expanded',\n 'aria-selected',\n 'accessible',\n]);\n\n/**\n * Checks if the JSX element has an accessibility property.\n *\n * @param path - The NodePath for the JSXOpeningElement, used for scope lookup.\n * @param attributes - The attributes to check.\n * @returns true if the JSX element has an accessibility property.\n */\nexport const hasAccessibilityProperty = (\n path: NodePath<t.JSXOpeningElement>,\n attributes: (t.JSXAttribute | t.JSXSpreadAttribute)[]\n): boolean => {\n for (const attribute of attributes) {\n if (t.isJSXAttribute(attribute)) {\n const key = attribute.name.name;\n if (typeof key === 'string' && accessibilityProperties.has(key)) {\n return true;\n }\n } else if (t.isJSXSpreadAttribute(attribute)) {\n if (t.isObjectExpression(attribute.argument)) {\n for (const property of attribute.argument.properties) {\n if (\n t.isObjectProperty(property) &&\n t.isIdentifier(property.key) &&\n accessibilityProperties.has(property.key.name)\n ) {\n return true;\n }\n }\n } else if (t.isIdentifier(attribute.argument)) {\n const binding = path.scope.getBinding(attribute.argument.name);\n if (binding && t.isVariableDeclarator(binding.path.node)) {\n const declarator = binding.path.node as t.VariableDeclarator;\n if (declarator.init && t.isObjectExpression(declarator.init)) {\n for (const property of declarator.init.properties) {\n if (\n t.isObjectProperty(property) &&\n t.isIdentifier(property.key) &&\n accessibilityProperties.has(property.key.name)\n ) {\n return true;\n }\n }\n continue;\n }\n }\n return true;\n } else {\n return true;\n }\n }\n }\n return false;\n};\n","import { NodePath, types as t } from '@babel/core';\nimport { HubFile, Optimizer } from '../../types';\nimport PluginError from '../../utils/plugin-error';\nimport {\n addFileImportHint,\n buildPropertiesFromAttributes,\n hasAccessibilityProperty,\n hasBlacklistedProperty,\n shouldIgnoreOptimization,\n} from '../../utils/common';\n\nexport const textBlacklistedProperties = new Set([\n 'allowFontScaling',\n 'ellipsizeMode',\n 'id',\n 'nativeID',\n 'onLongPress',\n 'onPress',\n 'onPressIn',\n 'onPressOut',\n 'onResponderGrant',\n 'onResponderMove',\n 'onResponderRelease',\n 'onResponderTerminate',\n 'onResponderTerminationRequest',\n 'onStartShouldSetResponder',\n 'pressRetentionOffset',\n 'suppressHighlighting',\n 'selectable',\n 'selectionColor',\n]);\n\nexport const textOptimizer: Optimizer = (path, log = () => {}) => {\n // Ensure we're processing a JSX Text element\n if (!t.isJSXIdentifier(path.node.name)) return;\n\n const parent = path.parent;\n if (!t.isJSXElement(parent)) return;\n\n const elementName = path.node.name.name;\n if (elementName !== 'Text') return;\n\n // If the component is preceded by an ignore comment, do not optimize.\n if (shouldIgnoreOptimization(path)) {\n return;\n }\n\n // Ensure Text element comes from react-native\n const binding = path.scope.getBinding(elementName);\n if (!binding) return;\n if (binding.kind === 'module') {\n const parentNode = binding.path.parent;\n if (!t.isImportDeclaration(parentNode) || parentNode.source.value !== 'react-native') {\n return;\n }\n }\n\n // Bail if the element has any blacklisted properties or non-string children props\n if (hasBlacklistedProperty(path, textBlacklistedProperties)) return;\n if (hasInvalidChildren(path)) return;\n if (!hasOnlyStringChildren(path, parent)) return;\n\n // Extract the file from the Babel hub and add flags for logging & import caching\n const hub = path.hub as unknown;\n const file = typeof hub === 'object' && hub !== null && 'file' in hub ? (hub.file as HubFile) : undefined;\n\n if (!file) {\n throw new PluginError('No file found in Babel hub');\n }\n\n const filename = file.opts?.filename || 'unknown file';\n const lineNumber = path.node.loc?.start.line ?? 'unknown line';\n log(`Optimizing Text component in ${filename}:${lineNumber}`);\n\n // Optimize props\n fixNegativeNumberOfLines({ path, log });\n\n // Process style and accessibility props\n const originalAttributes = [...path.node.attributes];\n let styleAttribute, styleExpr;\n for (const attribute of originalAttributes) {\n if (t.isJSXAttribute(attribute) && t.isJSXIdentifier(attribute.name, { name: 'style' })) {\n styleAttribute = attribute;\n break;\n }\n }\n if (\n styleAttribute &&\n styleAttribute.value &&\n t.isJSXExpressionContainer(styleAttribute.value) &&\n !t.isJSXEmptyExpression(styleAttribute.value.expression)\n ) {\n styleExpr = styleAttribute.value.expression;\n }\n const hasA11y = hasAccessibilityProperty(path, originalAttributes);\n\n if (styleExpr && hasA11y) {\n // When both style and accessibility properties exist, we split them into two separate spread attributes\n\n // Filter out the style attribute for accessibility props\n const accessibilityAttributes = originalAttributes.filter((attribute) => {\n if (t.isJSXAttribute(attribute) && t.isJSXIdentifier(attribute.name, { name: 'style' })) {\n return false;\n }\n return true;\n });\n\n // Set up the accessibility import if needed\n const normalizeIdentifier = addFileImportHint({\n file,\n nameHint: 'normalizeAccessibilityProps',\n path,\n importName: 'normalizeAccessibilityProps',\n moduleName: 'react-native-boost',\n });\n const accessibilityObject = buildPropertiesFromAttributes(accessibilityAttributes);\n const accessibilityExpr = t.callExpression(t.identifier(normalizeIdentifier.name), [accessibilityObject]);\n\n // Set up the style import if needed.\n const flattenIdentifier = addFileImportHint({\n file,\n nameHint: 'flattenTextStyle',\n path,\n importName: 'flattenTextStyle',\n moduleName: 'react-native-boost',\n });\n const flattenedStyleExpr = t.callExpression(t.identifier(flattenIdentifier.name), [styleExpr]);\n\n // Use two separate JSX spread attributes so that accessibility and style props remain distinct.\n path.node.attributes = [t.jsxSpreadAttribute(accessibilityExpr), t.jsxSpreadAttribute(flattenedStyleExpr)];\n } else if (styleExpr) {\n // Only style attribute is present.\n const flattenIdentifier = addFileImportHint({\n file,\n nameHint: 'flattenTextStyle',\n path,\n importName: 'flattenTextStyle',\n moduleName: 'react-native-boost',\n });\n const flattened = t.callExpression(t.identifier(flattenIdentifier.name), [styleExpr]);\n path.node.attributes = [t.jsxSpreadAttribute(flattened)];\n } else if (hasA11y) {\n // Only accessibility properties are present.\n const normalizeIdentifier = addFileImportHint({\n file,\n nameHint: 'normalizeAccessibilityProps',\n path,\n importName: 'normalizeAccessibilityProps',\n moduleName: 'react-native-boost',\n });\n const propsObject = buildPropertiesFromAttributes(originalAttributes);\n const normalized = t.callExpression(t.identifier(normalizeIdentifier.name), [propsObject]);\n path.node.attributes = [t.jsxSpreadAttribute(normalized)];\n }\n\n // Add TextNativeComponent import (cached on file) so we only add it once per file.\n const nativeTextIdentifier = addFileImportHint({\n file,\n nameHint: 'NativeText',\n path,\n importName: 'NativeText',\n moduleName: 'react-native/Libraries/Text/TextNativeComponent',\n });\n path.node.name.name = nativeTextIdentifier.name;\n\n // If the element is not self-closing, update the closing element as well\n if (\n !path.node.selfClosing &&\n parent.closingElement &&\n t.isJSXIdentifier(parent.closingElement.name) &&\n parent.closingElement.name.name === 'Text'\n ) {\n parent.closingElement.name.name = nativeTextIdentifier.name;\n }\n};\n\nfunction hasOnlyStringChildren(path: NodePath<t.JSXOpeningElement>, node: t.JSXElement): boolean {\n return node.children.every((child) => isStringNode(path, child));\n}\n\nfunction isStringNode(path: NodePath<t.JSXOpeningElement>, child: t.Node): boolean {\n if (t.isJSXText(child) || t.isStringLiteral(child)) return true;\n\n // Check for JSX expressions\n if (t.isJSXExpressionContainer(child)) {\n const expression = child.expression;\n if (t.isIdentifier(expression)) {\n const binding = path.scope.getBinding(expression.name);\n return binding ? t.isStringLiteral(binding.path.node) : false;\n }\n if (t.isStringLiteral(expression)) return true;\n }\n return false;\n}\n\nfunction fixNegativeNumberOfLines({\n path,\n log,\n}: {\n path: NodePath<t.JSXOpeningElement>;\n log: (message: string) => void;\n}) {\n for (const attribute of path.node.attributes) {\n if (\n t.isJSXAttribute(attribute) &&\n t.isJSXIdentifier(attribute.name, { name: 'numberOfLines' }) &&\n attribute.value &&\n t.isJSXExpressionContainer(attribute.value)\n ) {\n let originalValue: number | undefined;\n if (t.isNumericLiteral(attribute.value.expression)) {\n originalValue = attribute.value.expression.value;\n } else if (\n t.isUnaryExpression(attribute.value.expression) &&\n attribute.value.expression.operator === '-' &&\n t.isNumericLiteral(attribute.value.expression.argument)\n ) {\n originalValue = -attribute.value.expression.argument.value;\n }\n if (originalValue !== undefined && originalValue < 0) {\n log(\n `Warning: 'numberOfLines' in <Text> must be a non-negative number, received: ${originalValue}. The value will be set to 0.`\n );\n attribute.value.expression = t.numericLiteral(0);\n }\n }\n }\n}\n\nfunction hasInvalidChildren(path: NodePath<t.JSXOpeningElement>): boolean {\n for (const attribute of path.node.attributes) {\n if (t.isJSXSpreadAttribute(attribute)) continue; // Spread attributes are handled in hasBlacklistedProperty\n\n if (t.isJSXIdentifier(attribute.name) && attribute.value) {\n // For a \"children\" attribute, optimization is allowed only if it is a string\n if (attribute.name.name === 'children') {\n if (!isStringNode(path, attribute.value)) {\n return true;\n }\n } else if (textBlacklistedProperties.has(attribute.name.name)) {\n return true;\n }\n }\n }\n return false;\n}\n","export const log = (message: string) => {\n console.log(`[react-native-boost] ${message}`);\n};\n","import { NodePath, types as t } from '@babel/core';\nimport { HubFile, Optimizer } from '../../types';\nimport PluginError from '../../utils/plugin-error';\nimport { addFileImportHint, hasBlacklistedProperty, shouldIgnoreOptimization } from '../../utils/common';\n\nexport const viewBlacklistedProperties = new Set([\n 'accessible',\n 'accessibilityLabel',\n 'accessibilityState',\n 'allowFontScaling',\n 'aria-busy',\n 'aria-checked',\n 'aria-disabled',\n 'aria-expanded',\n 'aria-label',\n 'aria-selected',\n 'ellipsizeMode',\n 'disabled',\n 'id',\n 'nativeID',\n 'numberOfLines',\n 'onLongPress',\n 'onPress',\n 'onPressIn',\n 'onPressOut',\n 'onResponderGrant',\n 'onResponderMove',\n 'onResponderRelease',\n 'onResponderTerminate',\n 'onResponderTerminationRequest',\n 'onStartShouldSetResponder',\n 'pressRetentionOffset',\n 'selectable',\n 'selectionColor',\n 'suppressHighlighting',\n 'style',\n]);\n\nexport const viewOptimizer: Optimizer = (path, log = () => {}) => {\n // Ensure we're processing a JSX element identifier.\n if (!t.isJSXIdentifier(path.node.name)) return;\n\n const parent = path.parent;\n if (!t.isJSXElement(parent)) return;\n\n const elementName = path.node.name.name;\n if (elementName !== 'View') return;\n\n // Respect comments that disable optimization.\n if (shouldIgnoreOptimization(path)) return;\n\n // Ensure the View element comes from react-native.\n const binding = path.scope.getBinding(elementName);\n if (!binding) return;\n if (binding.kind === 'module') {\n const parentNode = binding.path.parent;\n if (!t.isImportDeclaration(parentNode) || parentNode.source.value !== 'react-native') {\n return;\n }\n }\n\n // Bail if any blacklisted props are present.\n if (hasBlacklistedProperty(path, viewBlacklistedProperties)) return;\n\n // Bail if a <TextAncestor /> component exists as an ancestor.\n if (hasTextAncestor(path)) return;\n\n // Extract the file from the Babel hub and add flags for logging & import caching.\n const hub = path.hub as unknown;\n const file = typeof hub === 'object' && hub !== null && 'file' in hub ? (hub.file as HubFile) : undefined;\n\n if (!file) {\n throw new PluginError('No file found in Babel hub');\n }\n\n const filename = file.opts?.filename || 'unknown file';\n const lineNumber = path.node.loc?.start.line ?? 'unknown line';\n log(`Optimizing View component in ${filename}:${lineNumber}`);\n\n // Add ViewNativeComponent import (cached on the file) to prevent duplicate imports.\n const viewNativeIdentifier = addFileImportHint({\n file,\n path,\n importName: 'ViewNativeComponent',\n moduleName: 'react-native/Libraries/Components/View/ViewNativeComponent',\n importType: 'default',\n nameHint: 'NativeView',\n });\n\n // Replace the component with its native counterpart.\n path.node.name.name = viewNativeIdentifier.name;\n\n // If the element is not self-closing, update the closing element as well.\n if (\n !path.node.selfClosing &&\n parent.closingElement &&\n t.isJSXIdentifier(parent.closingElement.name) &&\n parent.closingElement.name.name === 'View'\n ) {\n parent.closingElement.name.name = viewNativeIdentifier.name;\n }\n};\n\n/**\n * Returns true if any ancestor element is a <Text />.\n * TODO: This is dangerous as we can't resolve custom components and check if they have a <Text /> ancestor in the tree\n */\nfunction hasTextAncestor(path: NodePath<t.JSXOpeningElement>): boolean {\n return !!path.findParent((parentPath) => {\n return t.isJSXElement(parentPath.node) && t.isJSXIdentifier(parentPath.node.openingElement.name, { name: 'Text' });\n });\n}\n","import { declare } from '@babel/helper-plugin-utils';\nimport { textOptimizer } from './optimizers/text';\nimport { PluginOptions } from './types';\nimport { log } from './utils/logger';\nimport { viewOptimizer } from './optimizers/view';\nimport { isIgnoredFile } from './utils/common';\n\nexport default declare((api) => {\n api.assertVersion(7);\n\n return {\n name: 'react-native-boost',\n visitor: {\n JSXOpeningElement(path, state) {\n const options = (state.opts ?? {}) as PluginOptions;\n const logger = options.verbose ? log : () => {};\n if (isIgnoredFile(path, options.ignores ?? [])) return;\n if (options.optimizations?.text !== false) textOptimizer(path, logger);\n if (options.optimizations?.view !== false) viewOptimizer(path, logger);\n },\n },\n };\n});\n"],"names":["path","addDefault","addNamed","minimatch","t","declare"],"mappings":";;;;;;;;AAAA,MAAqB,oBAAoB,KAAM,CAAA;AAAA,EAC7C,YAAY,OAAiB,EAAA;AAC3B,IAAM,KAAA,CAAA,CAAA,6CAAA,EAAgD,OAAO,CAAE,CAAA,CAAA;AAC/D,IAAA,IAAA,CAAK,IAAO,GAAA,aAAA;AAAA;AAEhB;;ACLa,MAAA,WAAA,GAAc,CAAI,KAAwB,KAAA;AACrD,EAAA,IAAI,KAAM,CAAA,OAAA,CAAQ,KAAK,CAAA,EAAU,OAAA,KAAA;AACjC,EAAA,OAAO,CAAC,KAAK,CAAA;AACf,CAAA;;ACkBO,SAAS,iBAAkB,CAAA;AAAA,EAChC,IAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAAA,EAAAA,KAAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAa,GAAA;AACf,CAAoC,EAAA;AA5BpC,EAAA,IAAA,EAAA;AA6BE,EAAA,IAAI,EAAC,CAAA,EAAA,GAAA,IAAA,CAAK,YAAL,KAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAAoB,QAAW,CAAA,CAAA,EAAA;AAClC,IAAK,IAAA,CAAA,YAAA,GAAe,IAAK,CAAA,YAAA,IAAgB,EAAC;AAC1C,IAAA,IAAA,CAAK,aAAa,QAAQ,CAAA,GACxB,eAAe,SACX,GAAAC,8BAAA,CAAWD,OAAM,UAAY,EAAA,EAAE,QAAS,EAAC,IACzCE,4BAASF,CAAAA,KAAAA,EAAM,YAAY,UAAY,EAAA,EAAE,UAAU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A,MAAA,GAAA,EAAA,CAAuB,UAAS,KAAO,EAAA,aAAA,CAAc,MAAM,MAAM,CAAA;AACrE,QAAA,IAAA,CAAA,CAAI,aAAQ,aAAR,KAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAAuB,UAAS,KAAO,EAAA,aAAA,CAAc,MAAM,MAAM,CAAA;AAAA;AACvE;AACF,GACF;AACF,CAAC,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-boost",
|
|
3
3
|
"description": "🚀 Boost your React Native app's performance with a single line of code",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
"./package.json": "./package.json",
|
|
10
10
|
".": {
|
|
11
11
|
"import": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/esm/index.mjs"
|
|
14
14
|
},
|
|
15
15
|
"default": "./dist/index.js"
|
|
16
16
|
},
|
|
17
17
|
"./plugin": {
|
|
18
18
|
"import": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"types": "./dist/plugin/index.d.ts",
|
|
20
|
+
"default": "./dist/plugin/esm/index.mjs"
|
|
21
21
|
},
|
|
22
22
|
"default": "./dist/plugin/index.js"
|
|
23
23
|
}
|