Skip to content

Commit

Permalink
refactor(dev-middleware): allow inspector proxy implementation modifi…
Browse files Browse the repository at this point in the history
…cations
  • Loading branch information
byCedric committed Nov 9, 2023
1 parent 324def9 commit ac137df
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/dev-middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"directory": "packages/dev-middleware"
},
"license": "MIT",
"exports": {
".": "./src/index.js",
"./package.json": "./package.json"
},
"files": [
"dist"
],
Expand Down
10 changes: 9 additions & 1 deletion packages/dev-middleware/src/createDevMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<InspectorProxy>,
}>;

type DevMiddlewareAPI = $ReadOnly<{
Expand All @@ -73,10 +80,11 @@ export default function createDevMiddleware({
unstable_browserLauncher = DefaultBrowserLauncher,
unstable_eventReporter,
unstable_experiments: experimentConfig = {},
unstable_InspectorProxy = InspectorProxy,
}: Options): DevMiddlewareAPI {
const experiments = getExperiments(experimentConfig);

const inspectorProxy = new InspectorProxy(
const inspectorProxy = new unstable_InspectorProxy(
projectRoot,
serverBaseUrl,
unstable_eventReporter,
Expand Down
3 changes: 3 additions & 0 deletions packages/dev-middleware/src/index.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {InspectorProxy as unstable_InspectorProxy} from './inspector-proxy/InspectorProxy';
export {Device as unstable_Device} from './inspector-proxy/Device';

0 comments on commit ac137df

Please sign in to comment.