Skip to content

Commit

Permalink
[test] Add findSourceMapURL to ReactNoopFlightClient (#30395)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored Jul 19, 2024
1 parent 66df944 commit fac78af
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/react-noop-renderer/src/ReactNoopFlightClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -49,15 +51,19 @@ const {createResponse, processBinaryChunk, getRoot, close} = ReactFlightClient({
},
});

function read<T>(source: Source): Thenable<T> {
type ReadOptions = {|
findSourceMapURL?: FindSourceMapURLCallback,
|};

function read<T>(source: Source, options: ReadOptions): Thenable<T> {
const response = createResponse(
source,
null,
undefined,
undefined,
undefined,
undefined,
undefined,
options !== undefined ? options.findSourceMapURL : undefined,
true,
);
for (let i = 0; i < source.length; i++) {
Expand Down

0 comments on commit fac78af

Please sign in to comment.