ripple 0.2.94 → 0.2.96
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/package.json
CHANGED
|
@@ -140,6 +140,12 @@ const visitors = {
|
|
|
140
140
|
},
|
|
141
141
|
|
|
142
142
|
CallExpression(node, context) {
|
|
143
|
+
// bug in our acorn pasrer: it uses typeParameters instead of typeArguments
|
|
144
|
+
if (node.typeParameters) {
|
|
145
|
+
node.typeArguments = node.typeParameters;
|
|
146
|
+
delete node.typeParameters;
|
|
147
|
+
}
|
|
148
|
+
|
|
143
149
|
const callee = node.callee;
|
|
144
150
|
|
|
145
151
|
if (context.state.function_depth === 0 && is_ripple_track_call(callee, context)) {
|
|
@@ -301,6 +307,15 @@ const visitors = {
|
|
|
301
307
|
}
|
|
302
308
|
},
|
|
303
309
|
|
|
310
|
+
TSTypeReference(node, context) {
|
|
311
|
+
// bug in our acorn pasrer: it uses typeParameters instead of typeArguments
|
|
312
|
+
if (node.typeParameters) {
|
|
313
|
+
node.typeArguments = node.typeParameters;
|
|
314
|
+
delete node.typeParameters;
|
|
315
|
+
}
|
|
316
|
+
context.next();
|
|
317
|
+
},
|
|
318
|
+
|
|
304
319
|
IfStatement(node, context) {
|
|
305
320
|
if (!is_inside_component(context)) {
|
|
306
321
|
return context.next();
|
|
@@ -488,9 +503,9 @@ const visitors = {
|
|
|
488
503
|
if (attr.name.type === 'Identifier') {
|
|
489
504
|
attribute_names.add(attr.name);
|
|
490
505
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
506
|
+
if (attr.value !== null) {
|
|
507
|
+
visit(attr.value, state);
|
|
508
|
+
}
|
|
494
509
|
} else if (attr.type === 'SpreadAttribute') {
|
|
495
510
|
visit(attr.argument, state);
|
|
496
511
|
} else if (attr.type === 'RefAttribute') {
|
|
@@ -419,59 +419,7 @@ const visitors = {
|
|
|
419
419
|
delete declarator.id.typeAnnotation;
|
|
420
420
|
}
|
|
421
421
|
|
|
422
|
-
|
|
423
|
-
let expression;
|
|
424
|
-
|
|
425
|
-
if (context.state.to_ts) {
|
|
426
|
-
// TypeScript mode: lighter transformation
|
|
427
|
-
if (metadata.tracking && !metadata.await) {
|
|
428
|
-
expression = b.call(
|
|
429
|
-
'_$_.derived',
|
|
430
|
-
b.thunk(context.visit(declarator.init)),
|
|
431
|
-
b.id('__block'),
|
|
432
|
-
);
|
|
433
|
-
} else {
|
|
434
|
-
expression = b.call(
|
|
435
|
-
'_$_.tracked',
|
|
436
|
-
declarator.init === null ? undefined : context.visit(declarator.init),
|
|
437
|
-
b.id('__block'),
|
|
438
|
-
);
|
|
439
|
-
}
|
|
440
|
-
} else {
|
|
441
|
-
debugger;
|
|
442
|
-
// Runtime mode: full transformation
|
|
443
|
-
if (metadata.tracking && metadata.await) {
|
|
444
|
-
expression = b.call(
|
|
445
|
-
b.await(
|
|
446
|
-
b.call(
|
|
447
|
-
'_$_.resume_context',
|
|
448
|
-
b.call(
|
|
449
|
-
'_$_.async_computed',
|
|
450
|
-
b.thunk(context.visit(declarator.init), true),
|
|
451
|
-
b.id('__block'),
|
|
452
|
-
),
|
|
453
|
-
),
|
|
454
|
-
),
|
|
455
|
-
);
|
|
456
|
-
} else if (metadata.tracking && !metadata.await) {
|
|
457
|
-
expression = b.call(
|
|
458
|
-
'_$_.derived',
|
|
459
|
-
b.thunk(context.visit(declarator.init)),
|
|
460
|
-
b.id('__block'),
|
|
461
|
-
);
|
|
462
|
-
} else {
|
|
463
|
-
expression = b.call(
|
|
464
|
-
'_$_.tracked',
|
|
465
|
-
declarator.init === null ? undefined : context.visit(declarator.init),
|
|
466
|
-
b.id('__block'),
|
|
467
|
-
);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
declarations.push(b.declarator(declarator.id, expression));
|
|
472
|
-
} else {
|
|
473
|
-
declarations.push(context.visit(declarator));
|
|
474
|
-
}
|
|
422
|
+
declarations.push(context.visit(declarator));
|
|
475
423
|
} else {
|
|
476
424
|
if (!context.state.to_ts) {
|
|
477
425
|
delete declarator.id.typeAnnotation;
|