Skip to content

Commit ac137df

Browse files
committed
refactor(dev-middleware): allow inspector proxy implementation modifications
1 parent 324def9 commit ac137df

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

packages/dev-middleware/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"directory": "packages/dev-middleware"
1515
},
1616
"license": "MIT",
17+
"exports": {
18+
".": "./src/index.js",
19+
"./package.json": "./package.json"
20+
},
1721
"files": [
1822
"dist"
1923
],

packages/dev-middleware/src/createDevMiddleware.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ type Options = $ReadOnly<{
5959
* This is an unstable API with no semver guarantees.
6060
*/
6161
unstable_experiments?: ExperimentsConfig,
62+
63+
/**
64+
* An interface for using a modified inspector proxy implementation.
65+
*
66+
* This is an unstable API with no semver guarantees.
67+
*/
68+
unstable_InspectorProxy?: Class<InspectorProxy>,
6269
}>;
6370

6471
type DevMiddlewareAPI = $ReadOnly<{
@@ -73,10 +80,11 @@ export default function createDevMiddleware({
7380
unstable_browserLauncher = DefaultBrowserLauncher,
7481
unstable_eventReporter,
7582
unstable_experiments: experimentConfig = {},
83+
unstable_InspectorProxy = InspectorProxy,
7684
}: Options): DevMiddlewareAPI {
7785
const experiments = getExperiments(experimentConfig);
7886

79-
const inspectorProxy = new InspectorProxy(
87+
const inspectorProxy = new unstable_InspectorProxy(
8088
projectRoot,
8189
serverBaseUrl,
8290
unstable_eventReporter,

packages/dev-middleware/src/index.flow.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ export {default as createDevMiddleware} from './createDevMiddleware';
1313

1414
export type {BrowserLauncher, LaunchedBrowser} from './types/BrowserLauncher';
1515
export type {EventReporter, ReportableEvent} from './types/EventReporter';
16+
17+
export {InspectorProxy as unstable_InspectorProxy} from './inspector-proxy/InspectorProxy';
18+
export {Device as unstable_Device} from './inspector-proxy/Device';

0 commit comments

Comments
 (0)