ripple 0.3.3 → 0.3.5

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 (128) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/package.json +2 -2
  3. package/src/compiler/identifier-utils.js +1 -8
  4. package/src/compiler/phases/1-parse/index.js +101 -195
  5. package/src/compiler/phases/2-analyze/index.js +115 -174
  6. package/src/compiler/phases/2-analyze/prune.js +2 -2
  7. package/src/compiler/phases/3-transform/client/index.js +177 -261
  8. package/src/compiler/phases/3-transform/server/index.js +185 -42
  9. package/src/compiler/types/index.d.ts +15 -34
  10. package/src/compiler/utils.js +32 -20
  11. package/src/runtime/index-client.js +0 -17
  12. package/src/runtime/internal/client/bindings.js +118 -7
  13. package/src/runtime/internal/client/render.js +5 -1
  14. package/src/runtime/internal/client/runtime.js +1 -1
  15. package/src/runtime/internal/client/types.d.ts +4 -0
  16. package/src/runtime/internal/server/index.js +11 -0
  17. package/tests/client/array/array.copy-within.test.ripple +7 -7
  18. package/tests/client/array/array.derived.test.ripple +24 -24
  19. package/tests/client/array/array.iteration.test.ripple +7 -7
  20. package/tests/client/array/array.mutations.test.ripple +17 -17
  21. package/tests/client/array/array.to-methods.test.ripple +4 -4
  22. package/tests/client/async-suspend.test.ripple +3 -3
  23. package/tests/client/basic/basic.attributes.test.ripple +31 -31
  24. package/tests/client/basic/basic.collections.test.ripple +6 -6
  25. package/tests/client/basic/basic.components.test.ripple +8 -8
  26. package/tests/client/basic/basic.errors.test.ripple +31 -34
  27. package/tests/client/basic/basic.events.test.ripple +11 -11
  28. package/tests/client/basic/basic.get-set.test.ripple +18 -18
  29. package/tests/client/basic/basic.reactivity.test.ripple +36 -36
  30. package/tests/client/basic/basic.rendering.test.ripple +7 -7
  31. package/tests/client/basic/basic.utilities.test.ripple +4 -4
  32. package/tests/client/boundaries.test.ripple +7 -7
  33. package/tests/client/compiler/__snapshots__/compiler.typescript.test.ripple.snap +24 -0
  34. package/tests/client/compiler/compiler.assignments.test.ripple +12 -10
  35. package/tests/client/compiler/compiler.basic.test.ripple +57 -58
  36. package/tests/client/compiler/compiler.tracked-access.test.ripple +14 -8
  37. package/tests/client/compiler/compiler.typescript.test.ripple +31 -0
  38. package/tests/client/composite/composite.dynamic-components.test.ripple +6 -6
  39. package/tests/client/composite/composite.props.test.ripple +9 -9
  40. package/tests/client/composite/composite.reactivity.test.ripple +23 -23
  41. package/tests/client/composite/composite.render.test.ripple +52 -4
  42. package/tests/client/computed-properties.test.ripple +3 -3
  43. package/tests/client/context.test.ripple +3 -3
  44. package/tests/client/css/global-additional-cases.test.ripple +5 -2
  45. package/tests/client/css/style-identifier.test.ripple +40 -49
  46. package/tests/client/date.test.ripple +39 -39
  47. package/tests/client/dynamic-elements.test.ripple +37 -37
  48. package/tests/client/events.test.ripple +25 -25
  49. package/tests/client/for.test.ripple +8 -8
  50. package/tests/client/head.test.ripple +7 -7
  51. package/tests/client/html.test.ripple +2 -2
  52. package/tests/client/input-value.test.ripple +376 -177
  53. package/tests/client/lazy-destructuring.test.ripple +209 -0
  54. package/tests/client/map.test.ripple +20 -20
  55. package/tests/client/media-query.test.ripple +4 -4
  56. package/tests/client/object.test.ripple +5 -5
  57. package/tests/client/portal.test.ripple +4 -4
  58. package/tests/client/ref.test.ripple +3 -3
  59. package/tests/client/return.test.ripple +17 -17
  60. package/tests/client/set.test.ripple +10 -10
  61. package/tests/client/svg.test.ripple +6 -5
  62. package/tests/client/switch.test.ripple +10 -10
  63. package/tests/client/tracked-expression.test.ripple +3 -1
  64. package/tests/client/try.test.ripple +4 -4
  65. package/tests/client/url/url.derived.test.ripple +6 -7
  66. package/tests/client/url/url.parsing.test.ripple +9 -9
  67. package/tests/client/url/url.partial-removal.test.ripple +9 -9
  68. package/tests/client/url/url.reactivity.test.ripple +16 -16
  69. package/tests/client/url/url.serialization.test.ripple +3 -3
  70. package/tests/client/url-search-params/url-search-params.derived.test.ripple +7 -8
  71. package/tests/client/url-search-params/url-search-params.initialization.test.ripple +6 -4
  72. package/tests/client/url-search-params/url-search-params.iteration.test.ripple +12 -12
  73. package/tests/client/url-search-params/url-search-params.mutation.test.ripple +18 -18
  74. package/tests/client/url-search-params/url-search-params.retrieval.test.ripple +16 -16
  75. package/tests/client/url-search-params/url-search-params.serialization.test.ripple +4 -4
  76. package/tests/client/url-search-params/url-search-params.tracked-url.test.ripple +3 -3
  77. package/tests/hydration/build-components.js +4 -10
  78. package/tests/hydration/compiled/client/basic.js +4 -4
  79. package/tests/hydration/compiled/client/events.js +2 -0
  80. package/tests/hydration/compiled/client/for.js +2 -0
  81. package/tests/hydration/compiled/client/head.js +13 -11
  82. package/tests/hydration/compiled/client/hmr.js +4 -2
  83. package/tests/hydration/compiled/client/html.js +82 -95
  84. package/tests/hydration/compiled/client/if-children.js +8 -9
  85. package/tests/hydration/compiled/client/if.js +2 -0
  86. package/tests/hydration/compiled/client/mixed-control-flow.js +4 -2
  87. package/tests/hydration/compiled/client/portal.js +1 -1
  88. package/tests/hydration/compiled/client/reactivity.js +2 -0
  89. package/tests/hydration/compiled/client/return.js +2 -0
  90. package/tests/hydration/compiled/client/switch.js +2 -0
  91. package/tests/hydration/compiled/server/composite.js +2 -2
  92. package/tests/hydration/compiled/server/events.js +2 -0
  93. package/tests/hydration/compiled/server/for.js +2 -0
  94. package/tests/hydration/compiled/server/head.js +13 -11
  95. package/tests/hydration/compiled/server/hmr.js +2 -0
  96. package/tests/hydration/compiled/server/html.js +2 -0
  97. package/tests/hydration/compiled/server/if-children.js +2 -0
  98. package/tests/hydration/compiled/server/if.js +2 -0
  99. package/tests/hydration/compiled/server/mixed-control-flow.js +2 -0
  100. package/tests/hydration/compiled/server/portal.js +1 -1
  101. package/tests/hydration/compiled/server/reactivity.js +2 -0
  102. package/tests/hydration/compiled/server/return.js +2 -0
  103. package/tests/hydration/compiled/server/switch.js +2 -0
  104. package/tests/hydration/components/composite.ripple +1 -1
  105. package/tests/hydration/components/events.ripple +10 -8
  106. package/tests/hydration/components/for.ripple +22 -20
  107. package/tests/hydration/components/head.ripple +8 -6
  108. package/tests/hydration/components/hmr.ripple +3 -1
  109. package/tests/hydration/components/html.ripple +3 -1
  110. package/tests/hydration/components/if-children.ripple +9 -7
  111. package/tests/hydration/components/if.ripple +7 -5
  112. package/tests/hydration/components/mixed-control-flow.ripple +5 -3
  113. package/tests/hydration/components/portal.ripple +2 -2
  114. package/tests/hydration/components/reactivity.ripple +11 -9
  115. package/tests/hydration/components/return.ripple +13 -11
  116. package/tests/hydration/components/switch.ripple +6 -4
  117. package/tests/server/__snapshots__/compiler.test.ripple.snap +22 -0
  118. package/tests/server/await.test.ripple +2 -2
  119. package/tests/server/basic.attributes.test.ripple +21 -19
  120. package/tests/server/basic.components.test.ripple +5 -4
  121. package/tests/server/basic.test.ripple +21 -20
  122. package/tests/server/compiler.test.ripple +36 -5
  123. package/tests/server/composite.props.test.ripple +7 -6
  124. package/tests/server/context.test.ripple +3 -1
  125. package/tests/server/dynamic-elements.test.ripple +24 -24
  126. package/tests/server/head.test.ripple +7 -5
  127. package/tests/server/lazy-destructuring.test.ripple +103 -0
  128. package/tests/server/style-identifier.test.ripple +95 -16
@@ -88,6 +88,8 @@ var root_83 = _$_.template(`<div class="layout"><template id="page-data"></templ
88
88
  var root_85 = _$_.template(`<div class="doc-content"><!></div>`, 0);
89
89
  var root_84 = _$_.template(`<!>`, 1, 1);
90
90
 
91
+ import { track } from 'ripple';
92
+
91
93
  export function StaticHtml(__anchor, _, __block) {
92
94
  _$_.push_component();
93
95
 
@@ -213,7 +215,7 @@ export function HtmlWithReactivity(__anchor, _, __block) {
213
215
  _$_.pop_component();
214
216
  }
215
217
 
216
- export function HtmlWrapper(__anchor, __props, __block) {
218
+ export function HtmlWrapper(__anchor, { children }, __block) {
217
219
  _$_.push_component();
218
220
 
219
221
  var div_6 = root_6();
@@ -224,7 +226,7 @@ export function HtmlWrapper(__anchor, __props, __block) {
224
226
  {
225
227
  var node_7 = _$_.child(div_7);
226
228
 
227
- _$_.composite(() => __props.children, node_7, {});
229
+ children(node_7, {}, _$_.active_block);
228
230
  _$_.pop(div_7);
229
231
  }
230
232
  }
@@ -436,7 +438,11 @@ function DocFooter(__anchor, _, __block) {
436
438
  _$_.pop_component();
437
439
  }
438
440
 
439
- export function DocLayout(__anchor, __props, __block) {
441
+ export function DocLayout(
442
+ __anchor,
443
+ { children, editPath = '', nextLink = null, toc = [] },
444
+ __block
445
+ ) {
440
446
  _$_.push_component();
441
447
 
442
448
  var div_14 = root_18();
@@ -453,7 +459,7 @@ export function DocLayout(__anchor, __props, __block) {
453
459
  {
454
460
  var node_19 = _$_.child(div_15);
455
461
 
456
- _$_.composite(() => __props.children, node_19, {});
462
+ children(node_19, {}, _$_.active_block);
457
463
  _$_.pop(div_15);
458
464
  }
459
465
  }
@@ -468,17 +474,15 @@ export function DocLayout(__anchor, __props, __block) {
468
474
 
469
475
  {
470
476
  var a_1 = _$_.child(div_17);
471
- }
472
477
 
473
- _$_.render(() => {
474
- _$_.set_attribute(a_1, 'href', `https://github.com/edit/${_$_.fallback(__props.editPath, '')}`);
475
- });
478
+ _$_.set_attribute(a_1, 'href', `https://github.com/edit/${editPath}`);
479
+ }
476
480
 
477
481
  _$_.append(__anchor, div_17);
478
482
  };
479
483
 
480
484
  _$_.if(node_20, (__render) => {
481
- if (_$_.fallback(__props.editPath, '')) __render(consequent);
485
+ if (editPath) __render(consequent);
482
486
  });
483
487
  }
484
488
 
@@ -500,13 +504,13 @@ export function DocLayout(__anchor, __props, __block) {
500
504
 
501
505
  _$_.render(
502
506
  (__prev) => {
503
- var __a = _$_.fallback(__props.nextLink, null).text;
507
+ var __a = nextLink.text;
504
508
 
505
509
  if (__prev.a !== __a) {
506
510
  _$_.set_text(text_1, __prev.a = __a);
507
511
  }
508
512
 
509
- var __b = _$_.fallback(__props.nextLink, null).href;
513
+ var __b = nextLink.href;
510
514
 
511
515
  if (__prev.b !== __b) {
512
516
  _$_.set_attribute(a_2, 'href', __prev.b = __b);
@@ -519,7 +523,7 @@ export function DocLayout(__anchor, __props, __block) {
519
523
  };
520
524
 
521
525
  _$_.if(node_21, (__render) => {
522
- if (_$_.fallback(__props.nextLink, null)) __render(consequent_1);
526
+ if (nextLink) __render(consequent_1);
523
527
  });
524
528
  }
525
529
 
@@ -544,7 +548,7 @@ export function DocLayout(__anchor, __props, __block) {
544
548
  {
545
549
  _$_.for(
546
550
  ul_1,
547
- () => _$_.fallback(__props.toc, []),
551
+ () => toc,
548
552
  (__anchor, item) => {
549
553
  var li_1 = root_22();
550
554
 
@@ -588,7 +592,7 @@ export function DocLayout(__anchor, __props, __block) {
588
592
  };
589
593
 
590
594
  _$_.if(node_23, (__render) => {
591
- if (_$_.fallback(__props.toc, []).length > 0) __render(consequent_2);
595
+ if (toc.length > 0) __render(consequent_2);
592
596
  });
593
597
  }
594
598
 
@@ -715,7 +719,7 @@ export function HtmlWithUndefinedContent(__anchor, _, __block) {
715
719
  _$_.pop_component();
716
720
  }
717
721
 
718
- function DynamicHeading(__anchor, __props, __block) {
722
+ function DynamicHeading(__anchor, { level, children }, __block) {
719
723
  _$_.push_component();
720
724
 
721
725
  var fragment_8 = root_29();
@@ -728,7 +732,7 @@ function DynamicHeading(__anchor, __props, __block) {
728
732
  {
729
733
  var node_31 = _$_.child(h1_2);
730
734
 
731
- _$_.composite(() => __props.children, node_31, {});
735
+ children(node_31, {}, _$_.active_block);
732
736
  _$_.pop(h1_2);
733
737
  }
734
738
 
@@ -741,7 +745,7 @@ function DynamicHeading(__anchor, __props, __block) {
741
745
  {
742
746
  var node_32 = _$_.child(h2_1);
743
747
 
744
- _$_.composite(() => __props.children, node_32, {});
748
+ children(node_32, {}, _$_.active_block);
745
749
  _$_.pop(h2_1);
746
750
  }
747
751
 
@@ -751,7 +755,7 @@ function DynamicHeading(__anchor, __props, __block) {
751
755
  _$_.switch(node_30, () => {
752
756
  var result = [];
753
757
 
754
- switch (__props.level) {
758
+ switch (level) {
755
759
  case 1:
756
760
  result.push(switch_case_0);
757
761
 
@@ -766,10 +770,10 @@ function DynamicHeading(__anchor, __props, __block) {
766
770
  _$_.pop_component();
767
771
  }
768
772
 
769
- function CodeBlock(__anchor, __props, __block) {
773
+ function CodeBlock(__anchor, { code }, __block) {
770
774
  _$_.push_component();
771
775
 
772
- const highlighted = `<pre class="shiki"><code>${__props.code}</code></pre>`;
776
+ const highlighted = `<pre class="shiki"><code>${code}</code></pre>`;
773
777
  var div_22 = root_32();
774
778
 
775
779
  {
@@ -794,7 +798,7 @@ function CodeBlock(__anchor, __props, __block) {
794
798
  _$_.pop_component();
795
799
  }
796
800
 
797
- function ContentWrapper(__anchor, __props, __block) {
801
+ function ContentWrapper(__anchor, { children }, __block) {
798
802
  _$_.push_component();
799
803
 
800
804
  var div_25 = root_33();
@@ -805,7 +809,7 @@ function ContentWrapper(__anchor, __props, __block) {
805
809
  {
806
810
  var node_34 = _$_.child(div_26);
807
811
 
808
- _$_.composite(() => __props.children, node_34, {});
812
+ children(node_34, {}, _$_.active_block);
809
813
  _$_.pop(div_26);
810
814
  }
811
815
  }
@@ -861,11 +865,13 @@ export function HtmlAfterSwitchInChildren(__anchor, _, __block) {
861
865
  _$_.pop_component();
862
866
  }
863
867
 
864
- function NavItem(__anchor, __props, __block) {
868
+ function NavItem(__anchor, { href, text, active = false }, __block) {
865
869
  _$_.push_component();
866
870
 
867
871
  var div_27 = root_36();
868
872
 
873
+ _$_.set_class(div_27, `nav-item${active ? ' active' : ''}`, void 0, true);
874
+
869
875
  {
870
876
  var node_38 = _$_.child(div_27);
871
877
 
@@ -877,18 +883,21 @@ function NavItem(__anchor, __props, __block) {
877
883
  };
878
884
 
879
885
  _$_.if(node_38, (__render) => {
880
- if (_$_.fallback(__props.active, false)) __render(consequent_3);
886
+ if (active) __render(consequent_3);
881
887
  });
882
888
  }
883
889
 
884
890
  var a_4 = _$_.sibling(node_38);
885
891
 
892
+ _$_.set_attribute(a_4, 'href', href);
893
+
886
894
  {
887
895
  var span_1 = _$_.child(a_4);
888
896
 
889
897
  {
890
898
  var text_4 = _$_.child(span_1, true);
891
899
 
900
+ text_4.nodeValue = text;
892
901
  _$_.pop(span_1);
893
902
  }
894
903
  }
@@ -896,34 +905,11 @@ function NavItem(__anchor, __props, __block) {
896
905
  _$_.pop(div_27);
897
906
  }
898
907
 
899
- _$_.render(
900
- (__prev) => {
901
- var __a = __props.text;
902
-
903
- if (__prev.a !== __a) {
904
- _$_.set_text(text_4, __prev.a = __a);
905
- }
906
-
907
- var __b = __props.href;
908
-
909
- if (__prev.b !== __b) {
910
- _$_.set_attribute(a_4, 'href', __prev.b = __b);
911
- }
912
-
913
- var __c = `nav-item${_$_.fallback(__props.active, false) ? ' active' : ''}`;
914
-
915
- if (__prev.c !== __c) {
916
- _$_.set_class(div_27, __prev.c = __c, void 0, true);
917
- }
918
- },
919
- { a: ' ', b: void 0, c: Symbol() }
920
- );
921
-
922
908
  _$_.append(__anchor, div_27);
923
909
  _$_.pop_component();
924
910
  }
925
911
 
926
- function SidebarSection(__anchor, __props, __block) {
912
+ function SidebarSection(__anchor, { title, children }, __block) {
927
913
  _$_.push_component();
928
914
 
929
915
  let expanded = _$_.track(true, void 0, void 0, __block);
@@ -938,6 +924,7 @@ function SidebarSection(__anchor, __props, __block) {
938
924
  {
939
925
  var text_5 = _$_.child(h2_2, true);
940
926
 
927
+ text_5.nodeValue = title;
941
928
  _$_.pop(h2_2);
942
929
  }
943
930
 
@@ -957,7 +944,7 @@ function SidebarSection(__anchor, __props, __block) {
957
944
  {
958
945
  var node_40 = _$_.child(div_30);
959
946
 
960
- _$_.composite(() => __props.children, node_40, {});
947
+ children(node_40, {}, _$_.active_block);
961
948
  _$_.pop(div_30);
962
949
  }
963
950
 
@@ -972,15 +959,11 @@ function SidebarSection(__anchor, __props, __block) {
972
959
  _$_.pop(section_2);
973
960
  }
974
961
 
975
- _$_.render(() => {
976
- _$_.set_text(text_5, __props.title);
977
- });
978
-
979
962
  _$_.append(__anchor, section_2);
980
963
  _$_.pop_component();
981
964
  }
982
965
 
983
- function SideNav(__anchor, __props, __block) {
966
+ function SideNav(__anchor, { currentPath }, __block) {
984
967
  _$_.push_component();
985
968
 
986
969
  var aside_2 = root_40();
@@ -1009,9 +992,7 @@ function SideNav(__anchor, __props, __block) {
1009
992
  {
1010
993
  href: "/intro",
1011
994
  text: "Introduction",
1012
- get active() {
1013
- return __props.currentPath === '/intro';
1014
- }
995
+ active: currentPath === '/intro'
1015
996
  },
1016
997
  _$_.active_block
1017
998
  );
@@ -1023,9 +1004,7 @@ function SideNav(__anchor, __props, __block) {
1023
1004
  {
1024
1005
  href: "/start",
1025
1006
  text: "Quick Start",
1026
- get active() {
1027
- return __props.currentPath === '/start';
1028
- }
1007
+ active: currentPath === '/start'
1029
1008
  },
1030
1009
  _$_.active_block
1031
1010
  );
@@ -1060,9 +1039,7 @@ function SideNav(__anchor, __props, __block) {
1060
1039
  {
1061
1040
  href: "/guide/app",
1062
1041
  text: "Application",
1063
- get active() {
1064
- return __props.currentPath === '/guide/app';
1065
- }
1042
+ active: currentPath === '/guide/app'
1066
1043
  },
1067
1044
  _$_.active_block
1068
1045
  );
@@ -1074,9 +1051,7 @@ function SideNav(__anchor, __props, __block) {
1074
1051
  {
1075
1052
  href: "/guide/syntax",
1076
1053
  text: "Syntax",
1077
- get active() {
1078
- return __props.currentPath === '/guide/syntax';
1079
- }
1054
+ active: currentPath === '/guide/syntax'
1080
1055
  },
1081
1056
  _$_.active_block
1082
1057
  );
@@ -1160,7 +1135,7 @@ export function LayoutWithSidebarAndMain(__anchor, _, __block) {
1160
1135
  _$_.pop_component();
1161
1136
  }
1162
1137
 
1163
- function ArticleWrapper(__anchor, __props, __block) {
1138
+ function ArticleWrapper(__anchor, { children }, __block) {
1164
1139
  _$_.push_component();
1165
1140
 
1166
1141
  var article_2 = root_46();
@@ -1171,7 +1146,7 @@ function ArticleWrapper(__anchor, __props, __block) {
1171
1146
  {
1172
1147
  var node_51 = _$_.child(div_37);
1173
1148
 
1174
- _$_.composite(() => __props.children, node_51, {});
1149
+ children(node_51, {}, _$_.active_block);
1175
1150
  _$_.pop(div_37);
1176
1151
  }
1177
1152
  }
@@ -1308,7 +1283,7 @@ export function ArticleWithHtmlChildThenSibling(__anchor, _, __block) {
1308
1283
  _$_.pop_component();
1309
1284
  }
1310
1285
 
1311
- function InlineArticleLayout(__anchor, __props, __block) {
1286
+ function InlineArticleLayout(__anchor, { children }, __block) {
1312
1287
  _$_.push_component();
1313
1288
 
1314
1289
  var div_43 = root_55();
@@ -1322,7 +1297,7 @@ function InlineArticleLayout(__anchor, __props, __block) {
1322
1297
  {
1323
1298
  var node_60 = _$_.child(div_44);
1324
1299
 
1325
- _$_.composite(() => __props.children, node_60, {});
1300
+ children(node_60, {}, _$_.active_block);
1326
1301
  _$_.pop(div_44);
1327
1302
  }
1328
1303
  }
@@ -1416,7 +1391,11 @@ function FooterStub(__anchor, _, __block) {
1416
1391
  _$_.pop_component();
1417
1392
  }
1418
1393
 
1419
- function DocsLayoutInner(__anchor, __props, __block) {
1394
+ function DocsLayoutInner(
1395
+ __anchor,
1396
+ { children, editPath = '', nextLink = null },
1397
+ __block
1398
+ ) {
1420
1399
  _$_.push_component();
1421
1400
 
1422
1401
  var div_47 = root_62();
@@ -1453,7 +1432,7 @@ function DocsLayoutInner(__anchor, __props, __block) {
1453
1432
  {
1454
1433
  var node_67 = _$_.child(div_49);
1455
1434
 
1456
- _$_.composite(() => __props.children, node_67, {});
1435
+ children(node_67, {}, _$_.active_block);
1457
1436
  _$_.pop(div_49);
1458
1437
  }
1459
1438
  }
@@ -1470,7 +1449,7 @@ function DocsLayoutInner(__anchor, __props, __block) {
1470
1449
  };
1471
1450
 
1472
1451
  _$_.if(node_68, (__render) => {
1473
- if (_$_.fallback(__props.editPath, '')) __render(consequent_10);
1452
+ if (editPath) __render(consequent_10);
1474
1453
  });
1475
1454
  }
1476
1455
 
@@ -1492,13 +1471,13 @@ function DocsLayoutInner(__anchor, __props, __block) {
1492
1471
 
1493
1472
  _$_.render(
1494
1473
  (__prev) => {
1495
- var __a = _$_.fallback(__props.nextLink, null).text;
1474
+ var __a = nextLink.text;
1496
1475
 
1497
1476
  if (__prev.a !== __a) {
1498
1477
  _$_.set_text(text_6, __prev.a = __a);
1499
1478
  }
1500
1479
 
1501
- var __b = _$_.fallback(__props.nextLink, null).href;
1480
+ var __b = nextLink.href;
1502
1481
 
1503
1482
  if (__prev.b !== __b) {
1504
1483
  _$_.set_attribute(a_5, 'href', __prev.b = __b);
@@ -1511,7 +1490,7 @@ function DocsLayoutInner(__anchor, __props, __block) {
1511
1490
  };
1512
1491
 
1513
1492
  _$_.if(node_69, (__render) => {
1514
- if (_$_.fallback(__props.nextLink, null)) __render(consequent_11);
1493
+ if (nextLink) __render(consequent_11);
1515
1494
  });
1516
1495
  }
1517
1496
 
@@ -1608,7 +1587,17 @@ export function DocsLayoutWithoutData(__anchor, _, __block) {
1608
1587
  _$_.pop_component();
1609
1588
  }
1610
1589
 
1611
- function DocsLayoutExact(__anchor, __props, __block) {
1590
+ function DocsLayoutExact(
1591
+ __anchor,
1592
+ {
1593
+ children,
1594
+ editPath = '',
1595
+ prevLink = null,
1596
+ nextLink = null,
1597
+ toc = []
1598
+ },
1599
+ __block
1600
+ ) {
1612
1601
  _$_.push_component();
1613
1602
 
1614
1603
  var div_56 = root_69();
@@ -1645,7 +1634,7 @@ function DocsLayoutExact(__anchor, __props, __block) {
1645
1634
  {
1646
1635
  var node_77 = _$_.child(div_58);
1647
1636
 
1648
- _$_.composite(() => __props.children, node_77, {});
1637
+ children(node_77, {}, _$_.active_block);
1649
1638
  _$_.pop(div_58);
1650
1639
  }
1651
1640
  }
@@ -1660,17 +1649,15 @@ function DocsLayoutExact(__anchor, __props, __block) {
1660
1649
 
1661
1650
  {
1662
1651
  var a_6 = _$_.child(div_62);
1663
- }
1664
1652
 
1665
- _$_.render(() => {
1666
- _$_.set_attribute(a_6, 'href', `/edit/${_$_.fallback(__props.editPath, '')}`);
1667
- });
1653
+ _$_.set_attribute(a_6, 'href', `/edit/${editPath}`);
1654
+ }
1668
1655
 
1669
1656
  _$_.append(__anchor, div_62);
1670
1657
  };
1671
1658
 
1672
1659
  _$_.if(node_78, (__render) => {
1673
- if (_$_.fallback(__props.editPath, '')) __render(consequent_12);
1660
+ if (editPath) __render(consequent_12);
1674
1661
  });
1675
1662
  }
1676
1663
 
@@ -1699,13 +1686,13 @@ function DocsLayoutExact(__anchor, __props, __block) {
1699
1686
 
1700
1687
  _$_.render(
1701
1688
  (__prev) => {
1702
- var __a = _$_.fallback(__props.prevLink, null).text;
1689
+ var __a = prevLink.text;
1703
1690
 
1704
1691
  if (__prev.a !== __a) {
1705
1692
  _$_.set_text(text_7, __prev.a = __a);
1706
1693
  }
1707
1694
 
1708
- var __b = _$_.fallback(__props.prevLink, null).href;
1695
+ var __b = prevLink.href;
1709
1696
 
1710
1697
  if (__prev.b !== __b) {
1711
1698
  _$_.set_attribute(a_7, 'href', __prev.b = __b);
@@ -1724,7 +1711,7 @@ function DocsLayoutExact(__anchor, __props, __block) {
1724
1711
  };
1725
1712
 
1726
1713
  _$_.if(node_80, (__render) => {
1727
- if (_$_.fallback(__props.prevLink, null)) __render(consequent_13); else __render(alternate, false);
1714
+ if (prevLink) __render(consequent_13); else __render(alternate, false);
1728
1715
  });
1729
1716
  }
1730
1717
 
@@ -1746,13 +1733,13 @@ function DocsLayoutExact(__anchor, __props, __block) {
1746
1733
 
1747
1734
  _$_.render(
1748
1735
  (__prev) => {
1749
- var __a = _$_.fallback(__props.nextLink, null).text;
1736
+ var __a = nextLink.text;
1750
1737
 
1751
1738
  if (__prev.a !== __a) {
1752
1739
  _$_.set_text(text_8, __prev.a = __a);
1753
1740
  }
1754
1741
 
1755
- var __b = _$_.fallback(__props.nextLink, null).href;
1742
+ var __b = nextLink.href;
1756
1743
 
1757
1744
  if (__prev.b !== __b) {
1758
1745
  _$_.set_attribute(a_8, 'href', __prev.b = __b);
@@ -1765,7 +1752,7 @@ function DocsLayoutExact(__anchor, __props, __block) {
1765
1752
  };
1766
1753
 
1767
1754
  _$_.if(node_81, (__render) => {
1768
- if (_$_.fallback(__props.nextLink, null)) __render(consequent_14);
1755
+ if (nextLink) __render(consequent_14);
1769
1756
  });
1770
1757
  }
1771
1758
 
@@ -1776,7 +1763,7 @@ function DocsLayoutExact(__anchor, __props, __block) {
1776
1763
  };
1777
1764
 
1778
1765
  _$_.if(node_79, (__render) => {
1779
- if (_$_.fallback(__props.prevLink, null) || _$_.fallback(__props.nextLink, null)) __render(consequent_15);
1766
+ if (prevLink || nextLink) __render(consequent_15);
1780
1767
  });
1781
1768
  }
1782
1769
 
@@ -1804,7 +1791,7 @@ function DocsLayoutExact(__anchor, __props, __block) {
1804
1791
  {
1805
1792
  _$_.for(
1806
1793
  nav_6,
1807
- () => _$_.fallback(__props.toc, []),
1794
+ () => toc,
1808
1795
  (__anchor, item) => {
1809
1796
  var a_9 = root_76();
1810
1797
 
@@ -1844,7 +1831,7 @@ function DocsLayoutExact(__anchor, __props, __block) {
1844
1831
  };
1845
1832
 
1846
1833
  _$_.if(node_83, (__render) => {
1847
- if (_$_.fallback(__props.toc, []).length > 0) __render(consequent_16);
1834
+ if (toc.length > 0) __render(consequent_16);
1848
1835
  });
1849
1836
  }
1850
1837
 
@@ -1988,7 +1975,7 @@ export function TemplateWithHtmlAndSiblings(__anchor, _, __block) {
1988
1975
  _$_.pop_component();
1989
1976
  }
1990
1977
 
1991
- function LayoutWithTemplate(__anchor, __props, __block) {
1978
+ function LayoutWithTemplate(__anchor, { children, data }, __block) {
1992
1979
  _$_.push_component();
1993
1980
 
1994
1981
  var div_68 = root_83();
@@ -2000,13 +1987,13 @@ function LayoutWithTemplate(__anchor, __props, __block) {
2000
1987
  {
2001
1988
  var node_88 = _$_.child(main_4);
2002
1989
 
2003
- _$_.composite(() => __props.children, node_88, {});
1990
+ children(node_88, {}, _$_.active_block);
2004
1991
  _$_.pop(main_4);
2005
1992
  }
2006
1993
  }
2007
1994
 
2008
1995
  _$_.render(() => {
2009
- template_3.innerHTML = _$_.with_scope(__block, () => JSON.stringify(__props.data));
1996
+ template_3.innerHTML = _$_.with_scope(__block, () => JSON.stringify(data));
2010
1997
  });
2011
1998
 
2012
1999
  _$_.append(__anchor, div_68);
@@ -22,7 +22,9 @@ var root_15 = _$_.template(`<div class="tabs"><div class="tab-list"><button clas
22
22
  var root_18 = _$_.template(`<div class="container"><ul class="list"><li class="item"> </li><li class="item">Another item</li></ul><h2 class="heading">Static Heading</h2><p class="para">Static paragraph</p></div><button class="inc">Increment</button>`, 1, 2);
23
23
  var root_19 = _$_.template(`<div class="wrapper"><ul class="features"><li><strong>Feature One</strong>: Description of feature one with <code>code</code> reference</li><li><strong>Feature Two</strong>: Another feature description</li><li><strong>Feature Three</strong>: Third feature</li></ul><h2 class="section-heading">Section Heading</h2><p class="section-content">Static paragraph with <a href="/link">a link</a> and more text.</p></div>`, 0);
24
24
 
25
- export function IfWithChildren(__anchor, __props, __block) {
25
+ import { track } from 'ripple';
26
+
27
+ export function IfWithChildren(__anchor, { children }, __block) {
26
28
  _$_.push_component();
27
29
 
28
30
  let expanded = _$_.track(true, void 0, void 0, __block);
@@ -42,7 +44,7 @@ export function IfWithChildren(__anchor, __props, __block) {
42
44
  {
43
45
  var node_1 = _$_.child(div_3);
44
46
 
45
- _$_.composite(() => __props.children, node_1, {});
47
+ children(node_1, {}, _$_.active_block);
46
48
  _$_.pop(div_3);
47
49
  }
48
50
 
@@ -61,7 +63,7 @@ export function IfWithChildren(__anchor, __props, __block) {
61
63
  _$_.pop_component();
62
64
  }
63
65
 
64
- export function ChildItem(__anchor, __props, __block) {
66
+ export function ChildItem(__anchor, { text }, __block) {
65
67
  _$_.push_component();
66
68
 
67
69
  var div_4 = root_2();
@@ -69,13 +71,10 @@ export function ChildItem(__anchor, __props, __block) {
69
71
  {
70
72
  var text_1 = _$_.child(div_4, true);
71
73
 
74
+ text_1.nodeValue = text;
72
75
  _$_.pop(div_4);
73
76
  }
74
77
 
75
- _$_.render(() => {
76
- _$_.set_text(text_1, __props.text);
77
- });
78
-
79
78
  _$_.append(__anchor, div_4);
80
79
  _$_.pop_component();
81
80
  }
@@ -143,7 +142,7 @@ export function IfWithStaticChildren(__anchor, _, __block) {
143
142
  _$_.pop_component();
144
143
  }
145
144
 
146
- export function IfWithSiblingsAndChildren(__anchor, __props, __block) {
145
+ export function IfWithSiblingsAndChildren(__anchor, { children }, __block) {
147
146
  _$_.push_component();
148
147
 
149
148
  let expanded = _$_.track(true, void 0, void 0, __block);
@@ -164,7 +163,7 @@ export function IfWithSiblingsAndChildren(__anchor, __props, __block) {
164
163
  {
165
164
  var node_7 = _$_.child(div_9);
166
165
 
167
- _$_.composite(() => __props.children, node_7, {});
166
+ children(node_7, {}, _$_.active_block);
168
167
  _$_.pop(div_9);
169
168
  }
170
169
 
@@ -22,6 +22,8 @@ var root_19 = _$_.template(`<div class="state">Error occurred</div>`, 0);
22
22
  var root_17 = _$_.template(`<!>`, 1, 1);
23
23
  var root_15 = _$_.template(`<div><button class="success">Success</button><button class="error">Error</button><button class="loading">Loading</button><!></div>`, 0);
24
24
 
25
+ import { track } from 'ripple';
26
+
25
27
  export function IfTruthy(__anchor, _, __block) {
26
28
  _$_.push_component();
27
29
 
@@ -28,6 +28,8 @@ var root_19 = _$_.template(`<!>`, 1, 1);
28
28
  var root_18 = _$_.template(`<div class="before">before</div><!>`, 1, 2);
29
29
  var root_25 = _$_.template(`<div class="resolved-row"> </div>`, 0);
30
30
 
31
+ import { track } from 'ripple';
32
+
31
33
  export function MixedControlFlowStatic(__anchor, _, __block) {
32
34
  _$_.push_component();
33
35
 
@@ -456,11 +458,11 @@ export function MixedControlFlowAsyncPending(__anchor, _, __block) {
456
458
  _$_.pop_component();
457
459
  }
458
460
 
459
- function AsyncRow(__anchor, __props, __block) {
461
+ function AsyncRow(__anchor, { label }, __block) {
460
462
  _$_.async(async () => {
461
463
  _$_.push_component();
462
464
 
463
- let value = (await _$_.maybe_tracked(_$_.with_scope(__block, async () => Promise.resolve(__props.label))))();
465
+ let value = (await _$_.maybe_tracked(_$_.with_scope(__block, async () => Promise.resolve(label))))();
464
466
 
465
467
  if (_$_.aborted()) return;
466
468
 
@@ -11,7 +11,7 @@ var root_5 = _$_.template(`<div><div class="main-content">Main page content</div
11
11
  var root_8 = _$_.template(`<div class="portal-content">Portal content</div>`, 0);
12
12
  var root_7 = _$_.template(`<div class="outer"><div class="inner"><span>Nested content</span></div><!></div>`, 0);
13
13
 
14
- import { Portal } from 'ripple';
14
+ import { Portal, track } from 'ripple';
15
15
 
16
16
  export function SimplePortal(__anchor, _, __block) {
17
17
  _$_.push_component();
@@ -8,6 +8,8 @@ var root_3 = _$_.template(`<div class="sum"> </div>`, 0);
8
8
  var root_4 = _$_.template(`<div class="x"> </div><div class="y"> </div><div class="z"> </div>`, 1, 3);
9
9
  var root_5 = _$_.template(`<div class="name"> </div>`, 0);
10
10
 
11
+ import { track } from 'ripple';
12
+
11
13
  export function TrackedState(__anchor, _, __block) {
12
14
  _$_.push_component();
13
15
 
@@ -130,6 +130,8 @@ var root_121 = _$_.template(`<div class="middle">middle</div><section class="nes
130
130
  var root_127 = _$_.template(`<div class="root-1">root-1</div><div class="root-2">root-2</div><div class="root-3">root-3</div><div class="root-4">root-4</div>`, 1, 4);
131
131
  var root_119 = _$_.template(`<button class="toggle-c1">Toggle C1</button><button class="toggle-c2">Toggle C2</button><button class="toggle-c3">Toggle C3</button><button class="toggle-c4">Toggle C4</button><div class="top">top</div><!><!><!>`, 1, 8);
132
132
 
133
+ import { track } from 'ripple';
134
+
133
135
  export function DirectReturn(__anchor, _, __block) {
134
136
  _$_.push_component();
135
137
 
@@ -25,6 +25,8 @@ var root_21 = _$_.template(`<div class="nobreak-2">NoBreak 2</div>`, 0);
25
25
  var root_22 = _$_.template(`<div class="nobreak-3">NoBreak 3</div>`, 0);
26
26
  var root_19 = _$_.template(`<button class="nobreak-toggle">Toggle</button><!>`, 1, 2);
27
27
 
28
+ import { track } from 'ripple';
29
+
28
30
  export function SwitchStatic(__anchor, _, __block) {
29
31
  _$_.push_component();
30
32