ripple 0.3.35 → 0.3.37

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,29 @@
1
1
  # ripple
2
2
 
3
+ ## 0.3.37
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1002](https://github.com/Ripple-TS/ripple/pull/1002)
8
+ [`c631ab0`](https://github.com/Ripple-TS/ripple/commit/c631ab0076b7e2cb30f4998101b54c3a86e78c61)
9
+ Thanks [@trueadm](https://github.com/trueadm)! - Align direct double-quoted TSRX
10
+ text children with quoted JSX attribute text by decoding character references
11
+ and treating backslashes as literal text. Preserve the direct quoted form in the
12
+ Prettier plugin and highlight it as JSX text in the TextMate grammar.
13
+
14
+ - Updated dependencies
15
+ [[`c631ab0`](https://github.com/Ripple-TS/ripple/commit/c631ab0076b7e2cb30f4998101b54c3a86e78c61)]:
16
+ - @tsrx/ripple@0.0.19
17
+ - ripple@0.3.37
18
+
19
+ ## 0.3.36
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies []:
24
+ - ripple@0.3.36
25
+ - @tsrx/ripple@0.0.18
26
+
3
27
  ## 0.3.35
4
28
 
5
29
  ### 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.35",
6
+ "version": "0.3.37",
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.17"
79
+ "@tsrx/ripple": "0.0.19"
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.15"
87
+ "@tsrx/core": "0.0.17"
88
88
  },
89
89
  "peerDependencies": {
90
- "ripple": "0.3.35"
90
+ "ripple": "0.3.37"
91
91
  }
92
92
  }
@@ -40,6 +40,21 @@ describe('basic client > rendering & text', () => {
40
40
  expect(div.querySelector('span')).toBeNull();
41
41
  });
42
42
 
43
+ it('renders direct double-quoted text children as text', () => {
44
+ component Basic() {
45
+ <div class="entities">"Rock &amp; &quot;Roll&quot;"</div>
46
+ <div class="backslash">"line\nbreak"</div>
47
+ <pre class="multiline">"first
48
+ second"</pre>
49
+ }
50
+
51
+ render(Basic);
52
+
53
+ expect(container.querySelector('.entities').textContent).toBe('Rock & "Roll"');
54
+ expect(container.querySelector('.backslash').textContent).toBe('line\\nbreak');
55
+ expect(container.querySelector('.multiline').textContent).toBe('first\nsecond');
56
+ });
57
+
43
58
  it('renders dynamic text', () => {
44
59
  component Basic() {
45
60
  let &[message] = track('Hello World');
@@ -25,6 +25,21 @@ describe('basic client', () => {
25
25
  expect(body).toBeHtml('<div>&lt;span>Not HTML&lt;/span></div>');
26
26
  });
27
27
 
28
+ it('renders direct double-quoted text children as text', async () => {
29
+ component Basic() {
30
+ <div>"Rock &amp; &quot;Roll&quot;"</div>
31
+ <div>"line\nbreak"</div>
32
+ <pre>"first
33
+ second"</pre>
34
+ }
35
+
36
+ const { body } = await render(Basic);
37
+
38
+ expect(body).toBeHtml(
39
+ '<div>Rock &amp; "Roll"</div><div>line\\nbreak</div><pre>first\nsecond</pre>',
40
+ );
41
+ });
42
+
28
43
  it('renders tracked state updates', async () => {
29
44
  component Counter() {
30
45
  let &[count] = track(0);
@@ -0,0 +1,16 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { compile } from '@tsrx/ripple';
3
+
4
+ describe('double-quoted text children', () => {
5
+ it('decodes JSX-style entities before server text escaping', () => {
6
+ const result = compile(
7
+ `component App() {
8
+ <div>"Rock &amp; &quot;Roll&quot;"</div>
9
+ }`,
10
+ '/src/App.tsrx',
11
+ { mode: 'server' },
12
+ );
13
+
14
+ expect(result.js.code).toContain(`_$_.output_push('Rock &amp; "Roll"')`);
15
+ });
16
+ });