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 Renderer, { RenderOptions } from '../Renderer';
import { get_slot_scope } from './shared/get_slot_scope';
import InlineComponent from '../../nodes/InlineComponent';
import { INode } from '../../nodes/interfaces';
import Text from '../../nodes/Text';
import { p, x } from 'code-red';
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 Renderer, { RenderOptions } from '../Renderer';
import Slot from '../../nodes/Slot';
@ -7,9 +6,7 @@ import { x } from 'code-red';
export default function(node: Slot, renderer: Renderer, options: RenderOptions) {
const slot_data = get_slot_data(node.values, true);
console.group('push');
renderer.push();
console.groupEnd();
renderer.render(node.children, options);
const result = renderer.pop();

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

Loading…
Cancel
Save