Skip to content

Commit

Permalink
feat: support onShellReady options
Browse files Browse the repository at this point in the history
  • Loading branch information
answershuto committed Sep 12, 2024
1 parent 58cbbe2 commit ad968d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/brown-forks-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ice/runtime': patch
---

feat: support onShellReady options
8 changes: 3 additions & 5 deletions packages/runtime/src/runServerApp.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import type { Location } from 'history';
import type { OnAllReadyParams } from './server/streamRender.js';
import type { OnAllReadyParams, OnShellReadyParams } from './server/streamRender.js';
import type {
AppContext,
ServerContext,
Expand Down Expand Up @@ -86,10 +86,8 @@ export async function renderToResponse(requestContext: ServerContext, renderOpti
return new Promise<void>((resolve, reject) => {
// Send stream result to ServerResponse.
pipe(res, {
onShellReady: () => {
onShellReady && onShellReady({
renderAssets: [],
});
onShellReady: (params: OnShellReadyParams) => {
onShellReady && onShellReady(params);
},
onShellError: async (err) => {
onShellError && onShellError(err);
Expand Down

0 comments on commit ad968d9

Please sign in to comment.