-
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.
fix: check for out.global.req/request when looking for incomingMessage
- Loading branch information
1 parent
385f054
commit d469c64
Showing
16 changed files
with
205 additions
and
4 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
..._tests__/__snapshots__/micro-frame-sse/ssr-behind-reorder/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,6 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<noscript | ||
id="GENERATED-0" | ||
/> |
38 changes: 38 additions & 0 deletions
38
..._tests__/__snapshots__/micro-frame-sse/ssr-behind-reorder/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,38 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<noscript | ||
id="GENERATED-0" | ||
/> | ||
<div | ||
id="GENERATED-1" | ||
style="display:none" | ||
/> | ||
<div | ||
id="GENERATED-2" | ||
style="display:none" | ||
> | ||
<div | ||
data-src="embed" | ||
id="GENERATED-3" | ||
> | ||
<noscript | ||
id="GENERATED-4" | ||
/> | ||
</div> | ||
<div | ||
data-from="test" | ||
data-slot="slot_1" | ||
id="GENERATED-5" | ||
> | ||
Could not get request from stream/global. Please assign out.global.req with proper request object. | ||
</div> | ||
<div | ||
data-from="test" | ||
data-slot="slot_2" | ||
id="GENERATED-6" | ||
/> | ||
</div> | ||
<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(1);$af(0) | ||
</script> |
30 changes: 30 additions & 0 deletions
30
..._tests__/__snapshots__/micro-frame-sse/ssr-behind-reorder/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,30 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<div | ||
data-src="embed" | ||
id="GENERATED-0" | ||
/> | ||
<div | ||
data-from="test" | ||
data-slot="slot_1" | ||
id="GENERATED-1" | ||
> | ||
Could not get request from stream/global. Please assign out.global.req with proper request object. | ||
</div> | ||
<div | ||
data-from="test" | ||
data-slot="slot_2" | ||
id="GENERATED-2" | ||
/> | ||
<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(1);$af(0) | ||
</script> |
25 changes: 25 additions & 0 deletions
25
src/components/micro-frame-sse/__tests__/fixtures/ssr-behind-reorder/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\ntype: update\ndata: next chunk for slot_1`; | ||
|
||
<await(wait())> | ||
<@then> | ||
$!{first} | ||
<await(wait())> | ||
<@then> | ||
$!{second} | ||
<await(wait())> | ||
<@then> | ||
$!{third} | ||
</@then> | ||
</await> | ||
</@then> | ||
</await> | ||
</@then> | ||
</await> |
25 changes: 25 additions & 0 deletions
25
src/components/micro-frame-sse/__tests__/fixtures/ssr-behind-reorder/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,25 @@ | ||
<!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> | ||
<await(new Promise((res) => setTimeout(res))) client-reorder> | ||
<@then> | ||
<micro-frame-sse | ||
src="embed" | ||
name="test" | ||
read=((e) => [e.lastEventId, e.data]) | ||
/> | ||
<micro-frame-slot from="test" slot="slot_1"> | ||
<@catch|err|>${err.message}</@catch> | ||
</micro-frame-slot> | ||
<micro-frame-slot from="test" slot="slot_2"/> | ||
</@then> | ||
</await> | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
src/components/micro-frame-sse/__tests__/fixtures/ssr-behind-reorder/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-behind-reorder/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
6 changes: 6 additions & 0 deletions
6
...ts/micro-frame/__tests__/__snapshots__/ssr-behind-reorder/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,6 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<noscript | ||
id="GENERATED-0" | ||
/> |
20 changes: 20 additions & 0 deletions
20
...ts/micro-frame/__tests__/__snapshots__/ssr-behind-reorder/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,20 @@ | ||
<div> | ||
Host app | ||
</div> | ||
<noscript | ||
id="GENERATED-0" | ||
/> | ||
<div | ||
id="GENERATED-1" | ||
style="display:none" | ||
> | ||
<div | ||
data-src="embed" | ||
id="GENERATED-2" | ||
> | ||
Could not get request from stream/global. Please assign out.global.req with proper request object. | ||
</div> | ||
</div> | ||
<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) | ||
</script> |
16 changes: 16 additions & 0 deletions
16
...ts/micro-frame/__tests__/__snapshots__/ssr-behind-reorder/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> | ||
<div | ||
data-src="embed" | ||
id="GENERATED-0" | ||
> | ||
Could not get request from stream/global. Please assign out.global.req with proper request object. | ||
</div> | ||
<div | ||
id="GENERATED-1" | ||
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) | ||
</script> |
4 changes: 4 additions & 0 deletions
4
src/components/micro-frame/__tests__/fixtures/ssr-behind-reorder/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,4 @@ | ||
<esbuild-assets/> | ||
<div> | ||
Embedded App. | ||
</div> |
19 changes: 19 additions & 0 deletions
19
src/components/micro-frame/__tests__/fixtures/ssr-behind-reorder/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,19 @@ | ||
<!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> | ||
<await(new Promise((res) => setTimeout(res))) client-reorder> | ||
<@then> | ||
<micro-frame src="embed"> | ||
<@catch|err|>${err.message}</@catch> | ||
</micro-frame> | ||
</@then> | ||
</await> | ||
</body> | ||
</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
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