From aa1b23da32a550aff12a6d0bd866b09b815e19be Mon Sep 17 00:00:00 2001 From: eps1lon Date: Thu, 18 Jul 2024 18:38:49 +0200 Subject: [PATCH] Add `findSourceMapURL` to `ReactNoopFlightClient` --- .../react-noop-renderer/src/ReactNoopFlightClient.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/react-noop-renderer/src/ReactNoopFlightClient.js b/packages/react-noop-renderer/src/ReactNoopFlightClient.js index 4065bd495797b..81709754df67e 100644 --- a/packages/react-noop-renderer/src/ReactNoopFlightClient.js +++ b/packages/react-noop-renderer/src/ReactNoopFlightClient.js @@ -14,6 +14,8 @@ * environment. */ +import type {FindSourceMapURLCallback} from 'react-client/flight'; + import {readModule} from 'react-noop-renderer/flight-modules'; import ReactFlightClient from 'react-client/flight'; @@ -49,7 +51,11 @@ const {createResponse, processBinaryChunk, getRoot, close} = ReactFlightClient({ }, }); -function read(source: Source): Thenable { +type ReadOptions = {| + findSourceMapURL?: FindSourceMapURLCallback, +|}; + +function read(source: Source, options: ReadOptions): Thenable { const response = createResponse( source, null, @@ -57,7 +63,7 @@ function read(source: Source): Thenable { undefined, undefined, undefined, - undefined, + options !== undefined ? options.findSourceMapURL : undefined, true, ); for (let i = 0; i < source.length; i++) {