@barefootjs/jsx 0.24.1 → 0.25.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/dist/analyzer.d.ts.map +1 -1
- package/dist/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.js +225 -55
- package/dist/types.d.ts +21 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/reactive-factory-cross-file.test.ts +582 -0
- package/src/__tests__/reactive-factory-inlining.test.ts +527 -1
- package/src/__tests__/reactive-factory-rename-fidelity.test.ts +318 -0
- package/src/analyzer.ts +385 -84
- package/src/errors.ts +4 -0
- package/src/types.ts +22 -1
package/src/types.ts
CHANGED
|
@@ -1455,6 +1455,19 @@ export interface NamedExportSpecifier {
|
|
|
1455
1455
|
isTypeOnly: boolean
|
|
1456
1456
|
}
|
|
1457
1457
|
|
|
1458
|
+
/** One identifier occurrence in a factory body that call-site inlining may
|
|
1459
|
+
* rename (#2341 BUG-1). Offsets are relative to ReactiveFactoryInfo.bodySource. */
|
|
1460
|
+
export interface FactoryRenameSite {
|
|
1461
|
+
name: string
|
|
1462
|
+
start: number
|
|
1463
|
+
end: number
|
|
1464
|
+
/** 'shorthand' = the identifier is simultaneously a property key and a
|
|
1465
|
+
* value/binding reference ({ name } literal, or { name } object-pattern
|
|
1466
|
+
* element). Renaming it must EXPAND to `name: <replacement>` to preserve
|
|
1467
|
+
* the key. 'plain' = ordinary reference or declaration name. */
|
|
1468
|
+
form: 'plain' | 'shorthand'
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1458
1471
|
/**
|
|
1459
1472
|
* Reactive factory helper metadata (#931). Collected when a same-file
|
|
1460
1473
|
* function matches the factory shape: exactly one top-level `return` whose
|
|
@@ -1500,6 +1513,14 @@ export interface ReactiveFactoryInfo {
|
|
|
1500
1513
|
* file are dropped at prescan time.
|
|
1501
1514
|
*/
|
|
1502
1515
|
requiredImports?: RequiredFactoryImport[]
|
|
1516
|
+
/**
|
|
1517
|
+
* Identifier occurrences within `bodySource` that call-site inlining may
|
|
1518
|
+
* rename (#2341 BUG-1) — collected by the same AST walk that produces
|
|
1519
|
+
* `bodySource`, so offsets stay in lockstep with the serialized text.
|
|
1520
|
+
* Same-file and cross-file factories both get this (both flow through
|
|
1521
|
+
* `detectReactiveFactory`).
|
|
1522
|
+
*/
|
|
1523
|
+
renameSites: FactoryRenameSite[]
|
|
1503
1524
|
}
|
|
1504
1525
|
|
|
1505
1526
|
/**
|
|
@@ -1526,7 +1547,7 @@ export interface RequiredFactoryImport {
|
|
|
1526
1547
|
* the generic BF110.
|
|
1527
1548
|
*/
|
|
1528
1549
|
export interface DeclinedReactiveFactory {
|
|
1529
|
-
code: 'BF111' | 'BF112' | 'BF113'
|
|
1550
|
+
code: 'BF111' | 'BF112' | 'BF113' | 'BF114'
|
|
1530
1551
|
/** Detail spliced into the call-site message (e.g. offending identifier list). */
|
|
1531
1552
|
detail: string
|
|
1532
1553
|
/** Definition site (in the helper file for cross-file declines). */
|