Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ fn mangle_exports_info(
let mut name;
loop {
name = number_to_identifier(i);
i += 1;
if !used_names.contains(&name) {
break;
}
i += 1;
}
changes.push((export_info, UsedNameItem::Str(name.into())));
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = () => "FIXME: entry path parsed failed"
module.exports = () => "TODO: support wired entry names"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = () => "FIXME: entry path parsed failed"
module.exports = () => "TODO: support wired entry names"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = () => "FIXME: missing error"
module.exports = () => "TODO: support asset generator options validation"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = () => "FIXME: missing error"
module.exports = () => "TODO: support case sensitive checking during emitting assets"
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
it("should generate a custom error content", async () => {
expect(__STATS__.modules.filter(m => m.moduleType !== "runtime").length).toEqual(14);
expect(__STATS__.assets.length).toEqual(19);
// DIFF: rspack will not generate a errored asset when failed
// expect(__STATS__.assets.length).toEqual(19);
expect(__STATS__.assets.length).toEqual(14);
expect(__STATS__.chunks.length).toEqual(12);

let errored;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = () => "FIXME: missing assets";
module.exports = () => true;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
findBundle: function () {
return [
// FIXME: the entry depenedency should generate module even when it is ignored
// DIFF: if the entry is ignored, webpack will generate an empty module which only contains a comment in it
// "./a.js",
// "./b.js",
"./bundle0.js"
Expand Down
50 changes: 25 additions & 25 deletions tests/rspack-test/configCases/inner-graph/issue-12669/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export function getEqual(E) {
(O.isNone(x)
? O.isNone(y)
: O.isNone(y)
? false
: E.equals(y.value)(x.value))
? false
: E.equals(y.value)(x.value))
};
}
export function getShow(S) {
Expand All @@ -39,29 +39,29 @@ export const AssociativeFlatten = /*#__PURE__*/ P.instance({
export const IdentityFlatten = /*#__PURE__*/ P.instance(
/*#__PURE__*/ Object.assign(
/*#__PURE__*/ Object.assign({}, Any),
AssociativeFlatten
)
AssociativeFlatten
)
);
export const Monad = /*#__PURE__*/ P.instance(
/*#__PURE__*/ Object.assign(
/*#__PURE__*/ Object.assign({}, Covariant),
IdentityFlatten
)
IdentityFlatten
)
);
export const AssociativeBoth = /*#__PURE__*/ P.instance({
both: O.zip
});
export const IdentityBoth = /*#__PURE__*/ P.instance(
/*#__PURE__*/ Object.assign(
/*#__PURE__*/ Object.assign({}, Any),
AssociativeBoth
)
AssociativeBoth
)
);
export const Applicative = /*#__PURE__*/ P.instance(
/*#__PURE__*/ Object.assign(
/*#__PURE__*/ Object.assign({}, Covariant),
IdentityBoth
)
IdentityBoth
)
);
export const Extend = /*#__PURE__*/ P.instance({
extend: O.extend
Expand All @@ -77,8 +77,8 @@ export const forEachF = /*#__PURE__*/ P.implementForEachF()(
);
export const ForEach = /*#__PURE__*/ P.instance(
/*#__PURE__*/ Object.assign(/*#__PURE__*/ Object.assign({}, Covariant), {
forEachF
})
forEachF
})
);
export const Fail = /*#__PURE__*/ P.instance({
fail: () => O.none
Expand Down Expand Up @@ -199,10 +199,10 @@ export function getOrd(_) {
x === y
? 0
: O.isSome(x)
? O.isSome(y)
? _.compare(y.value)(x.value)
: 1
: -1
? O.isSome(y)
? _.compare(y.value)(x.value)
: 1
: -1
);
}
export const filter = predicate => fa =>
Expand Down Expand Up @@ -241,9 +241,9 @@ export const separateF = /*#__PURE__*/ P.implementSeparateF()(
);
return O.isNone(o)
? P.succeedF(F)({
left: O.none,
right: O.none
})
left: O.none,
right: O.none
})
: o.value;
}
);
Expand All @@ -270,8 +270,8 @@ export function getIdentity(A) {
export const alt = /*#__PURE__*/ P.orElseF(
/*#__PURE__*/ Object.assign(
/*#__PURE__*/ Object.assign({}, Covariant),
AssociativeEither
)
AssociativeEither
)
);
export const gen = /*#__PURE__*/ P.genF(Monad);
export const bind = /*#__PURE__*/ P.bindF(Monad);
Expand All @@ -281,14 +281,14 @@ export { branch as if, branch_ as if_ };
export const struct = /*#__PURE__*/ P.structF(
/*#__PURE__*/ Object.assign(
/*#__PURE__*/ Object.assign({}, Monad),
Applicative
)
Applicative
)
);
export const tuple = /*#__PURE__*/ P.tupleF(
/*#__PURE__*/ Object.assign(
/*#__PURE__*/ Object.assign({}, Monad),
Applicative
)
Applicative
)
);
/**
* Matchers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
"use strict";

const createTestCases = require("../_helpers/createTestCases");

// TODO: figure out why some exports are missing
module.exports = createTestCases({
nothing: {
usedExports: [],
Expand All @@ -13,24 +17,27 @@ module.exports = createTestCases({
"map",
"map_",
"none",
"some",
// "some",
"zip"
],
"../Associative": [],
"../Either": ["left", "right"],
"../Either": [
// "left",
// "right"
],
"../Function": [],
"../Identity": [],
"../Ord": [],
"../Prelude": [
"implementCompactF",
"implementForEachF",
"implementSeparateF",
// "implementCompactF",
// "implementForEachF",
// "implementSeparateF",
"instance",
"matchers",
"orElseF",
"structF",
"succeedF",
"tupleF"
// "orElseF",
// "structF",
// "succeedF",
// "tupleF"
]
}
},
Expand All @@ -47,24 +54,26 @@ module.exports = createTestCases({
"map",
"map_",
"none",
"some",
// "some",
"zip"
],
"../Associative": [],
"../Either": ["left", "right"],
"../Either": [
// "left", "right"
],
"../Function": [],
"../Identity": [],
"../Ord": [],
"../Prelude": [
"implementCompactF",
"implementForEachF",
"implementSeparateF",
// "implementCompactF",
// "implementForEachF",
// "implementSeparateF",
"instance",
"matchers",
"orElseF",
"structF",
"succeedF",
"tupleF",
// "orElseF",
// "structF",
// "succeedF",
// "tupleF",
"conditionalF"
]
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ module.exports = {
const handler = (compilation) => {
compilation.hooks.afterProcessAssets.tap("testcase", (assets) => {
const source = assets["test.js"].source();
expect(source).toContain("export const value");
// DIFF:
// expect(source).toContain("export const value");
expect(source).toContain("export { __webpack_exports__value as value };");
});
};
this.hooks.compilation.tap("testcase", handler);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = () => "FIXME: can not find external const value";
module.exports = () => true;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = () => "FIXME: support loaderContext.utils.createHash";
module.exports = () => "TODO: support loaderContext.utils.createHash";

This file was deleted.

21 changes: 11 additions & 10 deletions tests/rspack-test/configCases/loaders/options/errors.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module.exports = [
[
/\.\/loader-1\.js/,
/Loader has been/,
/options\.arg6\.bar\.baz should be a string/
],
[
/\.\/loader-2\.js/,
/Custom Loader Name has been/,
/configuration\.arg should be true/
]
// TODO: support loader options validation with schema
// [
// /\.\/loader-1\.js/,
// /Loader has been/,
// /options\.arg6\.bar\.baz should be a string/
// ],
// [
// /\.\/loader-2\.js/,
// /Custom Loader Name has been/,
// /configuration\.arg should be true/
// ]
];
2 changes: 0 additions & 2 deletions tests/rspack-test/configCases/loaders/options/test.filter.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { moduleId, setToString, toString, abc, a, $1, __1 } from "./module";
const moduleId2 = require("./commonjs").moduleId;
const toString2 = require("./commonjs").toString;
const setToString2 = require("./commonjs").setToString;
const abc2 = require("./commonjs").abc;
const a2 = require("./commonjs").a;
const equals2 = require("./commonjs")["="];
const $12 = require("./commonjs").$1;
const __12 = require("./commonjs").__1;
// TODO: support CJS mangle exports
// const moduleId2 = require("./commonjs").moduleId;
// const toString2 = require("./commonjs").toString;
// const setToString2 = require("./commonjs").setToString;
// const abc2 = require("./commonjs").abc;
// const a2 = require("./commonjs").a;
// const equals2 = require("./commonjs")["="];
// const $12 = require("./commonjs").$1;
// const __12 = require("./commonjs").__1;

it("should mangle names and remove exports even with toString named export (ESM)", () => {
expect(abc).toBe("abc");
Expand All @@ -27,23 +28,23 @@ it("should mangle names and remove exports even with toString named export (ESM)
);
});

it("should mangle names and remove exports even with toString named export (CJS)", () => {
expect(abc2).toBe("abc");
expect(toString2).toBe(Object.prototype.toString);
setToString2();
const toString3 = require("./commonjs").toString;
expect(toString3()).toBe("toString");
expect(a2).toBe("single char");
expect(equals2).toBe("single char non-identifier");
expect($12).toBe("double char");
expect(__12).toBe("3 chars");
expect(
Object.keys(require.cache[moduleId2].exports)
.map(p => p.length)
.sort()
).toEqual(
OPTIMIZATION === "deterministic"
? [1, 2, 2, 2, 2, 2, 2, 8]
: [1, 1, 1, 1, 1, 1, 1, 8]
);
});
// it("should mangle names and remove exports even with toString named export (CJS)", () => {
// expect(abc2).toBe("abc");
// expect(toString2).toBe(Object.prototype.toString);
// setToString2();
// const toString3 = require("./commonjs").toString;
// expect(toString3()).toBe("toString");
// expect(a2).toBe("single char");
// expect(equals2).toBe("single char non-identifier");
// expect($12).toBe("double char");
// expect(__12).toBe("3 chars");
// expect(
// Object.keys(require.cache[moduleId2].exports)
// .map(p => p.length)
// .sort()
// ).toEqual(
// OPTIMIZATION === "deterministic"
// ? [1, 2, 2, 2, 2, 2, 2, 8]
// : [1, 1, 1, 1, 1, 1, 1, 8]
// );
// });
Loading
Loading