diff --git a/packages/dev-middleware/src/createDevMiddleware.js b/packages/dev-middleware/src/createDevMiddleware.js index 1396a7b6bd02cf..12892521e32c67 100644 --- a/packages/dev-middleware/src/createDevMiddleware.js +++ b/packages/dev-middleware/src/createDevMiddleware.js @@ -59,6 +59,13 @@ type Options = $ReadOnly<{ * This is an unstable API with no semver guarantees. */ unstable_experiments?: ExperimentsConfig, + + /** + * An interface for using a modified inspector proxy implementation. + * + * This is an unstable API with no semver guarantees. + */ + unstable_InspectorProxy?: Class, }>; type DevMiddlewareAPI = $ReadOnly<{ @@ -73,10 +80,12 @@ export default function createDevMiddleware({ unstable_browserLauncher = DefaultBrowserLauncher, unstable_eventReporter, unstable_experiments: experimentConfig = {}, + unstable_InspectorProxy, }: Options): DevMiddlewareAPI { const experiments = getExperiments(experimentConfig); - const inspectorProxy = new InspectorProxy( + const InspectorProxyClass = unstable_InspectorProxy ?? InspectorProxy; + const inspectorProxy = new InspectorProxyClass( projectRoot, serverBaseUrl, unstable_eventReporter, diff --git a/packages/dev-middleware/src/index.flow.js b/packages/dev-middleware/src/index.flow.js index 4060a2bb2d4c4d..c662838fea10ce 100644 --- a/packages/dev-middleware/src/index.flow.js +++ b/packages/dev-middleware/src/index.flow.js @@ -13,3 +13,6 @@ export {default as createDevMiddleware} from './createDevMiddleware'; export type {BrowserLauncher, LaunchedBrowser} from './types/BrowserLauncher'; export type {EventReporter, ReportableEvent} from './types/EventReporter'; + +export {default as unstable_InspectorProxy} from './inspector-proxy/InspectorProxy'; +export {default as unstable_Device} from './inspector-proxy/Device';