Skip to content

Commit 16ed5c1

Browse files
committed
Remove deprecation warnings and tests for them (tests fail)
1 parent 69b1b94 commit 16ed5c1

File tree

2 files changed

+1
-48
lines changed

2 files changed

+1
-48
lines changed

index.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,6 @@ function normalize(compiled) {
3333
return { js, css, ast: compiled.ast, warnings: compiled.warnings || compiled.stats.warnings || [] };
3434
}
3535

36-
const warned = {};
37-
function deprecatePreprocessOptions(options) {
38-
const preprocessOptions = {};
39-
40-
['markup', 'style', 'script'].forEach(kind => {
41-
if (options[kind]) {
42-
if (!warned[kind]) {
43-
console.warn(`[svelte-loader] DEPRECATION: options.${kind} is now options.preprocess.${kind}`);
44-
warned[kind] = true;
45-
}
46-
preprocessOptions[kind] = options[kind];
47-
}
48-
});
49-
50-
options.preprocess = options.preprocess || preprocessOptions;
51-
}
52-
5336
const virtualModules = new Map();
5437
let index = 0;
5538

@@ -82,8 +65,7 @@ module.exports = function(source, map) {
8265

8366
if (options.emitCss) compileOptions.css = false;
8467

85-
deprecatePreprocessOptions(options);
86-
options.preprocess.filename = compileOptions.filename;
68+
options.preprocess = { filename: compileOptions.filename };
8769

8870
preprocess(source, options.preprocess).then(processed => {
8971
if (processed.dependencies && this.addDependency) {

test/loader.spec.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -270,35 +270,6 @@ describe('loader', () => {
270270
});
271271
});
272272

273-
describe('deprecations', () => {
274-
it('should warn on options.style', done => {
275-
const { warn } = console;
276-
const warnings = [];
277-
278-
console.warn = msg => {
279-
warnings.push(msg);
280-
};
281-
282-
testLoader(
283-
'test/fixtures/style-valid.html',
284-
(err, code, map) => {
285-
expect(code).to.contain('50px');
286-
expect(warnings).to.deep.equal([
287-
'[svelte-loader] DEPRECATION: options.style is now options.preprocess.style'
288-
]);
289-
console.warn = warn;
290-
},
291-
{
292-
style: ({ content }) => {
293-
return {
294-
code: content.replace(/\$size/gi, '50px')
295-
};
296-
}
297-
}
298-
)(done);
299-
});
300-
});
301-
302273
describe('hotReload', () => {
303274
it(
304275
'should configure hotReload=false (default)',

0 commit comments

Comments
 (0)