Skip to content

Commit

Permalink
[v3.0] Show deprecation warning for maxParallelFileReads (#4575)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Jul 29, 2022
1 parent 2cc052b commit ff65a10
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/utils/options/normalizeInputOptions.ts
Expand Up @@ -185,7 +185,7 @@ const getmaxParallelFileOps = (
if (typeof maxParallelFileReads === 'number') {
warnDeprecationWithOptions(
'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.',
false,
true,
warn,
strictDeprecations
);
Expand Down
Expand Up @@ -25,5 +25,12 @@ module.exports = {
after() {
fs.readFile = fsReadFile;
assert.strictEqual(maxReads, 5, 'Wrong number of parallel file reads: ' + maxReads);
}
},
warnings: [
{
code: 'DEPRECATED_FEATURE',
message:
'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.'
}
]
};
Expand Up @@ -25,5 +25,12 @@ module.exports = {
after() {
fs.readFile = fsReadFile;
assert.strictEqual(maxReads, 3, 'Wrong number of parallel file reads: ' + maxReads);
}
},
warnings: [
{
code: 'DEPRECATED_FEATURE',
message:
'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.'
}
]
};
Expand Up @@ -32,5 +32,12 @@ module.exports = {
after() {
fs.readFile = fsReadFile;
assert.strictEqual(maxReads, 3, 'Wrong number of parallel file reads: ' + maxReads);
}
},
warnings: [
{
code: 'DEPRECATED_FEATURE',
message:
'The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.'
}
]
};
7 changes: 5 additions & 2 deletions test/misc/sanity-checks.js
Expand Up @@ -197,10 +197,13 @@ describe('sanity checks', () => {
it('does not throw when using dynamic imports with the "file" option and "inlineDynamicImports"', async () => {
const bundle = await rollup.rollup({
input: 'x',
inlineDynamicImports: true,
plugins: [loader({ x: 'console.log( "x" );import("y");', y: 'console.log( "y" );' })]
});
await bundle.generate({ file: 'x', format: 'es' });
await bundle.generate({
file: 'x',
format: 'es',
inlineDynamicImports: true
});
});

it('throws when using the object form of "input" together with the "file" option', async () => {
Expand Down

0 comments on commit ff65a10

Please sign in to comment.