-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39eaf14
commit 231288c
Showing
13 changed files
with
170 additions
and
1 deletion.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...s__/__snapshots__/micro-frame-sse/csr-slot-done-and-error/renders.expected/loading.0.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<button> | ||
Load Slot1 | ||
</button> | ||
<script> | ||
$csr_slot_done_and_error_index_C=(window.$csr_slot_done_and_error_index_C||[]).concat({"l":1,"w":[["s0-8",0,{},{"f":1}]],"t":["BQ+bMDNF"]}) | ||
</script> |
13 changes: 13 additions & 0 deletions
13
...s__/__snapshots__/micro-frame-sse/csr-slot-done-and-error/renders.expected/loading.1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<button> | ||
Load Slot1 | ||
</button> | ||
<div /> | ||
<div> | ||
Loading... | ||
</div> | ||
<script> | ||
$csr_slot_done_and_error_index_C=(window.$csr_slot_done_and_error_index_C||[]).concat({"l":1,"w":[["s0-8",0,{},{"f":1}]],"t":["BQ+bMDNF"]}) | ||
</script> |
16 changes: 16 additions & 0 deletions
16
...s__/__snapshots__/micro-frame-sse/csr-slot-done-and-error/renders.expected/loading.2.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<button> | ||
Load Slot1 | ||
</button> | ||
<div /> | ||
<div> | ||
Loading... | ||
<p> | ||
test_html for slot_2 | ||
</p> | ||
</div> | ||
<script> | ||
$csr_slot_done_and_error_index_C=(window.$csr_slot_done_and_error_index_C||[]).concat({"l":1,"w":[["s0-8",0,{},{"f":1}]],"t":["BQ+bMDNF"]}) | ||
</script> |
15 changes: 15 additions & 0 deletions
15
...s__/__snapshots__/micro-frame-sse/csr-slot-done-and-error/renders.expected/loading.3.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<button> | ||
Load Slot1 | ||
</button> | ||
<div /> | ||
<div> | ||
<p> | ||
test_html for slot_2 | ||
</p> | ||
</div> | ||
<script> | ||
$csr_slot_done_and_error_index_C=(window.$csr_slot_done_and_error_index_C||[]).concat({"l":1,"w":[["s0-8",0,{},{"f":1}]],"t":["BQ+bMDNF"]}) | ||
</script> |
18 changes: 18 additions & 0 deletions
18
...ts__/__snapshots__/micro-frame-sse/csr-slot-done-and-error/renders.expected/step-0.0.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<button> | ||
Load Slot1 | ||
</button> | ||
<div /> | ||
<div> | ||
<p> | ||
test_html for slot_2 | ||
</p> | ||
</div> | ||
<div> | ||
Loading... | ||
</div> | ||
<script> | ||
$csr_slot_done_and_error_index_C=(window.$csr_slot_done_and_error_index_C||[]).concat({"l":1,"w":[["s0-8",0,{},{"f":1}]],"t":["BQ+bMDNF"]}) | ||
</script> |
20 changes: 20 additions & 0 deletions
20
...ts__/__snapshots__/micro-frame-sse/csr-slot-done-and-error/renders.expected/step-0.1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<button> | ||
Load Slot1 | ||
</button> | ||
<div /> | ||
<div> | ||
<p> | ||
test_html for slot_2 | ||
</p> | ||
</div> | ||
<div> | ||
<p> | ||
test_html for slot_1 | ||
</p> | ||
</div> | ||
<script> | ||
$csr_slot_done_and_error_index_C=(window.$csr_slot_done_and_error_index_C||[]).concat({"l":1,"w":[["s0-8",0,{},{"f":1}]],"t":["BQ+bMDNF"]}) | ||
</script> |
31 changes: 31 additions & 0 deletions
31
...omponents/micro-frame-sse/__tests__/fixtures/csr-slot-done-and-error/components/app.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class { | ||
onCreate() { | ||
this.state = { mounted: false, loadSlot1: false }; | ||
} | ||
onMount() { | ||
this.state.mounted = true; | ||
} | ||
loadSlot1() { | ||
this.state.loadSlot1 = true; | ||
} | ||
} | ||
|
||
<button onClick("loadSlot1")>Load Slot1</button> | ||
<if(state.mounted)> | ||
<micro-frame-sse src="embed" name="test" read(e) { return [e.lastEventId, e.data, true] } /> | ||
<micro-frame-slot from="test" slot="slot_2"> | ||
<@loading> | ||
Loading... | ||
</@loading> | ||
</micro-frame-slot> | ||
<if(state.loadSlot1)> | ||
<micro-frame-slot from="test" slot="slot_1"> | ||
<@loading> | ||
Loading... | ||
</@loading> | ||
<@catch|err|> | ||
${err} | ||
</@catch> | ||
</micro-frame-slot> | ||
</if> | ||
</if> |
26 changes: 26 additions & 0 deletions
26
src/components/micro-frame-sse/__tests__/fixtures/csr-slot-done-and-error/embed.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { wait } from "../../../../../__tests__/queue"; | ||
import fs from "fs"; | ||
import path from "path"; | ||
|
||
$ const slot_1_html = fs.readFileSync(path.resolve(__dirname ,'slot_1.html'), 'utf8'); | ||
$ const slot_2_html = fs.readFileSync(path.resolve(__dirname ,'slot_2.html'), 'utf8'); | ||
$ const first = `id: slot_1\ndata: ${slot_1_html.replace(/\r?\n/g, '')}\n\n`; | ||
$ const second = `id: slot_2\ndata: ${slot_2_html.replace(/\r?\n/g, '')}\n\n`; | ||
$ const third = `id: slot_1\ndata: next chunk for slot_1\n\n`; | ||
|
||
<await(wait())> | ||
<@then> | ||
$!{first} | ||
<await(wait())> | ||
<@then> | ||
$!{second} | ||
<await(wait())> | ||
<@then> | ||
$!{third} | ||
<await(new Promise((_, reject) => setTimeout(() => reject("Error"), 100))) /> | ||
</@then> | ||
</await> | ||
</@then> | ||
</await> | ||
</@then> | ||
</await> |
13 changes: 13 additions & 0 deletions
13
src/components/micro-frame-sse/__tests__/fixtures/csr-slot-done-and-error/index.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Simple Example</title> | ||
<esbuild-assets/> | ||
</head> | ||
<body> | ||
<div>Host app</div> | ||
<app/> | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
src/components/micro-frame-sse/__tests__/fixtures/csr-slot-done-and-error/slot_1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>test_html for slot_1</p> |
1 change: 1 addition & 0 deletions
1
src/components/micro-frame-sse/__tests__/fixtures/csr-slot-done-and-error/slot_2.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>test_html for slot_2</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters