diff --git a/src/generators/server-side-rendering/index.ts b/src/generators/server-side-rendering/index.ts index 3d83ddfb5b..4006379b1e 100644 --- a/src/generators/server-side-rendering/index.ts +++ b/src/generators/server-side-rendering/index.ts @@ -163,47 +163,6 @@ export default function ssr( }; 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;`} diff --git a/test/js/samples/ssr-no-oncreate-etc/expected-bundle.js b/test/js/samples/ssr-no-oncreate-etc/expected-bundle.js index 13c64c9d6c..b1d2e97e04 100644 --- a/test/js/samples/ssr-no-oncreate-etc/expected-bundle.js +++ b/test/js/samples/ssr-no-oncreate-etc/expected-bundle.js @@ -41,22 +41,6 @@ SvelteComponent.css = { 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; module.exports = SvelteComponent; diff --git a/test/js/samples/ssr-no-oncreate-etc/expected.js b/test/js/samples/ssr-no-oncreate-etc/expected.js index d9b616e763..0aec3a5874 100644 --- a/test/js/samples/ssr-no-oncreate-etc/expected.js +++ b/test/js/samples/ssr-no-oncreate-etc/expected.js @@ -46,20 +46,6 @@ SvelteComponent.css = { }; 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; diff --git a/test/js/samples/ssr-preserve-comments/expected-bundle.js b/test/js/samples/ssr-preserve-comments/expected-bundle.js index 19461df020..7ccd01cbef 100644 --- a/test/js/samples/ssr-preserve-comments/expected-bundle.js +++ b/test/js/samples/ssr-preserve-comments/expected-bundle.js @@ -40,20 +40,4 @@ SvelteComponent.css = { 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; diff --git a/test/js/samples/ssr-preserve-comments/expected.js b/test/js/samples/ssr-preserve-comments/expected.js index 3497a72832..a672879685 100644 --- a/test/js/samples/ssr-preserve-comments/expected.js +++ b/test/js/samples/ssr-preserve-comments/expected.js @@ -44,19 +44,5 @@ SvelteComponent.css = { }; 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; \ No newline at end of file