@rspack-canary/core 1.7.3-canary-965a4980-20260119085659 → 1.7.3-canary-6991b7b5-20260119174555
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/ChunkGraph.d.ts +1 -1
- package/dist/Compilation.d.ts +27 -27
- package/dist/Compiler.d.ts +17 -18
- package/dist/ContextModuleFactory.d.ts +1 -1
- package/dist/Diagnostics.d.ts +1 -1
- package/dist/ExecuteModulePlugin.d.ts +1 -1
- package/dist/ExportsInfo.d.ts +1 -1
- package/dist/FileSystem.d.ts +1 -1
- package/dist/Module.d.ts +2 -2
- package/dist/ModuleGraph.d.ts +2 -2
- package/dist/MultiCompiler.d.ts +7 -7
- package/dist/MultiStats.d.ts +3 -3
- package/dist/MultiWatching.d.ts +2 -2
- package/dist/NativeWatchFileSystem.d.ts +1 -1
- package/dist/NormalModule.d.ts +3 -3
- package/dist/NormalModuleFactory.d.ts +3 -3
- package/dist/Resolver.d.ts +1 -1
- package/dist/ResolverFactory.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +1 -1
- package/dist/RuntimeModule.d.ts +3 -3
- package/dist/Stats.d.ts +4 -4
- package/dist/VirtualModulesPlugin.d.ts +1 -1
- package/dist/Watching.d.ts +4 -4
- package/dist/builtin-loader/index.d.ts +1 -1
- package/dist/builtin-loader/lightningcss/index.d.ts +5 -0
- package/dist/builtin-loader/swc/index.d.ts +5 -5
- package/dist/builtin-loader/swc/types.d.ts +6 -4
- package/dist/builtin-plugin/APIPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/BannerPlugin.d.ts +3 -3
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CaseSensitivePlugin.d.ts +3 -3
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +4 -4
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DataUriPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DefinePlugin.d.ts +3 -3
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EntryPlugin.d.ts +4 -4
- package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +3 -3
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FileUriPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +2 -2
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +3 -3
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +2 -2
- package/dist/builtin-plugin/IgnorePlugin.d.ts +3 -3
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/InlineExportsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +4 -4
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +3 -3
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +10 -5
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +3 -3
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +4 -4
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ProgressPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ProvidePlugin.d.ts +3 -3
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +8 -4
- package/dist/builtin-plugin/RslibPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RstestPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RuntimePlugin.d.ts +10 -6
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +3 -3
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +3 -3
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +3 -3
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +2 -2
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +5 -5
- package/dist/builtin-plugin/URLPlugin.d.ts +3 -3
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +2 -2
- package/dist/builtin-plugin/WorkerPlugin.d.ts +3 -3
- package/dist/builtin-plugin/base.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/index.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/loader.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/utils.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +2 -2
- package/dist/builtin-plugin/html-plugin/index.d.ts +2 -2
- package/dist/builtin-plugin/html-plugin/options.d.ts +6 -1
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +9 -5
- package/dist/builtin-plugin/html-plugin/taps.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +84 -85
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +4 -4
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +2 -2
- package/dist/config/adapter.d.ts +4 -4
- package/dist/config/adapterRuleUse.d.ts +9 -9
- package/dist/config/browserslistTargetHandler.d.ts +1 -1
- package/dist/config/defaults.d.ts +1 -1
- package/dist/config/devServer.d.ts +3 -3
- package/dist/config/index.d.ts +5 -5
- package/dist/config/normalization.d.ts +35 -7
- package/dist/config/types.d.ts +156 -67
- package/dist/container/ContainerPlugin.d.ts +3 -3
- package/dist/container/ContainerReferencePlugin.d.ts +3 -3
- package/dist/container/ModuleFederationManifestPlugin.d.ts +2 -2
- package/dist/container/ModuleFederationPlugin.d.ts +3 -3
- package/dist/container/ModuleFederationPluginV1.d.ts +5 -5
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +3 -3
- package/dist/container/index.d.ts +4 -4
- package/dist/cssExtractHmr.js +27 -2
- package/dist/cssExtractLoader.js +57 -15
- package/dist/exports.d.ts +81 -70
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11726 -11471
- package/dist/lib/AbstractMethodError.d.ts +1 -1
- package/dist/lib/Cache.d.ts +1 -1
- package/dist/lib/CacheFacade.d.ts +3 -3
- package/dist/lib/DllPlugin.d.ts +2 -2
- package/dist/lib/DllReferencePlugin.d.ts +3 -3
- package/dist/lib/EntryOptionPlugin.d.ts +2 -2
- package/dist/lib/EnvironmentPlugin.d.ts +1 -1
- package/dist/lib/HookWebpackError.d.ts +1 -1
- package/dist/lib/IgnoreWarningsPlugin.d.ts +1 -1
- package/dist/lib/LoaderOptionsPlugin.d.ts +2 -2
- package/dist/lib/LoaderTargetPlugin.d.ts +2 -2
- package/dist/lib/WebpackError.d.ts +2 -2
- package/dist/lib/cache/MemoryCachePlugin.d.ts +1 -1
- package/dist/lib/cache/getLazyHashedEtag.d.ts +1 -1
- package/dist/lib/cache/mergeEtags.d.ts +1 -1
- package/dist/loader-runner/ModuleError.d.ts +1 -1
- package/dist/loader-runner/index.d.ts +1 -1
- package/dist/loader-runner/loadLoader.d.ts +2 -2
- package/dist/loader-runner/utils.d.ts +3 -3
- package/dist/loader-runner/worker.d.ts +1 -1
- package/dist/logging/createConsoleLogger.d.ts +2 -2
- package/dist/moduleFederationDefaultRuntime.js +1 -1
- package/dist/node/NodeEnvironmentPlugin.d.ts +2 -2
- package/dist/node/NodeTemplatePlugin.d.ts +1 -1
- package/dist/node/NodeWatchFileSystem.d.ts +1 -1
- package/dist/node/nodeConsole.d.ts +1 -1
- package/dist/rspack.d.ts +5 -5
- package/dist/rspackOptionsApply.d.ts +1 -1
- package/dist/runtime/moduleFederationDefaultRuntime.d.ts +2 -1
- package/dist/sharing/ConsumeSharedPlugin.d.ts +2 -2
- package/dist/sharing/ProvideSharedPlugin.d.ts +2 -2
- package/dist/sharing/SharePlugin.d.ts +1 -1
- package/dist/sharing/ShareRuntimePlugin.d.ts +2 -2
- package/dist/stats/DefaultStatsFactoryPlugin.d.ts +1 -1
- package/dist/stats/DefaultStatsPresetPlugin.d.ts +1 -1
- package/dist/stats/DefaultStatsPrinterPlugin.d.ts +1 -1
- package/dist/stats/StatsFactory.d.ts +2 -2
- package/dist/stats/StatsPrinter.d.ts +1 -1
- package/dist/stats/statsFactoryUtils.d.ts +6 -3
- package/dist/taps/compilation.d.ts +1 -1
- package/dist/taps/compiler.d.ts +1 -1
- package/dist/taps/contextModuleFactory.d.ts +1 -1
- package/dist/taps/index.d.ts +6 -6
- package/dist/taps/javascriptModules.d.ts +1 -1
- package/dist/taps/normalModuleFactory.d.ts +1 -1
- package/dist/taps/types.d.ts +1 -1
- package/dist/trace/traceHookPlugin.d.ts +1 -1
- package/dist/util/createHash.d.ts +1 -1
- package/dist/util/fs.d.ts +1 -1
- package/dist/util/hash/md4.d.ts +1 -1
- package/dist/util/hash/xxhash64.d.ts +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/validateConfig.d.ts +1 -1
- package/dist/worker.js +918 -846
- package/hot/dev-server.js +9 -12
- package/hot/emitter.js +1 -5
- package/hot/lazy-compilation-node.js +1 -4
- package/hot/lazy-compilation-web.js +3 -2
- package/hot/log-apply-result.js +5 -8
- package/hot/log.js +7 -17
- package/hot/only-dev-server.js +10 -13
- package/hot/poll.js +8 -11
- package/hot/signal.js +9 -13
- package/package.json +6 -9
- package/dist/builtin-plugin/rsc/Coordinator.d.ts +0 -8
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +0 -13
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +0 -14
- package/dist/builtin-plugin/rsc/index.d.ts +0 -24
- package/dist/rslib-runtime.js +0 -29
package/hot/dev-server.js
CHANGED
|
@@ -3,19 +3,15 @@
|
|
|
3
3
|
Author Tobias Koppers @sokra
|
|
4
4
|
*/
|
|
5
5
|
/* globals __webpack_hash__ */
|
|
6
|
-
|
|
7
|
-
import { log, formatError } from './log.js';
|
|
8
|
-
import { emitter as hotEmitter } from './emitter.js';
|
|
9
|
-
import { logApplyResult } from './log-apply-result.js';
|
|
10
|
-
|
|
11
|
-
if (import.meta.webpackHot) {
|
|
6
|
+
if (module.hot) {
|
|
12
7
|
/** @type {undefined|string} */
|
|
13
8
|
var lastHash;
|
|
14
9
|
var upToDate = function upToDate() {
|
|
15
10
|
return /** @type {string} */ (lastHash).indexOf(__webpack_hash__) >= 0;
|
|
16
11
|
};
|
|
12
|
+
var log = require('./log');
|
|
17
13
|
var check = function check() {
|
|
18
|
-
|
|
14
|
+
module.hot
|
|
19
15
|
.check(true)
|
|
20
16
|
.then(function (updatedModules) {
|
|
21
17
|
if (!updatedModules) {
|
|
@@ -40,14 +36,14 @@ if (import.meta.webpackHot) {
|
|
|
40
36
|
check();
|
|
41
37
|
}
|
|
42
38
|
|
|
43
|
-
|
|
39
|
+
require('./log-apply-result')(updatedModules, updatedModules);
|
|
44
40
|
|
|
45
41
|
if (upToDate()) {
|
|
46
42
|
log('info', '[HMR] App is up to date.');
|
|
47
43
|
}
|
|
48
44
|
})
|
|
49
45
|
.catch(function (err) {
|
|
50
|
-
var status =
|
|
46
|
+
var status = module.hot.status();
|
|
51
47
|
if (['abort', 'fail'].indexOf(status) >= 0) {
|
|
52
48
|
log(
|
|
53
49
|
'warning',
|
|
@@ -56,18 +52,19 @@ if (import.meta.webpackHot) {
|
|
|
56
52
|
? 'Need to do a full reload!'
|
|
57
53
|
: 'Please reload manually!'),
|
|
58
54
|
);
|
|
59
|
-
log('warning', '[HMR] ' + formatError(err));
|
|
55
|
+
log('warning', '[HMR] ' + log.formatError(err));
|
|
60
56
|
if (typeof window !== 'undefined') {
|
|
61
57
|
window.location.reload();
|
|
62
58
|
}
|
|
63
59
|
} else {
|
|
64
|
-
log('warning', '[HMR] Update failed: ' + formatError(err));
|
|
60
|
+
log('warning', '[HMR] Update failed: ' + log.formatError(err));
|
|
65
61
|
}
|
|
66
62
|
});
|
|
67
63
|
};
|
|
64
|
+
var hotEmitter = require('./emitter');
|
|
68
65
|
hotEmitter.on('webpackHotUpdate', function (currentHash) {
|
|
69
66
|
lastHash = currentHash;
|
|
70
|
-
if (!upToDate() &&
|
|
67
|
+
if (!upToDate() && module.hot.status() === 'idle') {
|
|
71
68
|
log('info', '[HMR] Checking for updates on the server...');
|
|
72
69
|
check();
|
|
73
70
|
}
|
package/hot/emitter.js
CHANGED
|
@@ -18,8 +18,4 @@ EventEmitter.prototype.emit = function (eventName) {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// TODO: remove default export when rspack-dev-server refactored
|
|
24
|
-
export default emitter;
|
|
25
|
-
export { emitter };
|
|
21
|
+
module.exports = new EventEmitter();
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';
|
|
2
|
-
|
|
3
1
|
var urlBase = decodeURIComponent(__resourceQuery.slice(1));
|
|
4
|
-
var require = createRequire(import.meta.url);
|
|
5
2
|
var compiling = new Set();
|
|
6
3
|
var errorHandlers = new Set();
|
|
7
4
|
|
|
@@ -82,7 +79,7 @@ function sendActiveRequest() {
|
|
|
82
79
|
* @param {{ data: string, onError: (err: Error) => void, active: boolean, module: module }} options options
|
|
83
80
|
* @returns {() => void} function to destroy response
|
|
84
81
|
*/
|
|
85
|
-
|
|
82
|
+
exports.activate = function (options) {
|
|
86
83
|
var data = options.data;
|
|
87
84
|
var onError = options.onError;
|
|
88
85
|
var active = options.active;
|
|
@@ -72,10 +72,11 @@ function sendActiveRequest() {
|
|
|
72
72
|
* @param {{ data: string, onError: (err: Error) => void, active: boolean, module: module }} options options
|
|
73
73
|
* @returns {() => void} function to destroy response
|
|
74
74
|
*/
|
|
75
|
-
|
|
75
|
+
exports.activate = function (options) {
|
|
76
76
|
var data = options.data;
|
|
77
77
|
var onError = options.onError;
|
|
78
78
|
var active = options.active;
|
|
79
|
+
var module = options.module;
|
|
79
80
|
errorHandlers.add(onError);
|
|
80
81
|
|
|
81
82
|
if (!compiling.has(data)) {
|
|
@@ -83,7 +84,7 @@ export const activate = function (options) {
|
|
|
83
84
|
sendActiveRequest();
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
if (!active && !
|
|
87
|
+
if (!active && !module.hot) {
|
|
87
88
|
console.log(
|
|
88
89
|
'Hot Module Replacement is not enabled. Waiting for process restart...',
|
|
89
90
|
);
|
package/hot/log-apply-result.js
CHANGED
|
@@ -3,16 +3,15 @@
|
|
|
3
3
|
Author Tobias Koppers @sokra
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { log, groupCollapsed, groupEnd } from './log.js';
|
|
7
|
-
|
|
8
6
|
/**
|
|
9
7
|
* @param {(string | number)[]} updatedModules updated modules
|
|
10
8
|
* @param {(string | number)[] | null} renewedModules renewed modules
|
|
11
9
|
*/
|
|
12
|
-
function
|
|
10
|
+
module.exports = function (updatedModules, renewedModules) {
|
|
13
11
|
var unacceptedModules = updatedModules.filter(function (moduleId) {
|
|
14
12
|
return renewedModules && renewedModules.indexOf(moduleId) < 0;
|
|
15
13
|
});
|
|
14
|
+
var log = require('./log');
|
|
16
15
|
|
|
17
16
|
if (unacceptedModules.length > 0) {
|
|
18
17
|
log(
|
|
@@ -31,9 +30,9 @@ function logApplyResult(updatedModules, renewedModules) {
|
|
|
31
30
|
renewedModules.forEach(function (moduleId) {
|
|
32
31
|
if (typeof moduleId === 'string' && moduleId.indexOf('!') !== -1) {
|
|
33
32
|
var parts = moduleId.split('!');
|
|
34
|
-
groupCollapsed('info', '[HMR] - ' + parts.pop());
|
|
33
|
+
log.groupCollapsed('info', '[HMR] - ' + parts.pop());
|
|
35
34
|
log('info', '[HMR] - ' + moduleId);
|
|
36
|
-
groupEnd('info');
|
|
35
|
+
log.groupEnd('info');
|
|
37
36
|
} else {
|
|
38
37
|
log('info', '[HMR] - ' + moduleId);
|
|
39
38
|
}
|
|
@@ -47,6 +46,4 @@ function logApplyResult(updatedModules, renewedModules) {
|
|
|
47
46
|
'[HMR] Consider using the optimization.moduleIds: "named" for module names.',
|
|
48
47
|
);
|
|
49
48
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export { logApplyResult };
|
|
49
|
+
};
|
package/hot/log.js
CHANGED
|
@@ -33,7 +33,7 @@ function logGroup(logFn) {
|
|
|
33
33
|
* @param {LogLevel} level log level
|
|
34
34
|
* @param {string|Error} msg message
|
|
35
35
|
*/
|
|
36
|
-
function
|
|
36
|
+
module.exports = function (level, msg) {
|
|
37
37
|
if (shouldLog(level)) {
|
|
38
38
|
if (level === 'info') {
|
|
39
39
|
console.log(msg);
|
|
@@ -43,22 +43,22 @@ function log(level, msg) {
|
|
|
43
43
|
console.error(msg);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
}
|
|
46
|
+
};
|
|
47
47
|
|
|
48
48
|
var group = console.group || dummy;
|
|
49
49
|
var groupCollapsed = console.groupCollapsed || dummy;
|
|
50
50
|
var groupEnd = console.groupEnd || dummy;
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
module.exports.group = logGroup(group);
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
module.exports.groupCollapsed = logGroup(groupCollapsed);
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
module.exports.groupEnd = logGroup(groupEnd);
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* @param {LogLevel} level log level
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
module.exports.setLogLevel = function (level) {
|
|
62
62
|
logLevel = level;
|
|
63
63
|
};
|
|
64
64
|
|
|
@@ -66,7 +66,7 @@ export var setLogLevel = function (level) {
|
|
|
66
66
|
* @param {Error} err error
|
|
67
67
|
* @returns {string} formatted error
|
|
68
68
|
*/
|
|
69
|
-
|
|
69
|
+
module.exports.formatError = function (err) {
|
|
70
70
|
var message = err.message;
|
|
71
71
|
var stack = err.stack;
|
|
72
72
|
if (!stack) {
|
|
@@ -77,13 +77,3 @@ export var formatError = function (err) {
|
|
|
77
77
|
return stack;
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
-
|
|
81
|
-
log.group = group;
|
|
82
|
-
log.groupCollapsed = groupCollapsed;
|
|
83
|
-
log.groupEnd = groupEnd;
|
|
84
|
-
log.setLogLevel = setLogLevel;
|
|
85
|
-
log.formatError = formatError;
|
|
86
|
-
|
|
87
|
-
// TODO: remove default export when rspack-dev-server refactored
|
|
88
|
-
export default log;
|
|
89
|
-
export { log };
|
package/hot/only-dev-server.js
CHANGED
|
@@ -3,19 +3,15 @@
|
|
|
3
3
|
Author Tobias Koppers @sokra
|
|
4
4
|
*/
|
|
5
5
|
/*globals __webpack_hash__ */
|
|
6
|
-
|
|
7
|
-
import { log, formatError } from './log.js';
|
|
8
|
-
import { emitter as hotEmitter } from './emitter.js';
|
|
9
|
-
import { logApplyResult } from './log-apply-result.js';
|
|
10
|
-
|
|
11
|
-
if (import.meta.webpackHot) {
|
|
6
|
+
if (module.hot) {
|
|
12
7
|
/** @type {undefined|string} */
|
|
13
8
|
var lastHash;
|
|
14
9
|
var upToDate = function upToDate() {
|
|
15
10
|
return /** @type {string} */ (lastHash).indexOf(__webpack_hash__) >= 0;
|
|
16
11
|
};
|
|
12
|
+
var log = require('./log');
|
|
17
13
|
var check = function check() {
|
|
18
|
-
|
|
14
|
+
module.hot
|
|
19
15
|
.check()
|
|
20
16
|
.then(function (updatedModules) {
|
|
21
17
|
if (!updatedModules) {
|
|
@@ -27,7 +23,7 @@ if (import.meta.webpackHot) {
|
|
|
27
23
|
return;
|
|
28
24
|
}
|
|
29
25
|
|
|
30
|
-
return
|
|
26
|
+
return module.hot
|
|
31
27
|
.apply({
|
|
32
28
|
ignoreUnaccepted: true,
|
|
33
29
|
ignoreDeclined: true,
|
|
@@ -63,7 +59,7 @@ if (import.meta.webpackHot) {
|
|
|
63
59
|
check();
|
|
64
60
|
}
|
|
65
61
|
|
|
66
|
-
|
|
62
|
+
require('./log-apply-result')(updatedModules, renewedModules);
|
|
67
63
|
|
|
68
64
|
if (upToDate()) {
|
|
69
65
|
log('info', '[HMR] App is up to date.');
|
|
@@ -71,22 +67,23 @@ if (import.meta.webpackHot) {
|
|
|
71
67
|
});
|
|
72
68
|
})
|
|
73
69
|
.catch(function (err) {
|
|
74
|
-
var status =
|
|
70
|
+
var status = module.hot.status();
|
|
75
71
|
if (['abort', 'fail'].indexOf(status) >= 0) {
|
|
76
72
|
log(
|
|
77
73
|
'warning',
|
|
78
74
|
'[HMR] Cannot check for update. Need to do a full reload!',
|
|
79
75
|
);
|
|
80
|
-
log('warning', '[HMR] ' + formatError(err));
|
|
76
|
+
log('warning', '[HMR] ' + log.formatError(err));
|
|
81
77
|
} else {
|
|
82
|
-
log('warning', '[HMR] Update check failed: ' + formatError(err));
|
|
78
|
+
log('warning', '[HMR] Update check failed: ' + log.formatError(err));
|
|
83
79
|
}
|
|
84
80
|
});
|
|
85
81
|
};
|
|
82
|
+
var hotEmitter = require('./emitter');
|
|
86
83
|
hotEmitter.on('webpackHotUpdate', function (currentHash) {
|
|
87
84
|
lastHash = currentHash;
|
|
88
85
|
if (!upToDate()) {
|
|
89
|
-
var status =
|
|
86
|
+
var status = module.hot.status();
|
|
90
87
|
if (status === 'idle') {
|
|
91
88
|
log('info', '[HMR] Checking for updates on the server...');
|
|
92
89
|
check();
|
package/hot/poll.js
CHANGED
|
@@ -3,36 +3,33 @@
|
|
|
3
3
|
Author Tobias Koppers @sokra
|
|
4
4
|
*/
|
|
5
5
|
/*globals __resourceQuery */
|
|
6
|
-
|
|
7
|
-
import { log, formatError } from './log.js';
|
|
8
|
-
import { logApplyResult } from './log-apply-result.js';
|
|
9
|
-
|
|
10
|
-
if (import.meta.webpackHot) {
|
|
6
|
+
if (module.hot) {
|
|
11
7
|
var hotPollInterval = +__resourceQuery.slice(1) || 10 * 60 * 1000;
|
|
8
|
+
var log = require('./log');
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
* @param {boolean=} fromUpdate true when called from update
|
|
15
12
|
*/
|
|
16
13
|
var checkForUpdate = function checkForUpdate(fromUpdate) {
|
|
17
|
-
if (
|
|
18
|
-
|
|
14
|
+
if (module.hot.status() === 'idle') {
|
|
15
|
+
module.hot
|
|
19
16
|
.check(true)
|
|
20
17
|
.then(function (updatedModules) {
|
|
21
18
|
if (!updatedModules) {
|
|
22
19
|
if (fromUpdate) log('info', '[HMR] Update applied.');
|
|
23
20
|
return;
|
|
24
21
|
}
|
|
25
|
-
|
|
22
|
+
require('./log-apply-result')(updatedModules, updatedModules);
|
|
26
23
|
checkForUpdate(true);
|
|
27
24
|
})
|
|
28
25
|
.catch(function (err) {
|
|
29
|
-
var status =
|
|
26
|
+
var status = module.hot.status();
|
|
30
27
|
if (['abort', 'fail'].indexOf(status) >= 0) {
|
|
31
28
|
log('warning', '[HMR] Cannot apply update.');
|
|
32
|
-
log('warning', '[HMR] ' + formatError(err));
|
|
29
|
+
log('warning', '[HMR] ' + log.formatError(err));
|
|
33
30
|
log('warning', '[HMR] You need to restart the application!');
|
|
34
31
|
} else {
|
|
35
|
-
log('warning', '[HMR] Update failed: ' + formatError(err));
|
|
32
|
+
log('warning', '[HMR] Update failed: ' + log.formatError(err));
|
|
36
33
|
}
|
|
37
34
|
});
|
|
38
35
|
}
|
package/hot/signal.js
CHANGED
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
Author Tobias Koppers @sokra
|
|
4
4
|
*/
|
|
5
5
|
/*globals __resourceQuery */
|
|
6
|
+
if (module.hot) {
|
|
7
|
+
var log = require('./log');
|
|
6
8
|
|
|
7
|
-
import { log, formatError } from './log.js';
|
|
8
|
-
import { logApplyResult } from './log-apply-result.js';
|
|
9
|
-
|
|
10
|
-
if (import.meta.webpackHot) {
|
|
11
9
|
/**
|
|
12
10
|
* @param {boolean=} fromUpdate true when called from update
|
|
13
11
|
*/
|
|
14
12
|
var checkForUpdate = function checkForUpdate(fromUpdate) {
|
|
15
|
-
|
|
13
|
+
module.hot
|
|
16
14
|
.check()
|
|
17
15
|
.then(function (updatedModules) {
|
|
18
16
|
if (!updatedModules) {
|
|
@@ -21,7 +19,7 @@ if (import.meta.webpackHot) {
|
|
|
21
19
|
return;
|
|
22
20
|
}
|
|
23
21
|
|
|
24
|
-
return
|
|
22
|
+
return module.hot
|
|
25
23
|
.apply({
|
|
26
24
|
ignoreUnaccepted: true,
|
|
27
25
|
onUnaccepted: function (data) {
|
|
@@ -33,17 +31,17 @@ if (import.meta.webpackHot) {
|
|
|
33
31
|
},
|
|
34
32
|
})
|
|
35
33
|
.then(function (renewedModules) {
|
|
36
|
-
|
|
34
|
+
require('./log-apply-result')(updatedModules, renewedModules);
|
|
37
35
|
|
|
38
36
|
checkForUpdate(true);
|
|
39
37
|
return null;
|
|
40
38
|
});
|
|
41
39
|
})
|
|
42
40
|
.catch(function (err) {
|
|
43
|
-
var status =
|
|
41
|
+
var status = module.hot.status();
|
|
44
42
|
if (['abort', 'fail'].indexOf(status) >= 0) {
|
|
45
43
|
log('warning', '[HMR] Cannot apply update.');
|
|
46
|
-
log('warning', '[HMR] ' + formatError(err));
|
|
44
|
+
log('warning', '[HMR] ' + log.formatError(err));
|
|
47
45
|
log('warning', '[HMR] You need to restart the application!');
|
|
48
46
|
} else {
|
|
49
47
|
log('warning', '[HMR] Update failed: ' + (err.stack || err.message));
|
|
@@ -52,12 +50,10 @@ if (import.meta.webpackHot) {
|
|
|
52
50
|
};
|
|
53
51
|
|
|
54
52
|
process.on(__resourceQuery.slice(1) || 'SIGUSR2', function () {
|
|
55
|
-
if (
|
|
53
|
+
if (module.hot.status() !== 'idle') {
|
|
56
54
|
log(
|
|
57
55
|
'warning',
|
|
58
|
-
'[HMR] Got signal but currently in ' +
|
|
59
|
-
import.meta.webpackHot.status() +
|
|
60
|
-
' state.',
|
|
56
|
+
'[HMR] Got signal but currently in ' + module.hot.status() + ' state.',
|
|
61
57
|
);
|
|
62
58
|
log('warning', '[HMR] Need to be in idle state to start hot update.');
|
|
63
59
|
return;
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-canary/core",
|
|
3
|
-
"version": "1.7.3-canary-
|
|
3
|
+
"version": "1.7.3-canary-6991b7b5-20260119174555",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
|
7
|
+
"main": "./dist/index.js",
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
8
9
|
"publishConfig": {
|
|
9
10
|
"access": "public",
|
|
10
11
|
"provenance": true
|
|
11
12
|
},
|
|
12
|
-
"type": "module",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"module.d.ts"
|
|
28
28
|
],
|
|
29
29
|
"engines": {
|
|
30
|
-
"node": "
|
|
30
|
+
"node": ">=18.12.0"
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://rspack.rs",
|
|
33
33
|
"bugs": "https://github.com/web-infra-dev/rspack/issues",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"browserslist-load-config": "^1.0.1",
|
|
48
48
|
"enhanced-resolve": "5.18.4",
|
|
49
49
|
"glob-to-regexp": "^0.4.1",
|
|
50
|
-
"memfs": "4.
|
|
50
|
+
"memfs": "4.53.0",
|
|
51
51
|
"prebundle": "^1.6.0",
|
|
52
52
|
"tinypool": "^1.1.1",
|
|
53
53
|
"tsx": "^4.21.0",
|
|
@@ -56,17 +56,14 @@
|
|
|
56
56
|
"webpack-sources": "3.3.3"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
+
"@module-federation/runtime-tools": "0.22.0",
|
|
59
60
|
"@rspack/lite-tapable": "1.1.0",
|
|
60
|
-
"@rspack/binding": "npm:@rspack-canary/binding@1.7.3-canary-
|
|
61
|
+
"@rspack/binding": "npm:@rspack-canary/binding@1.7.3-canary-6991b7b5-20260119174555"
|
|
61
62
|
},
|
|
62
63
|
"peerDependencies": {
|
|
63
|
-
"@module-federation/runtime-tools": ">=0.22.0",
|
|
64
64
|
"@swc/helpers": ">=0.5.1"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
|
-
"@module-federation/runtime-tools": {
|
|
68
|
-
"optional": true
|
|
69
|
-
},
|
|
70
67
|
"@swc/helpers": {
|
|
71
68
|
"optional": true
|
|
72
69
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type Compiler } from '../../Compiler.js';
|
|
2
|
-
export declare const GET_OR_INIT_BINDING: unique symbol;
|
|
3
|
-
export declare class Coordinator {
|
|
4
|
-
#private;
|
|
5
|
-
constructor();
|
|
6
|
-
applyServerCompiler(serverCompiler: Compiler): void;
|
|
7
|
-
applyClientCompiler(clientCompiler: Compiler): void;
|
|
8
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type binding from '@rspack/binding';
|
|
2
|
-
import type { Compiler } from '../../index.js';
|
|
3
|
-
import { RspackBuiltinPlugin } from '../base.js';
|
|
4
|
-
import { type Coordinator } from './Coordinator.js';
|
|
5
|
-
export type RscClientPluginOptions = {
|
|
6
|
-
coordinator: Coordinator;
|
|
7
|
-
};
|
|
8
|
-
export declare class RscClientPlugin extends RspackBuiltinPlugin {
|
|
9
|
-
#private;
|
|
10
|
-
name: string;
|
|
11
|
-
constructor(options: RscClientPluginOptions);
|
|
12
|
-
raw(compiler: Compiler): binding.BuiltinPlugin;
|
|
13
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type binding from '@rspack/binding';
|
|
2
|
-
import type { Compiler } from '../../index.js';
|
|
3
|
-
import { RspackBuiltinPlugin } from '../base.js';
|
|
4
|
-
import { type Coordinator } from './Coordinator.js';
|
|
5
|
-
export type RscServerPluginOptions = {
|
|
6
|
-
coordinator: Coordinator;
|
|
7
|
-
onServerComponentChanges?: () => Promise<void>;
|
|
8
|
-
};
|
|
9
|
-
export declare class RscServerPlugin extends RspackBuiltinPlugin {
|
|
10
|
-
#private;
|
|
11
|
-
name: string;
|
|
12
|
-
constructor(options: RscServerPluginOptions);
|
|
13
|
-
raw(compiler: Compiler): binding.BuiltinPlugin;
|
|
14
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { RscClientPlugin, type RscClientPluginOptions } from './RscClientPlugin.js';
|
|
2
|
-
import { RscServerPlugin } from './RscServerPlugin.js';
|
|
3
|
-
declare class ServerPlugin extends RscServerPlugin {
|
|
4
|
-
constructor(options?: Omit<RscClientPluginOptions, 'coordinator'>);
|
|
5
|
-
}
|
|
6
|
-
declare class ClientPlugin extends RscClientPlugin {
|
|
7
|
-
}
|
|
8
|
-
export declare const rsc: {
|
|
9
|
-
createPlugins: () => {
|
|
10
|
-
ServerPlugin: new (options?: Omit<RscClientPluginOptions, "coordinator">) => ServerPlugin;
|
|
11
|
-
ClientPlugin: new () => ClientPlugin;
|
|
12
|
-
};
|
|
13
|
-
layers: {
|
|
14
|
-
/**
|
|
15
|
-
* The layer for server-only runtime and picking up `react-server` export conditions.
|
|
16
|
-
*/
|
|
17
|
-
readonly rsc: "react-server-components";
|
|
18
|
-
/**
|
|
19
|
-
* Server Side Rendering layer for app.
|
|
20
|
-
*/
|
|
21
|
-
readonly ssr: "server-side-rendering";
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export {};
|
package/dist/rslib-runtime.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var __webpack_modules__ = {}, __webpack_module_cache__ = {};
|
|
2
|
-
function __webpack_require__(moduleId) {
|
|
3
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
4
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
5
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
6
|
-
exports: {}
|
|
7
|
-
};
|
|
8
|
-
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
|
|
9
|
-
}
|
|
10
|
-
__webpack_require__.m = __webpack_modules__, __webpack_require__.add = function(modules) {
|
|
11
|
-
Object.assign(__webpack_require__.m, modules);
|
|
12
|
-
}, __webpack_require__.n = (module)=>{
|
|
13
|
-
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
14
|
-
return __webpack_require__.d(getter, {
|
|
15
|
-
a: getter
|
|
16
|
-
}), getter;
|
|
17
|
-
}, __webpack_require__.d = (exports, definition)=>{
|
|
18
|
-
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key) && Object.defineProperty(exports, key, {
|
|
19
|
-
enumerable: !0,
|
|
20
|
-
get: definition[key]
|
|
21
|
-
});
|
|
22
|
-
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports)=>{
|
|
23
|
-
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
24
|
-
value: 'Module'
|
|
25
|
-
}), Object.defineProperty(exports, '__esModule', {
|
|
26
|
-
value: !0
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
export { __webpack_require__ };
|