remove deprecated renderCss method

pull/1348/head
Rich Harris 7 years ago
parent ab79cc6608
commit ce114600d1

@ -163,47 +163,6 @@ export default function ssr(
}; };
var warned = false; var warned = false;
${name}.renderCss = function() {
if (!warned) {
console.error('Component.renderCss(...) is deprecated and will be removed in v2 — use Component.render(...).css instead');
warned = true;
}
var components = [];
${generator.stylesheet.hasStyles &&
deindent`
components.push({
filename: ${name}.filename,
css: ${name}.css && ${name}.css.code,
map: ${name}.css && ${name}.css.map
});
`}
${templateProperties.components &&
deindent`
var seen = {};
function addComponent(component) {
var result = component.renderCss();
result.components.forEach(x => {
if (seen[x.filename]) return;
seen[x.filename] = true;
components.push(x);
});
}
${templateProperties.components.value.properties.map((prop: Node) => {
return `addComponent(%components-${getName(prop.key)});`;
})}
`}
return {
css: components.map(x => x.css).join('\\n'),
map: null,
components
};
};
${templateProperties.preload && `${name}.preload = %preload;`} ${templateProperties.preload && `${name}.preload = %preload;`}

@ -41,22 +41,6 @@ SvelteComponent.css = {
map: null map: null
}; };
var warned = false;
SvelteComponent.renderCss = function() {
if (!warned) {
console.error('Component.renderCss(...) is deprecated and will be removed in v2 — use Component.render(...).css instead');
warned = true;
}
var components = [];
return {
css: components.map(x => x.css).join('\n'),
map: null,
components
};
};
SvelteComponent.preload = preload; SvelteComponent.preload = preload;
module.exports = SvelteComponent; module.exports = SvelteComponent;

@ -46,20 +46,6 @@ SvelteComponent.css = {
}; };
var warned = false; var warned = false;
SvelteComponent.renderCss = function() {
if (!warned) {
console.error('Component.renderCss(...) is deprecated and will be removed in v2 — use Component.render(...).css instead');
warned = true;
}
var components = [];
return {
css: components.map(x => x.css).join('\n'),
map: null,
components
};
};
SvelteComponent.preload = preload; SvelteComponent.preload = preload;

@ -40,20 +40,4 @@ SvelteComponent.css = {
map: null map: null
}; };
var warned = false;
SvelteComponent.renderCss = function() {
if (!warned) {
console.error('Component.renderCss(...) is deprecated and will be removed in v2 — use Component.render(...).css instead');
warned = true;
}
var components = [];
return {
css: components.map(x => x.css).join('\n'),
map: null,
components
};
};
module.exports = SvelteComponent; module.exports = SvelteComponent;

@ -44,19 +44,5 @@ SvelteComponent.css = {
}; };
var warned = false; var warned = false;
SvelteComponent.renderCss = function() {
if (!warned) {
console.error('Component.renderCss(...) is deprecated and will be removed in v2 — use Component.render(...).css instead');
warned = true;
}
var components = [];
return {
css: components.map(x => x.css).join('\n'),
map: null,
components
};
};
module.exports = SvelteComponent; module.exports = SvelteComponent;
Loading…
Cancel
Save