ripple 0.2.211 → 0.2.213

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +3 -0
  3. package/package.json +5 -2
  4. package/src/compiler/phases/1-parse/index.js +50 -2
  5. package/src/compiler/phases/2-analyze/index.js +13 -29
  6. package/src/compiler/phases/3-transform/client/index.js +145 -5
  7. package/src/compiler/types/index.d.ts +4 -7
  8. package/src/compiler/types/rpc.d.ts +5 -0
  9. package/src/runtime/internal/client/hydration.js +4 -0
  10. package/src/runtime/internal/client/rpc.js +31 -3
  11. package/src/runtime/internal/client/template.js +4 -2
  12. package/tests/client/compiler/compiler.basic.test.ripple +24 -0
  13. package/tests/client/compiler/compiler.try-in-function.test.ripple +159 -0
  14. package/tests/hydration/basic.test.js +23 -0
  15. package/tests/hydration/build-components.js +2 -2
  16. package/tests/hydration/compiled/client/basic.js +67 -1
  17. package/tests/hydration/compiled/client/composite.js +1 -0
  18. package/tests/hydration/compiled/client/events.js +1 -0
  19. package/tests/hydration/compiled/client/for.js +1 -0
  20. package/tests/hydration/compiled/client/head.js +1 -0
  21. package/tests/hydration/compiled/client/html.js +1 -0
  22. package/tests/hydration/compiled/client/if-children.js +407 -0
  23. package/tests/hydration/compiled/client/if.js +1 -0
  24. package/tests/hydration/compiled/client/portal.js +4 -0
  25. package/tests/hydration/compiled/client/reactivity.js +1 -0
  26. package/tests/hydration/compiled/client/return.js +1 -0
  27. package/tests/hydration/compiled/client/switch.js +1 -0
  28. package/tests/hydration/compiled/server/basic.js +108 -1
  29. package/tests/hydration/compiled/server/composite.js +1 -0
  30. package/tests/hydration/compiled/server/events.js +1 -0
  31. package/tests/hydration/compiled/server/for.js +1 -0
  32. package/tests/hydration/compiled/server/head.js +1 -0
  33. package/tests/hydration/compiled/server/html.js +1 -0
  34. package/tests/hydration/compiled/server/if-children.js +686 -0
  35. package/tests/hydration/compiled/server/if.js +1 -0
  36. package/tests/hydration/compiled/server/portal.js +1 -0
  37. package/tests/hydration/compiled/server/reactivity.js +1 -0
  38. package/tests/hydration/compiled/server/return.js +1 -0
  39. package/tests/hydration/compiled/server/switch.js +1 -0
  40. package/tests/hydration/components/basic.ripple +32 -1
  41. package/tests/hydration/components/composite.ripple +3 -1
  42. package/tests/hydration/components/if-children.ripple +196 -0
  43. package/tests/hydration/if-children.test.js +272 -0
  44. package/tests/hydration/tsconfig.json +12 -0
  45. package/tests/hydration.d.ts +14 -0
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  import * as _$_ from 'ripple/internal/server';
2
3
 
3
4
  export function StaticText(__output) {
@@ -345,7 +346,7 @@ function Actions(__output, { playgroundVisible = false }) {
345
346
  __output.push('</a>');
346
347
  __output.push('<!--[-->');
347
348
 
348
- if (_$_.get(playgroundVisible)) {
349
+ if (playgroundVisible) {
349
350
  __output.push('<a');
350
351
  __output.push(' href="/playground"');
351
352
  __output.push(' class="playground-link"');
@@ -469,5 +470,111 @@ export function WebsiteIndex(__output) {
469
470
  comp(...args);
470
471
  }
471
472
 
473
+ _$_.pop_component();
474
+ }
475
+
476
+ function LastChild(__output) {
477
+ _$_.push_component();
478
+ __output.push('<footer');
479
+ __output.push(' class="last-child"');
480
+ __output.push('>');
481
+
482
+ {
483
+ __output.push('I am the last child');
484
+ }
485
+
486
+ __output.push('</footer>');
487
+ _$_.pop_component();
488
+ }
489
+
490
+ export function ComponentAsLastSibling(__output) {
491
+ _$_.push_component();
492
+ __output.push('<div');
493
+ __output.push(' class="wrapper"');
494
+ __output.push('>');
495
+
496
+ {
497
+ __output.push('<h1');
498
+ __output.push('>');
499
+
500
+ {
501
+ __output.push('Header');
502
+ }
503
+
504
+ __output.push('</h1>');
505
+ __output.push('<p');
506
+ __output.push('>');
507
+
508
+ {
509
+ __output.push('Some content');
510
+ }
511
+
512
+ __output.push('</p>');
513
+
514
+ {
515
+ const comp = LastChild;
516
+ const args = [__output, {}];
517
+
518
+ comp(...args);
519
+ }
520
+ }
521
+
522
+ __output.push('</div>');
523
+ _$_.pop_component();
524
+ }
525
+
526
+ function InnerContent(__output) {
527
+ _$_.push_component();
528
+ __output.push('<div');
529
+ __output.push(' class="inner"');
530
+ __output.push('>');
531
+
532
+ {
533
+ __output.push('<span');
534
+ __output.push('>');
535
+
536
+ {
537
+ __output.push('Inner text');
538
+ }
539
+
540
+ __output.push('</span>');
541
+
542
+ {
543
+ const comp = LastChild;
544
+ const args = [__output, {}];
545
+
546
+ comp(...args);
547
+ }
548
+ }
549
+
550
+ __output.push('</div>');
551
+ _$_.pop_component();
552
+ }
553
+
554
+ export function NestedComponentAsLastSibling(__output) {
555
+ _$_.push_component();
556
+ __output.push('<section');
557
+ __output.push(' class="outer"');
558
+ __output.push('>');
559
+
560
+ {
561
+ __output.push('<h2');
562
+ __output.push('>');
563
+
564
+ {
565
+ __output.push('Section title');
566
+ }
567
+
568
+ __output.push('</h2>');
569
+
570
+ {
571
+ const comp = InnerContent;
572
+ const args = [__output, {}];
573
+
574
+ comp(...args);
575
+ }
576
+ }
577
+
578
+ __output.push('</section>');
472
579
  _$_.pop_component();
473
580
  }
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  import * as _$_ from 'ripple/internal/server';
2
3
 
3
4
  export async function Layout(__output, { children }) {
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  import * as _$_ from 'ripple/internal/server';
2
3
 
3
4
  import { track } from 'ripple/server';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  import * as _$_ from 'ripple/internal/server';
2
3
 
3
4
  import { track } from 'ripple/server';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  import * as _$_ from 'ripple/internal/server';
2
3
 
3
4
  import { track } from 'ripple/server';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  import * as _$_ from 'ripple/internal/server';
2
3
 
3
4
  import { track } from 'ripple/server';