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
@@ -3,7 +3,7 @@
3
3
  "description": "Ripple is an elegant TypeScript UI framework",
4
4
  "license": "MIT",
5
5
  "author": "Dominic Gannaway",
6
- "version": "0.2.94",
6
+ "version": "0.2.96",
7
7
  "type": "module",
8
8
  "module": "src/runtime/index-client.js",
9
9
  "main": "src/runtime/index-client.js",
@@ -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
- if (attr.value !== null) {
492
- visit(attr.value, state);
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
- if (binding !== null && binding.kind === 'tracked') {
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;