@lynx-js/chunk-loading-webpack-plugin-canary 0.1.6
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/CHANGELOG.md +43 -0
- package/LICENSE.txt +202 -0
- package/README.md +3 -0
- package/lib/ChunkLoadingRspackPlugin.d.ts +53 -0
- package/lib/ChunkLoadingRspackPlugin.js +115 -0
- package/lib/ChunkLoadingRspackPlugin.js.map +1 -0
- package/lib/ChunkLoadingRuntimeModule.d.ts +4 -0
- package/lib/ChunkLoadingRuntimeModule.js +64 -0
- package/lib/ChunkLoadingRuntimeModule.js.map +1 -0
- package/lib/ChunkLoadingWebpackPlugin.d.ts +9 -0
- package/lib/ChunkLoadingWebpackPlugin.js +108 -0
- package/lib/ChunkLoadingWebpackPlugin.js.map +1 -0
- package/lib/CssChunkLoadingRuntimeModule.d.ts +4 -0
- package/lib/CssChunkLoadingRuntimeModule.js +33 -0
- package/lib/CssChunkLoadingRuntimeModule.js.map +1 -0
- package/lib/index.d.ts +65 -0
- package/lib/index.js +67 -0
- package/lib/index.js.map +1 -0
- package/lib/runtime/CssRuntimeModule.d.ts +1 -0
- package/lib/runtime/CssRuntimeModule.js +41 -0
- package/lib/runtime/CssRuntimeModule.js.map +1 -0
- package/lib/runtime/JavaScriptRuntimeModule.d.ts +1 -0
- package/lib/runtime/JavaScriptRuntimeModule.js +75 -0
- package/lib/runtime/JavaScriptRuntimeModule.js.map +1 -0
- package/lib/runtime/css/chunk-loading.d.ts +1 -0
- package/lib/runtime/css/chunk-loading.js +25 -0
- package/lib/runtime/css/chunk-loading.js.map +1 -0
- package/lib/runtime/css/hmr-load-chunk.d.ts +1 -0
- package/lib/runtime/css/hmr-load-chunk.js +14 -0
- package/lib/runtime/css/hmr-load-chunk.js.map +1 -0
- package/lib/runtime/css/load-style.d.ts +1 -0
- package/lib/runtime/css/load-style.js +16 -0
- package/lib/runtime/css/load-style.js.map +1 -0
- package/lib/runtime/helper.d.ts +6 -0
- package/lib/runtime/helper.js +38 -0
- package/lib/runtime/helper.js.map +1 -0
- package/lib/runtime/javascript/chunk-loading.d.ts +1 -0
- package/lib/runtime/javascript/chunk-loading.js +60 -0
- package/lib/runtime/javascript/chunk-loading.js.map +1 -0
- package/lib/runtime/javascript/chunk-onload.d.ts +1 -0
- package/lib/runtime/javascript/chunk-onload.js +15 -0
- package/lib/runtime/javascript/chunk-onload.js.map +1 -0
- package/lib/runtime/javascript/hmr-load-chunk.d.ts +1 -0
- package/lib/runtime/javascript/hmr-load-chunk.js +32 -0
- package/lib/runtime/javascript/hmr-load-chunk.js.map +1 -0
- package/lib/runtime/javascript/hmr-load-manifest.d.ts +1 -0
- package/lib/runtime/javascript/hmr-load-manifest.js +20 -0
- package/lib/runtime/javascript/hmr-load-manifest.js.map +1 -0
- package/lib/runtime/javascript/hmr-runtime.d.ts +1 -0
- package/lib/runtime/javascript/hmr-runtime.js +445 -0
- package/lib/runtime/javascript/hmr-runtime.js.map +1 -0
- package/lib/runtime/javascript/install-chunk.d.ts +1 -0
- package/lib/runtime/javascript/install-chunk.js +26 -0
- package/lib/runtime/javascript/install-chunk.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CssRuntimeModule } from './runtime/CssRuntimeModule.js';
|
|
2
|
+
import { getCssChunkObject } from './runtime/helper.js';
|
|
3
|
+
export function createCssChunkLoadingRuntimeModule(webpack) {
|
|
4
|
+
const { RuntimeModule, RuntimeGlobals, Template } = webpack;
|
|
5
|
+
return class CssChunkLoadingRuntimeModule extends RuntimeModule {
|
|
6
|
+
runtimeRequirements;
|
|
7
|
+
constructor(runtimeRequirements) {
|
|
8
|
+
super('Lynx css loading', 10);
|
|
9
|
+
this.runtimeRequirements = runtimeRequirements;
|
|
10
|
+
this.runtimeRequirements = runtimeRequirements;
|
|
11
|
+
}
|
|
12
|
+
generate() {
|
|
13
|
+
const { chunk, runtimeRequirements } = this;
|
|
14
|
+
const chunkMap = getCssChunkObject(chunk, this.compilation);
|
|
15
|
+
const withLoading = runtimeRequirements.has(RuntimeGlobals.ensureChunkHandlers)
|
|
16
|
+
&& Object.keys(chunkMap).length > 0;
|
|
17
|
+
const withHmr = runtimeRequirements.has(RuntimeGlobals.hmrDownloadUpdateHandlers);
|
|
18
|
+
if (!withLoading && !withHmr) {
|
|
19
|
+
return '';
|
|
20
|
+
}
|
|
21
|
+
return Template.asString([
|
|
22
|
+
CssRuntimeModule.generateLoadStyleRuntime(),
|
|
23
|
+
'',
|
|
24
|
+
withLoading
|
|
25
|
+
? CssRuntimeModule.generateChunkLoadingRuntime(chunkMap, chunk.ids ?? [])
|
|
26
|
+
: '// no chunk loading',
|
|
27
|
+
'',
|
|
28
|
+
withHmr ? CssRuntimeModule.generateHMRLoadChunkRuntime() : '// no hmr',
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=CssChunkLoadingRuntimeModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CssChunkLoadingRuntimeModule.js","sourceRoot":"","sources":["../src/CssChunkLoadingRuntimeModule.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAMxD,MAAM,UAAU,kCAAkC,CAChD,OAAiC;IAEjC,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAE5D,OAAO,MAAM,4BAA6B,SAAQ,aAAa;QAC1C;QAAnB,YAAmB,mBAAgC;YACjD,KAAK,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;YADb,wBAAmB,GAAnB,mBAAmB,CAAa;YAGjD,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QACjD,CAAC;QAEQ,QAAQ;YACf,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAC;YAC5C,MAAM,QAAQ,GAAG,iBAAiB,CAChC,KAAM,EACN,IAAI,CAAC,WAAY,CAClB,CAAC;YAEF,MAAM,WAAW,GACf,mBAAmB,CAAC,GAAG,CAAC,cAAc,CAAC,mBAAmB,CAAC;mBACxD,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;YACtC,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,CACrC,cAAc,CAAC,yBAAyB,CACzC,CAAC;YAEF,IAAI,CAAC,WAAW,IAAI,CAAC,OAAO,EAAE,CAAC;gBAC7B,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,OAAO,QAAQ,CAAC,QAAQ,CAAC;gBACvB,gBAAgB,CAAC,wBAAwB,EAAE;gBAC3C,EAAE;gBACF,WAAW;oBACT,CAAC,CAAC,gBAAgB,CAAC,2BAA2B,CAC5C,QAAQ,EACR,KAAM,CAAC,GAAG,IAAI,EAAE,CACjB;oBACD,CAAC,CAAC,qBAAqB;gBACzB,EAAE;gBACF,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,2BAA2B,EAAE,CAAC,CAAC,CAAC,WAAW;aACvE,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* A webpack/Rspack plugin to generate chunk loading runtime for Lynx.
|
|
5
|
+
*/
|
|
6
|
+
import type { Compiler } from '@rspack/core';
|
|
7
|
+
/**
|
|
8
|
+
* The options for ChunkLoadingWebpackPlugin
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface ChunkLoadingWebpackPluginOptions {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The ChunkLoadingWebpackPlugin enables chunk loading for webpack/Rspack in Lynx.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* - Use with Rspack.
|
|
20
|
+
*
|
|
21
|
+
* ```js
|
|
22
|
+
* // rspack.config.js
|
|
23
|
+
* import { ChunkLoadingWebpackPlugin } from '@lynx-js/chunk-loading-webpack-plugin'
|
|
24
|
+
* export default {
|
|
25
|
+
* output: {
|
|
26
|
+
* chunkFormat: 'require',
|
|
27
|
+
* },
|
|
28
|
+
* plugins: [new ChunkLoadingWebpackPlugin()],
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
*
|
|
34
|
+
* - Use with Webpack.
|
|
35
|
+
*
|
|
36
|
+
* ```js
|
|
37
|
+
* // webpack.config.js
|
|
38
|
+
* import { ChunkLoadingWebpackPlugin } from '@lynx-js/chunk-loading-webpack-plugin'
|
|
39
|
+
* export default {
|
|
40
|
+
* output: {
|
|
41
|
+
* chunkFormat: 'lynx',
|
|
42
|
+
* },
|
|
43
|
+
* plugins: [new ChunkLoadingWebpackPlugin()],
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export declare class ChunkLoadingWebpackPlugin {
|
|
50
|
+
private readonly options;
|
|
51
|
+
constructor(options?: Partial<ChunkLoadingWebpackPluginOptions>);
|
|
52
|
+
/**
|
|
53
|
+
* `defaultOptions` is the default options that the {@link ChunkLoadingWebpackPlugin} uses.
|
|
54
|
+
*
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
static defaultOptions: Readonly<Required<ChunkLoadingWebpackPluginOptions>>;
|
|
58
|
+
/**
|
|
59
|
+
* The entry point of a webpack plugin.
|
|
60
|
+
* @param compiler - the webpack compiler
|
|
61
|
+
*/
|
|
62
|
+
apply(compiler: Compiler): void;
|
|
63
|
+
}
|
|
64
|
+
export { ChunkLoadingRspackPlugin } from './ChunkLoadingRspackPlugin.js';
|
|
65
|
+
export type { ChunkLoadingRspackPluginOptions } from './ChunkLoadingRspackPlugin.js';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
import { ChunkLoadingRspackPluginImpl } from './ChunkLoadingRspackPlugin.js';
|
|
5
|
+
import { ChunkLoadingWebpackPluginImpl } from './ChunkLoadingWebpackPlugin.js';
|
|
6
|
+
/**
|
|
7
|
+
* The ChunkLoadingWebpackPlugin enables chunk loading for webpack/Rspack in Lynx.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* - Use with Rspack.
|
|
12
|
+
*
|
|
13
|
+
* ```js
|
|
14
|
+
* // rspack.config.js
|
|
15
|
+
* import { ChunkLoadingWebpackPlugin } from '@lynx-js/chunk-loading-webpack-plugin'
|
|
16
|
+
* export default {
|
|
17
|
+
* output: {
|
|
18
|
+
* chunkFormat: 'require',
|
|
19
|
+
* },
|
|
20
|
+
* plugins: [new ChunkLoadingWebpackPlugin()],
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
*
|
|
26
|
+
* - Use with Webpack.
|
|
27
|
+
*
|
|
28
|
+
* ```js
|
|
29
|
+
* // webpack.config.js
|
|
30
|
+
* import { ChunkLoadingWebpackPlugin } from '@lynx-js/chunk-loading-webpack-plugin'
|
|
31
|
+
* export default {
|
|
32
|
+
* output: {
|
|
33
|
+
* chunkFormat: 'lynx',
|
|
34
|
+
* },
|
|
35
|
+
* plugins: [new ChunkLoadingWebpackPlugin()],
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export class ChunkLoadingWebpackPlugin {
|
|
42
|
+
options;
|
|
43
|
+
constructor(options = {}) {
|
|
44
|
+
this.options = options;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* `defaultOptions` is the default options that the {@link ChunkLoadingWebpackPlugin} uses.
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
static defaultOptions = Object.freeze({});
|
|
52
|
+
/**
|
|
53
|
+
* The entry point of a webpack plugin.
|
|
54
|
+
* @param compiler - the webpack compiler
|
|
55
|
+
*/
|
|
56
|
+
apply(compiler) {
|
|
57
|
+
const options = Object.assign({}, ChunkLoadingWebpackPlugin.defaultOptions, this.options);
|
|
58
|
+
if (compiler.webpack.rspackVersion) {
|
|
59
|
+
new ChunkLoadingRspackPluginImpl(compiler, options);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
new ChunkLoadingWebpackPluginImpl(compiler, options);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export { ChunkLoadingRspackPlugin } from './ChunkLoadingRspackPlugin.js';
|
|
67
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAU1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAU/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,OAAO,yBAAyB;IAEjB;IADnB,YACmB,UAAqD,EAAE;QAAvD,YAAO,GAAP,OAAO,CAAgD;IACvE,CAAC;IAEJ;;;;OAIG;IACH,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,CAEnC,EAAE,CAAC,CAAC;IAEN;;;OAGG;IACH,KAAK,CAAC,QAAkB;QACtB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAC3B,EAAE,EACF,yBAAyB,CAAC,cAAc,EACxC,IAAI,CAAC,OAAO,CACb,CAAC;QACF,IAAI,QAAQ,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;YACnC,IAAI,4BAA4B,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACtD,CAAC;aAAM,CAAC;YACN,IAAI,6BAA6B,CAC/B,QAAiD,EACjD,OAAO,CACR,CAAC;QACJ,CAAC;IACH,CAAC;;AAGH,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
3
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
4
|
+
// LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
import { generateFromTemplate } from './helper.js';
|
|
7
|
+
import loadStyleRuntime from './css/load-style.js';
|
|
8
|
+
import chunkLoadingRuntime from './css/chunk-loading.js';
|
|
9
|
+
import hmrLoadChunkRuntime from './css/hmr-load-chunk.js';
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*
|
|
13
|
+
* The base class to generate runtime of JavaScript. It should be use both in webpack and rspack.
|
|
14
|
+
*/
|
|
15
|
+
export class CssRuntimeModule {
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
* @returns CSS load style runtime code
|
|
19
|
+
*/
|
|
20
|
+
static generateLoadStyleRuntime() {
|
|
21
|
+
return generateFromTemplate(loadStyleRuntime);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
* @param chunkMap chunks that have css
|
|
26
|
+
* @returns CSS load style runtime code
|
|
27
|
+
*/
|
|
28
|
+
static generateChunkLoadingRuntime(chunkMap, installedCssChunks) {
|
|
29
|
+
return generateFromTemplate(chunkLoadingRuntime)
|
|
30
|
+
.replace(/\$INSTALLED_CHUNKS\$/g, `${installedCssChunks.map((id) => `${JSON.stringify(id)}: 0`).join(',\n')}`)
|
|
31
|
+
.replace(/\$CHUNK_MAP\$/g, `${JSON.stringify(chunkMap)}`);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
* @returns CSS hmr load chunk runtime code
|
|
36
|
+
*/
|
|
37
|
+
static generateHMRLoadChunkRuntime() {
|
|
38
|
+
return generateFromTemplate(hmrLoadChunkRuntime);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=CssRuntimeModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CssRuntimeModule.js","sourceRoot":"","sources":["../../src/runtime/CssRuntimeModule.ts"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AACzD,OAAO,mBAAmB,MAAM,yBAAyB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;;OAGG;IACH,MAAM,CAAC,wBAAwB;QAC7B,OAAO,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,2BAA2B,CAChC,QAAgB,EAChB,kBAAgD;QAEhD,OAAO,oBAAoB,CAAC,mBAAmB,CAAC;aAC7C,OAAO,CACN,uBAAuB,EACvB,GACE,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CACvE,EAAE,CACH;aACA,OAAO,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,2BAA2B;QAChC,OAAO,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;IACnD,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
3
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
4
|
+
// LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
import rspack from '@rspack/core';
|
|
7
|
+
import installChunkRuntime from './javascript/install-chunk.js';
|
|
8
|
+
import chunkLoadingRuntime from './javascript/chunk-loading.js';
|
|
9
|
+
import chunkOnloadRuntime from './javascript/chunk-onload.js';
|
|
10
|
+
import hmrLoadChunkRuntime from './javascript/hmr-load-chunk.js';
|
|
11
|
+
import hmrLoadManifestRuntime from './javascript/hmr-load-manifest.js';
|
|
12
|
+
import hmrRuntime from './javascript/hmr-runtime.js';
|
|
13
|
+
import { generateFromTemplate } from './helper.js';
|
|
14
|
+
const { Template } = rspack;
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*
|
|
18
|
+
* The base class to generate runtime of JavaScript. It should be use both in webpack and rspack.
|
|
19
|
+
*/
|
|
20
|
+
export class JavaScriptRuntimeModule {
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
* @param withOnload need call onload callback
|
|
24
|
+
* @returns JavaScript install chunk runtime code
|
|
25
|
+
*/
|
|
26
|
+
static generateInstallChunkRuntime(withOnload) {
|
|
27
|
+
return generateFromTemplate(installChunkRuntime)
|
|
28
|
+
.replace(/\$WITH_ONLOAD\$/g, `${withOnload}`);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
* @returns JavaScript chunk onload runtime code
|
|
33
|
+
*/
|
|
34
|
+
static generateChunkOnloadRuntime() {
|
|
35
|
+
return generateFromTemplate(chunkOnloadRuntime);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
* @param matcher filter initial chunk
|
|
40
|
+
* @returns JavaScript chunk loading Runtime Code
|
|
41
|
+
*/
|
|
42
|
+
static generateChunkLoadingRuntime(matcher) {
|
|
43
|
+
return generateFromTemplate(chunkLoadingRuntime)
|
|
44
|
+
.replace(/\$JS_MATCHER\$/g, `"${matcher}"`);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
* @returns JavaScript HMR runtime code
|
|
49
|
+
*/
|
|
50
|
+
static generateHMRRuntime() {
|
|
51
|
+
return Template.asString([
|
|
52
|
+
'',
|
|
53
|
+
generateFromTemplate(hmrLoadChunkRuntime),
|
|
54
|
+
'',
|
|
55
|
+
generateFromTemplate(hmrRuntime)
|
|
56
|
+
// The key here has to be `require`(the same as RequireChunkLoadingRuntimeModule)
|
|
57
|
+
// since we are concatenating this runtime module after the rspack runtime module.
|
|
58
|
+
// So we have to **override** the exactly same function(e.g.: `__webpack_require__.hmrC.require`).
|
|
59
|
+
.replace(/\$key\$/g, 'require')
|
|
60
|
+
.replace(/\$installedChunks\$/g, 'installedChunks')
|
|
61
|
+
.replace(/\$loadUpdateChunk\$/g, 'loadUpdateChunk'),
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
* @returns The HMR manifest runtime code(`RuntimeGlobals.hmrDownloadManifest`, aka `__webpack_require__.hmrM`)
|
|
67
|
+
*/
|
|
68
|
+
static generateHMRManifestRuntime() {
|
|
69
|
+
return Template.asString([
|
|
70
|
+
'',
|
|
71
|
+
generateFromTemplate(hmrLoadManifestRuntime),
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=JavaScriptRuntimeModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JavaScriptRuntimeModule.js","sourceRoot":"","sources":["../../src/runtime/JavaScriptRuntimeModule.ts"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,OAAO,mBAAmB,MAAM,+BAA+B,CAAC;AAChE,OAAO,mBAAmB,MAAM,+BAA+B,CAAC;AAChE,OAAO,kBAAkB,MAAM,8BAA8B,CAAC;AAC9D,OAAO,mBAAmB,MAAM,gCAAgC,CAAC;AACjE,OAAO,sBAAsB,MAAM,mCAAmC,CAAC;AACvE,OAAO,UAAU,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;AAC5B;;;;GAIG;AACH,MAAM,OAAO,uBAAuB;IAClC;;;;OAIG;IACH,MAAM,CAAC,2BAA2B,CAAC,UAAmB;QACpD,OAAO,oBAAoB,CAAC,mBAAmB,CAAC;aAC7C,OAAO,CAAC,kBAAkB,EAAE,GAAG,UAAU,EAAE,CAAC,CAAC;IAClD,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,0BAA0B;QAC/B,OAAO,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;IAClD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,2BAA2B,CAAC,OAAe;QAChD,OAAO,oBAAoB,CAAC,mBAAmB,CAAC;aAC7C,OAAO,CAAC,iBAAiB,EAAE,IAAI,OAAO,GAAG,CAAC,CAAC;IAChD,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,kBAAkB;QACvB,OAAO,QAAQ,CAAC,QAAQ,CAAC;YACvB,EAAE;YACF,oBAAoB,CAAC,mBAAmB,CAAC;YACzC,EAAE;YACF,oBAAoB,CAAC,UAAU,CAAC;gBAC9B,iFAAiF;gBACjF,kFAAkF;gBAClF,kGAAkG;iBACjG,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC;iBAC9B,OAAO,CAAC,sBAAsB,EAAE,iBAAiB,CAAC;iBAClD,OAAO,CAAC,sBAAsB,EAAE,iBAAiB,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,0BAA0B;QAC/B,OAAO,QAAQ,CAAC,QAAQ,CAAC;YACvB,EAAE;YACF,oBAAoB,CAAC,sBAAsB,CAAC;SAC7C,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function _default(): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
3
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
4
|
+
// LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
var $CHUNK_MAP$ = undefined;
|
|
8
|
+
export default function () {
|
|
9
|
+
var installedCssChunks = { $INSTALLED_CHUNKS$ };
|
|
10
|
+
// object to store loaded CSS chunks
|
|
11
|
+
$RuntimeGlobals_ensureChunkHandlers$.miniCss = function (chunkId, promises) {
|
|
12
|
+
var cssChunks = $CHUNK_MAP$;
|
|
13
|
+
if (installedCssChunks[chunkId])
|
|
14
|
+
promises.push(installedCssChunks[chunkId]);
|
|
15
|
+
else if (installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
|
|
16
|
+
promises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(function () {
|
|
17
|
+
installedCssChunks[chunkId] = 0;
|
|
18
|
+
}, function (e) {
|
|
19
|
+
delete installedCssChunks[chunkId];
|
|
20
|
+
throw e;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=chunk-loading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-loading.js","sourceRoot":"","sources":["../../../src/runtime/css/chunk-loading.js"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,cAAc;AAEd,IAAI,WAAW,GAAG,SAAS,CAAC;AAE5B,MAAM,CAAC,OAAO;IACZ,IAAI,kBAAkB,GAAG,EAAE,kBAAkB,EAAE,CAAC;IAEhD,oCAAoC;IACpC,oCAAoC,CAAC,OAAO,GAAG,UAAS,OAAO,EAAE,QAAQ;QACvE,IAAI,SAAS,GAAG,WAAW,CAAC;QAC5B,IAAI,kBAAkB,CAAC,OAAO,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;aACvE,IAAI,kBAAkB,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;YACjE,QAAQ,CAAC,IAAI,CACX,kBAAkB,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;gBACzD,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAClC,CAAC,EAAE,UAAS,CAAC;gBACX,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;gBACnC,MAAM,CAAC,CAAC;YACV,CAAC,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function _default(): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
3
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
4
|
+
// LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
export default function () {
|
|
8
|
+
$RuntimeGlobals_hmrDownloadUpdateHandlers$.miniCss = function (chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList) {
|
|
9
|
+
chunkIds.forEach(function (chunkId) {
|
|
10
|
+
promises.push(loadStylesheet(chunkId));
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=hmr-load-chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmr-load-chunk.js","sourceRoot":"","sources":["../../../src/runtime/css/hmr-load-chunk.js"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,cAAc;AAEd,MAAM,CAAC,OAAO;IACZ,0CAA0C,CAAC,OAAO,GAAG,UACnD,QAAQ,EACR,aAAa,EACb,cAAc,EACd,QAAQ,EACR,aAAa,EACb,kBAAkB;QAElB,QAAQ,CAAC,OAAO,CAAC,UAAS,OAAO;YAC/B,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function _default(): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
3
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
4
|
+
// LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
export default function () {
|
|
8
|
+
var loadStylesheet = function (chunkId) {
|
|
9
|
+
return new Promise(function (resolve, reject) {
|
|
10
|
+
var href = $RuntimeGlobals_require$.miniCssF(chunkId);
|
|
11
|
+
var fullHref = $RuntimeGlobals_publicPath$ + href;
|
|
12
|
+
resolve({});
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=load-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-style.js","sourceRoot":"","sources":["../../../src/runtime/css/load-style.js"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,cAAc;AAEd,MAAM,CAAC,OAAO;IACZ,IAAI,cAAc,GAAG,UAAS,OAAO;QACnC,OAAO,IAAI,OAAO,CAAC,UAAS,OAAO,EAAE,MAAM;YACzC,IAAI,IAAI,GAAG,wBAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACtD,IAAI,QAAQ,GAAG,2BAA2B,GAAG,IAAI,CAAC;YAElD,OAAO,CAAC,EAAE,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Chunk, Compilation, Module } from 'webpack';
|
|
2
|
+
export declare const MODULE_TYPE = "css/mini-extract";
|
|
3
|
+
export declare function generateFromTemplate(runtime: () => void): string;
|
|
4
|
+
export declare function compareIds(a: string, b: string): number;
|
|
5
|
+
export declare function compareModulesByIdentifier(a: Module, b: Module): number;
|
|
6
|
+
export declare const getCssChunkObject: (mainChunk: Chunk, compilation: Compilation) => Record<string, number>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { RuntimeGlobals as LynxRuntimeGlobals } from '@lynx-js/webpack-runtime-globals';
|
|
2
|
+
import rspack from '@rspack/core';
|
|
3
|
+
const RuntimeGlobals = Object.assign({}, rspack.RuntimeGlobals, LynxRuntimeGlobals);
|
|
4
|
+
const { Template } = rspack;
|
|
5
|
+
export const MODULE_TYPE = 'css/mini-extract';
|
|
6
|
+
export function generateFromTemplate(runtime) {
|
|
7
|
+
return Template.getFunctionContent(runtime).replace(/\$RuntimeGlobals_(\w+)\$/g, (_, name) => RuntimeGlobals[name]);
|
|
8
|
+
}
|
|
9
|
+
export function compareIds(a, b) {
|
|
10
|
+
if (a < b) {
|
|
11
|
+
return -1;
|
|
12
|
+
}
|
|
13
|
+
if (a > b) {
|
|
14
|
+
return 1;
|
|
15
|
+
}
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
export function compareModulesByIdentifier(a, b) {
|
|
19
|
+
return compareIds(a.identifier(), b.identifier());
|
|
20
|
+
}
|
|
21
|
+
export const getCssChunkObject = (mainChunk, compilation) => {
|
|
22
|
+
const obj = {};
|
|
23
|
+
const { chunkGraph } = compilation;
|
|
24
|
+
for (const chunk of mainChunk.getAllAsyncChunks()) {
|
|
25
|
+
// MiniCssExtractPlugin uses `chunkGraph.getOrderedChunkModulesIterable`
|
|
26
|
+
// but it does not exist on Rspack.
|
|
27
|
+
const modules = chunkGraph.getChunkModules(chunk);
|
|
28
|
+
modules.sort(compareModulesByIdentifier);
|
|
29
|
+
for (const module of modules) {
|
|
30
|
+
if (module.type === MODULE_TYPE) {
|
|
31
|
+
obj[chunk.id] = 1;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return obj;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../src/runtime/helper.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAExF,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAClC,EAAE,EACF,MAAM,CAAC,cAAc,EACrB,kBAAkB,CACnB,CAAC;AAEF,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;AAE5B,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAE9C,MAAM,UAAU,oBAAoB,CAAC,OAAmB;IACtD,OAAO,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,OAAO,CACjD,2BAA2B,EAC3B,CAAC,CAAC,EAAE,IAAiC,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAC/D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,CAAS,EAAE,CAAS;IAC7C,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACV,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACV,OAAO,CAAC,CAAC;IACX,CAAC;IAED,OAAO,CAAC,CAAC;AACX,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,CAAS,EAAE,CAAS;IAC7D,OAAO,UAAU,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,SAAgB,EAChB,WAAwB,EACA,EAAE;IAC1B,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,MAAM,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC;IAEnC,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,iBAAiB,EAAE,EAAE,CAAC;QAClD,wEAAwE;QACxE,mCAAmC;QACnC,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAElD,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QAEzC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;gBAChC,GAAG,CAAC,KAAK,CAAC,EAAY,CAAC,GAAG,CAAC,CAAC;gBAC5B,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function _default(): void;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
3
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
4
|
+
// LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
var $JS_MATCHER$ = undefined;
|
|
8
|
+
export default function () {
|
|
9
|
+
// TODO: replace this with `withLoading`
|
|
10
|
+
if ($RuntimeGlobals_ensureChunkHandlers$) {
|
|
11
|
+
// require() chunk loading for javascript
|
|
12
|
+
$RuntimeGlobals_ensureChunkHandlers$.require = function (chunkId, promises) {
|
|
13
|
+
var installedChunkData = installedChunks[chunkId];
|
|
14
|
+
// "1" is the signal for "already loaded"
|
|
15
|
+
if (installedChunkData !== 1) {
|
|
16
|
+
if (installedChunkData) {
|
|
17
|
+
// array of [resolve, reject, promise] means "currently loading"
|
|
18
|
+
promises.push(installedChunkData[2]);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
if ($JS_MATCHER$) {
|
|
22
|
+
if ($RuntimeGlobals_lynxAsyncChunkIds$
|
|
23
|
+
&& $RuntimeGlobals_lynxAsyncChunkIds$[chunkId]) {
|
|
24
|
+
installedChunkData = installedChunks[chunkId] = [null, null];
|
|
25
|
+
const promise = lynx.loadLazyBundle($RuntimeGlobals_publicPath$
|
|
26
|
+
+ $RuntimeGlobals_lynxAsyncChunkIds$[chunkId]).then((exports) => {
|
|
27
|
+
installChunk(exports);
|
|
28
|
+
return exports;
|
|
29
|
+
});
|
|
30
|
+
installedChunkData[2] = promise;
|
|
31
|
+
promises.push(promise);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const promise = new Promise((resolve, reject) => {
|
|
35
|
+
installedChunkData = installedChunks[chunkId] = [resolve, reject];
|
|
36
|
+
lynx.requireModuleAsync($RuntimeGlobals_publicPath$
|
|
37
|
+
+ $RuntimeGlobals_getChunkScriptFilename$(chunkId), (err, exports) => {
|
|
38
|
+
if (err) {
|
|
39
|
+
reject(err);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
installChunk(exports);
|
|
43
|
+
resolve(exports);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
installedChunkData[2] = promise;
|
|
47
|
+
promises.push(promise);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
installedChunks[chunkId] = 1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (typeof installChunk !== 'undefined') {
|
|
57
|
+
$RuntimeGlobals_externalInstallChunk$ = installChunk;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=chunk-loading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-loading.js","sourceRoot":"","sources":["../../../src/runtime/javascript/chunk-loading.js"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,cAAc;AAEd,IAAI,YAAY,GAAG,SAAS,CAAC;AAE7B,MAAM,CAAC,OAAO;IACZ,wCAAwC;IACxC,IAAI,oCAAoC,EAAE,CAAC;QACzC,yCAAyC;QACzC,oCAAoC,CAAC,OAAO,GAAG,UAAS,OAAO,EAAE,QAAQ;YACvE,IAAI,kBAAkB,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;YAClD,yCAAyC;YACzC,IAAI,kBAAkB,KAAK,CAAC,EAAE,CAAC;gBAC7B,IAAI,kBAAkB,EAAE,CAAC;oBACvB,gEAAgE;oBAChE,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;gBACvC,CAAC;qBAAM,CAAC;oBACN,IAAI,YAAY,EAAE,CAAC;wBACjB,IACE,kCAAkC;+BAC/B,kCAAkC,CAAC,OAAO,CAAC,EAC9C,CAAC;4BACD,kBAAkB,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;4BAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CACjC,2BAA2B;kCACvB,kCAAkC,CAAC,OAAO,CAAC,CAChD,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;gCACjB,YAAY,CAAC,OAAO,CAAC,CAAC;gCACtB,OAAO,OAAO,CAAC;4BACjB,CAAC,CAAC,CAAC;4BACH,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;4BAChC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;4BACvB,OAAO;wBACT,CAAC;wBAED,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;4BAC9C,kBAAkB,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;4BAClE,IAAI,CAAC,kBAAkB,CACrB,2BAA2B;kCACvB,uCAAuC,CAAC,OAAO,CAAC,EACpD,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;gCACf,IAAI,GAAG,EAAE,CAAC;oCACR,MAAM,CAAC,GAAG,CAAC,CAAC;oCACZ,OAAO;gCACT,CAAC;gCACD,YAAY,CAAC,OAAO,CAAC,CAAC;gCACtB,OAAO,CAAC,OAAO,CAAC,CAAC;4BACnB,CAAC,CACF,CAAC;wBACJ,CAAC,CAAC,CAAC;wBACH,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;wBAChC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACzB,CAAC;yBAAM,CAAC;wBACN,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;oBAC/B,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE,CAAC;QACxC,qCAAqC,GAAG,YAAY,CAAC;IACvD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function _default(): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
3
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
4
|
+
// LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
export default function () {
|
|
8
|
+
if ($RuntimeGlobals_onChunksLoaded$) {
|
|
9
|
+
$RuntimeGlobals_onChunksLoaded$.require = function (chunkId) {
|
|
10
|
+
// "1" is the signal for "already loaded"
|
|
11
|
+
return installedChunks[chunkId] === 1;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=chunk-onload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-onload.js","sourceRoot":"","sources":["../../../src/runtime/javascript/chunk-onload.js"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,cAAc;AAEd,MAAM,CAAC,OAAO;IACZ,IAAI,+BAA+B,EAAE,CAAC;QACpC,+BAA+B,CAAC,OAAO,GAAG,UAAS,OAAO;YACxD,yCAAyC;YACzC,OAAO,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function _default(): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
3
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
4
|
+
// LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
export default function () {
|
|
8
|
+
function loadUpdateChunk(chunkId, updatedModulesList) {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
lynx.requireModuleAsync($RuntimeGlobals_publicPath$
|
|
11
|
+
+ $RuntimeGlobals_getChunkUpdateScriptFilename$(chunkId), (err, update) => {
|
|
12
|
+
if (err) {
|
|
13
|
+
reject(err);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
var updatedModules = update.modules;
|
|
17
|
+
var runtime = update.runtime;
|
|
18
|
+
for (var moduleId in updatedModules) {
|
|
19
|
+
if ($RuntimeGlobals_hasOwnProperty$(updatedModules, moduleId)) {
|
|
20
|
+
currentUpdate[moduleId] = updatedModules[moduleId];
|
|
21
|
+
if (updatedModulesList)
|
|
22
|
+
updatedModulesList.push(moduleId);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (runtime)
|
|
26
|
+
currentUpdateRuntime.push(runtime);
|
|
27
|
+
resolve();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=hmr-load-chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmr-load-chunk.js","sourceRoot":"","sources":["../../../src/runtime/javascript/hmr-load-chunk.js"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,cAAc;AAEd,MAAM,CAAC,OAAO;IACZ,SAAS,eAAe,CAAC,OAAO,EAAE,kBAAkB;QAClD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC,kBAAkB,CACrB,2BAA2B;kBACvB,6CAA6C,CAAC,OAAO,CAAC,EAC1D,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;gBACd,IAAI,GAAG,EAAE,CAAC;oBACR,MAAM,CAAC,GAAG,CAAC,CAAC;oBACZ,OAAO;gBACT,CAAC;gBAED,IAAI,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC;gBACpC,IAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;gBAC7B,KAAK,IAAI,QAAQ,IAAI,cAAc,EAAE,CAAC;oBACpC,IAAI,+BAA+B,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC;wBAC9D,aAAa,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;wBACnD,IAAI,kBAAkB;4BAAE,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBAC5D,CAAC;gBACH,CAAC;gBACD,IAAI,OAAO;oBAAE,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAChD,OAAO,EAAE,CAAC;YACZ,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function _default(): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
3
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
4
|
+
// LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
export default function () {
|
|
8
|
+
$RuntimeGlobals_hmrDownloadManifest$ = function () {
|
|
9
|
+
return new Promise((resolve, reject) => lynx.requireModuleAsync($RuntimeGlobals_publicPath$
|
|
10
|
+
+ $RuntimeGlobals_getUpdateManifestFilename$(), (err, ret) => {
|
|
11
|
+
if (err)
|
|
12
|
+
return reject(err);
|
|
13
|
+
resolve(ret);
|
|
14
|
+
}))['catch'](function (err) {
|
|
15
|
+
if (err.code !== 'MODULE_NOT_FOUND')
|
|
16
|
+
throw err;
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=hmr-load-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmr-load-manifest.js","sourceRoot":"","sources":["../../../src/runtime/javascript/hmr-load-manifest.js"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,cAAc;AAEd,MAAM,CAAC,OAAO;IACZ,oCAAoC,GAAG;QACrC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CACrC,IAAI,CAAC,kBAAkB,CACrB,2BAA2B;cACvB,0CAA0C,EAAE,EAChD,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YACX,IAAI,GAAG;gBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC,CACF,CACF,CAAC,OAAO,CAAC,CAAC,UAAS,GAAG;YACrB,IAAI,GAAG,CAAC,IAAI,KAAK,kBAAkB;gBAAE,MAAM,GAAG,CAAC;QACjD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function _default(): void;
|