Skip to content

Commit

Permalink
add noScripts option for renderToStringAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Oct 25, 2023
1 parent 021b34b commit e09e255
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/dom-expressions/src/server.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function renderToStringAsync<T>(
nonce?: string;
renderId?: string;
event?: RequestEvent;
noScripts?: boolean;
onError?: (err: any) => void;
}
): Promise<string>;
Expand Down
3 changes: 2 additions & 1 deletion packages/dom-expressions/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ export function renderToStringAsync(code, options = {}) {
}

export function renderToStream(code, options = {}) {
let { nonce, onCompleteShell, onCompleteAll, renderId } = options;
let { nonce, onCompleteShell, onCompleteAll, renderId, noScripts } = options;
let dispose;
const blockingPromises = [];
const pushTask = task => {
if (noScripts) return;
// TODO is the correct place to put this
if (!tasks && !firstFlushed) {
tasks = getLocalHeaderScript(renderId);
Expand Down

0 comments on commit e09e255

Please sign in to comment.