ripple 0.3.29 → 0.3.31

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/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # ripple
2
2
 
3
+ ## 0.3.31
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - ripple@0.3.31
9
+ - @tsrx/ripple@0.0.13
10
+
11
+ ## 0.3.30
12
+
13
+ ### Patch Changes
14
+
15
+ - [`7f59ed8`](https://github.com/Ripple-TS/ripple/commit/7f59ed80d7b44c847fb9eb8bf00d4fe9835c3136)
16
+ Thanks [@leonidaz](https://github.com/leonidaz)! - Replace `node:crypto` usage
17
+ in the compiler with a pure-JS implementation so Ripple can be compiled inside
18
+ browser workers (e.g. the Monaco-based playground) where `crypto.createHash` is
19
+ not available.
20
+
21
+ The hashing utility is split into two functions:
22
+ - `simple_hash` — fast non-cryptographic djb2 (base36). Used for CSS class-name
23
+ prefixes and runtime `{html}` hydration markers where the input is user
24
+ content and the output multiplies across the shipped bundle.
25
+ - `strong_hash` — preimage-resistant SHA-256 prefix (pure-JS via
26
+ `@noble/hashes`). Used everywhere a hash is derived from a server-only
27
+ filesystem path (`#server` RPC ids, `track`/`trackAsync` ids, head-element
28
+ hydration markers) so the hash can't be inverted to reveal the original path.
29
+
30
+ The runtime `ripple` package no longer ships its own `hashing.js` — it
31
+ re-exports `simple_hash`/`strong_hash` from `@tsrx/core`, and the compiler emits
32
+ `_$_.simple_hash` (previously `_$_.hash`) for dynamic `{html}` hydration
33
+ markers.
34
+
35
+ - Updated dependencies
36
+ [[`7f59ed8`](https://github.com/Ripple-TS/ripple/commit/7f59ed80d7b44c847fb9eb8bf00d4fe9835c3136)]:
37
+ - @tsrx/ripple@0.0.12
38
+ - ripple@0.3.30
39
+
3
40
  ## 0.3.29
4
41
 
5
42
  ### Patch Changes
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.3.29",
6
+ "version": "0.3.31",
7
7
  "type": "module",
8
8
  "module": "src/runtime/index-client.js",
9
9
  "main": "src/runtime/index-client.js",
@@ -76,7 +76,7 @@
76
76
  "esm-env": "^1.2.2",
77
77
  "@types/estree": "^1.0.8",
78
78
  "@types/estree-jsx": "^1.0.5",
79
- "@tsrx/ripple": "0.0.11"
79
+ "@tsrx/ripple": "0.0.13"
80
80
  },
81
81
  "devDependencies": {
82
82
  "@types/node": "^24.3.0",
@@ -84,9 +84,9 @@
84
84
  "typescript": "^5.9.3",
85
85
  "@volar/language-core": "~2.4.28",
86
86
  "vscode-languageserver-types": "^3.17.5",
87
- "@tsrx/core": "0.0.9"
87
+ "@tsrx/core": "0.0.11"
88
88
  },
89
89
  "peerDependencies": {
90
- "ripple": "0.3.29"
90
+ "ripple": "0.3.31"
91
91
  }
92
92
  }
@@ -51,7 +51,7 @@ import { COMPONENT_BLOCK, TRY_BLOCK } from './constants.js';
51
51
 
52
52
  export { escape };
53
53
  export { register_component_css as register_css } from './css-registry.js';
54
- export { hash } from '../../../utils/hashing.js';
54
+ export { simpleHash as simple_hash, strongHash as strong_hash } from '@tsrx/core';
55
55
  export { context } from './context.js';
56
56
  export { try_block, component_block, regular_block } from './blocks.js';
57
57
  export { array_slice };
@@ -22,7 +22,7 @@ export function StaticTitle(__anchor, _, __block) {
22
22
 
23
23
  var div_1 = root();
24
24
 
25
- _$_.head('o6otu9', (__anchor) => {
25
+ _$_.head('c8908187', (__anchor) => {
26
26
  _$_.document.title = 'Static Test Title';
27
27
  });
28
28
 
@@ -47,7 +47,7 @@ export function ReactiveTitle(__anchor, _, __block) {
47
47
  }
48
48
  }
49
49
 
50
- _$_.head('1kaaszj', (__anchor) => {
50
+ _$_.head('8af28792', (__anchor) => {
51
51
  _$_.render(() => {
52
52
  _$_.document.title = _$_.get(lazy);
53
53
  });
@@ -62,7 +62,7 @@ export function MultipleHeadElements(__anchor, _, __block) {
62
62
 
63
63
  var div_3 = root_2();
64
64
 
65
- _$_.head('9nqthf', (__anchor) => {
65
+ _$_.head('3a79945b', (__anchor) => {
66
66
  var fragment = root_3();
67
67
 
68
68
  _$_.document.title = 'Page Title';
@@ -87,7 +87,7 @@ export function ReactiveMetaTags(__anchor, _, __block) {
87
87
  _$_.pop(div_4);
88
88
  }
89
89
 
90
- _$_.head('1v7o69o', (__anchor) => {
90
+ _$_.head('c9fd7b0f', (__anchor) => {
91
91
  var meta_1 = root_5();
92
92
 
93
93
  _$_.document.title = 'My Page';
@@ -112,7 +112,7 @@ export function TitleWithTemplate(__anchor, _, __block) {
112
112
  _$_.pop(div_5);
113
113
  }
114
114
 
115
- _$_.head('za44d', (__anchor) => {
115
+ _$_.head('72f81455', (__anchor) => {
116
116
  _$_.render(() => {
117
117
  _$_.document.title = `Hello ${_$_.get(lazy_2)}!`;
118
118
  });
@@ -127,7 +127,7 @@ export function EmptyTitle(__anchor, _, __block) {
127
127
 
128
128
  var div_6 = root_7();
129
129
 
130
- _$_.head('1st5x80', (__anchor) => {
130
+ _$_.head('35a7fe4a', (__anchor) => {
131
131
  _$_.document.title = '';
132
132
  });
133
133
 
@@ -149,7 +149,7 @@ export function ConditionalTitle(__anchor, _, __block) {
149
149
  _$_.pop(div_7);
150
150
  }
151
151
 
152
- _$_.head('54ijvi', (__anchor) => {
152
+ _$_.head('453e9ed4', (__anchor) => {
153
153
  _$_.render(() => {
154
154
  _$_.document.title = _$_.get(lazy_3) ? 'App - ' + _$_.get(lazy_4) : _$_.get(lazy_4);
155
155
  });
@@ -177,7 +177,7 @@ export function ComputedTitle(__anchor, _, __block) {
177
177
  }
178
178
  }
179
179
 
180
- _$_.head('h5jm3a', (__anchor) => {
180
+ _$_.head('63888c83', (__anchor) => {
181
181
  _$_.render(() => {
182
182
  _$_.document.title = prefix + _$_.get(lazy_5);
183
183
  });
@@ -192,11 +192,11 @@ export function MultipleHeadBlocks(__anchor, _, __block) {
192
192
 
193
193
  var div_9 = root_10();
194
194
 
195
- _$_.head('133vcai', (__anchor) => {
195
+ _$_.head('43cf39fd', (__anchor) => {
196
196
  _$_.document.title = 'First Head';
197
197
  });
198
198
 
199
- _$_.head('fju8tw', (__anchor) => {
199
+ _$_.head('e9abd92f', (__anchor) => {
200
200
  var meta_2 = root_11();
201
201
 
202
202
  _$_.append(__anchor, meta_2);
@@ -211,7 +211,7 @@ export function HeadWithStyle(__anchor, _, __block) {
211
211
 
212
212
  var div_10 = root_12();
213
213
 
214
- _$_.head('1iodql4', (__anchor) => {
214
+ _$_.head('d246667e', (__anchor) => {
215
215
  _$_.document.title = 'Styled Page';
216
216
  });
217
217
 
@@ -18,7 +18,7 @@ export function StaticTitle() {
18
18
  });
19
19
 
20
20
  _$_.set_output_target('head');
21
- _$_.output_push('<!--o6otu9-->');
21
+ _$_.output_push('<!--c8908187-->');
22
22
  _$_.output_push('<title');
23
23
  _$_.output_push('>');
24
24
 
@@ -55,7 +55,7 @@ export function ReactiveTitle() {
55
55
  });
56
56
 
57
57
  _$_.set_output_target('head');
58
- _$_.output_push('<!--1kaaszj-->');
58
+ _$_.output_push('<!--8af28792-->');
59
59
  _$_.output_push('<title');
60
60
  _$_.output_push('>');
61
61
 
@@ -83,7 +83,7 @@ export function MultipleHeadElements() {
83
83
  });
84
84
 
85
85
  _$_.set_output_target('head');
86
- _$_.output_push('<!--9nqthf-->');
86
+ _$_.output_push('<!--3a79945b-->');
87
87
  _$_.output_push('<title');
88
88
  _$_.output_push('>');
89
89
 
@@ -121,7 +121,7 @@ export function ReactiveMetaTags() {
121
121
  });
122
122
 
123
123
  _$_.set_output_target('head');
124
- _$_.output_push('<!--1v7o69o-->');
124
+ _$_.output_push('<!--c9fd7b0f-->');
125
125
  _$_.output_push('<title');
126
126
  _$_.output_push('>');
127
127
 
@@ -155,7 +155,7 @@ export function TitleWithTemplate() {
155
155
  });
156
156
 
157
157
  _$_.set_output_target('head');
158
- _$_.output_push('<!--za44d-->');
158
+ _$_.output_push('<!--72f81455-->');
159
159
  _$_.output_push('<title');
160
160
  _$_.output_push('>');
161
161
 
@@ -183,7 +183,7 @@ export function EmptyTitle() {
183
183
  });
184
184
 
185
185
  _$_.set_output_target('head');
186
- _$_.output_push('<!--1st5x80-->');
186
+ _$_.output_push('<!--35a7fe4a-->');
187
187
  _$_.output_push('<title');
188
188
  _$_.output_push('>');
189
189
 
@@ -214,7 +214,7 @@ export function ConditionalTitle() {
214
214
  });
215
215
 
216
216
  _$_.set_output_target('head');
217
- _$_.output_push('<!--54ijvi-->');
217
+ _$_.output_push('<!--453e9ed4-->');
218
218
  _$_.output_push('<title');
219
219
  _$_.output_push('>');
220
220
 
@@ -252,7 +252,7 @@ export function ComputedTitle() {
252
252
  });
253
253
 
254
254
  _$_.set_output_target('head');
255
- _$_.output_push('<!--h5jm3a-->');
255
+ _$_.output_push('<!--63888c83-->');
256
256
  _$_.output_push('<title');
257
257
  _$_.output_push('>');
258
258
 
@@ -280,7 +280,7 @@ export function MultipleHeadBlocks() {
280
280
  });
281
281
 
282
282
  _$_.set_output_target('head');
283
- _$_.output_push('<!--133vcai-->');
283
+ _$_.output_push('<!--43cf39fd-->');
284
284
  _$_.output_push('<title');
285
285
  _$_.output_push('>');
286
286
 
@@ -289,7 +289,7 @@ export function MultipleHeadBlocks() {
289
289
  }
290
290
 
291
291
  _$_.output_push('</title>');
292
- _$_.output_push('<!--fju8tw-->');
292
+ _$_.output_push('<!--e9abd92f-->');
293
293
  _$_.output_push('<meta');
294
294
  _$_.output_push(' name="author"');
295
295
  _$_.output_push(' content="Test Author"');
@@ -313,7 +313,7 @@ export function HeadWithStyle() {
313
313
  });
314
314
 
315
315
  _$_.set_output_target('head');
316
- _$_.output_push('<!--1iodql4-->');
316
+ _$_.output_push('<!--d246667e-->');
317
317
  _$_.output_push('<title');
318
318
  _$_.output_push('>');
319
319
 
@@ -14,7 +14,7 @@ export function SimpleTemplateHtml() {
14
14
  {
15
15
  const html_value = String(data ?? '');
16
16
 
17
- _$_.output_push('<!--' + _$_.hash(html_value) + '-->');
17
+ _$_.output_push('<!--' + _$_.simple_hash(html_value) + '-->');
18
18
  _$_.output_push(html_value);
19
19
  _$_.output_push('<!---->');
20
20
  }
@@ -38,7 +38,7 @@ export function TemplateWithJSON() {
38
38
  {
39
39
  const html_value_1 = String(jsonData ?? '');
40
40
 
41
- _$_.output_push('<!--' + _$_.hash(html_value_1) + '-->');
41
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_1) + '-->');
42
42
  _$_.output_push(html_value_1);
43
43
  _$_.output_push('<!---->');
44
44
  }
@@ -15,7 +15,7 @@ export function StaticHtml() {
15
15
  {
16
16
  const html_value = String(html ?? '');
17
17
 
18
- _$_.output_push('<!--' + _$_.hash(html_value) + '-->');
18
+ _$_.output_push('<!--' + _$_.simple_hash(html_value) + '-->');
19
19
  _$_.output_push(html_value);
20
20
  _$_.output_push('<!---->');
21
21
  }
@@ -38,7 +38,7 @@ export function DynamicHtml() {
38
38
  {
39
39
  const html_value_1 = String(content ?? '');
40
40
 
41
- _$_.output_push('<!--' + _$_.hash(html_value_1) + '-->');
41
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_1) + '-->');
42
42
  _$_.output_push(html_value_1);
43
43
  _$_.output_push('<!---->');
44
44
  }
@@ -61,7 +61,7 @@ export function EmptyHtml() {
61
61
  {
62
62
  const html_value_2 = String(html ?? '');
63
63
 
64
- _$_.output_push('<!--' + _$_.hash(html_value_2) + '-->');
64
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_2) + '-->');
65
65
  _$_.output_push(html_value_2);
66
66
  _$_.output_push('<!---->');
67
67
  }
@@ -84,7 +84,7 @@ export function ComplexHtml() {
84
84
  {
85
85
  const html_value_3 = String(html ?? '');
86
86
 
87
- _$_.output_push('<!--' + _$_.hash(html_value_3) + '-->');
87
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_3) + '-->');
88
88
  _$_.output_push(html_value_3);
89
89
  _$_.output_push('<!---->');
90
90
  }
@@ -108,13 +108,13 @@ export function MultipleHtml() {
108
108
  {
109
109
  const html_value_4 = String(html1 ?? '');
110
110
 
111
- _$_.output_push('<!--' + _$_.hash(html_value_4) + '-->');
111
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_4) + '-->');
112
112
  _$_.output_push(html_value_4);
113
113
  _$_.output_push('<!---->');
114
114
 
115
115
  const html_value_5 = String(html2 ?? '');
116
116
 
117
- _$_.output_push('<!--' + _$_.hash(html_value_5) + '-->');
117
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_5) + '-->');
118
118
  _$_.output_push(html_value_5);
119
119
  _$_.output_push('<!---->');
120
120
  }
@@ -198,7 +198,7 @@ export function HtmlInChildren() {
198
198
  {
199
199
  const html_value_6 = String(content ?? '');
200
200
 
201
- _$_.output_push('<!--' + _$_.hash(html_value_6) + '-->');
201
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_6) + '-->');
202
202
  _$_.output_push(html_value_6);
203
203
  _$_.output_push('<!---->');
204
204
  }
@@ -244,7 +244,7 @@ export function HtmlInChildrenWithSiblings() {
244
244
  {
245
245
  const html_value_7 = String(content ?? '');
246
246
 
247
- _$_.output_push('<!--' + _$_.hash(html_value_7) + '-->');
247
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_7) + '-->');
248
248
  _$_.output_push(html_value_7);
249
249
  _$_.output_push('<!---->');
250
250
  }
@@ -283,13 +283,13 @@ export function MultipleHtmlInChildren() {
283
283
  {
284
284
  const html_value_8 = String(html1 ?? '');
285
285
 
286
- _$_.output_push('<!--' + _$_.hash(html_value_8) + '-->');
286
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_8) + '-->');
287
287
  _$_.output_push(html_value_8);
288
288
  _$_.output_push('<!---->');
289
289
 
290
290
  const html_value_9 = String(html2 ?? '');
291
291
 
292
- _$_.output_push('<!--' + _$_.hash(html_value_9) + '-->');
292
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_9) + '-->');
293
293
  _$_.output_push(html_value_9);
294
294
  _$_.output_push('<!---->');
295
295
  }
@@ -319,7 +319,7 @@ export function HtmlWithComments() {
319
319
  {
320
320
  const html_value_10 = String(content ?? '');
321
321
 
322
- _$_.output_push('<!--' + _$_.hash(html_value_10) + '-->');
322
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_10) + '-->');
323
323
  _$_.output_push(html_value_10);
324
324
  _$_.output_push('<!---->');
325
325
  }
@@ -342,7 +342,7 @@ export function HtmlWithEmptyComment() {
342
342
  {
343
343
  const html_value_11 = String(content ?? '');
344
344
 
345
- _$_.output_push('<!--' + _$_.hash(html_value_11) + '-->');
345
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_11) + '-->');
346
346
  _$_.output_push(html_value_11);
347
347
  _$_.output_push('<!---->');
348
348
  }
@@ -373,7 +373,7 @@ export function HtmlWithCommentsInChildren() {
373
373
  {
374
374
  const html_value_12 = String(content ?? '');
375
375
 
376
- _$_.output_push('<!--' + _$_.hash(html_value_12) + '-->');
376
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_12) + '-->');
377
377
  _$_.output_push(html_value_12);
378
378
  _$_.output_push('<!---->');
379
379
  }
@@ -579,7 +579,7 @@ export function HtmlWithServerData() {
579
579
  {
580
580
  const html_value_13 = String(content ?? '');
581
581
 
582
- _$_.output_push('<!--' + _$_.hash(html_value_13) + '-->');
582
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_13) + '-->');
583
583
  _$_.output_push(html_value_13);
584
584
  _$_.output_push('<!---->');
585
585
  }
@@ -617,7 +617,7 @@ export function HtmlWithClientDefaults() {
617
617
  {
618
618
  const html_value_14 = String(content ?? '');
619
619
 
620
- _$_.output_push('<!--' + _$_.hash(html_value_14) + '-->');
620
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_14) + '-->');
621
621
  _$_.output_push(html_value_14);
622
622
  _$_.output_push('<!---->');
623
623
  }
@@ -655,7 +655,7 @@ export function HtmlWithUndefinedContent() {
655
655
  {
656
656
  const html_value_15 = String(content ?? '');
657
657
 
658
- _$_.output_push('<!--' + _$_.hash(html_value_15) + '-->');
658
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_15) + '-->');
659
659
  _$_.output_push(html_value_15);
660
660
  _$_.output_push('<!---->');
661
661
  }
@@ -748,7 +748,7 @@ function CodeBlock({ code }) {
748
748
  {
749
749
  const html_value_16 = String(highlighted ?? '');
750
750
 
751
- _$_.output_push('<!--' + _$_.hash(html_value_16) + '-->');
751
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_16) + '-->');
752
752
  _$_.output_push(html_value_16);
753
753
  _$_.output_push('<!---->');
754
754
  }
@@ -1393,7 +1393,7 @@ export function ArticleWithHtmlChildThenSibling() {
1393
1393
  {
1394
1394
  const html_value_17 = String(htmlContent ?? '');
1395
1395
 
1396
- _$_.output_push('<!--' + _$_.hash(html_value_17) + '-->');
1396
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_17) + '-->');
1397
1397
  _$_.output_push(html_value_17);
1398
1398
  _$_.output_push('<!---->');
1399
1399
  }
@@ -1528,7 +1528,7 @@ export function InlineArticleWithHtmlChild() {
1528
1528
  {
1529
1529
  const html_value_18 = String(htmlContent ?? '');
1530
1530
 
1531
- _$_.output_push('<!--' + _$_.hash(html_value_18) + '-->');
1531
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_18) + '-->');
1532
1532
  _$_.output_push(html_value_18);
1533
1533
  _$_.output_push('<!---->');
1534
1534
  }
@@ -1762,7 +1762,7 @@ export function DocsLayoutWithData() {
1762
1762
  {
1763
1763
  const html_value_19 = String(htmlContent ?? '');
1764
1764
 
1765
- _$_.output_push('<!--' + _$_.hash(html_value_19) + '-->');
1765
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_19) + '-->');
1766
1766
  _$_.output_push(html_value_19);
1767
1767
  _$_.output_push('<!---->');
1768
1768
  }
@@ -1800,7 +1800,7 @@ export function DocsLayoutWithoutData() {
1800
1800
  {
1801
1801
  const html_value_20 = String(htmlContent ?? '');
1802
1802
 
1803
- _$_.output_push('<!--' + _$_.hash(html_value_20) + '-->');
1803
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_20) + '-->');
1804
1804
  _$_.output_push(html_value_20);
1805
1805
  _$_.output_push('<!---->');
1806
1806
  }
@@ -2082,7 +2082,7 @@ export function DocsLayoutExactWithData() {
2082
2082
  {
2083
2083
  const html_value_21 = String(htmlContent ?? '');
2084
2084
 
2085
- _$_.output_push('<!--' + _$_.hash(html_value_21) + '-->');
2085
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_21) + '-->');
2086
2086
  _$_.output_push(html_value_21);
2087
2087
  _$_.output_push('<!---->');
2088
2088
  }
@@ -2128,7 +2128,7 @@ export function DocsLayoutExactWithoutData() {
2128
2128
  {
2129
2129
  const html_value_22 = String(htmlContent ?? '');
2130
2130
 
2131
- _$_.output_push('<!--' + _$_.hash(html_value_22) + '-->');
2131
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_22) + '-->');
2132
2132
  _$_.output_push(html_value_22);
2133
2133
  _$_.output_push('<!---->');
2134
2134
  }
@@ -2163,7 +2163,7 @@ export function TemplateWithHtmlContent() {
2163
2163
  {
2164
2164
  const html_value_23 = String(JSON.stringify(data) ?? '');
2165
2165
 
2166
- _$_.output_push('<!--' + _$_.hash(html_value_23) + '-->');
2166
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_23) + '-->');
2167
2167
  _$_.output_push(html_value_23);
2168
2168
  _$_.output_push('<!---->');
2169
2169
  }
@@ -2212,7 +2212,7 @@ export function TemplateWithHtmlAndSiblings() {
2212
2212
  {
2213
2213
  const html_value_24 = String(JSON.stringify(data) ?? '');
2214
2214
 
2215
- _$_.output_push('<!--' + _$_.hash(html_value_24) + '-->');
2215
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_24) + '-->');
2216
2216
  _$_.output_push(html_value_24);
2217
2217
  _$_.output_push('<!---->');
2218
2218
  }
@@ -2251,7 +2251,7 @@ function LayoutWithTemplate({ children, data }) {
2251
2251
  {
2252
2252
  const html_value_25 = String(JSON.stringify(data) ?? '');
2253
2253
 
2254
- _$_.output_push('<!--' + _$_.hash(html_value_25) + '-->');
2254
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_25) + '-->');
2255
2255
  _$_.output_push(html_value_25);
2256
2256
  _$_.output_push('<!---->');
2257
2257
  }
@@ -2294,7 +2294,7 @@ export function NestedTemplateInLayout() {
2294
2294
  {
2295
2295
  const html_value_26 = String(doc.html ?? '');
2296
2296
 
2297
- _$_.output_push('<!--' + _$_.hash(html_value_26) + '-->');
2297
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_26) + '-->');
2298
2298
  _$_.output_push(html_value_26);
2299
2299
  _$_.output_push('<!---->');
2300
2300
  }
@@ -2368,7 +2368,7 @@ export function HtmlCodeBlocksWithSiblingChain() {
2368
2368
  {
2369
2369
  const html_value_27 = String(html1 ?? '');
2370
2370
 
2371
- _$_.output_push('<!--' + _$_.hash(html_value_27) + '-->');
2371
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_27) + '-->');
2372
2372
  _$_.output_push(html_value_27);
2373
2373
  _$_.output_push('<!---->');
2374
2374
  }
@@ -2396,7 +2396,7 @@ export function HtmlCodeBlocksWithSiblingChain() {
2396
2396
  {
2397
2397
  const html_value_28 = String(html2 ?? '');
2398
2398
 
2399
- _$_.output_push('<!--' + _$_.hash(html_value_28) + '-->');
2399
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_28) + '-->');
2400
2400
  _$_.output_push(html_value_28);
2401
2401
  _$_.output_push('<!---->');
2402
2402
  }
@@ -2424,7 +2424,7 @@ export function HtmlCodeBlocksWithSiblingChain() {
2424
2424
  {
2425
2425
  const html_value_29 = String(html3 ?? '');
2426
2426
 
2427
- _$_.output_push('<!--' + _$_.hash(html_value_29) + '-->');
2427
+ _$_.output_push('<!--' + _$_.simple_hash(html_value_29) + '-->');
2428
2428
  _$_.output_push(html_value_29);
2429
2429
  _$_.output_push('<!---->');
2430
2430
  }
@@ -413,7 +413,9 @@ component TodoItem(props: { id: number; text: string }) {
413
413
  done = (e.target as HTMLInputElement).checked;
414
414
  }}
415
415
  />
416
- <span class={done ? 'completed' : 'pending'}>{props.text}</span>
416
+ <span class={done ? 'completed' : 'pending'}>
417
+ {props.text}
418
+ </span>
417
419
  </div>
418
420
  }
419
421
 
@@ -1,15 +0,0 @@
1
- const regex_return_characters = /\r/g;
2
-
3
- /**
4
- * Hashes a string to a base36 value
5
- * @param {string} str
6
- * @returns {string}
7
- */
8
- export function hash(str) {
9
- str = str.replace(regex_return_characters, '');
10
- let hash = 5381;
11
- let i = str.length;
12
-
13
- while (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);
14
- return (hash >>> 0).toString(36);
15
- }
@@ -1,49 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`computed tracked properties > should update a property using assignment 1`] = `
4
- <div>
5
- <div>
6
- 0
7
- </div>
8
- <button>
9
- Increment
10
- </button>
11
-
12
- </div>
13
- `;
14
-
15
- exports[`computed tracked properties > should update a property using assignment 2`] = `
16
- <div>
17
- <div>
18
- 1
19
- </div>
20
- <button>
21
- Increment
22
- </button>
23
-
24
- </div>
25
- `;
26
-
27
- exports[`computed tracked properties > should update a property using update expressions 1`] = `
28
- <div>
29
- <div>
30
- 0
31
- </div>
32
- <button>
33
- Increment
34
- </button>
35
-
36
- </div>
37
- `;
38
-
39
- exports[`computed tracked properties > should update a property using update expressions 2`] = `
40
- <div>
41
- <div>
42
- 1
43
- </div>
44
- <button>
45
- Increment
46
- </button>
47
-
48
- </div>
49
- `;
@@ -1,319 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`for statements > correctly handles intermediate statements in for block 1`] = `
4
- <div>
5
- <div>
6
- <div>
7
- <div>
8
- 1
9
- </div>
10
- <div>
11
- 1
12
- </div>
13
- </div>
14
- <div>
15
- <div>
16
- 2
17
- </div>
18
- <div>
19
- 2
20
- </div>
21
- </div>
22
- <div>
23
- <div>
24
- 3
25
- </div>
26
- <div>
27
- 3
28
- </div>
29
- </div>
30
-
31
- </div>
32
- <button>
33
- Add Item
34
- </button>
35
-
36
- </div>
37
- `;
38
-
39
- exports[`for statements > correctly handles intermediate statements in for block 2`] = `
40
- <div>
41
- <div>
42
- <div>
43
- <div>
44
- 1
45
- </div>
46
- <div>
47
- 1
48
- </div>
49
- </div>
50
- <div>
51
- <div>
52
- 2
53
- </div>
54
- <div>
55
- 2
56
- </div>
57
- </div>
58
- <div>
59
- <div>
60
- 3
61
- </div>
62
- <div>
63
- 3
64
- </div>
65
- </div>
66
- <div>
67
- <div>
68
- 4
69
- </div>
70
- <div>
71
- 4
72
- </div>
73
- </div>
74
-
75
- </div>
76
- <button>
77
- Add Item
78
- </button>
79
-
80
- </div>
81
- `;
82
-
83
- exports[`for statements > correctly handles keyed for...of loops 1`] = `
84
- <div>
85
- <!---->
86
- <div>
87
- 0:Item 1
88
- </div>
89
- <div>
90
- 1:Item 2
91
- </div>
92
- <div>
93
- 2:Item 3
94
- </div>
95
- <!---->
96
- <button>
97
- Reverse
98
- </button>
99
-
100
- </div>
101
- `;
102
-
103
- exports[`for statements > correctly handles keyed for...of loops 2`] = `
104
- <div>
105
- <!---->
106
- <div>
107
- 0:Item 3
108
- </div>
109
- <div>
110
- 1:Item 2
111
- </div>
112
- <div>
113
- 2:Item 1
114
- </div>
115
- <!---->
116
- <button>
117
- Reverse
118
- </button>
119
-
120
- </div>
121
- `;
122
-
123
- exports[`for statements > correctly handles the index in a for...of loop 1`] = `
124
- <div>
125
- <div>
126
- <div>
127
- 0 : a
128
- </div>
129
- <div>
130
- 1 : b
131
- </div>
132
- <div>
133
- 2 : c
134
- </div>
135
-
136
- </div>
137
- <button>
138
- Add Item
139
- </button>
140
- <button>
141
- Reverse
142
- </button>
143
-
144
- </div>
145
- `;
146
-
147
- exports[`for statements > correctly handles the index in a for...of loop 2`] = `
148
- <div>
149
- <div>
150
- <div>
151
- 0 : a
152
- </div>
153
- <div>
154
- 1 : b
155
- </div>
156
- <div>
157
- 2 : c
158
- </div>
159
- <div>
160
- 3 : d
161
- </div>
162
-
163
- </div>
164
- <button>
165
- Add Item
166
- </button>
167
- <button>
168
- Reverse
169
- </button>
170
-
171
- </div>
172
- `;
173
-
174
- exports[`for statements > correctly handles the index in a for...of loop 3`] = `
175
- <div>
176
- <div>
177
- <div>
178
- 0 : d
179
- </div>
180
- <div>
181
- 1 : c
182
- </div>
183
- <div>
184
- 2 : b
185
- </div>
186
- <div>
187
- 3 : a
188
- </div>
189
-
190
- </div>
191
- <button>
192
- Add Item
193
- </button>
194
- <button>
195
- Reverse
196
- </button>
197
-
198
- </div>
199
- `;
200
-
201
- exports[`for statements > handles updating with new objects with same key 1`] = `
202
- <div>
203
- <!---->
204
- <div>
205
- 0:Item 1
206
- </div>
207
- <div>
208
- 1:Item 2
209
- </div>
210
- <div>
211
- 2:Item 3
212
- </div>
213
- <!---->
214
- <button>
215
- Reverse
216
- </button>
217
-
218
- </div>
219
- `;
220
-
221
- exports[`for statements > handles updating with new objects with same key 2`] = `
222
- <div>
223
- <!---->
224
- <div>
225
- 0:Item 1!
226
- </div>
227
- <div>
228
- 1:Item 2!
229
- </div>
230
- <div>
231
- 2:Item 3!
232
- </div>
233
- <!---->
234
- <button>
235
- Reverse
236
- </button>
237
-
238
- </div>
239
- `;
240
-
241
- exports[`for statements > renders a simple dynamic array 1`] = `
242
- <div>
243
- <!---->
244
- <div
245
- class="Item 1"
246
- >
247
- Item 1
248
- </div>
249
- <div
250
- class="Item 2"
251
- >
252
- Item 2
253
- </div>
254
- <div
255
- class="Item 3"
256
- >
257
- Item 3
258
- </div>
259
- <!---->
260
- <button>
261
- Add Item
262
- </button>
263
-
264
- </div>
265
- `;
266
-
267
- exports[`for statements > renders a simple dynamic array 2`] = `
268
- <div>
269
- <!---->
270
- <div
271
- class="Item 1"
272
- >
273
- Item 1
274
- </div>
275
- <div
276
- class="Item 2"
277
- >
278
- Item 2
279
- </div>
280
- <div
281
- class="Item 3"
282
- >
283
- Item 3
284
- </div>
285
- <div
286
- class="Item 4"
287
- >
288
- Item 4
289
- </div>
290
- <!---->
291
- <button>
292
- Add Item
293
- </button>
294
-
295
- </div>
296
- `;
297
-
298
- exports[`for statements > renders a simple static array 1`] = `
299
- <div>
300
- <!---->
301
- <div
302
- class="Item 1"
303
- >
304
- Item 1
305
- </div>
306
- <div
307
- class="Item 2"
308
- >
309
- Item 2
310
- </div>
311
- <div
312
- class="Item 3"
313
- >
314
- Item 3
315
- </div>
316
- <!---->
317
-
318
- </div>
319
- `;
@@ -1,40 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`html directive > renders dynamic html 1`] = `
4
- <div>
5
- <!---->
6
- <div>
7
- Test
8
- </div>
9
- <!---->
10
- <button>
11
- Update
12
- </button>
13
-
14
- </div>
15
- `;
16
-
17
- exports[`html directive > renders dynamic html 2`] = `
18
- <div>
19
- <!---->
20
- <div>
21
- Updated
22
- </div>
23
- <!---->
24
- <button>
25
- Update
26
- </button>
27
-
28
- </div>
29
- `;
30
-
31
- exports[`html directive > renders static html 1`] = `
32
- <div>
33
- <!---->
34
- <div>
35
- Test
36
- </div>
37
- <!---->
38
-
39
- </div>
40
- `;
@@ -1,60 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`basic client > attribute rendering > handles boolean attributes with no prop value provides 1`] = `
4
- <div>
5
- <div
6
- class="container"
7
- >
8
- <button
9
- disabled=""
10
- >
11
- Button
12
- </button>
13
- <input
14
- checked=""
15
- type="checkbox"
16
- />
17
- </div>
18
-
19
- </div>
20
- `;
21
-
22
- exports[`basic client > attribute rendering > handles boolean props correctly 1`] = `
23
- <div>
24
- <div
25
- data-disabled=""
26
- />
27
- <input
28
- disabled=""
29
- />
30
- <!---->
31
-
32
- </div>
33
- `;
34
-
35
- exports[`basic client > attribute rendering > render spread props without duplication 1`] = `
36
- <div>
37
- <div>
38
- <input
39
- id="vehicle1"
40
- name="car"
41
- type="checkbox"
42
- value="Bike"
43
- />
44
- </div>
45
-
46
- </div>
47
- `;
48
-
49
- exports[`basic client > attribute rendering > render static attributes 1`] = `
50
- <div>
51
- <div
52
- class="foo"
53
- id="bar"
54
- style="color: red;"
55
- >
56
- Hello World
57
- </div>
58
-
59
- </div>
60
- `;
@@ -1,59 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`basic client > rendering & text > basic operations 1`] = `
4
- <div>
5
- <div>
6
- 0
7
- </div>
8
- <div>
9
- 2
10
- </div>
11
- <div>
12
- 5
13
- </div>
14
- <div>
15
- 2
16
- </div>
17
-
18
- </div>
19
- `;
20
-
21
- exports[`basic client > rendering & text > renders semi-dynamic text 1`] = `
22
- <div>
23
- <div>
24
- Hello World
25
- </div>
26
-
27
- </div>
28
- `;
29
-
30
- exports[`basic client > rendering & text > renders simple JS expression logic correctly 1`] = `
31
- <div>
32
- <div>
33
- {"0":"Test"}
34
- </div>
35
- <div>
36
- 1
37
- </div>
38
-
39
- </div>
40
- `;
41
-
42
- exports[`basic client > rendering & text > renders static text 1`] = `
43
- <div>
44
- <div>
45
- Hello World
46
- </div>
47
-
48
- </div>
49
- `;
50
-
51
- exports[`basic client > rendering & text > should handle lexical scopes correctly 1`] = `
52
- <div>
53
- <section>
54
- Nested scope variable
55
- <!---->
56
- </section>
57
-
58
- </div>
59
- `;
@@ -1,49 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`basic client > text rendering > basic operations 1`] = `
4
- <div>
5
- <div>
6
- 0
7
- </div>
8
- <div>
9
- 2
10
- </div>
11
- <div>
12
- 5
13
- </div>
14
- <div>
15
- 2
16
- </div>
17
-
18
- </div>
19
- `;
20
-
21
- exports[`basic client > text rendering > renders semi-dynamic text 1`] = `
22
- <div>
23
- <div>
24
- Hello World
25
- </div>
26
-
27
- </div>
28
- `;
29
-
30
- exports[`basic client > text rendering > renders simple JS expression logic correctly 1`] = `
31
- <div>
32
- <div>
33
- {"0":"Test"}
34
- </div>
35
- <div>
36
- 1
37
- </div>
38
-
39
- </div>
40
- `;
41
-
42
- exports[`basic client > text rendering > renders static text 1`] = `
43
- <div>
44
- <div>
45
- Hello World
46
- </div>
47
-
48
- </div>
49
- `;
@@ -1,12 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`compiler > assignments > compiles tracked values in effect with assignment expression 1`] = `"state.count = _$_.get(lazy);"`;
4
-
5
- exports[`compiler > assignments > compiles tracked values in effect with update expressions 1`] = `
6
- "_$_.untrack(() => {
7
- state.preIncrement = _$_.update_pre(lazy);
8
- state.postIncrement = _$_.update(lazy);
9
- state.preDecrement = _$_.update_pre(lazy, -1);
10
- state.postDecrement = _$_.update(lazy, -1);
11
- });"
12
- `;
@@ -1,46 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`compiler > typescript > compiles TSInstantiationExpression 1`] = `
4
- "import * as _$_ from 'ripple/internal/client';
5
-
6
- function makeBox(value) {
7
- return { value };
8
- }
9
-
10
- const makeStringBox = (makeBox);
11
- const stringBox = makeStringBox('abc');
12
- const ErrorMap = (Map);
13
- const errorMap = new ErrorMap();"
14
- `;
15
-
16
- exports[`compiler > typescript > removes class TypeScript syntax from JS output 1`] = `
17
- "import * as _$_ from 'ripple/internal/client';
18
-
19
- class PrintEvent {
20
- text;
21
-
22
- constructor(text) {
23
- this.text = text;
24
- }
25
- }"
26
- `;
27
-
28
- exports[`compiler > typescript > removes class extends type arguments from JS output 1`] = `
29
- "import * as _$_ from 'ripple/internal/client';
30
-
31
- class StringMap extends Map {
32
- constructor() {
33
- var __block = _$_.scope();
34
-
35
- super();
36
- }
37
- }"
38
- `;
39
-
40
- exports[`compiler > typescript > removes type assertions from function parameters and leaves default values 1`] = `
41
- "import * as _$_ from 'ripple/internal/client';
42
-
43
- function getString(e = 'test') {
44
- return e;
45
- }"
46
- `;
@@ -1,37 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`composite > render > correct handles passing through component props and children 1`] = `
4
- <div>
5
- <!---->
6
- <div>
7
- <div>
8
- I am A
9
- </div>
10
- <!---->
11
- <div>
12
- other text
13
- </div>
14
- <!---->
15
- <div>
16
- I am B
17
- </div>
18
- <!---->
19
- </div>
20
- <!---->
21
-
22
- </div>
23
- `;
24
-
25
- exports[`composite > render > render simple text as children 1`] = `
26
- <div>
27
- <!---->
28
- <button
29
- class="my-button"
30
- >
31
- Click Me
32
- <!---->
33
- </button>
34
- <!---->
35
-
36
- </div>
37
- `;