@rspack/browser 2.0.0-beta.6 → 2.0.0-beta.7
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/builtin-loader/swc/types.d.ts +8 -0
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
- package/dist/builtin-plugin/WorkerPlugin.d.ts +1 -0
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +25 -0
- package/dist/config/devServer.d.ts +15 -22
- package/dist/config/types.d.ts +1 -4
- package/dist/index.js +418 -537
- package/dist/napi-binding.d.ts +14 -1
- package/dist/rslib-runtime.js +5 -8
- package/dist/rspack.wasm32-wasi.wasm +0 -0
- package/dist/wasi-worker-browser.mjs +22 -23
- package/package.json +1 -1
package/dist/napi-binding.d.ts
CHANGED
|
@@ -1060,6 +1060,7 @@ export interface JsRscClientPluginOptions {
|
|
|
1060
1060
|
export interface JsRscServerPluginOptions {
|
|
1061
1061
|
coordinator: JsCoordinator
|
|
1062
1062
|
onServerComponentChanges?: (() => void) | undefined | null
|
|
1063
|
+
onManifest?: ((arg: string) => Promise<undefined>) | undefined | null
|
|
1063
1064
|
}
|
|
1064
1065
|
|
|
1065
1066
|
export interface JsRsdoctorAsset {
|
|
@@ -1111,6 +1112,18 @@ export interface JsRsdoctorConnection {
|
|
|
1111
1112
|
active: boolean
|
|
1112
1113
|
}
|
|
1113
1114
|
|
|
1115
|
+
export interface JsRsdoctorConnectionsOnlyImport {
|
|
1116
|
+
moduleUkey: number
|
|
1117
|
+
modulePath: string
|
|
1118
|
+
connections: Array<JsRsdoctorConnectionsOnlyImportConnection>
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
export interface JsRsdoctorConnectionsOnlyImportConnection {
|
|
1122
|
+
originModule?: number
|
|
1123
|
+
dependencyType: string
|
|
1124
|
+
userRequest: string
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1114
1127
|
export interface JsRsdoctorDependency {
|
|
1115
1128
|
ukey: number
|
|
1116
1129
|
kind: string
|
|
@@ -1164,6 +1177,7 @@ export interface JsRsdoctorModuleGraph {
|
|
|
1164
1177
|
modules: Array<JsRsdoctorModule>
|
|
1165
1178
|
dependencies: Array<JsRsdoctorDependency>
|
|
1166
1179
|
chunkModules: Array<JsRsdoctorChunkModules>
|
|
1180
|
+
connectionsOnlyImports: Array<JsRsdoctorConnectionsOnlyImport>
|
|
1167
1181
|
}
|
|
1168
1182
|
|
|
1169
1183
|
export interface JsRsdoctorModuleGraphModule {
|
|
@@ -2656,7 +2670,6 @@ export interface RawOccurrenceChunkIdsPluginOptions {
|
|
|
2656
2670
|
}
|
|
2657
2671
|
|
|
2658
2672
|
export interface RawOptimizationOptions {
|
|
2659
|
-
removeAvailableModules: boolean
|
|
2660
2673
|
sideEffects: boolean | string
|
|
2661
2674
|
usedExports: boolean | string
|
|
2662
2675
|
providedExports: boolean
|
package/dist/rslib-runtime.js
CHANGED
|
@@ -4,20 +4,12 @@ function __webpack_require__(moduleId) {
|
|
|
4
4
|
var cachedModule = __webpack_module_cache__[moduleId];
|
|
5
5
|
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
6
6
|
var module = __webpack_module_cache__[moduleId] = {
|
|
7
|
-
id: moduleId,
|
|
8
|
-
loaded: false,
|
|
9
7
|
exports: {}
|
|
10
8
|
};
|
|
11
9
|
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
12
|
-
module.loaded = true;
|
|
13
10
|
return module.exports;
|
|
14
11
|
}
|
|
15
12
|
__webpack_require__.m = __webpack_modules__;
|
|
16
|
-
(()=>{
|
|
17
|
-
__webpack_require__.add = function(modules) {
|
|
18
|
-
Object.assign(__webpack_require__.m, modules);
|
|
19
|
-
};
|
|
20
|
-
})();
|
|
21
13
|
(()=>{
|
|
22
14
|
__webpack_require__.n = (module)=>{
|
|
23
15
|
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
@@ -35,6 +27,11 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
35
27
|
});
|
|
36
28
|
};
|
|
37
29
|
})();
|
|
30
|
+
(()=>{
|
|
31
|
+
__webpack_require__.add = function(modules) {
|
|
32
|
+
Object.assign(__webpack_require__.m, modules);
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
38
35
|
(()=>{
|
|
39
36
|
__webpack_require__.g = (()=>{
|
|
40
37
|
if ('object' == typeof globalThis) return globalThis;
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*!
|
|
1
|
+
/*! LICENSE: wasi-worker-browser.mjs.LICENSE.txt */
|
|
2
2
|
(()=>{
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
4
|
"../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js" (module) {
|
|
@@ -139,7 +139,6 @@
|
|
|
139
139
|
return module.exports;
|
|
140
140
|
}
|
|
141
141
|
(()=>{
|
|
142
|
-
"use strict";
|
|
143
142
|
var wasi_threads_esm_bundler_process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
|
|
144
143
|
var _WebAssembly = "u" > typeof WebAssembly ? WebAssembly : "u" > typeof WXWebAssembly ? WXWebAssembly : void 0;
|
|
145
144
|
var wasi_threads_esm_bundler_ENVIRONMENT_IS_NODE = 'object' == typeof wasi_threads_esm_bundler_process && null !== wasi_threads_esm_bundler_process && 'object' == typeof wasi_threads_esm_bundler_process.versions && null !== wasi_threads_esm_bundler_process.versions && 'string' == typeof wasi_threads_esm_bundler_process.versions.node;
|
|
@@ -5346,7 +5345,7 @@
|
|
|
5346
5345
|
if (1 === key_mode) break;
|
|
5347
5346
|
obj = Object.getPrototypeOf(obj);
|
|
5348
5347
|
own = false;
|
|
5349
|
-
}while (obj)
|
|
5348
|
+
}while (obj)
|
|
5350
5349
|
var ret = [];
|
|
5351
5350
|
var addName = function(ret, name, key_filter, conversion_mode) {
|
|
5352
5351
|
if (-1 !== ret.indexOf(name)) return;
|
|
@@ -8245,7 +8244,7 @@
|
|
|
8245
8244
|
const pathString = wasm_util_esm_bundler_decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
|
|
8246
8245
|
const fs = getFs(this);
|
|
8247
8246
|
const resolved_path = resolvePathSync(fs, fileDescriptor, pathString, dirflags);
|
|
8248
|
-
const r = fs.openSync(resolved_path, flagsRes,
|
|
8247
|
+
const r = fs.openSync(resolved_path, flagsRes, 0o666);
|
|
8249
8248
|
const filetype = wasi.fds.getFileTypeByFd(r);
|
|
8250
8249
|
if (3 !== filetype && ((2 & o_flags) !== 0 || resolved_path.endsWith('/'))) return 54;
|
|
8251
8250
|
const { base: max_base, inheriting: max_inheriting } = getRights(wasi.fds.stdio, r, flagsRes, filetype);
|
|
@@ -8275,7 +8274,7 @@
|
|
|
8275
8274
|
const pathString = wasm_util_esm_bundler_decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
|
|
8276
8275
|
const fs = getFs(this);
|
|
8277
8276
|
const resolved_path = await resolvePathAsync(fs, fileDescriptor, pathString, dirflags);
|
|
8278
|
-
const r = await fs.promises.open(resolved_path, flagsRes,
|
|
8277
|
+
const r = await fs.promises.open(resolved_path, flagsRes, 0o666);
|
|
8279
8278
|
const filetype = await wasi.fds.getFileTypeByFd(r);
|
|
8280
8279
|
if ((2 & o_flags) !== 0 && 3 !== filetype) return 54;
|
|
8281
8280
|
const { base: max_base, inheriting: max_inheriting } = getRights(wasi.fds.stdio, r.fd, flagsRes, filetype);
|
|
@@ -8525,7 +8524,7 @@
|
|
|
8525
8524
|
const _this = new WASI$1(args, env, fds, false, fs);
|
|
8526
8525
|
if (preopens.length > 0) for(let i = 0; i < preopens.length; ++i){
|
|
8527
8526
|
const realPath = fs.realpathSync(preopens[i].realPath, 'utf8');
|
|
8528
|
-
const fd = fs.openSync(realPath, 'r',
|
|
8527
|
+
const fd = fs.openSync(realPath, 'r', 0o666);
|
|
8529
8528
|
fds.insertPreopen(fd, preopens[i].mappedPath, realPath);
|
|
8530
8529
|
}
|
|
8531
8530
|
return _this;
|
|
@@ -8543,7 +8542,7 @@
|
|
|
8543
8542
|
if (preopens.length > 0) for(let i = 0; i < preopens.length; ++i){
|
|
8544
8543
|
const entry = preopens[i];
|
|
8545
8544
|
const realPath = await fs.promises.realpath(entry.realPath);
|
|
8546
|
-
const fd = await fs.promises.open(realPath, 'r',
|
|
8545
|
+
const fd = await fs.promises.open(realPath, 'r', 0o666);
|
|
8547
8546
|
await fds.insertPreopen(fd, entry.mappedPath, realPath);
|
|
8548
8547
|
}
|
|
8549
8548
|
return _this;
|
|
@@ -11861,7 +11860,7 @@
|
|
|
11861
11860
|
const getuid = ()=>process_1.default.getuid?.() ?? 0;
|
|
11862
11861
|
const getgid = ()=>process_1.default.getgid?.() ?? 0;
|
|
11863
11862
|
let Node$1 = class {
|
|
11864
|
-
constructor(ino, mode =
|
|
11863
|
+
constructor(ino, mode = 0o666){
|
|
11865
11864
|
this.changes = new fanout_1.FanOut();
|
|
11866
11865
|
this._uid = getuid();
|
|
11867
11866
|
this._gid = getgid();
|
|
@@ -11956,7 +11955,7 @@
|
|
|
11956
11955
|
return (this.mode & S_IFMT) === S_IFCHR;
|
|
11957
11956
|
}
|
|
11958
11957
|
makeSymlink(symlink) {
|
|
11959
|
-
this.mode =
|
|
11958
|
+
this.mode = 0o666 | S_IFLNK;
|
|
11960
11959
|
this.symlink = symlink;
|
|
11961
11960
|
}
|
|
11962
11961
|
write(buf, off = 0, len = buf.length, pos = 0) {
|
|
@@ -12101,7 +12100,7 @@
|
|
|
12101
12100
|
getNode() {
|
|
12102
12101
|
return this.node;
|
|
12103
12102
|
}
|
|
12104
|
-
createChild(name, node = this.vol.createNode(
|
|
12103
|
+
createChild(name, node = this.vol.createNode(0o666 | S_IFREG)) {
|
|
12105
12104
|
const link = new Link(this.vol, this, name);
|
|
12106
12105
|
link.setNode(node);
|
|
12107
12106
|
if (node.isDirectory()) {
|
|
@@ -15579,7 +15578,7 @@
|
|
|
15579
15578
|
this.closeFile(file);
|
|
15580
15579
|
};
|
|
15581
15580
|
const root = this.createLink();
|
|
15582
|
-
root.setNode(this.createNode(
|
|
15581
|
+
root.setNode(this.createNode(0o777 | constants_1.constants.S_IFDIR));
|
|
15583
15582
|
root.setChild('.', root);
|
|
15584
15583
|
root.getNode().nlink++;
|
|
15585
15584
|
root.setChild('..', root);
|
|
@@ -15589,7 +15588,7 @@
|
|
|
15589
15588
|
createLink(parent, name, isDirectory = false, mode) {
|
|
15590
15589
|
if (!parent) return new Link_1.Link(this, void 0, '');
|
|
15591
15590
|
if (!name) throw new Error('createLink: name cannot be empty');
|
|
15592
|
-
const finalPerm = mode ?? (isDirectory ?
|
|
15591
|
+
const finalPerm = mode ?? (isDirectory ? 0o777 : 0o666);
|
|
15593
15592
|
const hasFileType = mode && mode & constants_1.constants.S_IFMT;
|
|
15594
15593
|
const modeType = hasFileType ? mode & constants_1.constants.S_IFMT : isDirectory ? constants_1.constants.S_IFDIR : constants_1.constants.S_IFREG;
|
|
15595
15594
|
const finalMode = finalPerm & ~constants_1.constants.S_IFMT | modeType;
|
|
@@ -15769,7 +15768,7 @@
|
|
|
15769
15768
|
this.releasedFds = [];
|
|
15770
15769
|
this.openFiles = 0;
|
|
15771
15770
|
this.root = this.createLink();
|
|
15772
|
-
this.root.setNode(this.createNode(
|
|
15771
|
+
this.root.setNode(this.createNode(0o777 | constants_1.constants.S_IFDIR));
|
|
15773
15772
|
}
|
|
15774
15773
|
mountSync(mountpoint, json) {
|
|
15775
15774
|
this.fromJSON(json, mountpoint);
|
|
@@ -15807,7 +15806,7 @@
|
|
|
15807
15806
|
const dirNode = dirLink.getNode();
|
|
15808
15807
|
if (!dirNode.isDirectory()) throw (0, util_1.createError)("ENOTDIR", 'open', filename);
|
|
15809
15808
|
if (!dirNode.canExecute() || !dirNode.canWrite()) throw (0, util_1.createError)("EACCES", 'open', filename);
|
|
15810
|
-
modeNum ?? (modeNum =
|
|
15809
|
+
modeNum ?? (modeNum = 0o666);
|
|
15811
15810
|
link = this.createLink(dirLink, steps[steps.length - 1], false, modeNum);
|
|
15812
15811
|
} else throw err;
|
|
15813
15812
|
}
|
|
@@ -17760,7 +17759,7 @@
|
|
|
17760
17759
|
break;
|
|
17761
17760
|
}
|
|
17762
17761
|
++c;
|
|
17763
|
-
}while (null !== (p = p.next))
|
|
17762
|
+
}while (null !== (p = p.next))
|
|
17764
17763
|
this.length -= c;
|
|
17765
17764
|
return ret;
|
|
17766
17765
|
}
|
|
@@ -17788,7 +17787,7 @@
|
|
|
17788
17787
|
break;
|
|
17789
17788
|
}
|
|
17790
17789
|
++c;
|
|
17791
|
-
}while (null !== (p = p.next))
|
|
17790
|
+
}while (null !== (p = p.next))
|
|
17792
17791
|
this.length -= c;
|
|
17793
17792
|
return ret;
|
|
17794
17793
|
}
|
|
@@ -19324,7 +19323,7 @@
|
|
|
19324
19323
|
buffered[i++] = null;
|
|
19325
19324
|
const len = objectMode ? 1 : chunk.length;
|
|
19326
19325
|
doWrite(stream, state, false, len, chunk, encoding, callback);
|
|
19327
|
-
}while (i < buffered.length && !state.writing)
|
|
19326
|
+
}while (i < buffered.length && !state.writing)
|
|
19328
19327
|
if (i === buffered.length) resetBuffer(state);
|
|
19329
19328
|
else if (i > 256) {
|
|
19330
19329
|
buffered.splice(0, i);
|
|
@@ -21688,7 +21687,7 @@
|
|
|
21688
21687
|
({ done, value } = iteratorInfo[iteratorInfo.length - 1].next());
|
|
21689
21688
|
if (done) break;
|
|
21690
21689
|
[name, link] = value;
|
|
21691
|
-
}while ('.' === name || '..' === name)
|
|
21690
|
+
}while ('.' === name || '..' === name)
|
|
21692
21691
|
if (done) {
|
|
21693
21692
|
iteratorInfo.pop();
|
|
21694
21693
|
if (0 === iteratorInfo.length) break;
|
|
@@ -21697,7 +21696,7 @@
|
|
|
21697
21696
|
if (this.options.recursive && link.children.size) iteratorInfo.push(link.children[Symbol.iterator]());
|
|
21698
21697
|
return Dirent_1.default.build(link, this.options.encoding);
|
|
21699
21698
|
}
|
|
21700
|
-
}while (!done)
|
|
21699
|
+
}while (!done)
|
|
21701
21700
|
return null;
|
|
21702
21701
|
}
|
|
21703
21702
|
close(callback) {
|
|
@@ -22594,7 +22593,7 @@
|
|
|
22594
22593
|
};
|
|
22595
22594
|
this.mkdirSync = (path, options)=>{
|
|
22596
22595
|
const opts = (0, options_1.getMkdirOptions)(options);
|
|
22597
|
-
const modeNum = (0, util_2.modeToNumber)(opts.mode,
|
|
22596
|
+
const modeNum = (0, util_2.modeToNumber)(opts.mode, 0o777);
|
|
22598
22597
|
const filename = (0, util_2.pathToFilename)(path);
|
|
22599
22598
|
if (opts.recursive) return this._core.mkdirp(filename, modeNum);
|
|
22600
22599
|
this._core.mkdir(filename, modeNum);
|
|
@@ -22602,7 +22601,7 @@
|
|
|
22602
22601
|
this.mkdir = (path, a, b)=>{
|
|
22603
22602
|
const opts = (0, options_1.getMkdirOptions)(a);
|
|
22604
22603
|
const callback = (0, util_2.validateCallback)('function' == typeof a ? a : b);
|
|
22605
|
-
const modeNum = (0, util_2.modeToNumber)(opts.mode,
|
|
22604
|
+
const modeNum = (0, util_2.modeToNumber)(opts.mode, 0o777);
|
|
22606
22605
|
const filename = (0, util_2.pathToFilename)(path);
|
|
22607
22606
|
if (opts.recursive) this.wrapAsync(this._core.mkdirp, [
|
|
22608
22607
|
filename,
|
|
@@ -23191,7 +23190,7 @@
|
|
|
23191
23190
|
this.path = (0, util_2.pathToFilename)(path);
|
|
23192
23191
|
this.fd = void 0 === options.fd ? null : 'number' != typeof options.fd ? options.fd.fd : options.fd;
|
|
23193
23192
|
this.flags = void 0 === options.flags ? 'r' : options.flags;
|
|
23194
|
-
this.mode = void 0 === options.mode ?
|
|
23193
|
+
this.mode = void 0 === options.mode ? 0o666 : options.mode;
|
|
23195
23194
|
this.start = options.start;
|
|
23196
23195
|
this.end = options.end;
|
|
23197
23196
|
this.autoClose = void 0 === options.autoClose ? true : options.autoClose;
|
|
@@ -23287,7 +23286,7 @@
|
|
|
23287
23286
|
this.path = (0, util_2.pathToFilename)(path);
|
|
23288
23287
|
this.fd = void 0 === options.fd ? null : 'number' != typeof options.fd ? options.fd.fd : options.fd;
|
|
23289
23288
|
this.flags = void 0 === options.flags ? 'w' : options.flags;
|
|
23290
|
-
this.mode = void 0 === options.mode ?
|
|
23289
|
+
this.mode = void 0 === options.mode ? 0o666 : options.mode;
|
|
23291
23290
|
this.start = options.start;
|
|
23292
23291
|
this.autoClose = void 0 === options.autoClose ? true : !!options.autoClose;
|
|
23293
23292
|
this.pos = void 0;
|
package/package.json
CHANGED