-
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
Showing
16 changed files
with
314 additions
and
2 deletions.
There are no files selected for viewing
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
19 changes: 19 additions & 0 deletions
19
...se/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/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,19 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<button> | ||
Change | ||
</button> | ||
<div | ||
data-src="embed" | ||
id="GENERATED-0" | ||
> | ||
<noscript | ||
id="GENERATED-1" | ||
/> | ||
</div> | ||
<div | ||
data-from="test" | ||
data-slot="slot_1" | ||
id="GENERATED-2" | ||
/> |
23 changes: 23 additions & 0 deletions
23
...se/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/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,23 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<button> | ||
Change | ||
</button> | ||
<div | ||
data-src="embed" | ||
id="GENERATED-0" | ||
> | ||
<noscript | ||
id="GENERATED-1" | ||
/> | ||
</div> | ||
<div | ||
data-from="test" | ||
data-slot="slot_1" | ||
id="GENERATED-2" | ||
> | ||
<p> | ||
test_html for slot_1 | ||
</p> | ||
</div> |
24 changes: 24 additions & 0 deletions
24
...se/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/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,24 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<button> | ||
Change | ||
</button> | ||
<div | ||
data-src="embed" | ||
id="GENERATED-0" | ||
> | ||
<noscript | ||
id="GENERATED-1" | ||
/> | ||
</div> | ||
<div | ||
data-from="test" | ||
data-slot="slot_1" | ||
id="GENERATED-2" | ||
> | ||
<p> | ||
test_html for slot_1 | ||
</p> | ||
next chunk for slot_1 | ||
</div> |
48 changes: 48 additions & 0 deletions
48
...se/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/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,48 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<button> | ||
Change | ||
</button> | ||
<div | ||
data-src="embed" | ||
id="GENERATED-0" | ||
> | ||
<noscript | ||
id="GENERATED-1" | ||
/> | ||
</div> | ||
<div | ||
data-from="test" | ||
data-slot="slot_1" | ||
id="GENERATED-2" | ||
> | ||
<p> | ||
test_html for slot_1 | ||
</p> | ||
next chunk for slot_1 | ||
</div> | ||
<div | ||
data-from="test" | ||
data-slot="slot_2" | ||
id="GENERATED-3" | ||
> | ||
<p> | ||
test_html for slot_2 | ||
</p> | ||
</div> | ||
<div | ||
id="GENERATED-4" | ||
style="display:none" | ||
> | ||
<noscript | ||
id="GENERATED-5" | ||
/> | ||
</div> | ||
<div | ||
id="GENERATED-6" | ||
style="display:none" | ||
/> | ||
<script> | ||
function $af(d,a,e,l,g,h,k,b,f,c){c=$af;if(a&&!c[a])(c[a+="$"]||(c[a]=[])).push(d);else{e=document;l=e.getElementById("af"+d);g=e.getElementById("afph"+d);h=e.createDocumentFragment();k=l.childNodes;b=0;for(f=k.length;b<f;b++)h.appendChild(k.item(0));g&&g.parentNode.replaceChild(h,g);c[d]=1;if(a=c[d+"$"])for(b=0,f=a.length;b<f;b++)c(a[b])}};$af(0);$af(1);$ssr_no_refresh_index_C=(window.$ssr_no_refresh_index_C||[]).concat({"l":1,"w":[["s0-8",0,{},{"f":1}]],"t":["Za8QocXx"]}) | ||
</script> |
40 changes: 40 additions & 0 deletions
40
...se/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.4.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,40 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<button> | ||
Change | ||
</button> | ||
<div | ||
data-src="embed" | ||
id="GENERATED-0" | ||
/> | ||
<div | ||
data-from="test" | ||
data-slot="slot_1" | ||
id="GENERATED-1" | ||
> | ||
<p> | ||
test_html for slot_1 | ||
</p> | ||
next chunk for slot_1 | ||
</div> | ||
<div | ||
data-from="test" | ||
data-slot="slot_2" | ||
id="GENERATED-2" | ||
> | ||
<p> | ||
test_html for slot_2 | ||
</p> | ||
</div> | ||
<div | ||
id="GENERATED-3" | ||
style="display:none" | ||
/> | ||
<div | ||
id="GENERATED-4" | ||
style="display:none" | ||
/> | ||
<script> | ||
function $af(d,a,e,l,g,h,k,b,f,c){c=$af;if(a&&!c[a])(c[a+="$"]||(c[a]=[])).push(d);else{e=document;l=e.getElementById("af"+d);g=e.getElementById("afph"+d);h=e.createDocumentFragment();k=l.childNodes;b=0;for(f=k.length;b<f;b++)h.appendChild(k.item(0));g&&g.parentNode.replaceChild(h,g);c[d]=1;if(a=c[d+"$"])for(b=0,f=a.length;b<f;b++)c(a[b])}};$af(0);$af(1);$ssr_no_refresh_index_C=(window.$ssr_no_refresh_index_C||[]).concat({"l":1,"w":[["s0-8",0,{},{"f":1}]],"t":["Za8QocXx"]}) | ||
</script> |
35 changes: 35 additions & 0 deletions
35
...sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/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,35 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<button> | ||
Change | ||
</button> | ||
<div | ||
data-src="embed" | ||
id="GENERATED-0" | ||
/> | ||
<div | ||
data-from="test" | ||
data-slot="slot_1" | ||
id="GENERATED-1" | ||
/> | ||
<div | ||
data-from="test" | ||
data-slot="slot_2" | ||
id="GENERATED-2" | ||
> | ||
<p> | ||
test_html for slot_2 | ||
</p> | ||
</div> | ||
<div | ||
id="GENERATED-3" | ||
style="display:none" | ||
/> | ||
<div | ||
id="GENERATED-4" | ||
style="display:none" | ||
/> | ||
<script> | ||
function $af(d,a,e,l,g,h,k,b,f,c){c=$af;if(a&&!c[a])(c[a+="$"]||(c[a]=[])).push(d);else{e=document;l=e.getElementById("af"+d);g=e.getElementById("afph"+d);h=e.createDocumentFragment();k=l.childNodes;b=0;for(f=k.length;b<f;b++)h.appendChild(k.item(0));g&&g.parentNode.replaceChild(h,g);c[d]=1;if(a=c[d+"$"])for(b=0,f=a.length;b<f;b++)c(a[b])}};$af(0);$af(1);$ssr_no_refresh_index_C=(window.$ssr_no_refresh_index_C||[]).concat({"l":1,"w":[["s0-8",0,{},{"f":1}]],"t":["Za8QocXx"]}) | ||
</script> |
37 changes: 37 additions & 0 deletions
37
...sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/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,37 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<button> | ||
Change | ||
</button> | ||
<div | ||
data-src="embed" | ||
id="GENERATED-0" | ||
/> | ||
<div | ||
data-from="test" | ||
data-slot="slot_1" | ||
id="GENERATED-1" | ||
> | ||
slot_1 after src change | ||
</div> | ||
<div | ||
data-from="test" | ||
data-slot="slot_2" | ||
id="GENERATED-2" | ||
> | ||
<p> | ||
test_html for slot_2 | ||
</p> | ||
</div> | ||
<div | ||
id="GENERATED-3" | ||
style="display:none" | ||
/> | ||
<div | ||
id="GENERATED-4" | ||
style="display:none" | ||
/> | ||
<script> | ||
function $af(d,a,e,l,g,h,k,b,f,c){c=$af;if(a&&!c[a])(c[a+="$"]||(c[a]=[])).push(d);else{e=document;l=e.getElementById("af"+d);g=e.getElementById("afph"+d);h=e.createDocumentFragment();k=l.childNodes;b=0;for(f=k.length;b<f;b++)h.appendChild(k.item(0));g&&g.parentNode.replaceChild(h,g);c[d]=1;if(a=c[d+"$"])for(b=0,f=a.length;b<f;b++)c(a[b])}};$af(0);$af(1);$ssr_no_refresh_index_C=(window.$ssr_no_refresh_index_C||[]).concat({"l":1,"w":[["s0-8",0,{},{"f":1}]],"t":["Za8QocXx"]}) | ||
</script> |
13 changes: 13 additions & 0 deletions
13
src/components/micro-frame-sse/__tests__/fixtures/ssr-no-refresh/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,13 @@ | ||
class { | ||
onCreate() { | ||
this.state = { src: "embed", name: "test" }; | ||
} | ||
change() { | ||
this.state.src = "embed_2"; | ||
} | ||
} | ||
|
||
<button onClick("change")>Change</button> | ||
<micro-frame-sse src=state.src name=state.name read=(e => [e.lastEventId, e.data]) /> | ||
<micro-frame-slot from="test" slot="slot_1" /> | ||
<micro-frame-slot from="test" slot="slot_2" no-refresh /> |
25 changes: 25 additions & 0 deletions
25
src/components/micro-frame-sse/__tests__/fixtures/ssr-no-refresh/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,25 @@ | ||
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} | ||
</@then> | ||
</await> | ||
</@then> | ||
</await> | ||
</@then> | ||
</await> |
9 changes: 9 additions & 0 deletions
9
src/components/micro-frame-sse/__tests__/fixtures/ssr-no-refresh/embed_2.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,9 @@ | ||
import { wait } from "../../../../../__tests__/queue"; | ||
|
||
$ const first = `id: slot_1\ndata: slot_1 after src change\n\n`; | ||
|
||
<await(wait())> | ||
<@then> | ||
$!{first} | ||
</@then> | ||
</await> |
13 changes: 13 additions & 0 deletions
13
src/components/micro-frame-sse/__tests__/fixtures/ssr-no-refresh/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/ssr-no-refresh/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/ssr-no-refresh/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