From 637709d00cc60e5d4abdb4f3fe67b2021cea34b5 Mon Sep 17 00:00:00 2001 From: Bill Min Date: Thu, 4 Jan 2024 12:38:08 -0500 Subject: [PATCH] feat: sse slot no-refresh option --- .../micro-frame-slot/marko-tag.json | 8 ++++ .../renders.expected/loading.0.html | 19 ++++++++ .../renders.expected/loading.1.html | 23 +++++++++ .../renders.expected/loading.2.html | 24 ++++++++++ .../renders.expected/loading.3.html | 48 +++++++++++++++++++ .../renders.expected/loading.4.html | 40 ++++++++++++++++ .../renders.expected/step-0.0.html | 35 ++++++++++++++ .../renders.expected/step-0.1.html | 37 ++++++++++++++ .../ssr-no-refresh/components/app.marko | 13 +++++ .../fixtures/ssr-no-refresh/embed.marko | 25 ++++++++++ .../fixtures/ssr-no-refresh/embed_2.marko | 9 ++++ .../fixtures/ssr-no-refresh/index.marko | 13 +++++ .../fixtures/ssr-no-refresh/slot_1.html | 1 + .../fixtures/ssr-no-refresh/slot_2.html | 1 + .../micro-frame-sse/__tests__/server.test.ts | 14 ++++++ .../web.component.ts | 6 ++- 16 files changed, 314 insertions(+), 2 deletions(-) create mode 100644 src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.0.html create mode 100644 src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.1.html create mode 100644 src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.2.html create mode 100644 src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.3.html create mode 100644 src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.4.html create mode 100644 src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/step-0.0.html create mode 100644 src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/step-0.1.html create mode 100644 src/components/micro-frame-sse/__tests__/fixtures/ssr-no-refresh/components/app.marko create mode 100644 src/components/micro-frame-sse/__tests__/fixtures/ssr-no-refresh/embed.marko create mode 100644 src/components/micro-frame-sse/__tests__/fixtures/ssr-no-refresh/embed_2.marko create mode 100644 src/components/micro-frame-sse/__tests__/fixtures/ssr-no-refresh/index.marko create mode 100644 src/components/micro-frame-sse/__tests__/fixtures/ssr-no-refresh/slot_1.html create mode 100644 src/components/micro-frame-sse/__tests__/fixtures/ssr-no-refresh/slot_2.html diff --git a/src/components/micro-frame-slot/marko-tag.json b/src/components/micro-frame-slot/marko-tag.json index ce5d990..99c6c89 100644 --- a/src/components/micro-frame-slot/marko-tag.json +++ b/src/components/micro-frame-slot/marko-tag.json @@ -50,6 +50,14 @@ } ] }, + "@no-refresh": { + "type": "boolean", + "autocomplete": [ + { + "description": "Flag to disable slot content refresh after stream src change." + } + ] + }, "@class": { "autocomplete": [ { diff --git a/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.0.html b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.0.html new file mode 100644 index 0000000..721429b --- /dev/null +++ b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.0.html @@ -0,0 +1,19 @@ +
+ Host app +
+ +
+
+
\ No newline at end of file diff --git a/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.1.html b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.1.html new file mode 100644 index 0000000..99f8541 --- /dev/null +++ b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.1.html @@ -0,0 +1,23 @@ +
+ Host app +
+ +
+
+
+

+ test_html for slot_1 +

+
\ No newline at end of file diff --git a/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.2.html b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.2.html new file mode 100644 index 0000000..808df14 --- /dev/null +++ b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.2.html @@ -0,0 +1,24 @@ +
+ Host app +
+ +
+
+
+

+ test_html for slot_1 +

+ next chunk for slot_1 +
\ No newline at end of file diff --git a/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.3.html b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.3.html new file mode 100644 index 0000000..8b18766 --- /dev/null +++ b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-no-refresh/renders.expected/loading.3.html @@ -0,0 +1,48 @@ +
+ Host app +
+ +
+
+
+

+ test_html for slot_1 +

+ next chunk for slot_1 +
+
+

+ test_html for slot_2 +

+
+ +