From 3c295522c5bde1ece1b66a26091eb8182bb54af3 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 10 Dec 2020 03:45:50 +0000 Subject: [PATCH] Tighten the types --- .../src/ReactFlightWebpackNodeLoader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-server-dom-webpack/src/ReactFlightWebpackNodeLoader.js b/packages/react-server-dom-webpack/src/ReactFlightWebpackNodeLoader.js index c33648cab2d16..db618f0eb17e2 100644 --- a/packages/react-server-dom-webpack/src/ReactFlightWebpackNodeLoader.js +++ b/packages/react-server-dom-webpack/src/ReactFlightWebpackNodeLoader.js @@ -18,7 +18,7 @@ type ResolveFunction = ( string, ResolveContext, ResolveFunction, -) => Promise<{url: string}>; +) => {url: string} | Promise<{url: string}>; type GetSourceContext = { format: string, @@ -133,7 +133,7 @@ function addExportNames(names, node) { function resolveClientImport( specifier: string, parentURL: string, -): Promise<{url: string}> { +): {url: string} | Promise<{url: string}> { // Resolve an import specifier as if it was loaded by the client. This doesn't use // the overrides that this loader does but instead reverts to the default. // This resolution algorithm will not necessarily have the same configuration