@remotion/bundler 3.0.0-processing.7 → 3.0.0-wrapped.210
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundler.d.ts +1 -0
- package/dist/bundler.d.ts.map +1 -1
- package/dist/bundler.js +9 -9
- package/dist/bundler.js.map +1 -1
- package/dist/env-variables.d.ts +2 -0
- package/dist/env-variables.d.ts.map +1 -0
- package/dist/env-variables.js +5 -0
- package/dist/env-variables.js.map +1 -0
- package/dist/fast-refresh/error-overlay/entry-basic.d.ts +3 -0
- package/dist/fast-refresh/error-overlay/entry-basic.d.ts.map +1 -0
- package/dist/fast-refresh/error-overlay/entry-basic.js +27 -0
- package/dist/fast-refresh/error-overlay/entry-basic.js.map +1 -0
- package/dist/fast-refresh/error-overlay/entry-devserver.d.ts +8 -0
- package/dist/fast-refresh/error-overlay/entry-devserver.d.ts.map +1 -0
- package/dist/fast-refresh/error-overlay/entry-devserver.js +36 -0
- package/dist/fast-refresh/error-overlay/entry-devserver.js.map +1 -0
- package/dist/fast-refresh/error-overlay/index.d.ts +7 -0
- package/dist/fast-refresh/error-overlay/index.d.ts.map +1 -0
- package/dist/fast-refresh/error-overlay/index.js +92 -0
- package/dist/fast-refresh/error-overlay/index.js.map +1 -0
- package/dist/fast-refresh/fast-refresh.d.ts +28 -0
- package/dist/fast-refresh/fast-refresh.d.ts.map +1 -0
- package/dist/fast-refresh/fast-refresh.js +98 -0
- package/dist/fast-refresh/fast-refresh.js.map +1 -0
- package/dist/fast-refresh/helpers.d.ts +32 -0
- package/dist/fast-refresh/helpers.d.ts.map +1 -0
- package/dist/fast-refresh/helpers.js +138 -0
- package/dist/fast-refresh/helpers.js.map +1 -0
- package/dist/fast-refresh/loader.d.ts +26 -0
- package/dist/fast-refresh/loader.d.ts.map +1 -0
- package/dist/fast-refresh/loader.js +106 -0
- package/dist/fast-refresh/loader.js.map +1 -0
- package/dist/fast-refresh/runtime.d.ts +26 -0
- package/dist/fast-refresh/runtime.d.ts.map +1 -0
- package/dist/fast-refresh/runtime.js +52 -0
- package/dist/fast-refresh/runtime.js.map +1 -0
- package/dist/hot-middleware.d.ts +28 -0
- package/dist/hot-middleware.d.ts.map +1 -0
- package/dist/hot-middleware.js +119 -0
- package/dist/hot-middleware.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/start-server.d.ts +1 -0
- package/dist/start-server.d.ts.map +1 -1
- package/dist/start-server.js +4 -2
- package/dist/start-server.js.map +1 -1
- package/dist/webpack-config.d.ts +2 -1
- package/dist/webpack-config.d.ts.map +1 -1
- package/dist/webpack-config.js +2 -1
- package/dist/webpack-config.js.map +1 -1
- package/package.json +3 -3
- package/web/index.html +1 -1
package/dist/bundler.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export declare const bundle: (entryPoint: string, onProgressUpdate?: ((progress:
|
|
|
3
3
|
webpackOverride?: WebpackOverrideFn | undefined;
|
|
4
4
|
outDir?: string | undefined;
|
|
5
5
|
enableCaching?: boolean | undefined;
|
|
6
|
+
publicPath?: string | undefined;
|
|
6
7
|
} | undefined) => Promise<string>;
|
|
7
8
|
//# sourceMappingURL=bundler.d.ts.map
|
package/dist/bundler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../src/bundler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../src/bundler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAkBtD,eAAO,MAAM,MAAM,eACN,MAAM,iCACY,MAAM,KAAK,IAAI;;;;;kBAO3C,QAAQ,MAAM,CAqChB,CAAC"}
|
package/dist/bundler.js
CHANGED
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.bundle = void 0;
|
|
7
|
-
const execa_1 = __importDefault(require("execa"));
|
|
8
7
|
const fs_1 = __importDefault(require("fs"));
|
|
9
8
|
const os_1 = __importDefault(require("os"));
|
|
10
9
|
const path_1 = __importDefault(require("path"));
|
|
@@ -22,7 +21,7 @@ const prepareOutDir = async (specified) => {
|
|
|
22
21
|
return fs_1.default.promises.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'react-motion-graphics'));
|
|
23
22
|
};
|
|
24
23
|
const bundle = async (entryPoint, onProgressUpdate, options) => {
|
|
25
|
-
var _a, _b, _c;
|
|
24
|
+
var _a, _b, _c, _d, _e;
|
|
26
25
|
const outDir = await prepareOutDir((_a = options === null || options === void 0 ? void 0 : options.outDir) !== null && _a !== void 0 ? _a : null);
|
|
27
26
|
const output = await promisified([
|
|
28
27
|
(0, webpack_config_1.webpackConfig)({
|
|
@@ -32,7 +31,8 @@ const bundle = async (entryPoint, onProgressUpdate, options) => {
|
|
|
32
31
|
environment: 'production',
|
|
33
32
|
webpackOverride: (_b = options === null || options === void 0 ? void 0 : options.webpackOverride) !== null && _b !== void 0 ? _b : remotion_1.Internals.getWebpackOverrideFn(),
|
|
34
33
|
onProgressUpdate,
|
|
35
|
-
enableCaching: (_c = options === null || options === void 0 ? void 0 : options.enableCaching) !== null && _c !== void 0 ? _c : remotion_1.Internals.
|
|
34
|
+
enableCaching: (_c = options === null || options === void 0 ? void 0 : options.enableCaching) !== null && _c !== void 0 ? _c : remotion_1.Internals.getWebpackCaching(),
|
|
35
|
+
publicPath: (_d = options === null || options === void 0 ? void 0 : options.publicPath) !== null && _d !== void 0 ? _d : '/',
|
|
36
36
|
maxTimelineTracks: 15,
|
|
37
37
|
}),
|
|
38
38
|
]);
|
|
@@ -44,12 +44,12 @@ const bundle = async (entryPoint, onProgressUpdate, options) => {
|
|
|
44
44
|
throw new Error(errors[0].message + '\n' + errors[0].details);
|
|
45
45
|
}
|
|
46
46
|
const indexHtmlDir = path_1.default.join(__dirname, '..', 'web', 'index.html');
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
const content = await fs_1.default.promises.readFile(indexHtmlDir, {
|
|
48
|
+
encoding: 'utf-8',
|
|
49
|
+
});
|
|
50
|
+
const withPublicPath = content.replace(/%PUBLIC_PATH%/g, (_e = options === null || options === void 0 ? void 0 : options.publicPath) !== null && _e !== void 0 ? _e : '/');
|
|
51
|
+
const outPath = path_1.default.join(outDir, 'index.html');
|
|
52
|
+
await fs_1.default.promises.writeFile(outPath, withPublicPath);
|
|
53
53
|
return outDir;
|
|
54
54
|
};
|
|
55
55
|
exports.bundle = bundle;
|
package/dist/bundler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../src/bundler.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../src/bundler.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AACxB,uCAAsD;AACtD,+BAA+B;AAC/B,sDAA8B;AAC9B,qDAA+C;AAE/C,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AAE/C,MAAM,WAAW,GAAG,IAAA,gBAAS,EAAC,iBAAO,CAAC,CAAC;AAEvC,MAAM,aAAa,GAAG,KAAK,EAAE,SAAwB,EAAE,EAAE;IACxD,IAAI,SAAS,EAAE;QACd,MAAM,YAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAC;QACtD,OAAO,SAAS,CAAC;KACjB;IAED,OAAO,YAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,MAAM,EAAE,EAAE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,MAAM,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,EAAE;QACxD,QAAQ,EAAE,OAAO;KACjB,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CACrC,gBAAgB,EAChB,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,mCAAI,GAAG,CAC1B,CAAC;IACF,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAChD,MAAM,YAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAErD,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AA9CW,QAAA,MAAM,UA8CjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-variables.d.ts","sourceRoot":"","sources":["../src/env-variables.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-variables.js","sourceRoot":"","sources":["../src/env-variables.ts"],"names":[],"mappings":";;AAAA,uCAAmC;AAEnC,oBAAS,CAAC,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-basic.d.ts","sourceRoot":"","sources":["../../../src/fast-refresh/error-overlay/entry-basic.ts"],"names":[],"mappings":"AACA,QAAA,MACC,gBAAgB,OAChB,2BAA2B,OAC3B,oBAAoB,KACa,CAAC;AACnC,QAAA,MAAM,oBAAoB,KAAkD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-check
|
|
3
|
+
const { setEditorHandler, startReportingRuntimeErrors, dismissRuntimeErrors, } = require('react-error-overlay');
|
|
4
|
+
const launchEditorEndpoint = require('react-dev-utils/launchEditorEndpoint');
|
|
5
|
+
setEditorHandler((errorLocation) => {
|
|
6
|
+
// Keep this sync with errorOverlayMiddleware.js
|
|
7
|
+
fetch(launchEditorEndpoint +
|
|
8
|
+
'?fileName=' +
|
|
9
|
+
window.encodeURIComponent(errorLocation.fileName) +
|
|
10
|
+
'&lineNumber=' +
|
|
11
|
+
window.encodeURIComponent(errorLocation.lineNumber || 1) +
|
|
12
|
+
'&colNumber=' +
|
|
13
|
+
window.encodeURIComponent(errorLocation.colNumber || 1));
|
|
14
|
+
});
|
|
15
|
+
startReportingRuntimeErrors({
|
|
16
|
+
onError() {
|
|
17
|
+
if (module.hot) {
|
|
18
|
+
module.hot.addStatusHandler((status) => {
|
|
19
|
+
if (status === 'apply') {
|
|
20
|
+
// window.location.reload();
|
|
21
|
+
dismissRuntimeErrors();
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=entry-basic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-basic.js","sourceRoot":"","sources":["../../../src/fast-refresh/error-overlay/entry-basic.ts"],"names":[],"mappings":";AAAA,YAAY;AACZ,MAAM,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,oBAAoB,GACpB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AACnC,MAAM,oBAAoB,GAAG,OAAO,CAAC,sCAAsC,CAAC,CAAC;AAE7E,gBAAgB,CAAC,CAAC,aAAa,EAAE,EAAE;IAClC,gDAAgD;IAChD,KAAK,CACJ,oBAAoB;QACnB,YAAY;QACZ,MAAM,CAAC,kBAAkB,CAAC,aAAa,CAAC,QAAQ,CAAC;QACjD,cAAc;QACd,MAAM,CAAC,kBAAkB,CAAC,aAAa,CAAC,UAAU,IAAI,CAAC,CAAC;QACxD,aAAa;QACb,MAAM,CAAC,kBAAkB,CAAC,aAAa,CAAC,SAAS,IAAI,CAAC,CAAC,CACxD,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,2BAA2B,CAAC;IAC3B,OAAO;QACN,IAAI,MAAM,CAAC,GAAG,EAAE;YACf,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,EAAE;gBACtC,IAAI,MAAM,KAAK,OAAO,EAAE;oBACvB,4BAA4B;oBAC5B,oBAAoB,EAAE,CAAC;iBACvB;YACF,CAAC,CAAC,CAAC;SACH;IACF,CAAC;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const querystring: any;
|
|
2
|
+
declare const url: any;
|
|
3
|
+
declare const SockJS: any;
|
|
4
|
+
declare const formatWebpackMessages: any;
|
|
5
|
+
declare const reportBuildError: any, dismissBuildError: any;
|
|
6
|
+
declare let sockOptions: {};
|
|
7
|
+
declare const connection: any;
|
|
8
|
+
//# sourceMappingURL=entry-devserver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-devserver.d.ts","sourceRoot":"","sources":["../../../src/fast-refresh/error-overlay/entry-devserver.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,WAAW,KAAyB,CAAC;AAC3C,QAAA,MAAM,GAAG,KAAiB,CAAC;AAC3B,QAAA,MAAM,MAAM,KAA2B,CAAC;AACxC,QAAA,MAAM,qBAAqB,KAAmD,CAAC;AAC/E,QAAA,MAAO,gBAAgB,OAAE,iBAAiB,KAAkC,CAAC;AAE7E,QAAA,IAAI,WAAW,IAAK,CAAC;AAKrB,QAAA,MAAM,UAAU,KAOf,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-check
|
|
3
|
+
const querystring = require('querystring');
|
|
4
|
+
const url = require('url');
|
|
5
|
+
const SockJS = require('sockjs-client');
|
|
6
|
+
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
|
|
7
|
+
const { reportBuildError, dismissBuildError } = require('react-error-overlay');
|
|
8
|
+
let sockOptions = {};
|
|
9
|
+
if (typeof __resourceQuery === 'string' && __resourceQuery.length > 1) {
|
|
10
|
+
sockOptions = querystring.parse(__resourceQuery.substr(1));
|
|
11
|
+
}
|
|
12
|
+
const connection = new SockJS(url.format({
|
|
13
|
+
protocol: window.location.protocol,
|
|
14
|
+
hostname: sockOptions.sockHost || window.location.hostname,
|
|
15
|
+
port: sockOptions.sockPort || window.location.port,
|
|
16
|
+
pathname: sockOptions.sockPath || '/sockjs-node',
|
|
17
|
+
}));
|
|
18
|
+
connection.onmessage = function onmessage(e) {
|
|
19
|
+
const { type, data } = JSON.parse(e.data);
|
|
20
|
+
let formatted;
|
|
21
|
+
switch (type) {
|
|
22
|
+
case 'ok':
|
|
23
|
+
dismissBuildError();
|
|
24
|
+
break;
|
|
25
|
+
case 'errors':
|
|
26
|
+
formatted = formatWebpackMessages({
|
|
27
|
+
errors: data,
|
|
28
|
+
warnings: [],
|
|
29
|
+
});
|
|
30
|
+
reportBuildError(formatted.errors[0]);
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
// Do nothing.
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=entry-devserver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-devserver.js","sourceRoot":"","sources":["../../../src/fast-refresh/error-overlay/entry-devserver.ts"],"names":[],"mappings":";AAAA,YAAY;AACZ,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAC3C,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAC3B,MAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AACxC,MAAM,qBAAqB,GAAG,OAAO,CAAC,uCAAuC,CAAC,CAAC;AAC/E,MAAM,EAAC,gBAAgB,EAAE,iBAAiB,EAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAE7E,IAAI,WAAW,GAAG,EAAE,CAAC;AACrB,IAAI,OAAO,eAAe,KAAK,QAAQ,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;IACtE,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3D;AAED,MAAM,UAAU,GAAG,IAAI,MAAM,CAC5B,GAAG,CAAC,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ;IAClC,QAAQ,EAAE,WAAW,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ;IAC1D,IAAI,EAAE,WAAW,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI;IAClD,QAAQ,EAAE,WAAW,CAAC,QAAQ,IAAI,cAAc;CAChD,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,SAAS,GAAG,SAAS,SAAS,CAAC,CAAC;IAC1C,MAAM,EAAC,IAAI,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,SAAS,CAAC;IACd,QAAQ,IAAI,EAAE;QACb,KAAK,IAAI;YACR,iBAAiB,EAAE,CAAC;YACpB,MAAM;QACP,KAAK,QAAQ;YACZ,SAAS,GAAG,qBAAqB,CAAC;gBACjC,MAAM,EAAE,IAAI;gBACZ,QAAQ,EAAE,EAAE;aACZ,CAAC,CAAC;YACH,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACtC,MAAM;QACP,QAAQ;QACR,cAAc;KACd;AACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import webpack from 'webpack';
|
|
2
|
+
/** @typedef {{ sockHost: string, sockPath: string, sockPort: number }} SockOptions */
|
|
3
|
+
/** @typedef {{ dependOn?: [string, ...string[]], filename?: any, import: [string, ...string[]], library?: any }} EntryDescriptionNormalized */
|
|
4
|
+
export declare class ErrorOverlayPlugin {
|
|
5
|
+
apply(compiler: webpack.Compiler): void;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fast-refresh/error-overlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAS9B,sFAAsF;AACtF,+IAA+I;AAE/I,qBAAa,kBAAkB;IAC9B,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ;CAkDhC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorOverlayPlugin = void 0;
|
|
4
|
+
// @ts-check
|
|
5
|
+
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
|
|
6
|
+
const chunkPathBasic = require.resolve('./entry-basic');
|
|
7
|
+
const chunkPathDevServer = require.resolve('./entry-devserver');
|
|
8
|
+
let deps = [];
|
|
9
|
+
/** @typedef {{ sockHost: string, sockPath: string, sockPort: number }} SockOptions */
|
|
10
|
+
/** @typedef {{ dependOn?: [string, ...string[]], filename?: any, import: [string, ...string[]], library?: any }} EntryDescriptionNormalized */
|
|
11
|
+
class ErrorOverlayPlugin {
|
|
12
|
+
apply(compiler) {
|
|
13
|
+
const className = this.constructor.name;
|
|
14
|
+
if (compiler.options.mode !== 'development') {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const devServerEnabled = Boolean(compiler.options.devServer);
|
|
18
|
+
const usingSocket = devServerEnabled && typeof compiler.options.devServer.socket === 'string';
|
|
19
|
+
/** @type { SockOptions } */
|
|
20
|
+
const sockOptions = {};
|
|
21
|
+
if (devServerEnabled && usingSocket) {
|
|
22
|
+
sockOptions.sockHost = compiler.options.devServer.sockHost;
|
|
23
|
+
sockOptions.sockPath = compiler.options.devServer.sockPath;
|
|
24
|
+
sockOptions.sockPort = compiler.options.devServer.sockPort;
|
|
25
|
+
}
|
|
26
|
+
compiler.hooks.entryOption.tap(className, (context, entry) => {
|
|
27
|
+
if (typeof entry !== 'function') {
|
|
28
|
+
Object.keys(entry).forEach((entryName) => {
|
|
29
|
+
if (deps.includes(entryName)) {
|
|
30
|
+
// Skip dependencies, only inject real entry points
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
entry[entryName] = adjustEntry(entry[entryName], devServerEnabled, usingSocket, sockOptions);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
compiler.hooks.afterResolvers.tap(className, ({ options }) => {
|
|
38
|
+
if (devServerEnabled) {
|
|
39
|
+
const originalBefore = options.devServer.before;
|
|
40
|
+
options.devServer.before = (app, server) => {
|
|
41
|
+
if (originalBefore) {
|
|
42
|
+
originalBefore(app, server);
|
|
43
|
+
}
|
|
44
|
+
app.use(errorOverlayMiddleware());
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.ErrorOverlayPlugin = ErrorOverlayPlugin;
|
|
51
|
+
/**
|
|
52
|
+
* Puts dev server chunk path in front of other entries
|
|
53
|
+
* @param {EntryDescriptionNormalized} entry
|
|
54
|
+
* @param {boolean} enableDevServer
|
|
55
|
+
* @param {boolean} usingSocket
|
|
56
|
+
* @param {SockOptions} sockOptions
|
|
57
|
+
* @returns {EntryDescriptionNormalized}
|
|
58
|
+
*/
|
|
59
|
+
function adjustEntry(entry, enableDevServer, usingSocket, sockOptions) {
|
|
60
|
+
if (entry.dependOn) {
|
|
61
|
+
deps = [...deps, ...entry.dependOn];
|
|
62
|
+
}
|
|
63
|
+
if (entry.library) {
|
|
64
|
+
// skip libraries
|
|
65
|
+
return entry;
|
|
66
|
+
}
|
|
67
|
+
if (typeof entry.import === 'string') {
|
|
68
|
+
entry.import = [entry.import];
|
|
69
|
+
}
|
|
70
|
+
if (enableDevServer && usingSocket) {
|
|
71
|
+
const sockHost = sockOptions.sockHost
|
|
72
|
+
? ` & sockHost = ${sockOptions.sockHost}`
|
|
73
|
+
: '';
|
|
74
|
+
const sockPath = sockOptions.sockPath
|
|
75
|
+
? ` & sockPath = ${sockOptions.sockPath}`
|
|
76
|
+
: '';
|
|
77
|
+
const sockPort = sockOptions.sockPort
|
|
78
|
+
? ` & sockPort = ${sockOptions.sockPort}`
|
|
79
|
+
: '';
|
|
80
|
+
const chunkPathDevServerWithParams = `${chunkPathDevServer} ? ${sockHost}
|
|
81
|
+
${sockPath}
|
|
82
|
+
${sockPort}`;
|
|
83
|
+
if (!entry.import.includes(chunkPathDevServerWithParams)) {
|
|
84
|
+
entry.import.unshift(chunkPathDevServerWithParams);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (!entry.import.includes(chunkPathBasic)) {
|
|
88
|
+
entry.import.unshift(chunkPathBasic);
|
|
89
|
+
}
|
|
90
|
+
return entry;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fast-refresh/error-overlay/index.ts"],"names":[],"mappings":";;;AAEA,YAAY;AACZ,MAAM,sBAAsB,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AAEjF,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AACxD,MAAM,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAChE,IAAI,IAAI,GAAG,EAAE,CAAC;AAEd,sFAAsF;AACtF,+IAA+I;AAE/I,MAAa,kBAAkB;IAC9B,KAAK,CAAC,QAA0B;QAC/B,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAExC,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,aAAa,EAAE;YAC5C,OAAO;SACP;QAED,MAAM,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC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,CAAC,4BAA4B,CAAC,CAAC;SACnD;KACD;IAED,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE;QAC3C,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;KACrC;IAED,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2020 Vercel, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import webpack from 'webpack';
|
|
25
|
+
export declare class ReactFreshWebpackPlugin {
|
|
26
|
+
apply(compiler: webpack.Compiler): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=fast-refresh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fast-refresh.d.ts","sourceRoot":"","sources":["../../src/fast-refresh/fast-refresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,OAAO,MAAM,SAAS,CAAC;AA2C9B,qBAAa,uBAAuB;IACnC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ;CAkDhC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The MIT License (MIT)
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2020 Vercel, Inc.
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ReactFreshWebpackPlugin = void 0;
|
|
27
|
+
// This file is copied from the @vercel/next.js, with removed TS annotations
|
|
28
|
+
// minor tweaks, and removed all webpack v4-related functionality
|
|
29
|
+
//
|
|
30
|
+
// https://github.com/vercel/next.js/blob/canary/packages/react-refresh-utils/ReactRefreshWebpackPlugin.ts
|
|
31
|
+
const { Template, RuntimeModule, RuntimeGlobals, version } = require('webpack');
|
|
32
|
+
class ReactRefreshRuntimeModule extends RuntimeModule {
|
|
33
|
+
constructor() {
|
|
34
|
+
super('react refresh', 5);
|
|
35
|
+
}
|
|
36
|
+
generate() {
|
|
37
|
+
const { runtimeTemplate } = this.compilation;
|
|
38
|
+
return Template.asString([
|
|
39
|
+
`${RuntimeGlobals.interceptModuleExecution}.push(${runtimeTemplate.basicFunction('options', [
|
|
40
|
+
`const originalFactory = options.factory;`,
|
|
41
|
+
`options.factory = ${runtimeTemplate.basicFunction('moduleObject, moduleExports, webpackRequire', [
|
|
42
|
+
// Legacy CSS implementations will `eval` browser code in a Node.js
|
|
43
|
+
// context to extract CSS. For backwards compatibility, we need to check
|
|
44
|
+
// we're in a browser context before continuing.
|
|
45
|
+
`const hasRefresh = typeof self !== "undefined" && !!self.$RefreshInterceptModuleExecution$;`,
|
|
46
|
+
`const cleanup = hasRefresh ? self.$RefreshInterceptModuleExecution$(moduleObject.id) : () => {};`,
|
|
47
|
+
'try {',
|
|
48
|
+
Template.indent('originalFactory.call(this, moduleObject, moduleExports, webpackRequire);'),
|
|
49
|
+
'} finally {',
|
|
50
|
+
Template.indent(`cleanup();`),
|
|
51
|
+
'}',
|
|
52
|
+
])}`,
|
|
53
|
+
])})`,
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
class ReactFreshWebpackPlugin {
|
|
58
|
+
apply(compiler) {
|
|
59
|
+
// eslint-disable-next-line no-eq-null
|
|
60
|
+
const webpackMajorVersion = parseInt(version == null ? '' : version, 10);
|
|
61
|
+
if (webpackMajorVersion < 5) {
|
|
62
|
+
throw new Error(`ReactFreshWebpackPlugin does not support webpack v${webpackMajorVersion}.`);
|
|
63
|
+
}
|
|
64
|
+
compiler.hooks.beforeCompile.tap(this.constructor.name, (file) => {
|
|
65
|
+
console.log('before compile', Date.now());
|
|
66
|
+
});
|
|
67
|
+
compiler.hooks.done.tap(this.constructor.name, (file) => {
|
|
68
|
+
console.log('DONE', Date.now());
|
|
69
|
+
});
|
|
70
|
+
compiler.hooks.emit.tap(this.constructor.name, (file) => {
|
|
71
|
+
console.log('EMITTED', Date.now(), file.assets);
|
|
72
|
+
});
|
|
73
|
+
compiler.hooks.compilation.tap(this.constructor.name, (compilation) => {
|
|
74
|
+
console.log('TAPPING', Date.now());
|
|
75
|
+
compilation.hooks.rebuildModule.tap('ggg', () => {
|
|
76
|
+
console.log('rebuilt');
|
|
77
|
+
});
|
|
78
|
+
compilation.mainTemplate.hooks.localVars.tap(this.constructor.name, (source) => Template.asString([
|
|
79
|
+
source,
|
|
80
|
+
'',
|
|
81
|
+
'// noop fns to prevent runtime errors during initialization',
|
|
82
|
+
'if (typeof self !== "undefined") {',
|
|
83
|
+
Template.indent('self.$RefreshReg$ = function () {};'),
|
|
84
|
+
Template.indent('self.$RefreshSig$ = function () {'),
|
|
85
|
+
Template.indent(Template.indent('return function (type) {')),
|
|
86
|
+
Template.indent(Template.indent(Template.indent('return type;'))),
|
|
87
|
+
Template.indent(Template.indent('};')),
|
|
88
|
+
Template.indent('};'),
|
|
89
|
+
'}',
|
|
90
|
+
]));
|
|
91
|
+
compilation.hooks.additionalTreeRuntimeRequirements.tap(this.constructor.name, (chunk) => {
|
|
92
|
+
compilation.addRuntimeModule(chunk, new ReactRefreshRuntimeModule());
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.ReactFreshWebpackPlugin = ReactFreshWebpackPlugin;
|
|
98
|
+
//# sourceMappingURL=fast-refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fast-refresh.js","sourceRoot":"","sources":["../../src/fast-refresh/fast-refresh.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAIH,4EAA4E;AAC5E,iEAAiE;AACjE,EAAE;AACF,0GAA0G;AAE1G,MAAM,EAAC,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,OAAO,EAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAE9E,MAAM,yBAA0B,SAAQ,aAAa;IACpD;QACC,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED,QAAQ;QACP,MAAM,EAAC,eAAe,EAAC,GAAG,IAAI,CAAC,WAAW,CAAC;QAC3C,OAAO,QAAQ,CAAC,QAAQ,CAAC;YACxB,GACC,cAAc,CAAC,wBAChB,SAAS,eAAe,CAAC,aAAa,CAAC,SAAS,EAAE;gBACjD,0CAA0C;gBAC1C,qBAAqB,eAAe,CAAC,aAAa,CACjD,6CAA6C,EAC7C;oBACC,mEAAmE;oBACnE,wEAAwE;oBACxE,gDAAgD;oBAChD,6FAA6F;oBAC7F,kGAAkG;oBAClG,OAAO;oBACP,QAAQ,CAAC,MAAM,CACd,0EAA0E,CAC1E;oBACD,aAAa;oBACb,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC;oBAC7B,GAAG;iBACH,CACD,EAAE;aACH,CAAC,GAAG;SACL,CAAC,CAAC;IACJ,CAAC;CACD;AAED,MAAa,uBAAuB;IACnC,KAAK,CAAC,QAA0B;QAC/B,sCAAsC;QACtC,MAAM,mBAAmB,GAAG,QAAQ,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,EA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CAAC,GAAG,CAC3C,IAAI,CAAC,WAAW,CAAC,IAAI,EACrB,CAAC,MAAW,EAAE,EAAE,CACf,QAAQ,CAAC,QAAQ,CAAC;gBACjB,MAAM;gBACN,EAAE;gBACF,6DAA6D;gBAC7D,oCAAoC;gBACpC,QAAQ,CAAC,MAAM,CAAC,qCAAqC,CAAC;gBACtD,QAAQ,CAAC,MAAM,CAAC,mCAAmC,CAAC;gBACpD,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;gBAC5D,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;gBACjE,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACtC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;gBACrB,GAAG;aACH,CAAC,CACH,CAAC;YAEF,WAAW,CAAC,KAAK,CAAC,iCAAiC,CAAC,GAAG,CACtD,IAAI,CAAC,WAAW,CAAC,IAAI,EACrB,CAAC,KAAU,EAAE,EAAE;gBACd,WAAW,CAAC,gBAAgB,CAAC,KAAK,EAAE,IAAI,yBAAyB,EAAE,CAAC,CAAC;YACtE,CAAC,CACD,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAnDD,0DAmDC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
declare const RefreshRuntime: any;
|
|
25
|
+
declare function isSafeExport(key: any): boolean;
|
|
26
|
+
declare function registerExportsForReactRefresh(moduleExports: any, moduleID: any): void;
|
|
27
|
+
declare function isReactRefreshBoundary(moduleExports: any): boolean;
|
|
28
|
+
declare function shouldInvalidateReactRefreshBoundary(prevExports: any, nextExports: any): boolean;
|
|
29
|
+
declare function getRefreshBoundarySignature(moduleExports: any): any[];
|
|
30
|
+
declare let isUpdateScheduled: boolean;
|
|
31
|
+
declare function scheduleUpdate(): void;
|
|
32
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/fast-refresh/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,QAAA,MAAM,cAAc,KAAmC,CAAC;AAExD,iBAAS,YAAY,CAAC,GAAG,KAAA,WAQxB;AAED,iBAAS,8BAA8B,CAAC,aAAa,KAAA,EAAE,QAAQ,KAAA,QAiB9D;AAED,iBAAS,sBAAsB,CAAC,aAAa,KAAA,WAyB5C;AAED,iBAAS,oCAAoC,CAAC,WAAW,KAAA,EAAE,WAAW,KAAA,WAcrE;AAED,iBAAS,2BAA2B,CAAC,aAAa,KAAA,SAoBjD;AAED,QAAA,IAAI,iBAAiB,SAAQ,CAAC;AAC9B,iBAAS,cAAc,SA6BtB"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
// This file is copied from the Metro JavaScript bundler, with minor tweaks for
|
|
26
|
+
// webpack compatibility.
|
|
27
|
+
//
|
|
28
|
+
// https://github.com/facebook/metro/blob/d6b9685c730d0d63577db40f41369157f28dfa3a/packages/metro/src/lib/polyfills/require.js
|
|
29
|
+
const RefreshRuntime = require('react-refresh/runtime');
|
|
30
|
+
function isSafeExport(key) {
|
|
31
|
+
return (key === '__esModule' ||
|
|
32
|
+
key === '__N_SSG' ||
|
|
33
|
+
key === '__N_SSP' ||
|
|
34
|
+
// TODO: remove this key from page config instead of allow listing it
|
|
35
|
+
key === 'config');
|
|
36
|
+
}
|
|
37
|
+
function registerExportsForReactRefresh(moduleExports, moduleID) {
|
|
38
|
+
RefreshRuntime.register(moduleExports, moduleID + ' %exports%');
|
|
39
|
+
if (moduleExports == null || typeof moduleExports !== 'object') {
|
|
40
|
+
// Exit if we can't iterate over exports.
|
|
41
|
+
// (This is important for legacy environments.)
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
for (const key in moduleExports) {
|
|
45
|
+
if (isSafeExport(key)) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const exportValue = moduleExports[key];
|
|
49
|
+
const typeID = moduleID + ' %exports% ' + key;
|
|
50
|
+
RefreshRuntime.register(exportValue, typeID);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function isReactRefreshBoundary(moduleExports) {
|
|
54
|
+
if (RefreshRuntime.isLikelyComponentType(moduleExports)) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
if (moduleExports == null || typeof moduleExports !== 'object') {
|
|
58
|
+
// Exit if we can't iterate over exports.
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
let hasExports = false;
|
|
62
|
+
let areAllExportsComponents = true;
|
|
63
|
+
for (const key in moduleExports) {
|
|
64
|
+
hasExports = true;
|
|
65
|
+
if (isSafeExport(key)) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const exportValue = moduleExports[key];
|
|
69
|
+
if (!RefreshRuntime.isLikelyComponentType(exportValue)) {
|
|
70
|
+
areAllExportsComponents = false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return hasExports && areAllExportsComponents;
|
|
74
|
+
}
|
|
75
|
+
function shouldInvalidateReactRefreshBoundary(prevExports, nextExports) {
|
|
76
|
+
const prevSignature = getRefreshBoundarySignature(prevExports);
|
|
77
|
+
const nextSignature = getRefreshBoundarySignature(nextExports);
|
|
78
|
+
if (prevSignature.length !== nextSignature.length) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
for (let i = 0; i < nextSignature.length; i++) {
|
|
82
|
+
if (prevSignature[i] !== nextSignature[i]) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
function getRefreshBoundarySignature(moduleExports) {
|
|
89
|
+
const signature = [];
|
|
90
|
+
signature.push(RefreshRuntime.getFamilyByType(moduleExports));
|
|
91
|
+
if (moduleExports == null || typeof moduleExports !== 'object') {
|
|
92
|
+
// Exit if we can't iterate over exports.
|
|
93
|
+
// (This is important for legacy environments.)
|
|
94
|
+
return signature;
|
|
95
|
+
}
|
|
96
|
+
for (const key in moduleExports) {
|
|
97
|
+
if (isSafeExport(key)) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
const exportValue = moduleExports[key];
|
|
101
|
+
signature.push(key);
|
|
102
|
+
signature.push(RefreshRuntime.getFamilyByType(exportValue));
|
|
103
|
+
}
|
|
104
|
+
return signature;
|
|
105
|
+
}
|
|
106
|
+
let isUpdateScheduled = false;
|
|
107
|
+
function scheduleUpdate() {
|
|
108
|
+
if (isUpdateScheduled) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
function canApplyUpdate() {
|
|
112
|
+
return module.hot.status() === 'idle';
|
|
113
|
+
}
|
|
114
|
+
isUpdateScheduled = true;
|
|
115
|
+
setTimeout(() => {
|
|
116
|
+
isUpdateScheduled = false;
|
|
117
|
+
// Only trigger refresh if the webpack HMR state is idle
|
|
118
|
+
if (canApplyUpdate()) {
|
|
119
|
+
try {
|
|
120
|
+
RefreshRuntime.performReactRefresh();
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
console.warn('Warning: Failed to re-render. We will retry on the next Fast Refresh event.\n' +
|
|
124
|
+
err);
|
|
125
|
+
}
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
return scheduleUpdate();
|
|
129
|
+
}, 30);
|
|
130
|
+
}
|
|
131
|
+
module.exports = {
|
|
132
|
+
registerExportsForReactRefresh,
|
|
133
|
+
isReactRefreshBoundary,
|
|
134
|
+
shouldInvalidateReactRefreshBoundary,
|
|
135
|
+
getRefreshBoundarySignature,
|
|
136
|
+
scheduleUpdate,
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/fast-refresh/helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,+EAA+E;AAC/E,yBAAyB;AACzB,EAAE;AACF,8HAA8H;AAE9H,MAAM,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAExD,SAAS,YAAY,CAAC,GAAG;IACxB,OAAO,CACN,GAAG,KAAK,YAAY;QACpB,GAAG,KAAK,SAAS;QACjB,GAAG,KAAK,SAAS;QACjB,qEAAqE;QACrE,GAAG,KAAK,QAAQ,CAChB,CAAC;AACH,CAAC;AAED,SAAS,8BAA8B,CAAC,aAAa,EAAE,QAAQ;IAC9D,cAAc,CAAC,QAAQ,CAAC,aAAa,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC;IAChE,IAAI,aAAa,IAAI,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QAC/D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