pull/3539/head
Richard Harris 6 years ago
parent 6ac2c8aa4c
commit c4b8af9b21

@ -1,10 +1,9 @@
import { escape, escape_template, string_literal } from '../../utils/stringify'; import { string_literal } from '../../utils/stringify';
import { quote_name_if_necessary } from '../../../utils/names'; import { quote_name_if_necessary } from '../../../utils/names';
import Renderer, { RenderOptions } from '../Renderer'; import Renderer, { RenderOptions } from '../Renderer';
import { get_slot_scope } from './shared/get_slot_scope'; import { get_slot_scope } from './shared/get_slot_scope';
import InlineComponent from '../../nodes/InlineComponent'; import InlineComponent from '../../nodes/InlineComponent';
import { INode } from '../../nodes/interfaces'; import { INode } from '../../nodes/interfaces';
import Text from '../../nodes/Text';
import { p, x } from 'code-red'; import { p, x } from 'code-red';
function stringify_attribute(chunk: INode) { function stringify_attribute(chunk: INode) {

@ -1,4 +1,3 @@
import { quote_prop_if_necessary } from '../../../utils/names';
import get_slot_data from '../../utils/get_slot_data'; import get_slot_data from '../../utils/get_slot_data';
import Renderer, { RenderOptions } from '../Renderer'; import Renderer, { RenderOptions } from '../Renderer';
import Slot from '../../nodes/Slot'; import Slot from '../../nodes/Slot';
@ -7,9 +6,7 @@ import { x } from 'code-red';
export default function(node: Slot, renderer: Renderer, options: RenderOptions) { export default function(node: Slot, renderer: Renderer, options: RenderOptions) {
const slot_data = get_slot_data(node.values, true); const slot_data = get_slot_data(node.values, true);
console.group('push');
renderer.push(); renderer.push();
console.groupEnd();
renderer.render(node.children, options); renderer.render(node.children, options);
const result = renderer.pop(); const result = renderer.pop();

@ -1,7 +1,7 @@
import { b } from 'code-red'; import { b } from 'code-red';
import Component from '../Component'; import Component from '../Component';
import { CompileOptions } from '../../interfaces'; import { CompileOptions } from '../../interfaces';
import { stringify } from '../utils/stringify'; import { stringify, string_literal } from '../utils/stringify';
import Renderer from './Renderer'; import Renderer from './Renderer';
import { INode as TemplateNode } from '../nodes/interfaces'; // TODO import { INode as TemplateNode } from '../nodes/interfaces'; // TODO
import Text from '../nodes/Text'; import Text from '../nodes/Text';
@ -140,8 +140,8 @@ export default function ssr(
return b` return b`
${css.code && b` ${css.code && b`
const #css = { const #css = {
code: ${css.code ? stringify(css.code) : `''`}, code: "${css.code}",
map: ${css.map ? stringify(css.map.toString()) : 'null'} map: ${css.map ? string_literal(css.map.toString()) : 'null'}
};`} };`}
${component.extract_javascript(component.ast.module)} ${component.extract_javascript(component.ast.module)}

Loading…
Cancel
Save