Remove experimental support for Hermes Modules (CommonJS)

Summary: Changelog: [Internal]

Reviewed By: jacdebug

Differential Revision: D41736222

fbshipit-source-id: 05c03ff31072416f7ee81baccb8a4efd2c8baa85
This commit is contained in:
Moti Zilberman
2022-12-09 04:00:31 -08:00
committed by Facebook GitHub Bot
parent 006527fea7
commit 340c046c2e
-41
View File
@@ -11,7 +11,6 @@
'use strict';
export type FetchSegmentFunction = typeof __fetchSegment;
export type GetSegmentFunction = typeof __getSegment;
/**
* Set up SegmentFetcher.
@@ -51,43 +50,3 @@ function __fetchSegment(
}
global.__fetchSegment = __fetchSegment;
function __getSegment(
segmentId: number,
options: $ReadOnly<{
otaBuildNumber: ?string,
requestedModuleName: string,
segmentHash: string,
}>,
callback: (?Error, ?string) => void,
) {
const SegmentFetcher =
require('./SegmentFetcher/NativeSegmentFetcher').default;
if (!SegmentFetcher.getSegment) {
throw new Error('SegmentFetcher.getSegment must be defined');
}
SegmentFetcher.getSegment(
segmentId,
options,
(
errorObject: ?{
message: string,
code: string,
...
},
path: ?string,
) => {
if (errorObject) {
const error = new Error(errorObject.message);
(error: any).code = errorObject.code; // flowlint-line unclear-type: off
callback(error);
}
callback(null, path);
},
);
}
global.__getSegment = __getSegment;