remove v1 runtime tests

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

@ -21,11 +21,11 @@ let compileOptions = null;
let compile = null;
function getName(filename) {
const base = path.basename(filename).replace('-v2', '').replace(".html", "");
const base = path.basename(filename).replace(".html", "");
return base[0].toUpperCase() + base.slice(1);
}
describe("runtime", () => {
describe.only("runtime", () => {
before(() => {
svelte = loadSvelte(false);
svelte$ = loadSvelte(true);
@ -46,7 +46,7 @@ describe("runtime", () => {
const failed = new Set();
function runTest(dir, shared, hydrate, v2) {
function runTest(dir, shared, hydrate) {
if (dir[0] === ".") return;
const config = loadConfig(`./runtime/samples/${dir}/_config.js`);
@ -55,7 +55,7 @@ describe("runtime", () => {
throw new Error("Forgot to remove `solo: true` from test");
}
(config.skip ? it.skip : config.solo ? it.only : it)(`${dir} (${shared ? 'shared' : 'inline'} helpers${hydrate ? ', hydration' : ''}${v2 ? ', v2' : ''})`, () => {
(config.skip ? it.skip : config.solo ? it.only : it)(`${dir} (${shared ? 'shared' : 'inline'} helpers${hydrate ? ', hydration' : ''})`, () => {
if (failed.has(dir)) {
// this makes debugging easier, by only printing compiled output once
throw new Error('skipping test, already failed');
@ -72,7 +72,7 @@ describe("runtime", () => {
compileOptions.dev = config.dev;
compileOptions.store = !!config.store;
compileOptions.immutable = config.immutable;
compileOptions.parser = v2 ? 'v2' : 'v1';
compileOptions.parser = 'v2'; // TODO remove
Object.keys(require.cache)
.filter(x => x.endsWith(".html"))
@ -112,7 +112,7 @@ describe("runtime", () => {
};
try {
SvelteComponent = require(`./samples/${dir}/main${v2 ? '-v2' : ''}.html`);
SvelteComponent = require(`./samples/${dir}/main.html`);
} catch (err) {
showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store }, compile); // eslint-disable-line no-console
throw err;
@ -172,12 +172,12 @@ describe("runtime", () => {
config.error(assert, err);
} else {
failed.add(dir);
showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store, v2 }, compile); // eslint-disable-line no-console
showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store, v2: true }, compile); // eslint-disable-line no-console
throw err;
}
})
.then(() => {
if (config.show) showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store, v2 }, compile);
if (config.show) showOutput(cwd, { shared, format: 'cjs', hydratable: hydrate, store: !!compileOptions.store, v2: true }, compile);
});
});
}
@ -187,10 +187,6 @@ describe("runtime", () => {
runTest(dir, shared, false);
runTest(dir, shared, true);
runTest(dir, null, false);
if (fs.existsSync(`test/runtime/samples/${dir}/main-v2.html`)) {
runTest(dir, shared, false, true);
}
});
it("fails if options.target is missing in dev mode", () => {

@ -1,4 +1,4 @@
<button use:foo>{{x}}</button>
<button use:foo>{x}</button>
<script>
export default {

@ -1,52 +0,0 @@
<button use:tooltip="tooltip">action</button>
<svelte:window on:keydown="checkForCtrl(event)" on:keyup="checkForCtrl(event)"/>
<script>
export default {
data() {
return { tooltip: 'Perform an Action' };
},
methods: {
checkForCtrl(event) {
if (event.ctrlKey) {
this.set({ tooltip: 'Perform an augmented Action' });
} else {
this.set({ tooltip: 'Perform an Action' });
}
}
},
actions: {
tooltip(node, text) {
let tooltip = null;
function onMouseEnter() {
tooltip = document.createElement('div');
tooltip.classList.add('tooltip');
tooltip.textContent = text;
node.parentNode.appendChild(tooltip);
}
function onMouseLeave() {
if (!tooltip) return;
tooltip.remove();
tooltip = null;
}
node.addEventListener('mouseenter', onMouseEnter);
node.addEventListener('mouseleave', onMouseLeave);
return {
update(text) {
if (tooltip) tooltip.textContent = text;
},
destroy() {
node.removeEventListener('mouseenter', onMouseEnter);
node.removeEventListener('mouseleave', onMouseLeave);
}
}
}
}
}
</script>

@ -1,5 +1,5 @@
<button use:tooltip="tooltip">action</button>
<:Window on:keydown="checkForCtrl(event)" on:keyup="checkForCtrl(event)"/>
<svelte:window on:keydown="checkForCtrl(event)" on:keyup="checkForCtrl(event)"/>
<script>
export default {

@ -1 +1 @@
<textarea readonly="{{false}}"></textarea>
<textarea readonly="{false}"></textarea>

@ -1 +1 @@
<input type='checkbox' indeterminate='{{indeterminate}}'>
<input type='checkbox' indeterminate='{indeterminate}'>

@ -1 +1 @@
<textarea readonly="{{true}}"></textarea>
<textarea readonly="{true}"></textarea>

@ -1,3 +1,3 @@
{{#each items as item, i}}
<div class='{{item.foo ? "foo" : ""}} {{item.bar ? "bar" : ""}}'>{{i + 1}}</div>
{{/each}}
{#each items as item, i}
<div class='{item.foo ? "foo" : ""} {item.bar ? "bar" : ""}'>{i + 1}</div>
{/each}

@ -1 +1 @@
<span title='{{"\"foo\""}}'>foo</span>
<span title='{"\"foo\""}'>foo</span>

@ -1 +1 @@
<div class='{{class}}'></div>{{123}}
<div class='{class}'></div>{123}

@ -1,9 +0,0 @@
<div {id}/>
<script>
export default {
data: () => ({
id: 'foo'
})
};
</script>

@ -1,4 +1,4 @@
<div :id/>
<div {id}/>
<script>
export default {

@ -1 +1 @@
<input type='{{inputType}}' value='{{inputValue}}'>
<input type='{inputType}' value='{inputValue}'>

@ -1,4 +1,4 @@
<div style='color: {{color}};'>{{color}}</div>
<div style='color: {color};'>{color}</div>
<script>
export default {

@ -1,3 +1,3 @@
<svg>
<use xlink:href="#{{foo}}"/>
<use xlink:href="#{foo}"/>
</svg>

Before

Width:  |  Height:  |  Size: 42 B

After

Width:  |  Height:  |  Size: 40 B

@ -1 +1 @@
<p data-value="{{value}}"></p>
<p data-value="{value}"></p>

@ -1,2 +1,2 @@
<input type='radio' bind:group='foo' value='{{false}}'>
<input type='radio' bind:group='foo' value='{{true}}'>
<input type='radio' bind:group='foo' value='{false}'>
<input type='radio' bind:group='foo' value='{true}'>

@ -1,3 +1,3 @@
{{#if visible}}
{#if visible}
<input ref:input autofocus>
{{/if}}
{/if}

@ -1,5 +1,5 @@
<p>{{value}}</p>
<p>{{called}}</p>
<p>{value}</p>
<p>{called}</p>
<script>
export default {

@ -1,6 +1,6 @@
{{#await promise then value}}
<Foo :value />
{{/await}}
{#await promise then value}
<Foo {value} />
{/await}
<script>
import Foo from './Foo.html';

@ -1,9 +1,9 @@
{{#if promise}}
{{#await promise}}
{#if promise}
{#await promise}
<p>wait for it...</p>
{{then _}}
<p>the answer is {{answer}}!</p>
{{catch error}}
{:then _}
<p>the answer is {answer}!</p>
{:catch error}
<p>well that's odd</p>
{{/await}}
{{/if}}
{/await}
{/if}

@ -1,9 +1,9 @@
<div>
{{#await thePromise}}
{#await thePromise}
<p>loading...</p>
{{then theValue}}
<p>the value is {{theValue}}</p>
{{catch theError}}
<p>oh no! {{theError.message}}</p>
{{/await}}
{:then theValue}
<p>the value is {theValue}</p>
{:catch theError}
<p>oh no! {theError.message}</p>
{/await}
</div>

@ -1,7 +1,7 @@
{{#await thePromise}}
{#await thePromise}
<p>loading...</p>
{{then theValue}}
{:then theValue}
<button ref:button on:click='set({ clicked: theValue })'>click me</button>
{{catch theError}}
<p>oh no! {{theError.message}}</p>
{{/await}}
{:catch theError}
<p>oh no! {theError.message}</p>
{/await}

@ -1,11 +1,11 @@
{{#if show}}
{{#await thePromise}}
{#if show}
{#await thePromise}
<p>loading...</p>
{{then theValue}}
<p>the value is {{theValue}}</p>
{{catch theError}}
<p>oh no! {{theError.message}}</p>
{{/await}}
{{else}}
{:then theValue}
<p>the value is {theValue}</p>
{:catch theError}
<p>oh no! {theError.message}</p>
{/await}
{:else}
<p>Else</p>
{{/if}}
{/if}

@ -1,11 +1,11 @@
<Foo>
{{#await thePromise}}
{#await thePromise}
<p>loading...</p>
{{then theValue}}
<p>the value is {{theValue}}</p>
{{catch theError}}
<p>oh no! {{theError.message}}</p>
{{/await}}
{:then theValue}
<p>the value is {theValue}</p>
{:catch theError}
<p>oh no! {theError.message}</p>
{/await}
</Foo>
<script>

@ -1,15 +1,15 @@
{{#await thePromise}}
{#await thePromise}
<p>loading...</p>
{{then theValue}}
<p>the value is {{theValue}}</p>
{{catch theError}}
<p>oh no! {{theError.message}}</p>
{{/await}}
{:then theValue}
<p>the value is {theValue}</p>
{:catch theError}
<p>oh no! {theError.message}</p>
{/await}
{{#await thePromise}}
{#await thePromise}
<p>loading...</p>
{{then theValue}}
<p>the value is {{theValue}}</p>
{{catch theError}}
<p>oh no! {{theError.message}}</p>
{{/await}}
{:then theValue}
<p>the value is {theValue}</p>
{:catch theError}
<p>oh no! {theError.message}</p>
{/await}

@ -1,7 +1,7 @@
{{#await thePromise}}
{#await thePromise}
<p>loading...</p>
{{then theValue}}
<p>the value is {{theValue}}</p>
{{catch theError}}
<p>oh no! {{theError.message}}</p>
{{/await}}
{:then theValue}
<p>the value is {theValue}</p>
{:catch theError}
<p>oh no! {theError.message}</p>
{/await}

@ -1,7 +1,7 @@
{{#await thePromise}}
{#await thePromise}
<p>loading...</p>
{{then theValue}}
<p>the value is {{theValue}}</p>
{{catch theError}}
<p>oh no! {{theError.message}}</p>
{{/await}}
{:then theValue}
<p>the value is {theValue}</p>
{:catch theError}
<p>oh no! {theError.message}</p>
{/await}

@ -1,5 +1,5 @@
{{#await thePromise then theValue}}
<p>the value is {{theValue}}</p>
{{catch theError}}
<p>oh no! {{theError.message}}</p>
{{/await}}
{#await thePromise then theValue}
<p>the value is {theValue}</p>
{:catch theError}
<p>oh no! {theError.message}</p>
{/await}

@ -1,10 +1,10 @@
<select bind:value="selected.letter">
{{#each uppercase as letter}}
<option value="{{letter}}">{{letter}}</option>
{{/each}}
{#each uppercase as letter}
<option value="{letter}">{letter}</option>
{/each}
</select>
{{selected.letter}}
{selected.letter}
<script>
export default {
@ -21,7 +21,7 @@
}
},
computed:{
uppercase: letters => letters.map(x => x.toUpperCase())
uppercase: ({ letters }) => letters.map(x => x.toUpperCase())
}
};
</script>

@ -1,14 +1,14 @@
<select bind:value='selected'>
{{#each tasks as task}}
<option value='{{task}}'>{{task.description}}</option>
{{/each}}
{#each tasks as task}
<option value='{task}'>{task.description}</option>
{/each}
</select>
<label>
<input type='checkbox' bind:checked='selected.done'> {{selected.description}}
<input type='checkbox' bind:checked='selected.done'> {selected.description}
</label>
<h2>Pending tasks</h2>
{{#each tasks.filter(t => !t.done) as task}}
<p>{{task.description}}</p>
{{/each}}
{#each tasks.filter(t => !t.done) as task}
<p>{task.description}</p>
{/each}

@ -1,13 +1,13 @@
{{#each items as item}}
<div><input type='checkbox' bind:checked='item.completed'><p>{{item.description}}</p></div>
{{/each}}
{#each items as item}
<div><input type='checkbox' bind:checked='item.completed'><p>{item.description}</p></div>
{/each}
<p>{{numCompleted}} completed</p>
<p>{numCompleted} completed</p>
<script>
export default {
computed: {
numCompleted ( items ) {
numCompleted ({ items }) {
return items.reduce( ( total, item ) => total + ( item.completed ? 1 : 0 ), 0 );
}
}

@ -1,13 +1,13 @@
<label>
<input type="checkbox" value="{{values[0]}}" bind:group='selected' /> {{values[0].name}}
<input type="checkbox" value="{values[0]}" bind:group='selected' /> {values[0].name}
</label>
<label>
<input type="checkbox" value="{{values[1]}}" bind:group='selected' /> {{values[1].name}}
<input type="checkbox" value="{values[1]}" bind:group='selected' /> {values[1].name}
</label>
<label>
<input type="checkbox" value="{{values[2]}}" bind:group='selected' /> {{values[2].name}}
<input type="checkbox" value="{values[2]}" bind:group='selected' /> {values[2].name}
</label>
<p>{{selected.map( function ( value ) { return value.name; }).join( ', ' ) }}</p>
<p>{selected.map( function ( value ) { return value.name; }).join( ', ' ) }</p>

@ -1,7 +1,7 @@
{{#each values as value}}
{#each values as value}
<label>
<input type="checkbox" value="{{value}}" bind:group='selected' /> {{value.name}}
<input type="checkbox" value="{value}" bind:group='selected' /> {value.name}
</label>
{{/each}}
{/each}
<p>{{selected.map( function ( value ) { return value.name; }).join( ', ' ) }}</p>
<p>{selected.map( function ( value ) { return value.name; }).join( ', ' ) }</p>

@ -1,3 +1,3 @@
<input type='checkbox' bind:checked bind:indeterminate>
<p>checked? {{checked}}</p>
<p>indeterminate? {{indeterminate}}</p>
<p>checked? {checked}</p>
<p>indeterminate? {indeterminate}</p>

@ -1,2 +1,2 @@
<input type='checkbox' bind:checked='foo'>
<p>{{foo}}</p>
<p>{foo}</p>

@ -1,2 +1,2 @@
<input type='number' bind:value='count'>
<p>{{typeof count}} {{count}}</p>
<p>{typeof count} {count}</p>

@ -1,7 +1,7 @@
{{#each values as value}}
{#each values as value}
<label>
<input type="radio" value="{{value}}" bind:group='selected' /> {{value.name}}
<input type="radio" value="{value}" bind:group='selected' /> {value.name}
</label>
{{/each}}
{/each}
<p>{{selected.name}}</p>
<p>{selected.name}</p>

@ -1,2 +1,2 @@
<input type='range' bind:value='count'>
<p>{{typeof count}} {{count}}</p>
<p>{typeof count} {count}</p>

@ -1,2 +1,2 @@
<input type='range' bind:value='count'>
<p>{{typeof count}} {{count}}</p>
<p>{typeof count} {count}</p>

@ -1,3 +1,3 @@
{{#each items as item}}
<div><input bind:value='item'><p>{{item}}</p></div>
{{/each}}
{#each items as item}
<div><input bind:value='item'><p>{item}</p></div>
{/each}

@ -1,2 +1,2 @@
<h1>Hello {{component.name}}!</h1>
<h1>Hello {component.name}!</h1>
<input bind:value="component.name"/>

@ -1,2 +1,2 @@
<input bind:value='obj[prop]'>
<pre>{{JSON.stringify(obj)}}</pre>
<pre>{JSON.stringify(obj)}</pre>

@ -1,2 +1,2 @@
<input bind:value='user[prop]'>
<p>hello {{user.name}}</p>
<p>hello {user.name}</p>

@ -1,4 +1,4 @@
{{#each objects as obj}}
{#each objects as obj}
<input bind:value='obj[prop]'>
<pre>{{JSON.stringify(obj)}}</pre>
{{/each}}
<pre>{JSON.stringify(obj)}</pre>
{/each}

@ -1,3 +1,3 @@
{{#each items as item}}
<div><input bind:value='item.description'><p>{{item.description}}</p></div>
{{/each}}
{#each items as item}
<div><input bind:value='item.description'><p>{item.description}</p></div>
{/each}

@ -1,2 +1,2 @@
<input bind:value='user.name'>
<p>hello {{user.name}}</p>
<p>hello {user.name}</p>

@ -1,2 +1,2 @@
<input bind:value='name'>
<p>hello {{name}}</p>
<p>hello {name}</p>

@ -1,7 +1,7 @@
<select bind:value='foo'>
{{#each values as v}}
<option>{{v}}</option>
{{/each}}
{#each values as v}
<option>{v}</option>
{/each}
</select>
<p>foo: {{foo}}</p>
<p>foo: {foo}</p>

@ -1,6 +1,6 @@
{{#each items as item}}
{#each items as item}
<select bind:value="item.value">
<option value="hullo">Hullo</option>
<option value="world">World</option>
</select>
{{/each}}
{/each}

@ -1,6 +1,6 @@
{{#if !hidden}}
{#if !hidden}
<slot></slot>
{{/if}}
{/if}
<script>
export default {

@ -1,9 +1,9 @@
<Modal ref:modal>
<span>{{letter}}</span>
<span>{letter}</span>
<select bind:value='letter'>
{{#each letters as letter}}
<option value="{{letter}}">{{letter}}</option>
{{/each}}
{#each letters as letter}
<option value="{letter}">{letter}</option>
{/each}
</select>
</Modal>

@ -1,4 +1,4 @@
<p>selected: {{selected}}</p>
<p>selected: {selected}</p>
<select bind:value='selected'>
<option>a</option>
@ -6,4 +6,4 @@
<option>c</option>
</select>
<p>selected: {{selected}}</p>
<p>selected: {selected}</p>

@ -1,4 +1,4 @@
<p>selected: {{selected}}</p>
<p>selected: {selected}</p>
<select bind:value='selected'>
<option>a</option>
@ -6,4 +6,4 @@
<option>c</option>
</select>
<p>selected: {{selected}}</p>
<p>selected: {selected}</p>

@ -1,7 +1,7 @@
<select bind:value='selected'>
{{#each items as item}}
<option>{{item}}</option>
{{/each}}
{#each items as item}
<option>{item}</option>
{/each}
</select>
<p>selected: {{selected || 'nothing'}}</p>
<p>selected: {selected || 'nothing'}</p>

@ -4,4 +4,4 @@
<option>three</option>
</select>
<p>selected: {{selected.join( ', ' )}}</p>
<p>selected: {selected.join( ', ' )}</p>

@ -1,4 +1,4 @@
<h1>Hello {{name}}!</h1>
<h1>Hello {name}!</h1>
<select bind:value="name">
<option value="Harry">Harry</option>

@ -1,4 +1,4 @@
<p>selected: {{selected}}</p>
<p>selected: {selected}</p>
<select bind:value='selected'>
<option>one</option>
@ -6,4 +6,4 @@
<option>three</option>
</select>
<p>selected: {{selected}}</p>
<p>selected: {selected}</p>

@ -1,2 +1,2 @@
<textarea bind:value></textarea>
<p>{{value}}</p>
<p>{value}</p>

@ -7,7 +7,7 @@
},
computed: {
foo(bar) {
foo({ bar }) {
return bar * 2;
}
}

@ -1,5 +1,5 @@
<p>bar in Foo: {{bar}}</p>
<p>baz in Foo: {{baz}}</p>
<p>bar in Foo: {bar}</p>
<p>baz in Foo: {baz}</p>
<script>
export default {

@ -1,5 +1,5 @@
<Foo ref:foo bind:bar bind:baz/>
<p ref:p>{{bar + baz}}</p>
<p ref:p>{bar + baz}</p>
<script>
import Foo from './Foo.html';

@ -1,11 +1,11 @@
<input type='number' bind:value='count'>
<ol>
{{#each ids as id}}
<Nested :id bind:value="idToValue[id]">
{{id}}: value is {{idToValue[id]}}
{#each ids as id}
<Nested {id} bind:value="idToValue[id]">
{id}: value is {idToValue[id]}
</Nested>
{{/each}}
{/each}
</ol>
<script>
@ -19,7 +19,7 @@
},
computed: {
ids(count) {
ids({ count }) {
return new Array(count)
.fill(null)
.map((_, i) => 'id-' + i);

@ -1,5 +1,5 @@
<li>
{{yield}}
<slot></slot>
</li>
<script>

@ -1,11 +1,11 @@
<input type='number' bind:value='count'>
<ol>
{{#each ids as object @id}}
<Nested bind:value='idToValue[object.id]' id='{{object.id}}'>
{{object.id}}: value is {{idToValue[object.id]}}
{#each ids as object (object.id)}
<Nested bind:value='idToValue[object.id]' id='{object.id}'>
{object.id}: value is {idToValue[object.id]}
</Nested>
{{/each}}
{/each}
</ol>
<script>
@ -19,7 +19,7 @@
},
computed: {
ids(count) {
ids({ count }) {
return new Array(count)
.fill(null)
.map((_, i) => ({ id: 'id-' + i}))

@ -1,6 +1,6 @@
{{#if x}}
{#if x}
<Widget bind:foo='bar.baz'/>
{{/if}}
{/if}
<script>
import Widget from './Widget.html';

@ -1,3 +1,3 @@
<label>
{{field}} <input bind:value>
{field} <input bind:value>
</label>

@ -1,6 +1,6 @@
{{#each fields as field}}
<Nested :field bind:value='values[field]'/>
{{/each}}
{#each fields as field}
<Nested {field} bind:value='values[field]'/>
{/each}
<script>
import Nested from './Nested.html';

@ -1,4 +1,4 @@
<p>y: {{y}}</p>
<p>y: {y}</p>
<script>
export default {

@ -1,4 +1,4 @@
<p>y: {{y}}</p>
<p>y: {y}</p>
<script>
export default {

@ -1,12 +1,12 @@
<p>y: {{y}}</p>
<p>y: {y}</p>
<Baz bind:x/>
{{#if x}}
{#if x}
<Foo bind:y/>
{{else}}
{:else}
<Bar bind:y/>
{{/if}}
{/if}
<script>
import Foo from './Foo.html';

@ -1,4 +1,4 @@
<p>y: {{y}}</p>
<p>y: {y}</p>
<script>
export default {

@ -1,4 +1,4 @@
<p>y: {{y}}</p>
<p>y: {y}</p>
<script>
export default {

@ -1,10 +1,10 @@
<p>y: {{y}}</p>
<p>y: {y}</p>
{{#if x}}
{#if x}
<Foo bind:y/>
{{else}}
{:else}
<Bar bind:y/>
{{/if}}
{/if}
<Baz bind:x/>

@ -1,5 +1,5 @@
<select bind:value='selectedComponent'>
{{#each components as component}}
<option value='{{component}}'>{{component.name}}.html</option>
{{/each}}
{#each components as component}
<option value='{component}'>{component.name}.html</option>
{/each}
</select>

@ -1,8 +1,8 @@
<ComponentSelector :components bind:selectedComponent/>
<ComponentSelector {components} bind:selectedComponent/>
<Editor bind:code='selectedComponent.source' />
<pre>
{{compiled}}
{compiled}
</pre>
<script>

@ -1,6 +1,6 @@
<Widget bind:value='deep.name'/>
<p>{{deep.name}}</p>
<p>{deep.name}</p>
<script>
import Widget from './Widget.html';

@ -1,8 +1,8 @@
{{#each a as x}}
{#each a as x}
<Widget bind:value='x.name'/>
{{/each}}
{/each}
<p>{{a.map(getName).join(', ')}}</p>
<p>{a.map(getName).join(', ')}</p>
<script>
import Widget from './Widget.html';

@ -1 +1 @@
<span>{{value.id}}</span>
<span>{value.id}</span>

@ -1,6 +1,6 @@
{{#each a as x}}
{#each a as x}
<Widget bind:value='x'/>
{{/each}}
{/each}
<script>
import Widget from './Widget.html';

@ -1,8 +1,8 @@
{{#each a as x}}
{#each a as x}
<Widget bind:value='x'/>
{{/each}}
{/each}
<p>{{a.join(', ')}}</p>
<p>{a.join(', ')}</p>
<script>
import Widget from './Widget.html';

@ -1,10 +1,10 @@
{{#each list as item}}
{#each list as item}
<p>
<C identifier="{{item}}" bind:currentIdentifier>
{{item}}
<C identifier="{item}" bind:currentIdentifier>
{item}
</C>
</p>
{{/each}}
{/each}
<script>
import C from './C.html';

@ -1,14 +1,14 @@
<span
on:click="toggle()"
class="{{isCurrentlySelected ? 'selected' : ''}}"
class="{isCurrentlySelected ? 'selected' : ''}"
>
{{yield}}
<slot></slot>
</span>
<script>
export default {
computed: {
isCurrentlySelected: (currentIdentifier, identifier) => currentIdentifier === identifier
isCurrentlySelected: ({ currentIdentifier, identifier }) => currentIdentifier === identifier
},
methods: {
toggle() {

@ -1,5 +1,5 @@
<button class='bar' on:click='set({ x: "q" })'>bar</button>
<p>bar x: {{x}}</p>
<p>bar x: {x}</p>
<Baz bind:x/>

@ -1,2 +1,2 @@
<button class='baz' on:click='set({ x: "r" })'>baz</button>
<p>baz x: {{x}}</p>
<p>baz x: {x}</p>

@ -1,5 +1,5 @@
<button class='foo' on:click='set({ x: "p" })'>foo</button>
<p>foo x: {{x}}</p>
<p>foo x: {x}</p>
<Bar bind:x/>

@ -1,4 +1,4 @@
<p>x: {{x}}</p>
<p>x: {x}</p>
<Foo bind:x/>

@ -1,5 +1,5 @@
<Counter bind:count='x'/>
<p>count: {{x}}</p>
<p>count: {x}</p>
<script>
import Counter from './Counter.html';

@ -1,8 +1,8 @@
{{#if show}}
{#if show}
<Nested bind:show/>
{{else}}
{:else}
<button on:click="set({show:true})">Show</button>
{{/if}}
{/if}
<script>
import Nested from './Nested.html';

@ -1,5 +1,5 @@
<Counter bind:count='x'/>
<p>count: {{x}}</p>
<p>count: {x}</p>
<script>
import Counter from './Counter.html';

@ -1,6 +1,6 @@
{{#if foo}}
<Widget p='{{q}}'/>
{{/if}}
{#if foo}
<Widget p='{q}'/>
{/if}
<script>
import Widget from './Widget.html';

@ -1,5 +1,5 @@
<div>
<Widget :foo/>
<Widget {foo}/>
</div>
<script>

@ -1,4 +1,4 @@
<p>foo: {{foo}}</p>
<p>baz: {{baz}} ({{typeof baz}})</p>
<p>qux: {{qux}}</p>
<p>quux: {{quux}}</p>
<p>foo: {foo}</p>
<p>baz: {baz} ({typeof baz})</p>
<p>qux: {qux}</p>
<p>quux: {quux}</p>

@ -1,5 +1,5 @@
<div>
<Widget foo='{{bar}}' baz='{{40 + x}}' qux='this is a {{compound}} string' quux='{{go.deeper}}'/>
<Widget foo='{bar}' baz='{40 + x}' qux='this is a {compound} string' quux='{go.deeper}'/>
</div>
<script>

@ -1 +1 @@
<p>foo: '{{foo}}'</p>
<p>foo: '{foo}'</p>

@ -1 +1 @@
<a href={{href}}>link</a>
<a href={href}>link</a>

@ -1 +1 @@
<p>x: {{x}} ({{typeof x}})</p>
<p>x: {x} ({typeof x})</p>

@ -1,2 +1,2 @@
<p>foo: {{foo}}</p>
<p>baz: {{baz}} ({{typeof baz}})</p>
<p>foo: {foo}</p>
<p>baz: {baz} ({typeof baz})</p>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save