diff --git a/src/components/micro-frame-slot/marko-tag.json b/src/components/micro-frame-slot/marko-tag.json index e259d7f..ce5d990 100644 --- a/src/components/micro-frame-slot/marko-tag.json +++ b/src/components/micro-frame-slot/marko-tag.json @@ -17,10 +17,9 @@ ] }, "@client-reorder": { - "type": "boolean", "autocomplete": [ { - "description": "See client-reorder in ", + "description": "See client-reorder in . Also support additional 'after-first-chunk' value.", "descriptionMoreURL": "https://markojs.com/docs/core-tags/#await" } ] diff --git a/src/components/micro-frame-sse/README.md b/src/components/micro-frame-sse/README.md index baa8aeb..c2c6d71 100644 --- a/src/components/micro-frame-sse/README.md +++ b/src/components/micro-frame-sse/README.md @@ -189,6 +189,14 @@ Flag indicate if the slot need to be streamed out-of-order. Please refer to [cli ``` +### `client-reorder="after-first-chunk"` + +There is an additional value supported here which is `after-first-chunk`. When set, the slot will be rendered in-order before first chunk and will convert to out-of-order while streaming. This is useful when loading indicator is controlled inside stream. + +```marko + +``` + ## `timeout` in slot A timeout in `ms` (defaults to 30s) that will prematurely abort the slot. This will trigger the `<@catch>` if provided. diff --git a/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-reorder-after-first-chunk/renders.expected/loading.0.html b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-reorder-after-first-chunk/renders.expected/loading.0.html new file mode 100644 index 0000000..fa43e92 --- /dev/null +++ b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-reorder-after-first-chunk/renders.expected/loading.0.html @@ -0,0 +1,16 @@ +
+ Host app +
+
+
+
\ No newline at end of file diff --git a/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-reorder-after-first-chunk/renders.expected/loading.1.html b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-reorder-after-first-chunk/renders.expected/loading.1.html new file mode 100644 index 0000000..09091ab --- /dev/null +++ b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-reorder-after-first-chunk/renders.expected/loading.1.html @@ -0,0 +1,44 @@ +
+ Host app +
+
+
+
+

+ test_html for slot_1 +

+
+
+
+non-reorder data + + \ No newline at end of file diff --git a/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-reorder-after-first-chunk/renders.expected/loading.2.html b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-reorder-after-first-chunk/renders.expected/loading.2.html new file mode 100644 index 0000000..085f796 --- /dev/null +++ b/src/components/micro-frame-sse/__tests__/__snapshots__/micro-frame-sse/ssr-reorder-after-first-chunk/renders.expected/loading.2.html @@ -0,0 +1,40 @@ +
+ Host app +
+
+
+
+

+ test_html for slot_1 +

+
+
+
+non-reorder data +