@barefootjs/jsx 0.3.0 → 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/dist/adapters/interface.d.ts +20 -0
- package/dist/adapters/interface.d.ts.map +1 -1
- package/dist/expression-parser.d.ts +36 -19
- package/dist/expression-parser.d.ts.map +1 -1
- package/dist/import-map.d.ts +56 -0
- package/dist/import-map.d.ts.map +1 -0
- package/dist/import-map.js +18 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +160 -162
- package/dist/ir-to-client-js/html-template.d.ts.map +1 -1
- package/dist/ir-to-client-js/utils.d.ts.map +1 -1
- package/dist/scanner/js-scanner.d.ts +10 -0
- package/dist/scanner/js-scanner.d.ts.map +1 -1
- package/dist/scanner/js-scanner.js +5 -0
- package/package.json +7 -3
- package/src/__tests__/__snapshots__/doc-examples.test.ts.snap +134 -8
- package/src/__tests__/auto-defer-brand.test.ts +81 -0
- package/src/__tests__/child-components-in-map.test.ts +76 -0
- package/src/__tests__/import-map.test.ts +75 -0
- package/src/__tests__/ir-sort-comparator.test.ts +212 -9
- package/src/__tests__/token-contains-ident.test.ts +27 -0
- package/src/__tests__/unsupported-expression.test.ts +42 -13
- package/src/adapters/interface.ts +20 -0
- package/src/expression-parser.ts +265 -50
- package/src/import-map.ts +72 -0
- package/src/index.ts +5 -1
- package/src/ir-to-client-js/html-template.ts +17 -0
- package/src/ir-to-client-js/stringify/static-array-child-init.ts +8 -4
- package/src/ir-to-client-js/utils.ts +29 -115
- package/src/scanner/js-scanner.ts +16 -1
package/dist/index.js
CHANGED
|
@@ -62,6 +62,9 @@ function canRegexStartHere(prev) {
|
|
|
62
62
|
return true;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
+
function isIdentifierLikeToken(kind) {
|
|
66
|
+
return kind === ts.SyntaxKind.Identifier || kind >= ts.SyntaxKind.FirstKeyword && kind <= ts.SyntaxKind.LastKeyword;
|
|
67
|
+
}
|
|
65
68
|
function isOpaqueContentKind(kind) {
|
|
66
69
|
return kind === ts.SyntaxKind.StringLiteral || kind === ts.SyntaxKind.NoSubstitutionTemplateLiteral || kind === ts.SyntaxKind.RegularExpressionLiteral || kind === ts.SyntaxKind.SingleLineCommentTrivia || kind === ts.SyntaxKind.MultiLineCommentTrivia;
|
|
67
70
|
}
|
|
@@ -173,6 +176,22 @@ function findTopLevelTemplateLiterals(code) {
|
|
|
173
176
|
return out;
|
|
174
177
|
}
|
|
175
178
|
|
|
179
|
+
// src/import-map.ts
|
|
180
|
+
function escapeHtmlAttr(value) {
|
|
181
|
+
return value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
182
|
+
}
|
|
183
|
+
function renderImportMapHtml(manifest) {
|
|
184
|
+
const imports = manifest.importmap?.imports ?? {};
|
|
185
|
+
const json = JSON.stringify({ imports }).replace(/</g, "\\u003c");
|
|
186
|
+
const lines = [`<script type="importmap">${json}</script>`];
|
|
187
|
+
for (const href of manifest.preloads ?? []) {
|
|
188
|
+
lines.push(`<link rel="modulepreload" href="${escapeHtmlAttr(href)}" crossorigin>`);
|
|
189
|
+
}
|
|
190
|
+
return lines.join(`
|
|
191
|
+
`) + `
|
|
192
|
+
`;
|
|
193
|
+
}
|
|
194
|
+
|
|
176
195
|
// src/analyzer.ts
|
|
177
196
|
import ts7 from "typescript";
|
|
178
197
|
|
|
@@ -398,150 +417,17 @@ function setIntersects(a, b) {
|
|
|
398
417
|
function tokenContainsIdent(expr, ident) {
|
|
399
418
|
return scanForIdentifiers(expr, (token) => token === ident);
|
|
400
419
|
}
|
|
401
|
-
var IDENT_START_RE = /[A-Za-z_$]/;
|
|
402
|
-
var IDENT_PART_RE = /[A-Za-z0-9_$]/;
|
|
403
420
|
function scanForIdentifiers(expr, predicate) {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
case 0:
|
|
413
|
-
case 4: {
|
|
414
|
-
if (ch === "'") {
|
|
415
|
-
state = 1;
|
|
416
|
-
i++;
|
|
417
|
-
continue;
|
|
418
|
-
}
|
|
419
|
-
if (ch === '"') {
|
|
420
|
-
state = 2;
|
|
421
|
-
i++;
|
|
422
|
-
continue;
|
|
423
|
-
}
|
|
424
|
-
if (ch === "`") {
|
|
425
|
-
state = 3;
|
|
426
|
-
i++;
|
|
427
|
-
continue;
|
|
428
|
-
}
|
|
429
|
-
if (ch === "/" && i + 1 < n) {
|
|
430
|
-
const next = expr[i + 1];
|
|
431
|
-
if (next === "/") {
|
|
432
|
-
state = 5;
|
|
433
|
-
i += 2;
|
|
434
|
-
continue;
|
|
435
|
-
}
|
|
436
|
-
if (next === "*") {
|
|
437
|
-
state = 6;
|
|
438
|
-
i += 2;
|
|
439
|
-
continue;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
if (state === 4) {
|
|
443
|
-
if (ch === "{") {
|
|
444
|
-
braceDepth++;
|
|
445
|
-
i++;
|
|
446
|
-
continue;
|
|
447
|
-
}
|
|
448
|
-
if (ch === "}") {
|
|
449
|
-
if (braceDepth === 0) {
|
|
450
|
-
const restored = tmplExprStack.pop();
|
|
451
|
-
braceDepth = restored ?? 0;
|
|
452
|
-
state = 3;
|
|
453
|
-
i++;
|
|
454
|
-
continue;
|
|
455
|
-
}
|
|
456
|
-
braceDepth--;
|
|
457
|
-
i++;
|
|
458
|
-
continue;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
if (IDENT_START_RE.test(ch)) {
|
|
462
|
-
let j = i + 1;
|
|
463
|
-
while (j < n && IDENT_PART_RE.test(expr[j]))
|
|
464
|
-
j++;
|
|
465
|
-
const token = expr.slice(i, j);
|
|
466
|
-
let prev = i - 1;
|
|
467
|
-
while (prev >= 0 && (expr[prev] === " " || expr[prev] === "\t" || expr[prev] === `
|
|
468
|
-
` || expr[prev] === "\r"))
|
|
469
|
-
prev--;
|
|
470
|
-
const isMemberTail = prev >= 0 && expr[prev] === "." && (prev === 0 || expr[prev - 1] !== ".");
|
|
471
|
-
if (!isMemberTail && predicate(token))
|
|
472
|
-
return true;
|
|
473
|
-
i = j;
|
|
474
|
-
continue;
|
|
475
|
-
}
|
|
476
|
-
i++;
|
|
477
|
-
continue;
|
|
478
|
-
}
|
|
479
|
-
case 1: {
|
|
480
|
-
if (ch === "\\" && i + 1 < n) {
|
|
481
|
-
i += 2;
|
|
482
|
-
continue;
|
|
483
|
-
}
|
|
484
|
-
if (ch === "'") {
|
|
485
|
-
state = 0;
|
|
486
|
-
i++;
|
|
487
|
-
continue;
|
|
488
|
-
}
|
|
489
|
-
i++;
|
|
490
|
-
continue;
|
|
491
|
-
}
|
|
492
|
-
case 2: {
|
|
493
|
-
if (ch === "\\" && i + 1 < n) {
|
|
494
|
-
i += 2;
|
|
495
|
-
continue;
|
|
496
|
-
}
|
|
497
|
-
if (ch === '"') {
|
|
498
|
-
state = 0;
|
|
499
|
-
i++;
|
|
500
|
-
continue;
|
|
501
|
-
}
|
|
502
|
-
i++;
|
|
503
|
-
continue;
|
|
504
|
-
}
|
|
505
|
-
case 3: {
|
|
506
|
-
if (ch === "\\" && i + 1 < n) {
|
|
507
|
-
i += 2;
|
|
508
|
-
continue;
|
|
509
|
-
}
|
|
510
|
-
if (ch === "`") {
|
|
511
|
-
state = tmplExprStack.length > 0 ? 4 : 0;
|
|
512
|
-
i++;
|
|
513
|
-
continue;
|
|
514
|
-
}
|
|
515
|
-
if (ch === "$" && i + 1 < n && expr[i + 1] === "{") {
|
|
516
|
-
tmplExprStack.push(braceDepth);
|
|
517
|
-
braceDepth = 0;
|
|
518
|
-
state = 4;
|
|
519
|
-
i += 2;
|
|
520
|
-
continue;
|
|
521
|
-
}
|
|
522
|
-
i++;
|
|
523
|
-
continue;
|
|
524
|
-
}
|
|
525
|
-
case 5: {
|
|
526
|
-
if (ch === `
|
|
527
|
-
` || ch === "\r") {
|
|
528
|
-
state = 0;
|
|
529
|
-
i++;
|
|
530
|
-
continue;
|
|
531
|
-
}
|
|
532
|
-
i++;
|
|
533
|
-
continue;
|
|
534
|
-
}
|
|
535
|
-
case 6: {
|
|
536
|
-
if (ch === "*" && i + 1 < n && expr[i + 1] === "/") {
|
|
537
|
-
state = 0;
|
|
538
|
-
i += 2;
|
|
539
|
-
continue;
|
|
540
|
-
}
|
|
541
|
-
i++;
|
|
542
|
-
continue;
|
|
543
|
-
}
|
|
421
|
+
let prevSignificant;
|
|
422
|
+
for (const tok of iterateJsTokens(expr)) {
|
|
423
|
+
if (isTriviaKind(tok.kind))
|
|
424
|
+
continue;
|
|
425
|
+
if (isIdentifierLikeToken(tok.kind)) {
|
|
426
|
+
const isMemberTail = prevSignificant === ts2.SyntaxKind.DotToken || prevSignificant === ts2.SyntaxKind.QuestionDotToken;
|
|
427
|
+
if (!isMemberTail && predicate(expr.slice(tok.pos, tok.end)))
|
|
428
|
+
return true;
|
|
544
429
|
}
|
|
430
|
+
prevSignificant = tok.kind;
|
|
545
431
|
}
|
|
546
432
|
return false;
|
|
547
433
|
}
|
|
@@ -1652,6 +1538,9 @@ function irToComponentTemplateWithOpts(node, opts) {
|
|
|
1652
1538
|
}
|
|
1653
1539
|
return `\${${transformExpr(node.expr, node.templateExpr)}}`;
|
|
1654
1540
|
case "conditional": {
|
|
1541
|
+
if (node.clientOnly && node.slotId) {
|
|
1542
|
+
return `<!--bf-cond-start:${node.slotId}--><!--bf-cond-end:${node.slotId}-->`;
|
|
1543
|
+
}
|
|
1655
1544
|
const trueBranch = recurse(node.whenTrue);
|
|
1656
1545
|
const falseBranch = recurse(node.whenFalse);
|
|
1657
1546
|
const trueHtml = node.slotId ? addCondAttrToTemplate(trueBranch, node.slotId) : trueBranch;
|
|
@@ -1882,6 +1771,9 @@ function generateCsrTemplateWithOpts(node, opts) {
|
|
|
1882
1771
|
return `\${${expr}}`;
|
|
1883
1772
|
}
|
|
1884
1773
|
case "conditional": {
|
|
1774
|
+
if (node.clientOnly && node.slotId) {
|
|
1775
|
+
return `<!--bf-cond-start:${node.slotId}--><!--bf-cond-end:${node.slotId}-->`;
|
|
1776
|
+
}
|
|
1885
1777
|
const trueBranch = recurse(node.whenTrue);
|
|
1886
1778
|
const falseBranch = recurse(node.whenFalse);
|
|
1887
1779
|
const trueHtml = node.slotId ? addCondAttrToTemplate(trueBranch, node.slotId) : trueBranch;
|
|
@@ -5412,6 +5304,8 @@ function convertNode(node, raw) {
|
|
|
5412
5304
|
` + ` (a, b) => a.field - b.field
|
|
5413
5305
|
` + ` (a, b) => a.localeCompare(b)
|
|
5414
5306
|
` + ` (a, b) => a.field.localeCompare(b.field)
|
|
5307
|
+
` + ` (a, b) => a.field > b.field ? 1 : -1 (relational ternary)
|
|
5308
|
+
` + ` any of the above ||-chained for multi-key tie-breaks
|
|
5415
5309
|
` + `(reverse the operands for descending order). ` + `Wrap the call in /* @client */ to evaluate at hydration.`
|
|
5416
5310
|
};
|
|
5417
5311
|
}
|
|
@@ -5571,26 +5465,54 @@ function extractSortComparatorFromTS(node, method) {
|
|
|
5571
5465
|
const paramA = pA.name.text;
|
|
5572
5466
|
const paramB = pB.name.text;
|
|
5573
5467
|
let body;
|
|
5574
|
-
if (ts8.isArrowFunction(node)) {
|
|
5575
|
-
if (ts8.isBlock(node.body))
|
|
5576
|
-
return null;
|
|
5468
|
+
if (ts8.isArrowFunction(node) && !ts8.isBlock(node.body)) {
|
|
5577
5469
|
body = node.body;
|
|
5578
5470
|
} else {
|
|
5579
|
-
const
|
|
5471
|
+
const block = node.body;
|
|
5472
|
+
const stmts = block.statements;
|
|
5580
5473
|
if (stmts.length !== 1 || !ts8.isReturnStatement(stmts[0]) || !stmts[0].expression)
|
|
5581
5474
|
return null;
|
|
5582
5475
|
body = stmts[0].expression;
|
|
5583
5476
|
}
|
|
5584
5477
|
const raw = body.getText();
|
|
5478
|
+
const keys = [];
|
|
5479
|
+
for (const operand of flattenLogicalOr(body)) {
|
|
5480
|
+
const key = classifyLeafComparator(operand, paramA, paramB);
|
|
5481
|
+
if (!key)
|
|
5482
|
+
return null;
|
|
5483
|
+
keys.push(key);
|
|
5484
|
+
}
|
|
5485
|
+
if (keys.length === 0)
|
|
5486
|
+
return null;
|
|
5487
|
+
return { keys, raw, paramA, paramB, method };
|
|
5488
|
+
}
|
|
5489
|
+
function unwrapParens(expr) {
|
|
5490
|
+
let e = expr;
|
|
5491
|
+
while (ts8.isParenthesizedExpression(e))
|
|
5492
|
+
e = e.expression;
|
|
5493
|
+
return e;
|
|
5494
|
+
}
|
|
5495
|
+
function flattenLogicalOr(expr) {
|
|
5496
|
+
const inner = unwrapParens(expr);
|
|
5497
|
+
if (ts8.isBinaryExpression(inner) && inner.operatorToken.kind === ts8.SyntaxKind.BarBarToken) {
|
|
5498
|
+
return [...flattenLogicalOr(inner.left), ...flattenLogicalOr(inner.right)];
|
|
5499
|
+
}
|
|
5500
|
+
return [inner];
|
|
5501
|
+
}
|
|
5502
|
+
function classifyLeafComparator(expr, paramA, paramB) {
|
|
5503
|
+
const body = unwrapParens(expr);
|
|
5585
5504
|
if (ts8.isBinaryExpression(body) && body.operatorToken.kind === ts8.SyntaxKind.MinusToken) {
|
|
5586
|
-
return classifyComparatorOperands(body.left, body.right, paramA, paramB, "numeric"
|
|
5505
|
+
return classifyComparatorOperands(body.left, body.right, paramA, paramB, "numeric");
|
|
5587
5506
|
}
|
|
5588
5507
|
if (ts8.isCallExpression(body) && ts8.isPropertyAccessExpression(body.expression) && body.expression.name.text === "localeCompare" && body.arguments.length === 1) {
|
|
5589
|
-
return classifyComparatorOperands(body.expression.expression, body.arguments[0], paramA, paramB, "string"
|
|
5508
|
+
return classifyComparatorOperands(body.expression.expression, body.arguments[0], paramA, paramB, "string");
|
|
5509
|
+
}
|
|
5510
|
+
if (ts8.isConditionalExpression(body)) {
|
|
5511
|
+
return classifyTernaryComparator(body, paramA, paramB);
|
|
5590
5512
|
}
|
|
5591
5513
|
return null;
|
|
5592
5514
|
}
|
|
5593
|
-
function classifyComparatorOperands(left, right, paramA, paramB, type
|
|
5515
|
+
function classifyComparatorOperands(left, right, paramA, paramB, type) {
|
|
5594
5516
|
const leftRef = classifySortOperand(left, paramA, paramB);
|
|
5595
5517
|
const rightRef = classifySortOperand(right, paramA, paramB);
|
|
5596
5518
|
if (!leftRef || !rightRef)
|
|
@@ -5603,15 +5525,89 @@ function classifyComparatorOperands(left, right, paramA, paramB, type, method, r
|
|
|
5603
5525
|
return null;
|
|
5604
5526
|
}
|
|
5605
5527
|
const direction = leftRef.param === "A" ? "asc" : "desc";
|
|
5606
|
-
return {
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5528
|
+
return { key: leftRef.key, type, direction };
|
|
5529
|
+
}
|
|
5530
|
+
function classifyTernaryComparator(node, paramA, paramB) {
|
|
5531
|
+
const cond = unwrapParens(node.condition);
|
|
5532
|
+
if (ts8.isBinaryExpression(cond) && (cond.operatorToken.kind === ts8.SyntaxKind.EqualsEqualsEqualsToken || cond.operatorToken.kind === ts8.SyntaxKind.EqualsEqualsToken) && sameKeyOperands(cond.left, cond.right, paramA, paramB) && numericSign(node.whenTrue) === 0) {
|
|
5533
|
+
const elseBranch = unwrapParens(node.whenFalse);
|
|
5534
|
+
if (ts8.isConditionalExpression(elseBranch)) {
|
|
5535
|
+
return classifyTernaryComparator(elseBranch, paramA, paramB);
|
|
5536
|
+
}
|
|
5537
|
+
return null;
|
|
5538
|
+
}
|
|
5539
|
+
if (!ts8.isBinaryExpression(cond))
|
|
5540
|
+
return null;
|
|
5541
|
+
const op = cond.operatorToken.kind;
|
|
5542
|
+
const isGreater = op === ts8.SyntaxKind.GreaterThanToken || op === ts8.SyntaxKind.GreaterThanEqualsToken;
|
|
5543
|
+
const isLess = op === ts8.SyntaxKind.LessThanToken || op === ts8.SyntaxKind.LessThanEqualsToken;
|
|
5544
|
+
if (!isGreater && !isLess)
|
|
5545
|
+
return null;
|
|
5546
|
+
const leftRef = classifySortOperand(cond.left, paramA, paramB);
|
|
5547
|
+
const rightRef = classifySortOperand(cond.right, paramA, paramB);
|
|
5548
|
+
if (!leftRef || !rightRef)
|
|
5549
|
+
return null;
|
|
5550
|
+
if (leftRef.param === rightRef.param)
|
|
5551
|
+
return null;
|
|
5552
|
+
if (leftRef.key.kind !== rightRef.key.kind)
|
|
5553
|
+
return null;
|
|
5554
|
+
if (leftRef.key.kind === "field" && rightRef.key.kind === "field" && leftRef.key.field !== rightRef.key.field) {
|
|
5555
|
+
return null;
|
|
5556
|
+
}
|
|
5557
|
+
const trueSign = numericSign(node.whenTrue);
|
|
5558
|
+
if (trueSign === null || trueSign === 0)
|
|
5559
|
+
return null;
|
|
5560
|
+
if (!isBoundedTernaryElse(node.whenFalse, leftRef.key, paramA, paramB))
|
|
5561
|
+
return null;
|
|
5562
|
+
const greaterForA = leftRef.param === "A" ? isGreater : !isGreater;
|
|
5563
|
+
const asc = greaterForA ? trueSign > 0 : trueSign < 0;
|
|
5564
|
+
return { key: leftRef.key, type: "auto", direction: asc ? "asc" : "desc" };
|
|
5565
|
+
}
|
|
5566
|
+
function sameKeyOperands(left, right, paramA, paramB) {
|
|
5567
|
+
const l = classifySortOperand(left, paramA, paramB);
|
|
5568
|
+
const r = classifySortOperand(right, paramA, paramB);
|
|
5569
|
+
if (!l || !r)
|
|
5570
|
+
return false;
|
|
5571
|
+
if (l.param === r.param)
|
|
5572
|
+
return false;
|
|
5573
|
+
if (l.key.kind !== r.key.kind)
|
|
5574
|
+
return false;
|
|
5575
|
+
if (l.key.kind === "field" && r.key.kind === "field" && l.key.field !== r.key.field)
|
|
5576
|
+
return false;
|
|
5577
|
+
return true;
|
|
5578
|
+
}
|
|
5579
|
+
function numericSign(expr) {
|
|
5580
|
+
const e = unwrapParens(expr);
|
|
5581
|
+
if (ts8.isPrefixUnaryExpression(e) && e.operator === ts8.SyntaxKind.MinusToken) {
|
|
5582
|
+
const inner = numericSign(e.operand);
|
|
5583
|
+
return inner === null ? null : -inner;
|
|
5584
|
+
}
|
|
5585
|
+
if (ts8.isNumericLiteral(e)) {
|
|
5586
|
+
const n = Number(e.text);
|
|
5587
|
+
if (Number.isNaN(n))
|
|
5588
|
+
return null;
|
|
5589
|
+
if (n === 0)
|
|
5590
|
+
return 0;
|
|
5591
|
+
return n > 0 ? 1 : -1;
|
|
5592
|
+
}
|
|
5593
|
+
return null;
|
|
5594
|
+
}
|
|
5595
|
+
function isBoundedTernaryElse(expr, key, paramA, paramB) {
|
|
5596
|
+
const e = unwrapParens(expr);
|
|
5597
|
+
if (numericSign(e) !== null)
|
|
5598
|
+
return true;
|
|
5599
|
+
if (ts8.isConditionalExpression(e)) {
|
|
5600
|
+
const nested = classifyTernaryComparator(e, paramA, paramB);
|
|
5601
|
+
return nested !== null && sortKeyEquals(nested.key, key);
|
|
5602
|
+
}
|
|
5603
|
+
return false;
|
|
5604
|
+
}
|
|
5605
|
+
function sortKeyEquals(a, b) {
|
|
5606
|
+
if (a.kind !== b.kind)
|
|
5607
|
+
return false;
|
|
5608
|
+
if (a.kind === "field" && b.kind === "field")
|
|
5609
|
+
return a.field === b.field;
|
|
5610
|
+
return true;
|
|
5615
5611
|
}
|
|
5616
5612
|
function classifySortOperand(expr, paramA, paramB) {
|
|
5617
5613
|
if (ts8.isIdentifier(expr)) {
|
|
@@ -12685,10 +12681,11 @@ function emitInnerLoopNested(lines, plan) {
|
|
|
12685
12681
|
for (const stmt of innerPreludeStatements) {
|
|
12686
12682
|
lines.push(` ${stmt}`);
|
|
12687
12683
|
}
|
|
12688
|
-
|
|
12689
|
-
|
|
12690
|
-
lines.push(`
|
|
12691
|
-
|
|
12684
|
+
comps.forEach((comp, i) => {
|
|
12685
|
+
const compElVar = comps.length > 1 ? `__compEl${i}` : "__compEl";
|
|
12686
|
+
lines.push(` const ${compElVar} = qsaChildScope(__innerEl, ${comp.selector})`);
|
|
12687
|
+
lines.push(` if (${compElVar}) initChild('${nameForRegistryRef(comp.componentName)}', ${compElVar}, ${comp.propsExpr})`);
|
|
12688
|
+
});
|
|
12692
12689
|
lines.push(` })`);
|
|
12693
12690
|
lines.push(` })`);
|
|
12694
12691
|
lines.push(` }`);
|
|
@@ -18359,6 +18356,7 @@ export {
|
|
|
18359
18356
|
rewriteImportsForTemplate,
|
|
18360
18357
|
resolveSetters,
|
|
18361
18358
|
resetCompilerCounters,
|
|
18359
|
+
renderImportMapHtml,
|
|
18362
18360
|
parseExpression,
|
|
18363
18361
|
parseBlockBody,
|
|
18364
18362
|
needsTypeBasedDetection,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-template.d.ts","sourceRoot":"","sources":["../../src/ir-to-client-js/html-template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,EAAE,MAAM,UAAU,CAAA;AAG9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,OAAO,EAAwD,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI;IACvC,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9B,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;CAC/B,CAaA;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAwBnE;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,IAAI;IACpD,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9B,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;CAC/B,CAeA;AA+LD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM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AE,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,OAAO,CAO7G;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAEvE;AAwED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,CAMvH;AAmGD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EACrC,QAAQ,EAAE,MAAM,GACf,MAAM,CAGR;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;CACvC;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,aAAa,CAAC,GAAG,MAAM,CAQ/G"}
|
|
@@ -39,6 +39,16 @@ export interface JsToken {
|
|
|
39
39
|
* about brace depth, not classification).
|
|
40
40
|
*/
|
|
41
41
|
export declare function iterateJsTokens(text: string, start?: number, end?: number): Generator<JsToken>;
|
|
42
|
+
export declare function isTriviaKind(kind: ts.SyntaxKind): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether `kind` is an identifier-like token — a plain identifier or any
|
|
45
|
+
* reserved/contextual keyword. Keywords lex to their own token kinds but
|
|
46
|
+
* still match the `[A-Za-z_$][\w$]*` shape the previous hand-rolled
|
|
47
|
+
* scanners treated as candidate identifier tokens, so consumers that want
|
|
48
|
+
* "every bare word in code context" (e.g. `tokenContainsIdent`) include
|
|
49
|
+
* them and compare the slice text themselves.
|
|
50
|
+
*/
|
|
51
|
+
export declare function isIdentifierLikeToken(kind: ts.SyntaxKind): boolean;
|
|
42
52
|
type Replacement = string | ((substring: string, ...args: any[]) => string);
|
|
43
53
|
/**
|
|
44
54
|
* Apply `re` / `replacement` to `code`, but only in expression-context
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"js-scanner.d.ts","sourceRoot":"","sources":["../../src/scanner/js-scanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,MAAM,WAAW,OAAO;IACtB,+FAA+F;IAC/F,IAAI,EAAE,EAAE,CAAC,UAAU,CAAA;IACnB,wGAAwG;IACxG,GAAG,EAAE,MAAM,CAAA;IACX,0BAA0B;IAC1B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;;;;;;;;GAUG;AACH,wBAAiB,eAAe,CAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,SAAI,EACT,GAAG,GAAE,MAAoB,GACxB,SAAS,CAAC,OAAO,CAAC,CA+DpB;
|
|
1
|
+
{"version":3,"file":"js-scanner.d.ts","sourceRoot":"","sources":["../../src/scanner/js-scanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,MAAM,WAAW,OAAO;IACtB,+FAA+F;IAC/F,IAAI,EAAE,EAAE,CAAC,UAAU,CAAA;IACnB,wGAAwG;IACxG,GAAG,EAAE,MAAM,CAAA;IACX,0BAA0B;IAC1B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;;;;;;;;GAUG;AACH,wBAAiB,eAAe,CAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,SAAI,EACT,GAAG,GAAE,MAAoB,GACxB,SAAS,CAAC,OAAO,CAAC,CA+DpB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,GAAG,OAAO,CASzD;AA6CD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,GAAG,OAAO,CAKlE;AAkBD,KAAK,WAAW,GAAG,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,CAAA;AAE3E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,WAAW,GACvB,MAAM,CAuCR;AAaD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAuBxE;AAKD;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAiF1E"}
|
|
@@ -62,6 +62,9 @@ function canRegexStartHere(prev) {
|
|
|
62
62
|
return true;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
+
function isIdentifierLikeToken(kind) {
|
|
66
|
+
return kind === ts.SyntaxKind.Identifier || kind >= ts.SyntaxKind.FirstKeyword && kind <= ts.SyntaxKind.LastKeyword;
|
|
67
|
+
}
|
|
65
68
|
function isOpaqueContentKind(kind) {
|
|
66
69
|
return kind === ts.SyntaxKind.StringLiteral || kind === ts.SyntaxKind.NoSubstitutionTemplateLiteral || kind === ts.SyntaxKind.RegularExpressionLiteral || kind === ts.SyntaxKind.SingleLineCommentTrivia || kind === ts.SyntaxKind.MultiLineCommentTrivia;
|
|
67
70
|
}
|
|
@@ -175,6 +178,8 @@ function findTopLevelTemplateLiterals(code) {
|
|
|
175
178
|
export {
|
|
176
179
|
replaceInExprContexts,
|
|
177
180
|
iterateJsTokens,
|
|
181
|
+
isTriviaKind,
|
|
182
|
+
isIdentifierLikeToken,
|
|
178
183
|
findTopLevelTemplateLiterals,
|
|
179
184
|
findInterpolationEnd
|
|
180
185
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/jsx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "JSX compiler for BarefootJS - transforms JSX to server HTML + client JS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"types": "./dist/scanner/js-scanner.d.ts",
|
|
15
15
|
"import": "./dist/scanner/js-scanner.js"
|
|
16
16
|
},
|
|
17
|
+
"./import-map": {
|
|
18
|
+
"types": "./dist/import-map.d.ts",
|
|
19
|
+
"import": "./dist/import-map.js"
|
|
20
|
+
},
|
|
17
21
|
"./jsx-runtime": {
|
|
18
22
|
"types": "./src/jsx-runtime/index.d.ts"
|
|
19
23
|
},
|
|
@@ -27,7 +31,7 @@
|
|
|
27
31
|
],
|
|
28
32
|
"scripts": {
|
|
29
33
|
"build": "bun run build:js && bun run build:types",
|
|
30
|
-
"build:js": "bun build ./src/index.ts ./src/scanner/js-scanner.ts --root ./src --outdir ./dist --format esm --external typescript --external @barefootjs/shared --external @barefootjs/client",
|
|
34
|
+
"build:js": "bun build ./src/index.ts ./src/scanner/js-scanner.ts ./src/import-map.ts --root ./src --outdir ./dist --format esm --external typescript --external @barefootjs/shared --external @barefootjs/client",
|
|
31
35
|
"build:types": "tsgo --emitDeclarationOnly --outDir ./dist",
|
|
32
36
|
"test": "bun test && bun run typecheck:tests",
|
|
33
37
|
"typecheck:tests": "tsgo --noEmit -p __tests__/tsconfig.json",
|
|
@@ -49,7 +53,7 @@
|
|
|
49
53
|
"directory": "packages/jsx"
|
|
50
54
|
},
|
|
51
55
|
"dependencies": {
|
|
52
|
-
"@barefootjs/shared": "0.
|
|
56
|
+
"@barefootjs/shared": "0.5.0"
|
|
53
57
|
},
|
|
54
58
|
"peerDependencies": {
|
|
55
59
|
"@barefootjs/client": ">=0.2.0",
|