ripple 0.3.51 → 0.3.53
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 +26 -0
- package/package.json +4 -4
- package/tests/client/try.test.tsrx +34 -0
- package/tests/client/tsx.test.tsrx +6 -2
- package/tests/server/try.test.tsrx +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# ripple
|
|
2
2
|
|
|
3
|
+
## 0.3.53
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
[[`5a59d73`](https://github.com/Ripple-TS/ripple/commit/5a59d73daf60b2652c86ffad2a4eaf3d801e40d7),
|
|
9
|
+
[`4f360f0`](https://github.com/Ripple-TS/ripple/commit/4f360f008edf61492cf85afa646c797c80a73f22),
|
|
10
|
+
[`c042672`](https://github.com/Ripple-TS/ripple/commit/c04267255d35945753ca8090006622c96fa0a14f),
|
|
11
|
+
[`a9d640f`](https://github.com/Ripple-TS/ripple/commit/a9d640f0728996b3f21b452ffe6040e54d82609c),
|
|
12
|
+
[`5a59d73`](https://github.com/Ripple-TS/ripple/commit/5a59d73daf60b2652c86ffad2a4eaf3d801e40d7),
|
|
13
|
+
[`2ae792c`](https://github.com/Ripple-TS/ripple/commit/2ae792cdca7d466e552a330ea965cefec2b1f5a5),
|
|
14
|
+
[`96360f3`](https://github.com/Ripple-TS/ripple/commit/96360f36306180e67ce69e464dd545773e57e8b1)]:
|
|
15
|
+
- @tsrx/core@0.1.3
|
|
16
|
+
- @tsrx/ripple@0.1.3
|
|
17
|
+
- ripple@0.3.53
|
|
18
|
+
|
|
19
|
+
## 0.3.52
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
[[`2010290`](https://github.com/Ripple-TS/ripple/commit/20102904d68951b47dce3958f88ddd1fc150e7a1)]:
|
|
25
|
+
- @tsrx/core@0.1.2
|
|
26
|
+
- ripple@0.3.52
|
|
27
|
+
- @tsrx/ripple@0.1.2
|
|
28
|
+
|
|
3
29
|
## 0.3.51
|
|
4
30
|
|
|
5
31
|
### 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.
|
|
6
|
+
"version": "0.3.53",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"module": "src/runtime/index-client.js",
|
|
9
9
|
"main": "src/runtime/index-client.js",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"esm-env": "^1.2.2",
|
|
77
77
|
"@types/estree": "^1.0.8",
|
|
78
78
|
"@types/estree-jsx": "^1.0.5",
|
|
79
|
-
"@tsrx/core": "0.1.
|
|
80
|
-
"@tsrx/ripple": "0.1.
|
|
79
|
+
"@tsrx/core": "0.1.3",
|
|
80
|
+
"@tsrx/ripple": "0.1.3"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@types/node": "^24.3.0",
|
|
@@ -87,6 +87,6 @@
|
|
|
87
87
|
"vscode-languageserver-types": "^3.17.5"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
|
-
"ripple": "0.3.
|
|
90
|
+
"ripple": "0.3.53"
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -12,6 +12,40 @@ import {
|
|
|
12
12
|
} from 'ripple';
|
|
13
13
|
|
|
14
14
|
describe('try block with catch and pending', () => {
|
|
15
|
+
it('renders nothing for an empty pending fallback before resolving', async () => {
|
|
16
|
+
let resolve_value: (value: string) => void = () => {};
|
|
17
|
+
const promise = new Promise<string>((resolve) => {
|
|
18
|
+
resolve_value = resolve;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
component App() {
|
|
22
|
+
<span class="before">{'before'}</span>
|
|
23
|
+
try {
|
|
24
|
+
let &[data] = trackAsync(() => promise);
|
|
25
|
+
<p class="resolved">{data}</p>
|
|
26
|
+
} pending {}
|
|
27
|
+
<span class="after">{'after'}</span>
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
render(App);
|
|
31
|
+
|
|
32
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
33
|
+
flushSync();
|
|
34
|
+
|
|
35
|
+
expect(container.querySelector('.before')?.textContent).toBe('before');
|
|
36
|
+
expect(container.querySelector('.after')?.textContent).toBe('after');
|
|
37
|
+
expect(container.querySelector('.resolved')).toBeNull();
|
|
38
|
+
expect(container.innerHTML).not.toContain('loading');
|
|
39
|
+
|
|
40
|
+
resolve_value('resolved value');
|
|
41
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
42
|
+
flushSync();
|
|
43
|
+
|
|
44
|
+
expect(container.querySelector('.resolved')?.textContent).toBe('resolved value');
|
|
45
|
+
expect(container.querySelector('.before')?.textContent).toBe('before');
|
|
46
|
+
expect(container.querySelector('.after')?.textContent).toBe('after');
|
|
47
|
+
});
|
|
48
|
+
|
|
15
49
|
it('catch block works when a child throws synchronously', async () => {
|
|
16
50
|
component App() {
|
|
17
51
|
try {
|
|
@@ -317,8 +317,12 @@ describe('tsx expression', () => {
|
|
|
317
317
|
let &[index] = track(0);
|
|
318
318
|
|
|
319
319
|
const el = <tsx>
|
|
320
|
-
<div
|
|
321
|
-
index}
|
|
320
|
+
<div
|
|
321
|
+
id={'item-' + index}
|
|
322
|
+
class={'item pos-' + index}
|
|
323
|
+
data-index={index}
|
|
324
|
+
title={'Item ' + index}
|
|
325
|
+
>
|
|
322
326
|
{'Item ' + index}
|
|
323
327
|
</div>
|
|
324
328
|
</tsx>;
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import { trackAsync } from 'ripple';
|
|
2
2
|
|
|
3
3
|
describe('try block with catch and pending (server)', () => {
|
|
4
|
+
it('renders resolved content with an empty pending fallback', async () => {
|
|
5
|
+
component App() {
|
|
6
|
+
<span>{'before'}</span>
|
|
7
|
+
try {
|
|
8
|
+
let &[data] = trackAsync(() => Promise.resolve('resolved value'));
|
|
9
|
+
<p>{data}</p>
|
|
10
|
+
} pending {}
|
|
11
|
+
<span>{'after'}</span>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { body } = await render(App);
|
|
15
|
+
expect(body).toContain('before');
|
|
16
|
+
expect(body).toContain('resolved value');
|
|
17
|
+
expect(body).toContain('after');
|
|
18
|
+
expect(body).not.toContain('loading');
|
|
19
|
+
});
|
|
20
|
+
|
|
4
21
|
it('catch block works when component throws before await with pending block', async () => {
|
|
5
22
|
component ThrowingChild() {
|
|
6
23
|
throw new Error('sync error');
|