ripple 0.4.2 → 0.4.4

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 (98) hide show
  1. package/CHANGELOG.md +164 -0
  2. package/package.json +10 -4
  3. package/src/constants.js +6 -0
  4. package/src/jsx-runtime.d.ts +2 -1
  5. package/src/runtime/array.js +15 -9
  6. package/src/runtime/index-client.js +25 -7
  7. package/src/runtime/index-server.js +1 -0
  8. package/src/runtime/internal/client/attributes.js +439 -0
  9. package/src/runtime/internal/client/blocks.js +20 -20
  10. package/src/runtime/internal/client/component.js +2 -5
  11. package/src/runtime/internal/client/composite.js +295 -95
  12. package/src/runtime/internal/client/constants.js +14 -6
  13. package/src/runtime/internal/client/context.js +3 -2
  14. package/src/runtime/internal/client/css.js +11 -26
  15. package/src/runtime/internal/client/errors.js +188 -0
  16. package/src/runtime/internal/client/events.js +79 -34
  17. package/src/runtime/internal/client/expression.js +25 -120
  18. package/src/runtime/internal/client/for.js +113 -262
  19. package/src/runtime/internal/client/head.js +4 -3
  20. package/src/runtime/internal/client/html.js +5 -3
  21. package/src/runtime/internal/client/hydrate.js +484 -0
  22. package/src/runtime/internal/client/hydration-enabled.js +7 -0
  23. package/src/runtime/internal/client/hydration.js +16 -81
  24. package/src/runtime/internal/client/if.js +69 -10
  25. package/src/runtime/internal/client/index.js +18 -10
  26. package/src/runtime/internal/client/operations.js +11 -7
  27. package/src/runtime/internal/client/portal.js +3 -2
  28. package/src/runtime/internal/client/render.js +42 -325
  29. package/src/runtime/internal/client/root-boundary-enabled.js +7 -0
  30. package/src/runtime/internal/client/runtime.js +157 -371
  31. package/src/runtime/internal/client/template-ns.js +88 -0
  32. package/src/runtime/internal/client/template.js +118 -139
  33. package/src/runtime/internal/client/track-async.js +356 -0
  34. package/src/runtime/internal/client/try.js +133 -319
  35. package/src/runtime/internal/client/types.d.ts +48 -24
  36. package/src/runtime/internal/server/index.js +31 -29
  37. package/src/runtime/internal/server/prerender.js +27 -0
  38. package/src/server/index.js +1 -0
  39. package/src/utils/class-name.js +28 -0
  40. package/tests/client/basic/basic.errors.test.tsrx +3 -3
  41. package/tests/client/compiler/__snapshots__/compiler.typescript.test.tsrx.snap +0 -2
  42. package/tests/client/compiler/compiler.basic.test.tsrx +2 -2
  43. package/tests/client/compiler/compiler.tracked-access.test.tsrx +3 -3
  44. package/tests/client/composite/composite.dynamic-components.test.tsrx +40 -0
  45. package/tests/client/composite/composite.props.test.tsrx +10 -10
  46. package/tests/client/css/scoped-styles.test.tsrx +3 -1
  47. package/tests/client/derived-release.test.tsrx +3 -3
  48. package/tests/client/for-item.test.tsrx +39 -0
  49. package/tests/client/for-selector.test.tsrx +95 -0
  50. package/tests/client/svg.test.tsrx +273 -1
  51. package/tests/hydration/compiled/client/basic.js +88 -87
  52. package/tests/hydration/compiled/client/composite.js +15 -6
  53. package/tests/hydration/compiled/client/events.js +40 -48
  54. package/tests/hydration/compiled/client/for.js +191 -199
  55. package/tests/hydration/compiled/client/fragment-cursor.js +633 -334
  56. package/tests/hydration/compiled/client/head.js +22 -22
  57. package/tests/hydration/compiled/client/hmr.js +14 -5
  58. package/tests/hydration/compiled/client/html-in-template.js +5 -5
  59. package/tests/hydration/compiled/client/html.js +195 -177
  60. package/tests/hydration/compiled/client/if-children.js +136 -63
  61. package/tests/hydration/compiled/client/if-fragment-controlflow.js +63 -43
  62. package/tests/hydration/compiled/client/if.js +78 -30
  63. package/tests/hydration/compiled/client/mixed-control-flow.js +90 -72
  64. package/tests/hydration/compiled/client/nested-control-flow.js +266 -307
  65. package/tests/hydration/compiled/client/portal.js +20 -11
  66. package/tests/hydration/compiled/client/reactivity.js +29 -29
  67. package/tests/hydration/compiled/client/return.js +2 -2
  68. package/tests/hydration/compiled/client/streaming.js +33 -35
  69. package/tests/hydration/compiled/client/switch.js +25 -25
  70. package/tests/hydration/compiled/client/track-async-serialization.js +41 -41
  71. package/tests/hydration/compiled/client/try.js +15 -15
  72. package/tests/hydration/compiled/client/typed-text.js +8 -7
  73. package/tests/hydration/compiled/server/basic.js +6 -6
  74. package/tests/hydration/compiled/server/events.js +8 -8
  75. package/tests/hydration/compiled/server/for.js +22 -22
  76. package/tests/hydration/compiled/server/fragment-cursor.js +188 -52
  77. package/tests/hydration/compiled/server/head.js +6 -6
  78. package/tests/hydration/compiled/server/hmr.js +1 -1
  79. package/tests/hydration/compiled/server/html.js +1 -1
  80. package/tests/hydration/compiled/server/if-children.js +9 -9
  81. package/tests/hydration/compiled/server/if.js +5 -5
  82. package/tests/hydration/compiled/server/mixed-control-flow.js +4 -4
  83. package/tests/hydration/compiled/server/portal.js +1 -1
  84. package/tests/hydration/compiled/server/reactivity.js +9 -9
  85. package/tests/hydration/compiled/server/streaming.js +9 -9
  86. package/tests/hydration/compiled/server/switch.js +4 -4
  87. package/tests/hydration/compiled/server/track-async-serialization.js +16 -16
  88. package/tests/hydration/compiled/server/try.js +4 -4
  89. package/tests/hydration/compiled/server/typed-text.js +1 -1
  90. package/tests/hydration/components/fragment-cursor.tsrx +60 -0
  91. package/tests/hydration/components/track-async-serialization.tsrx +2 -2
  92. package/tests/hydration/fragment-cursor.test.js +34 -1
  93. package/tests/hydration/track-async-serialization.test.js +1 -1
  94. package/tests/server/basic.components.test.tsrx +3 -3
  95. package/tests/server/track-async-serialization.test.tsrx +6 -6
  96. package/tests/utils/tracked-types.test.js +3 -3
  97. package/types/index.d.ts +8 -8
  98. package/types/server.d.ts +17 -0
@@ -91,7 +91,7 @@ export function KeyedForLoop() {
91
91
 
92
92
  export function ReactiveForLoopAdd() {
93
93
  return _$_.tsrx_element(() => {
94
- const items = _$_.track(['A', 'B'], 'e145678a');
94
+ const items = _$_.track(['A', 'B'], '1qi64qy');
95
95
 
96
96
  _$_.regular_block(() => {
97
97
  let __out = '';
@@ -118,7 +118,7 @@ export function ReactiveForLoopAdd() {
118
118
 
119
119
  export function ReactiveForLoopRemove() {
120
120
  return _$_.tsrx_element(() => {
121
- const items = _$_.track(['A', 'B', 'C'], 'b4e9bd54');
121
+ const items = _$_.track(['A', 'B', 'C'], '1e738lw');
122
122
 
123
123
  _$_.regular_block(() => {
124
124
  let __out = '';
@@ -145,7 +145,7 @@ export function ReactiveForLoopRemove() {
145
145
 
146
146
  export function ForLoopInteractive() {
147
147
  return _$_.tsrx_element(() => {
148
- const counts = _$_.track([0, 0, 0], '36f563df');
148
+ const counts = _$_.track([0, 0, 0], 'f8yrj3');
149
149
 
150
150
  _$_.regular_block(() => {
151
151
  let __out = '';
@@ -295,7 +295,7 @@ export function KeyedForLoopReorder() {
295
295
  { id: 2, name: 'Second' },
296
296
  { id: 3, name: 'Third' }
297
297
  ],
298
- 'e7abc6a3'
298
+ '1sa3hr7'
299
299
  );
300
300
 
301
301
  _$_.regular_block(() => {
@@ -323,7 +323,7 @@ export function KeyedForLoopReorder() {
323
323
 
324
324
  export function KeyedForLoopUpdate() {
325
325
  return _$_.tsrx_element(() => {
326
- const items = _$_.track([{ id: 1, name: 'Item 1' }, { id: 2, name: 'Item 2' }], '7a2c2ada');
326
+ const items = _$_.track([{ id: 1, name: 'Item 1' }, { id: 2, name: 'Item 2' }], 'xwci56');
327
327
 
328
328
  _$_.regular_block(() => {
329
329
  let __out = '';
@@ -350,7 +350,7 @@ export function KeyedForLoopUpdate() {
350
350
 
351
351
  export function ForLoopMixedOperations() {
352
352
  return _$_.tsrx_element(() => {
353
- const items = _$_.track(['A', 'B', 'C', 'D'], '3dd7c7b6');
353
+ const items = _$_.track(['A', 'B', 'C', 'D'], 'h5qbw6');
354
354
 
355
355
  _$_.regular_block(() => {
356
356
  let __out = '';
@@ -377,8 +377,8 @@ export function ForLoopMixedOperations() {
377
377
 
378
378
  export function ForLoopInsideIf() {
379
379
  return _$_.tsrx_element(() => {
380
- const showList = _$_.track(true, '0528df30');
381
- const items = _$_.track(['X', 'Y', 'Z'], 'bf375103');
380
+ const showList = _$_.track(true, '1fjdps');
381
+ const items = _$_.track(['X', 'Y', 'Z'], '1h205c3');
382
382
 
383
383
  _$_.regular_block(() => {
384
384
  let __out = '';
@@ -411,7 +411,7 @@ export function ForLoopInsideIf() {
411
411
 
412
412
  export function ForLoopEmptyToPopulated() {
413
413
  return _$_.tsrx_element(() => {
414
- const items = _$_.track([], '525c5dbc');
414
+ const items = _$_.track([], 'muog58');
415
415
 
416
416
  _$_.regular_block(() => {
417
417
  let __out = '';
@@ -430,7 +430,7 @@ export function ForLoopEmptyToPopulated() {
430
430
 
431
431
  export function ForLoopPopulatedToEmpty() {
432
432
  return _$_.tsrx_element(() => {
433
- const items = _$_.track(['One', 'Two', 'Three'], 'ee47f078');
433
+ const items = _$_.track(['One', 'Two', 'Three'], '1u44ewo');
434
434
 
435
435
  _$_.regular_block(() => {
436
436
  let __out = '';
@@ -457,7 +457,7 @@ export function ForLoopPopulatedToEmpty() {
457
457
 
458
458
  export function NestedForLoopReactive() {
459
459
  return _$_.tsrx_element(() => {
460
- const grid = _$_.track([[1, 2], [3, 4]], 'a2f41fb3');
460
+ const grid = _$_.track([[1, 2], [3, 4]], '197p4tv');
461
461
 
462
462
  _$_.regular_block(() => {
463
463
  let __out = '';
@@ -578,7 +578,7 @@ export function ForLoopDeeplyNested() {
578
578
 
579
579
  export function ForLoopIndexUpdate() {
580
580
  return _$_.tsrx_element(() => {
581
- const items = _$_.track(['First', 'Second', 'Third'], 'f61e31e6');
581
+ const items = _$_.track(['First', 'Second', 'Third'], '1waej1i');
582
582
 
583
583
  _$_.regular_block(() => {
584
584
  let __out = '';
@@ -612,7 +612,7 @@ export function KeyedForLoopWithIndex() {
612
612
  { id: 'b', value: 'Beta' },
613
613
  { id: 'c', value: 'Gamma' }
614
614
  ],
615
- '3467975a'
615
+ 'ejgeai'
616
616
  );
617
617
 
618
618
  _$_.regular_block(() => {
@@ -641,7 +641,7 @@ export function KeyedForLoopWithIndex() {
641
641
 
642
642
  export function ForLoopWithSiblings() {
643
643
  return _$_.tsrx_element(() => {
644
- const items = _$_.track(['A', 'B'], '3c7e8152');
644
+ const items = _$_.track(['A', 'B'], 'gs9c2a');
645
645
 
646
646
  _$_.regular_block(() => {
647
647
  let __out = '';
@@ -698,7 +698,7 @@ export function ForLoopItemState() {
698
698
 
699
699
  function TodoItem(props) {
700
700
  return _$_.tsrx_element(() => {
701
- const done = _$_.track(false, '4f2402a4');
701
+ const done = _$_.track(false, 'lyii78');
702
702
 
703
703
  _$_.regular_block(() => {
704
704
  let __out = '';
@@ -738,7 +738,7 @@ export function ForLoopSingleItem() {
738
738
 
739
739
  export function ForLoopAddAtBeginning() {
740
740
  return _$_.tsrx_element(() => {
741
- const items = _$_.track(['B', 'C'], '1561403a');
741
+ const items = _$_.track(['B', 'C'], '5xk2t6');
742
742
 
743
743
  _$_.regular_block(() => {
744
744
  let __out = '';
@@ -765,7 +765,7 @@ export function ForLoopAddAtBeginning() {
765
765
 
766
766
  export function ForLoopAddInMiddle() {
767
767
  return _$_.tsrx_element(() => {
768
- const items = _$_.track(['A', 'C'], '1bc60b46');
768
+ const items = _$_.track(['A', 'C'], '7pf806');
769
769
 
770
770
  _$_.regular_block(() => {
771
771
  let __out = '';
@@ -792,7 +792,7 @@ export function ForLoopAddInMiddle() {
792
792
 
793
793
  export function ForLoopRemoveFromMiddle() {
794
794
  return _$_.tsrx_element(() => {
795
- const items = _$_.track(['A', 'B', 'C'], '1c87f95f');
795
+ const items = _$_.track(['A', 'B', 'C'], '7wzmn3');
796
796
 
797
797
  _$_.regular_block(() => {
798
798
  let __out = '';
@@ -855,7 +855,7 @@ export function ForLoopLargeList() {
855
855
 
856
856
  export function ForLoopSwap() {
857
857
  return _$_.tsrx_element(() => {
858
- const items = _$_.track(['A', 'B', 'C', 'D'], '5f8d152f');
858
+ const items = _$_.track(['A', 'B', 'C', 'D'], 'qiflm7');
859
859
 
860
860
  _$_.regular_block(() => {
861
861
  let __out = '';
@@ -882,7 +882,7 @@ export function ForLoopSwap() {
882
882
 
883
883
  export function ForLoopReverse() {
884
884
  return _$_.tsrx_element(() => {
885
- const items = _$_.track(['A', 'B', 'C', 'D'], '24602e64');
885
+ const items = _$_.track(['A', 'B', 'C', 'D'], 'a3chgk');
886
886
 
887
887
  _$_.regular_block(() => {
888
888
  let __out = '';
@@ -909,7 +909,7 @@ export function ForLoopReverse() {
909
909
 
910
910
  export function KeyedForLoopAppendAndRotate() {
911
911
  return _$_.tsrx_element(() => {
912
- const items = _$_.track([1, 2, 3], 'a8b41504');
912
+ const items = _$_.track([1, 2, 3], '1at4qo4');
913
913
 
914
914
  _$_.regular_block(() => {
915
915
  let __out = '';
@@ -953,7 +953,7 @@ function RootKeyedList(props) {
953
953
 
954
954
  export function RootKeyedForLoopAppendAndRotate() {
955
955
  return _$_.tsrx_element(() => {
956
- const items = _$_.track([1, 2, 3], '50a91d60');
956
+ const items = _$_.track([1, 2, 3], 'mdp2e8');
957
957
 
958
958
  _$_.regular_block(() => {
959
959
  let __out = '';