loading...
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
return sleep(50).then(() => {
assert.htmlEqual(target.innerHTML, `
a title: loading...
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
fulfil(42);
return thePromise
diff --git a/test/runtime/samples/await-then-catch-order/_config.js b/test/runtime/samples/await-then-catch-order/_config.js
index f972520904..29fc074162 100644
--- a/test/runtime/samples/await-then-catch-order/_config.js
+++ b/test/runtime/samples/await-then-catch-order/_config.js
@@ -13,7 +13,7 @@ export default {
loading...
diff --git a/test/runtime/samples/class-shortcut-with-class/_config.js b/test/runtime/samples/class-shortcut-with-class/_config.js
index 6d647e8f9d..5f2f28555e 100644
--- a/test/runtime/samples/class-shortcut-with-class/_config.js
+++ b/test/runtime/samples/class-shortcut-with-class/_config.js
@@ -7,7 +7,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.foo = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/class-shortcut/_config.js b/test/runtime/samples/class-shortcut/_config.js
index aba7e0e031..ac5be276b0 100644
--- a/test/runtime/samples/class-shortcut/_config.js
+++ b/test/runtime/samples/class-shortcut/_config.js
@@ -6,7 +6,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.foo = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js b/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js
index f704e9327f..0c357926e2 100644
--- a/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js
+++ b/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js
@@ -8,7 +8,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.myClass = 'one';
component.attributes = {
'aria-label': 'Test'
diff --git a/test/runtime/samples/class-with-dynamic-attribute/_config.js b/test/runtime/samples/class-with-dynamic-attribute/_config.js
index 2be6500674..8e05c72065 100644
--- a/test/runtime/samples/class-with-dynamic-attribute/_config.js
+++ b/test/runtime/samples/class-with-dynamic-attribute/_config.js
@@ -5,7 +5,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.myClass = 'one';
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/class-with-spread-and-bind/_config.js b/test/runtime/samples/class-with-spread-and-bind/_config.js
index 7b50502f34..d1f3503b6c 100644
--- a/test/runtime/samples/class-with-spread-and-bind/_config.js
+++ b/test/runtime/samples/class-with-spread-and-bind/_config.js
@@ -5,7 +5,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.primary = true;
assert.htmlEqual(
diff --git a/test/runtime/samples/class-with-spread/_config.js b/test/runtime/samples/class-with-spread/_config.js
index c7c85e38b0..d49b3f053e 100644
--- a/test/runtime/samples/class-with-spread/_config.js
+++ b/test/runtime/samples/class-with-spread/_config.js
@@ -8,7 +8,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.myClass = 'one';
component.attributes = {
'aria-label': 'Test'
diff --git a/test/runtime/samples/component-binding-accessors/_config.js b/test/runtime/samples/component-binding-accessors/_config.js
index 0fb83df870..4513b43a0b 100644
--- a/test/runtime/samples/component-binding-accessors/_config.js
+++ b/test/runtime/samples/component-binding-accessors/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [input1, input2] = target.querySelectorAll('input');
assert.equal(input1.value, 'something');
assert.equal(input2.value, 'something');
diff --git a/test/runtime/samples/component-binding-blowback-b/_config.js b/test/runtime/samples/component-binding-blowback-b/_config.js
index 69af7917ca..2f6350c4fb 100644
--- a/test/runtime/samples/component-binding-blowback-b/_config.js
+++ b/test/runtime/samples/component-binding-blowback-b/_config.js
@@ -14,7 +14,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
input.value = 4;
diff --git a/test/runtime/samples/component-binding-parent-supercedes-child-b/_config.js b/test/runtime/samples/component-binding-parent-supercedes-child-b/_config.js
index bf6312f5ad..4e31a4d79c 100644
--- a/test/runtime/samples/component-binding-parent-supercedes-child-b/_config.js
+++ b/test/runtime/samples/component-binding-parent-supercedes-child-b/_config.js
@@ -4,7 +4,7 @@ export default {
x in parent: yes
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
component.a = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/component-binding-parent-supercedes-child-c/_config.js b/test/runtime/samples/component-binding-parent-supercedes-child-c/_config.js
index bf6312f5ad..4e31a4d79c 100644
--- a/test/runtime/samples/component-binding-parent-supercedes-child-c/_config.js
+++ b/test/runtime/samples/component-binding-parent-supercedes-child-c/_config.js
@@ -4,7 +4,7 @@ export default {
x in parent: yes
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
component.a = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/component-binding-private-state/_config.js b/test/runtime/samples/component-binding-private-state/_config.js
index bd8a25d490..f4f2fd6f83 100644
--- a/test/runtime/samples/component-binding-private-state/_config.js
+++ b/test/runtime/samples/component-binding-private-state/_config.js
@@ -4,7 +4,7 @@ export default {
x in parent: undefined
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
component.a = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/component-binding-reactive-statement/_config.js b/test/runtime/samples/component-binding-reactive-statement/_config.js
index 49342d0645..8b8d091c73 100644
--- a/test/runtime/samples/component-binding-reactive-statement/_config.js
+++ b/test/runtime/samples/component-binding-reactive-statement/_config.js
@@ -4,7 +4,7 @@ export default {
button 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.MouseEvent('click');
const buttons = target.querySelectorAll('button');
diff --git a/test/runtime/samples/component-event-handler-contenteditable/_config.js b/test/runtime/samples/component-event-handler-contenteditable/_config.js
index 3a85734975..1628e22d01 100644
--- a/test/runtime/samples/component-event-handler-contenteditable/_config.js
+++ b/test/runtime/samples/component-event-handler-contenteditable/_config.js
@@ -3,7 +3,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const div = target.querySelector('div');
const text = window.document.createTextNode('a');
div.insertBefore(text, null);
diff --git a/test/runtime/samples/component-events-console/_config.js b/test/runtime/samples/component-events-console/_config.js
index 39ccbd719f..fc3b4daa85 100644
--- a/test/runtime/samples/component-events-console/_config.js
+++ b/test/runtime/samples/component-events-console/_config.js
@@ -1,7 +1,7 @@
export default {
html: '
click me ',
- test({ assert, component, target }) {
+ test({ assert, target }) {
const button = target.querySelector('button');
const messages = [];
diff --git a/test/runtime/samples/component-nested-deep/_config.js b/test/runtime/samples/component-nested-deep/_config.js
index 0114e79223..3d5305529e 100644
--- a/test/runtime/samples/component-nested-deep/_config.js
+++ b/test/runtime/samples/component-nested-deep/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component }) {
+ test({ component }) {
component.l1.$destroy();
}
};
diff --git a/test/runtime/samples/component-nested-deeper/_config.js b/test/runtime/samples/component-nested-deeper/_config.js
index 86993b3e9a..828a3169ac 100644
--- a/test/runtime/samples/component-nested-deeper/_config.js
+++ b/test/runtime/samples/component-nested-deeper/_config.js
@@ -3,7 +3,7 @@ export default {
values: [1, 2, 3, 4]
},
- test({ assert, component }) {
+ test({ component }) {
component.values = [2, 3];
}
};
diff --git a/test/runtime/samples/component-slot-attribute-order/_config.js b/test/runtime/samples/component-slot-attribute-order/_config.js
index 54dc21c446..f4572317ca 100644
--- a/test/runtime/samples/component-slot-attribute-order/_config.js
+++ b/test/runtime/samples/component-slot-attribute-order/_config.js
@@ -4,7 +4,7 @@ export default {
Button
Button
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [btn, btn1, btn2] = target.querySelectorAll('button');
await btn.dispatchEvent(new window.MouseEvent('click'));
diff --git a/test/runtime/samples/component-slot-dynamic/_config.js b/test/runtime/samples/component-slot-dynamic/_config.js
index 9e43ff15fe..9a6ed1a057 100644
--- a/test/runtime/samples/component-slot-dynamic/_config.js
+++ b/test/runtime/samples/component-slot-dynamic/_config.js
@@ -3,7 +3,7 @@ export default {
override default slot
`,
- test({ assert, component }) {
+ test({ component }) {
component.nested.foo = 'b';
}
};
diff --git a/test/runtime/samples/component-slot-let-destructured-2/_config.js b/test/runtime/samples/component-slot-let-destructured-2/_config.js
index 38b04b7b5e..e407dcf2f8 100644
--- a/test/runtime/samples/component-slot-let-destructured-2/_config.js
+++ b/test/runtime/samples/component-slot-let-destructured-2/_config.js
@@ -13,7 +13,7 @@ export default {
Increment
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [button1, button2, button3] = target.querySelectorAll('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/component-slot-nested-if/_config.js b/test/runtime/samples/component-slot-nested-if/_config.js
index 45c570fc22..e4af352970 100644
--- a/test/runtime/samples/component-slot-nested-if/_config.js
+++ b/test/runtime/samples/component-slot-nested-if/_config.js
@@ -2,7 +2,7 @@ export default {
html: `
diff --git a/test/runtime/samples/props-reactive-only-with-change/_config.js b/test/runtime/samples/props-reactive-only-with-change/_config.js
index dcf12868f9..8ed82fc8ec 100644
--- a/test/runtime/samples/props-reactive-only-with-change/_config.js
+++ b/test/runtime/samples/props-reactive-only-with-change/_config.js
@@ -11,7 +11,7 @@ export default {
callbacks = [];
},
- async test({ assert, component, target }) {
+ async test({ assert, component }) {
assert.equal(callbacks.length, 2);
assert.equal(JSON.stringify(callbacks), '["1","2"]');
diff --git a/test/runtime/samples/props-reactive-slot/_config.js b/test/runtime/samples/props-reactive-slot/_config.js
index 266f0fc8a8..6129866605 100644
--- a/test/runtime/samples/props-reactive-slot/_config.js
+++ b/test/runtime/samples/props-reactive-slot/_config.js
@@ -4,7 +4,7 @@ export default {
Change
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const btn = target.querySelector('button');
const clickEvent = new window.MouseEvent('click');
diff --git a/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/_config.js b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/_config.js
index 08a3435a4b..bc34b3893c 100644
--- a/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/_config.js
+++ b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/_config.js
@@ -5,7 +5,7 @@ export default {
before_test() {
store.reset();
},
- async test({ assert, target, component }) {
+ async test({ assert, target }) {
store.set(42);
await Promise.resolve();
diff --git a/test/runtime/samples/reactive-function-called-reassigned/_config.js b/test/runtime/samples/reactive-function-called-reassigned/_config.js
index b4d50a3e84..3469c285af 100644
--- a/test/runtime/samples/reactive-function-called-reassigned/_config.js
+++ b/test/runtime/samples/reactive-function-called-reassigned/_config.js
@@ -12,7 +12,7 @@ export default {
before_test() {
called = 0;
},
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
assert.equal(called, 1);
const input = target.querySelector('input');
diff --git a/test/runtime/samples/reactive-values-exported/_config.js b/test/runtime/samples/reactive-values-exported/_config.js
index 56220d3993..9f782835f3 100644
--- a/test/runtime/samples/reactive-values-exported/_config.js
+++ b/test/runtime/samples/reactive-values-exported/_config.js
@@ -7,7 +7,7 @@ export default {
1 1 1
`,
- test({ assert, component, target }) {
+ test({ assert, component }) {
assert.equal(component.y, 1);
assert.equal(component.z, 1);
diff --git a/test/runtime/samples/reactive-values-fixed/_config.js b/test/runtime/samples/reactive-values-fixed/_config.js
index 58aee09c35..9f25b3e24e 100644
--- a/test/runtime/samples/reactive-values-fixed/_config.js
+++ b/test/runtime/samples/reactive-values-fixed/_config.js
@@ -3,7 +3,7 @@ export default {
4
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
assert.htmlEqual(target.innerHTML, `
4
`);
diff --git a/test/runtime/samples/reactive-values-second-order/_config.js b/test/runtime/samples/reactive-values-second-order/_config.js
index c1dee87e2c..c70fb0641c 100644
--- a/test/runtime/samples/reactive-values-second-order/_config.js
+++ b/test/runtime/samples/reactive-values-second-order/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target }) {
+ test({ assert, component }) {
assert.equal(component.qux, 2);
component.foo = 2;
diff --git a/test/runtime/samples/select-bind-in-array/_config.js b/test/runtime/samples/select-bind-in-array/_config.js
index d104743d44..79c5641324 100644
--- a/test/runtime/samples/select-bind-in-array/_config.js
+++ b/test/runtime/samples/select-bind-in-array/_config.js
@@ -7,7 +7,7 @@ export default {
items
},
- test({ assert, component, target }) {
+ test({ assert, component }) {
const items = component.items;
assert.equal( items[0].id, 'a' );
diff --git a/test/runtime/samples/select-no-whitespace/_config.js b/test/runtime/samples/select-no-whitespace/_config.js
index fbd4990317..b00b800033 100644
--- a/test/runtime/samples/select-no-whitespace/_config.js
+++ b/test/runtime/samples/select-no-whitespace/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target }) {
+ test({ assert, target }) {
const select = target.querySelector( 'select' );
assert.equal( select.childNodes.length, 3 );
}
diff --git a/test/runtime/samples/select-props/_config.js b/test/runtime/samples/select-props/_config.js
index 640fee0ef7..93915d5b82 100644
--- a/test/runtime/samples/select-props/_config.js
+++ b/test/runtime/samples/select-props/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window }) {
+ test({ assert, component, window }) {
const selects = document.querySelectorAll('select');
const event1 = new window.Event('change');
diff --git a/test/runtime/samples/set-after-destroy/_config.js b/test/runtime/samples/set-after-destroy/_config.js
index 063c133b87..3411f0cc79 100644
--- a/test/runtime/samples/set-after-destroy/_config.js
+++ b/test/runtime/samples/set-after-destroy/_config.js
@@ -3,7 +3,7 @@ export default {
x: 1
},
- test({ assert, component }) {
+ test({ component }) {
component.$destroy();
component.x = 2;
}
diff --git a/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js b/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js
index 1d572f52fa..9f50a3cf25 100644
--- a/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js
+++ b/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js
@@ -1,7 +1,7 @@
export default {
skip: true, // nice-to-have – tricky though, so skipping for now
- test({ assert, component }) {
+ test({ component }) {
component.foo = { x: 2 };
}
};
diff --git a/test/runtime/samples/spread-component-with-bind/_config.js b/test/runtime/samples/spread-component-with-bind/_config.js
index 96eb3c9475..5394fa80e0 100644
--- a/test/runtime/samples/spread-component-with-bind/_config.js
+++ b/test/runtime/samples/spread-component-with-bind/_config.js
@@ -9,7 +9,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
input.value = 'bar';
diff --git a/test/runtime/samples/spread-element-input-bind-group-with-value-attr/_config.js b/test/runtime/samples/spread-element-input-bind-group-with-value-attr/_config.js
index 4bbc9d278c..5176fb976c 100644
--- a/test/runtime/samples/spread-element-input-bind-group-with-value-attr/_config.js
+++ b/test/runtime/samples/spread-element-input-bind-group-with-value-attr/_config.js
@@ -7,7 +7,7 @@ export default {
html: '
',
- async test({ assert, component, target, window }) {
+ async test({ assert, target }) {
const input = target.querySelector('input');
assert.equal(input.value, 'abc');
assert.equal(input.__value, 'abc');
diff --git a/test/runtime/samples/spread-element-input-select/_config.js b/test/runtime/samples/spread-element-input-select/_config.js
index 7361e6bb31..7971a2a3fc 100644
--- a/test/runtime/samples/spread-element-input-select/_config.js
+++ b/test/runtime/samples/spread-element-input-select/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const select = target.querySelector('select');
const [option1, option2] = select.childNodes;
diff --git a/test/runtime/samples/spread-element-input-value-undefined/_config.js b/test/runtime/samples/spread-element-input-value-undefined/_config.js
index 9a83dccd80..9f5c0b8e77 100644
--- a/test/runtime/samples/spread-element-input-value-undefined/_config.js
+++ b/test/runtime/samples/spread-element-input-value-undefined/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const input = target.querySelector('input');
component.value = undefined;
diff --git a/test/runtime/samples/spread-element-select-value-undefined/_config.js b/test/runtime/samples/spread-element-select-value-undefined/_config.js
index 59cf59d662..0c2c76a119 100644
--- a/test/runtime/samples/spread-element-select-value-undefined/_config.js
+++ b/test/runtime/samples/spread-element-select-value-undefined/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const select = target.querySelector('select');
assert.equal(select.value, '1');
diff --git a/test/runtime/samples/store-assignment-updates-property/_config.js b/test/runtime/samples/store-assignment-updates-property/_config.js
index a1c41b9888..467e7782d6 100644
--- a/test/runtime/samples/store-assignment-updates-property/_config.js
+++ b/test/runtime/samples/store-assignment-updates-property/_config.js
@@ -6,7 +6,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [btn1, btn2] = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/_config.js b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/_config.js
index 27189d58d7..560eb44a9a 100644
--- a/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/_config.js
+++ b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/_config.js
@@ -4,7 +4,7 @@ export default {
Hello World
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
await component.update_value('Hi Svelte');
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/store-contextual/_config.js b/test/runtime/samples/store-contextual/_config.js
index 2a4f8fef8d..0b7aa6cf33 100644
--- a/test/runtime/samples/store-contextual/_config.js
+++ b/test/runtime/samples/store-contextual/_config.js
@@ -30,7 +30,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const inputs = target.querySelectorAll('input');
const change = new window.MouseEvent('change');
diff --git a/test/runtime/samples/store-invalidation-while-update-1/_config.js b/test/runtime/samples/store-invalidation-while-update-1/_config.js
index 0f8ff1809b..bc78193ae7 100644
--- a/test/runtime/samples/store-invalidation-while-update-1/_config.js
+++ b/test/runtime/samples/store-invalidation-while-update-1/_config.js
@@ -12,7 +12,7 @@ export default {
click me
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
const button = target.querySelector('button');
@@ -28,7 +28,7 @@ export default {
foo
click me
`);
-
+
await button.dispatchEvent(clickEvent);
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/store-invalidation-while-update-2/_config.js b/test/runtime/samples/store-invalidation-while-update-2/_config.js
index 2465b7d444..78104ef293 100644
--- a/test/runtime/samples/store-invalidation-while-update-2/_config.js
+++ b/test/runtime/samples/store-invalidation-while-update-2/_config.js
@@ -12,7 +12,7 @@ export default {
click me
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
const button = target.querySelector('button');
@@ -28,7 +28,7 @@ export default {
click me
`);
-
+
await button.dispatchEvent(clickEvent);
assert.htmlEqual(target.innerHTML, `
foo
diff --git a/test/runtime/samples/svg-attributes/_config.js b/test/runtime/samples/svg-attributes/_config.js
index 668fb391c0..44f7d3a368 100644
--- a/test/runtime/samples/svg-attributes/_config.js
+++ b/test/runtime/samples/svg-attributes/_config.js
@@ -7,7 +7,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const circle = target.querySelector('circle');
assert.equal(circle.getAttribute('class'), 'red');
}
diff --git a/test/runtime/samples/svg-class/_config.js b/test/runtime/samples/svg-class/_config.js
index 36f5d06b1c..ce32d1fb93 100644
--- a/test/runtime/samples/svg-class/_config.js
+++ b/test/runtime/samples/svg-class/_config.js
@@ -3,7 +3,7 @@
export default {
html: "
",
- test({ assert, component, target }) {
+ test({ assert, target }) {
const svg = target.querySelector('svg');
assert.equal(svg.namespaceURI, 'http://www.w3.org/2000/svg');
diff --git a/test/runtime/samples/svg-each-block-namespace/_config.js b/test/runtime/samples/svg-each-block-namespace/_config.js
index 795510c879..c43734885f 100644
--- a/test/runtime/samples/svg-each-block-namespace/_config.js
+++ b/test/runtime/samples/svg-each-block-namespace/_config.js
@@ -5,7 +5,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const circles = target.querySelectorAll('circle');
assert.equal(circles[0].namespaceURI, 'http://www.w3.org/2000/svg');
assert.equal(circles[1].namespaceURI, 'http://www.w3.org/2000/svg');
diff --git a/test/runtime/samples/svg-no-whitespace/_config.js b/test/runtime/samples/svg-no-whitespace/_config.js
index 6d4cefba21..2f7a917f16 100644
--- a/test/runtime/samples/svg-no-whitespace/_config.js
+++ b/test/runtime/samples/svg-no-whitespace/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target }) {
+ test({ assert, target }) {
const svg = target.querySelector( 'svg' );
assert.equal( svg.childNodes.length, 2 );
diff --git a/test/runtime/samples/svg-xlink/_config.js b/test/runtime/samples/svg-xlink/_config.js
index 6e0ad4664c..d3018b3698 100644
--- a/test/runtime/samples/svg-xlink/_config.js
+++ b/test/runtime/samples/svg-xlink/_config.js
@@ -8,7 +8,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const use = target.querySelector('use');
const href = use.attributes[ 'xlink:href' ];
diff --git a/test/runtime/samples/target-dom-detached/_config.js b/test/runtime/samples/target-dom-detached/_config.js
index b63656530c..055d1868eb 100644
--- a/test/runtime/samples/target-dom-detached/_config.js
+++ b/test/runtime/samples/target-dom-detached/_config.js
@@ -3,7 +3,7 @@ export default {
compileOptions: {
cssHash: () => 'svelte-xyz'
},
- async test({ assert, component, target, window }) {
+ async test({ assert, component, window }) {
assert.htmlEqual(
window.document.head.innerHTML,
''
diff --git a/test/runtime/samples/target-dom/_config.js b/test/runtime/samples/target-dom/_config.js
index b63656530c..055d1868eb 100644
--- a/test/runtime/samples/target-dom/_config.js
+++ b/test/runtime/samples/target-dom/_config.js
@@ -3,7 +3,7 @@ export default {
compileOptions: {
cssHash: () => 'svelte-xyz'
},
- async test({ assert, component, target, window }) {
+ async test({ assert, component, window }) {
assert.htmlEqual(
window.document.head.innerHTML,
''
diff --git a/test/runtime/samples/target-shadow-dom/_config.js b/test/runtime/samples/target-shadow-dom/_config.js
index cec383afd0..ff775d15fd 100644
--- a/test/runtime/samples/target-shadow-dom/_config.js
+++ b/test/runtime/samples/target-shadow-dom/_config.js
@@ -3,7 +3,7 @@ export default {
compileOptions: {
cssHash: () => 'svelte-xyz'
},
- async test({ assert, component, target, window }) {
+ async test({ assert, component, window }) {
assert.htmlEqual(window.document.head.innerHTML, '');
assert.htmlEqual(component.div.shadowRoot.innerHTML, `
diff --git a/test/runtime/samples/template/_config.js b/test/runtime/samples/template/_config.js
index fd9bb3af67..f5117d3808 100644
--- a/test/runtime/samples/template/_config.js
+++ b/test/runtime/samples/template/_config.js
@@ -7,7 +7,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const template = target.querySelector('template');
assert.htmlEqual(template.innerHTML, `
diff --git a/test/runtime/samples/transition-abort/_config.js b/test/runtime/samples/transition-abort/_config.js
index 4f31c44a4d..c0f702cb76 100644
--- a/test/runtime/samples/transition-abort/_config.js
+++ b/test/runtime/samples/transition-abort/_config.js
@@ -7,7 +7,7 @@ export default {
a
`,
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
component.visible = false;
// abort halfway through the outro transition
diff --git a/test/runtime/samples/transition-css-deferred-removal/_config.js b/test/runtime/samples/transition-css-deferred-removal/_config.js
index 763f004835..9bf429cd9e 100644
--- a/test/runtime/samples/transition-css-deferred-removal/_config.js
+++ b/test/runtime/samples/transition-css-deferred-removal/_config.js
@@ -3,7 +3,7 @@ export default {
visible: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = false;
const outer = target.querySelector('.outer');
diff --git a/test/runtime/samples/transition-css-duration/_config.js b/test/runtime/samples/transition-css-duration/_config.js
index a448c3f164..b2a9fb3476 100644
--- a/test/runtime/samples/transition-css-duration/_config.js
+++ b/test/runtime/samples/transition-css-duration/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-css-iframe/_config.js b/test/runtime/samples/transition-css-iframe/_config.js
index 612ee8e5ba..a7d98dc474 100644
--- a/test/runtime/samples/transition-css-iframe/_config.js
+++ b/test/runtime/samples/transition-css-iframe/_config.js
@@ -1,7 +1,7 @@
export default {
skip_if_ssr: true,
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
const frame = target.querySelector('iframe');
await Promise.resolve();
diff --git a/test/runtime/samples/transition-css-in-out-in-with-param/_config.js b/test/runtime/samples/transition-css-in-out-in-with-param/_config.js
index c5dfb63225..7d0dfa9a07 100644
--- a/test/runtime/samples/transition-css-in-out-in-with-param/_config.js
+++ b/test/runtime/samples/transition-css-in-out-in-with-param/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-css-in-out-in/_config.js b/test/runtime/samples/transition-css-in-out-in/_config.js
index 6d93c0e8c3..5debe6abd6 100644
--- a/test/runtime/samples/transition-css-in-out-in/_config.js
+++ b/test/runtime/samples/transition-css-in-out-in/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-args-dynamic/_config.js b/test/runtime/samples/transition-js-args-dynamic/_config.js
index 513a17486a..50bf9eeefc 100644
--- a/test/runtime/samples/transition-js-args-dynamic/_config.js
+++ b/test/runtime/samples/transition-js-args-dynamic/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-args/_config.js b/test/runtime/samples/transition-js-args/_config.js
index 00682894cd..5fb9f1e93d 100644
--- a/test/runtime/samples/transition-js-args/_config.js
+++ b/test/runtime/samples/transition-js-args/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-context/_config.js b/test/runtime/samples/transition-js-context/_config.js
index e2e7135180..6bc20d3dd1 100644
--- a/test/runtime/samples/transition-js-context/_config.js
+++ b/test/runtime/samples/transition-js-context/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-delay-in-out/_config.js b/test/runtime/samples/transition-js-delay-in-out/_config.js
index bb00604dd9..5a17eead20 100644
--- a/test/runtime/samples/transition-js-delay-in-out/_config.js
+++ b/test/runtime/samples/transition-js-delay-in-out/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-delay/_config.js b/test/runtime/samples/transition-js-delay/_config.js
index 4567573661..aeb42b5d0f 100644
--- a/test/runtime/samples/transition-js-delay/_config.js
+++ b/test/runtime/samples/transition-js-delay/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-destroyed-before-end/_config.js b/test/runtime/samples/transition-js-destroyed-before-end/_config.js
index 59615bd7a5..8033c7c00c 100644
--- a/test/runtime/samples/transition-js-destroyed-before-end/_config.js
+++ b/test/runtime/samples/transition-js-destroyed-before-end/_config.js
@@ -3,7 +3,7 @@ export default {
visible: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = false;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-dynamic-component/_config.js b/test/runtime/samples/transition-js-dynamic-component/_config.js
index e8104a67e5..b59bd41af8 100644
--- a/test/runtime/samples/transition-js-dynamic-component/_config.js
+++ b/test/runtime/samples/transition-js-dynamic-component/_config.js
@@ -7,7 +7,7 @@ export default {
a
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/transition-js-each-block-intro-outro/_config.js b/test/runtime/samples/transition-js-each-block-intro-outro/_config.js
index 9b83a1a1d3..9a0326fbb0 100644
--- a/test/runtime/samples/transition-js-each-block-intro-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-intro-outro/_config.js
@@ -4,7 +4,7 @@ export default {
things: [ 'a', 'b', 'c' ]
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const divs = target.querySelectorAll('div');
assert.equal(divs[0].foo, 0);
diff --git a/test/runtime/samples/transition-js-each-block-intro/_config.js b/test/runtime/samples/transition-js-each-block-intro/_config.js
index 42d69665cf..14e17ae8a9 100644
--- a/test/runtime/samples/transition-js-each-block-intro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-intro/_config.js
@@ -5,7 +5,7 @@ export default {
intro: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
let divs = target.querySelectorAll('div');
assert.equal(divs[0].foo, 0);
assert.equal(divs[1].foo, 0);
diff --git a/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js b/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js
index 9927289ee5..5d1ae5d3e9 100644
--- a/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js
@@ -9,7 +9,7 @@ export default {
intro: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const divs = target.querySelectorAll('div');
divs[0].i = 0; // for debugging
divs[1].i = 1;
diff --git a/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js b/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js
index c37cb8101d..f6b1416789 100644
--- a/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js
@@ -9,7 +9,7 @@ export default {
intro: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
let divs = target.querySelectorAll('div');
assert.equal(divs[0].foo, 0);
assert.equal(divs[1].foo, 0);
diff --git a/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js b/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js
index 1c98ec3198..f3677ef89a 100644
--- a/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js
@@ -7,7 +7,7 @@ export default {
]
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const divs = target.querySelectorAll( 'div' );
component.things = [
diff --git a/test/runtime/samples/transition-js-each-block-outro/_config.js b/test/runtime/samples/transition-js-each-block-outro/_config.js
index e9a7644383..b36a3d93eb 100644
--- a/test/runtime/samples/transition-js-each-block-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-outro/_config.js
@@ -3,7 +3,7 @@ export default {
things: [ 'a', 'b', 'c' ]
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const divs = target.querySelectorAll( 'div' );
component.things = [ 'a' ];
diff --git a/test/runtime/samples/transition-js-each-else-block-intro-outro/_config.js b/test/runtime/samples/transition-js-each-else-block-intro-outro/_config.js
index d51fdecb2e..692713840d 100644
--- a/test/runtime/samples/transition-js-each-else-block-intro-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-else-block-intro-outro/_config.js
@@ -3,7 +3,7 @@ export default {
things: ['a', 'b', 'c']
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.things = [];
let div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-each-else-block-intro/_config.js b/test/runtime/samples/transition-js-each-else-block-intro/_config.js
index dccfbd1a03..77edb37ef2 100644
--- a/test/runtime/samples/transition-js-each-else-block-intro/_config.js
+++ b/test/runtime/samples/transition-js-each-else-block-intro/_config.js
@@ -3,7 +3,7 @@ export default {
things: ['a', 'b', 'c']
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.things = [];
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-each-else-block-outro/_config.js b/test/runtime/samples/transition-js-each-else-block-outro/_config.js
index 163cbbd08d..fb5d9cb823 100644
--- a/test/runtime/samples/transition-js-each-else-block-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-else-block-outro/_config.js
@@ -2,7 +2,7 @@ export default {
props: {
things: []
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const div = target.querySelector('div');
component.things = ['a', 'b', 'c'];
diff --git a/test/runtime/samples/transition-js-each-keyed-unchanged/_config.js b/test/runtime/samples/transition-js-each-keyed-unchanged/_config.js
index a36b1a4610..ddf83e4397 100644
--- a/test/runtime/samples/transition-js-each-keyed-unchanged/_config.js
+++ b/test/runtime/samples/transition-js-each-keyed-unchanged/_config.js
@@ -3,7 +3,7 @@ export default {
numbers: [1, 2, 3, 4, 5]
},
- test({ assert, component, target, raf }) {
+ test({ assert, component, target }) {
const divs1 = target.querySelectorAll('div');
assert.equal(divs1[0].foo, undefined);
diff --git a/test/runtime/samples/transition-js-each-unchanged/_config.js b/test/runtime/samples/transition-js-each-unchanged/_config.js
index 671aa2af74..2dfa1f65ac 100644
--- a/test/runtime/samples/transition-js-each-unchanged/_config.js
+++ b/test/runtime/samples/transition-js-each-unchanged/_config.js
@@ -3,7 +3,7 @@ export default {
numbers: [1, 2, 3, 4, 5]
},
- test({ assert, component, target, raf }) {
+ test({ assert, component, target }) {
const divs1 = target.querySelectorAll('div');
assert.equal(divs1[0].foo, undefined);
diff --git a/test/runtime/samples/transition-js-if-block-bidi/_config.js b/test/runtime/samples/transition-js-if-block-bidi/_config.js
index 1587a92ad6..68242ecbbf 100644
--- a/test/runtime/samples/transition-js-if-block-bidi/_config.js
+++ b/test/runtime/samples/transition-js-if-block-bidi/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
global.count = 0;
component.visible = true;
diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js
index fb885b0826..ed88103f2c 100644
--- a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js
+++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js
@@ -12,7 +12,7 @@ export default {
5
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
raf.tick(100);
component.threshold = 4;
diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js b/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js
index 712be980aa..b02ccffc81 100644
--- a/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js
+++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js
@@ -13,7 +13,7 @@ export default {
intro: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const divs = target.querySelectorAll('div');
assert.equal(divs[0].foo, 0);
diff --git a/test/runtime/samples/transition-js-if-block-intro-outro/_config.js b/test/runtime/samples/transition-js-if-block-intro-outro/_config.js
index 06f72653e4..89fbaac1e6 100644
--- a/test/runtime/samples/transition-js-if-block-intro-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-block-intro-outro/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
let div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js b/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js
index 4985d39850..c3f6334576 100644
--- a/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js
@@ -3,7 +3,7 @@ export default {
z: 'z'
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
assert.equal(target.querySelector('div'), component.no);
component.x = true;
diff --git a/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/_config.js b/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/_config.js
index 1c0c6e0543..9bd793c3ad 100644
--- a/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
const t = target.querySelector('#t');
await (component.condition = false);
diff --git a/test/runtime/samples/transition-js-if-else-block-outro/_config.js b/test/runtime/samples/transition-js-if-else-block-outro/_config.js
index 1dc5af8f6c..0d56cba09b 100644
--- a/test/runtime/samples/transition-js-if-else-block-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-else-block-outro/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
assert.equal(target.querySelector('div'), component.no);
component.x = true;
diff --git a/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js b/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js
index b11f33e7c1..9a61c2e45b 100644
--- a/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js
@@ -4,7 +4,7 @@ export default {
y: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
assert.equal(target.querySelector('div'), component.no);
component.x = true;
diff --git a/test/runtime/samples/transition-js-initial/_config.js b/test/runtime/samples/transition-js-initial/_config.js
index 3760a1cbfb..770b2a8cc9 100644
--- a/test/runtime/samples/transition-js-initial/_config.js
+++ b/test/runtime/samples/transition-js-initial/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js b/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js
index af8e957b19..b4d4dd2053 100644
--- a/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js
+++ b/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js
@@ -3,7 +3,7 @@ export default {
skip_if_hydrate: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, target, raf }) {
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js
index e209e0a80c..cada0124c6 100644
--- a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js
+++ b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, target, raf }) {
const div = target.querySelector('div');
assert.equal(div.foo, undefined);
diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js b/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js
index e209e0a80c..cada0124c6 100644
--- a/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js
+++ b/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, target, raf }) {
const div = target.querySelector('div');
assert.equal(div.foo, undefined);
diff --git a/test/runtime/samples/transition-js-local/_config.js b/test/runtime/samples/transition-js-local/_config.js
index 5f9cf9048a..f2d2c0384d 100644
--- a/test/runtime/samples/transition-js-local/_config.js
+++ b/test/runtime/samples/transition-js-local/_config.js
@@ -4,7 +4,7 @@ export default {
y: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
let div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-nested-await/_config.js b/test/runtime/samples/transition-js-nested-await/_config.js
index 78dbe5ae41..e0f26580cc 100644
--- a/test/runtime/samples/transition-js-nested-await/_config.js
+++ b/test/runtime/samples/transition-js-nested-await/_config.js
@@ -10,7 +10,7 @@ export default {
promise
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
fulfil();
diff --git a/test/runtime/samples/transition-js-nested-component/_config.js b/test/runtime/samples/transition-js-nested-component/_config.js
index f1ca81c52e..87d7aaa233 100644
--- a/test/runtime/samples/transition-js-nested-component/_config.js
+++ b/test/runtime/samples/transition-js-nested-component/_config.js
@@ -3,7 +3,7 @@ export default {
x: false
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js b/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js
index c2d782c0f2..1040d1af53 100644
--- a/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js
+++ b/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js
@@ -4,7 +4,7 @@ export default {
things: ['a', 'b']
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target }) {
component.x = false;
assert.htmlEqual(target.innerHTML, '');
}
diff --git a/test/runtime/samples/transition-js-nested-each-keyed/_config.js b/test/runtime/samples/transition-js-nested-each-keyed/_config.js
index 5ec416afd9..a74aba5610 100644
--- a/test/runtime/samples/transition-js-nested-each-keyed/_config.js
+++ b/test/runtime/samples/transition-js-nested-each-keyed/_config.js
@@ -4,7 +4,7 @@ export default {
things: ['a']
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-nested-if/_config.js b/test/runtime/samples/transition-js-nested-if/_config.js
index 7d48077aca..9e4c634967 100644
--- a/test/runtime/samples/transition-js-nested-if/_config.js
+++ b/test/runtime/samples/transition-js-nested-if/_config.js
@@ -4,7 +4,7 @@ export default {
y: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-nested-intro/_config.js b/test/runtime/samples/transition-js-nested-intro/_config.js
index 9c23290b1a..5d27f84839 100644
--- a/test/runtime/samples/transition-js-nested-intro/_config.js
+++ b/test/runtime/samples/transition-js-nested-intro/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-parameterised-with-state/_config.js b/test/runtime/samples/transition-js-parameterised-with-state/_config.js
index b143e8fdd6..07dd1ad906 100644
--- a/test/runtime/samples/transition-js-parameterised-with-state/_config.js
+++ b/test/runtime/samples/transition-js-parameterised-with-state/_config.js
@@ -3,7 +3,7 @@ export default {
duration: 200
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-parameterised/_config.js b/test/runtime/samples/transition-js-parameterised/_config.js
index 6655cd374d..222e9e713e 100644
--- a/test/runtime/samples/transition-js-parameterised/_config.js
+++ b/test/runtime/samples/transition-js-parameterised/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-slot-2/_config.js b/test/runtime/samples/transition-js-slot-2/_config.js
index 0f0cad5e41..1785941252 100644
--- a/test/runtime/samples/transition-js-slot-2/_config.js
+++ b/test/runtime/samples/transition-js-slot-2/_config.js
@@ -4,7 +4,7 @@ export default {
Foo
`,
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
await component.hide();
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-slot-3/_config.js b/test/runtime/samples/transition-js-slot-3/_config.js
index 67cc0b46d2..0dfe3281fc 100644
--- a/test/runtime/samples/transition-js-slot-3/_config.js
+++ b/test/runtime/samples/transition-js-slot-3/_config.js
@@ -3,7 +3,7 @@ export default {
Foo
`,
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
await component.hide();
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-slot-4-cancelled/_config.js b/test/runtime/samples/transition-js-slot-4-cancelled/_config.js
index d6b7c31132..8be95f0150 100644
--- a/test/runtime/samples/transition-js-slot-4-cancelled/_config.js
+++ b/test/runtime/samples/transition-js-slot-4-cancelled/_config.js
@@ -9,7 +9,7 @@ export default {
props: 'Foo'
},
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
await component.hide();
const [, div] = target.querySelectorAll('div');
diff --git a/test/runtime/samples/transition-js-slot-5-cancelled-overflow/_config.js b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/_config.js
index aedc87f0b6..556f75eccd 100644
--- a/test/runtime/samples/transition-js-slot-5-cancelled-overflow/_config.js
+++ b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/_config.js
@@ -12,7 +12,7 @@ export default {
props: 'Foo'
},
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
await component.hide();
const [, div] = target.querySelectorAll('div');
diff --git a/test/runtime/samples/transition-js-slot-6-spread-cancelled/_config.js b/test/runtime/samples/transition-js-slot-6-spread-cancelled/_config.js
index 1d42c9cf71..960e02a8f6 100644
--- a/test/runtime/samples/transition-js-slot-6-spread-cancelled/_config.js
+++ b/test/runtime/samples/transition-js-slot-6-spread-cancelled/_config.js
@@ -12,7 +12,7 @@ export default {
props: 'Foo'
},
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
await component.hide();
const [, div] = target.querySelectorAll('div');
diff --git a/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/_config.js b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/_config.js
index aedc87f0b6..556f75eccd 100644
--- a/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/_config.js
+++ b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/_config.js
@@ -12,7 +12,7 @@ export default {
props: 'Foo'
},
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
await component.hide();
const [, div] = target.querySelectorAll('div');
diff --git a/test/runtime/samples/transition-js-slot-fallback/_config.js b/test/runtime/samples/transition-js-slot-fallback/_config.js
index 67cc0b46d2..0dfe3281fc 100644
--- a/test/runtime/samples/transition-js-slot-fallback/_config.js
+++ b/test/runtime/samples/transition-js-slot-fallback/_config.js
@@ -3,7 +3,7 @@ export default {
Foo
`,
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
await component.hide();
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-slot/_config.js b/test/runtime/samples/transition-js-slot/_config.js
index e4d1c85a9f..3c1cbeec10 100644
--- a/test/runtime/samples/transition-js-slot/_config.js
+++ b/test/runtime/samples/transition-js-slot/_config.js
@@ -7,7 +7,7 @@ export default {
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const p = target.querySelector('p');
assert.equal(p.foo, 0);
diff --git a/test/runtime/samples/whitespace-each-block/_config.js b/test/runtime/samples/whitespace-each-block/_config.js
index 269e21781b..9f3f5735ed 100644
--- a/test/runtime/samples/whitespace-each-block/_config.js
+++ b/test/runtime/samples/whitespace-each-block/_config.js
@@ -3,7 +3,7 @@ export default {
characters: ['a', 'b', 'c']
},
- test({ assert, component, target }) {
+ test({ assert, target }) {
assert.equal(
target.textContent,
'a b c '
diff --git a/test/runtime/samples/whitespace-list/_config.js b/test/runtime/samples/whitespace-list/_config.js
index 1ba852726c..c3c9d31333 100644
--- a/test/runtime/samples/whitespace-list/_config.js
+++ b/test/runtime/samples/whitespace-list/_config.js
@@ -14,7 +14,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const ul = target.querySelector('ul');
assert.equal(ul.childNodes.length, 5);
diff --git a/test/runtime/samples/whitespace-normal/_config.js b/test/runtime/samples/whitespace-normal/_config.js
index 9b82576c06..90ca0b42c0 100644
--- a/test/runtime/samples/whitespace-normal/_config.js
+++ b/test/runtime/samples/whitespace-normal/_config.js
@@ -3,7 +3,7 @@ export default {
name: 'world'
},
- test({ assert, component, target }) {
+ test({ assert, target }) {
assert.equal(
target.textContent,
'Hello world! How are you?'
diff --git a/test/runtime/samples/window-bind-scroll-update/_config.js b/test/runtime/samples/window-bind-scroll-update/_config.js
index ac6f54ad55..60bdb4b7f6 100644
--- a/test/runtime/samples/window-bind-scroll-update/_config.js
+++ b/test/runtime/samples/window-bind-scroll-update/_config.js
@@ -24,7 +24,7 @@ export default {
clock = null;
},
- async test({ assert, component, target, window }) {
+ async test({ assert, component, window }) {
assert.equal(window.pageYOffset, 0);
// clear the previous 'scrolling' state
diff --git a/test/runtime/samples/window-binding-resize/_config.js b/test/runtime/samples/window-binding-resize/_config.js
index c396666014..c99e92a07b 100644
--- a/test/runtime/samples/window-binding-resize/_config.js
+++ b/test/runtime/samples/window-binding-resize/_config.js
@@ -16,7 +16,7 @@ export default {
skip_if_ssr: true, // there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.Event('resize');
Object.defineProperties(window, {
diff --git a/test/runtime/samples/window-binding-scroll-store/_config.js b/test/runtime/samples/window-binding-scroll-store/_config.js
index 0ce87efee0..47951506bf 100644
--- a/test/runtime/samples/window-binding-scroll-store/_config.js
+++ b/test/runtime/samples/window-binding-scroll-store/_config.js
@@ -8,7 +8,7 @@ export default {
}
});
},
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
assert.equal(window.pageYOffset, 0);
const event = new window.Event('scroll');
diff --git a/test/runtime/samples/window-event-custom/_config.js b/test/runtime/samples/window-event-custom/_config.js
index 15644bc8e8..2e3b577b86 100644
--- a/test/runtime/samples/window-event-custom/_config.js
+++ b/test/runtime/samples/window-event-custom/_config.js
@@ -1,7 +1,7 @@
export default {
html: '
escaped: false
',
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.KeyboardEvent('keydown', {
key: 'Escape'
});
diff --git a/test/runtime/samples/window-event/_config.js b/test/runtime/samples/window-event/_config.js
index 90c6562f95..9abde274e9 100644
--- a/test/runtime/samples/window-event/_config.js
+++ b/test/runtime/samples/window-event/_config.js
@@ -3,7 +3,7 @@ export default {
skip_if_ssr: true, // there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.Event('resize');
Object.defineProperties(window, {
From 0d7c583364ad87697473af19898f255be0584f21 Mon Sep 17 00:00:00 2001
From: Mohamed Haddi
Date: Sun, 10 Oct 2021 18:11:10 +0100
Subject: [PATCH 3/8] [docs] align input controls (#6831)
---
.../06-bindings/02-numeric-inputs/app-a/App.svelte | 7 ++++++-
.../06-bindings/02-numeric-inputs/app-b/App.svelte | 7 ++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/site/content/tutorial/06-bindings/02-numeric-inputs/app-a/App.svelte b/site/content/tutorial/06-bindings/02-numeric-inputs/app-a/App.svelte
index ac4fadf012..795090a8bd 100644
--- a/site/content/tutorial/06-bindings/02-numeric-inputs/app-a/App.svelte
+++ b/site/content/tutorial/06-bindings/02-numeric-inputs/app-a/App.svelte
@@ -13,4 +13,9 @@
-{a} + {b} = {a + b}
\ No newline at end of file
+{a} + {b} = {a + b}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/02-numeric-inputs/app-b/App.svelte b/site/content/tutorial/06-bindings/02-numeric-inputs/app-b/App.svelte
index 798d57e021..a419675623 100644
--- a/site/content/tutorial/06-bindings/02-numeric-inputs/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/02-numeric-inputs/app-b/App.svelte
@@ -13,4 +13,9 @@
-{a} + {b} = {a + b}
\ No newline at end of file
+{a} + {b} = {a + b}
+
+
\ No newline at end of file
From b6b7f5c8a46c18712c502a41341a81e586e9e97c Mon Sep 17 00:00:00 2001
From: Vaibhav Rai
Date: Wed, 13 Oct 2021 01:43:44 +0530
Subject: [PATCH 4/8] [fix] properly respect sveltePath when rewriting user
imports (#6842)
---
src/compiler/compile/create_module.ts | 21 +++---
test/js/samples/custom-svelte-path/_config.js | 5 ++
.../js/samples/custom-svelte-path/expected.js | 64 +++++++++++++++++++
.../samples/custom-svelte-path/input.svelte | 9 +++
4 files changed, 90 insertions(+), 9 deletions(-)
create mode 100644 test/js/samples/custom-svelte-path/_config.js
create mode 100644 test/js/samples/custom-svelte-path/expected.js
create mode 100644 test/js/samples/custom-svelte-path/input.svelte
diff --git a/src/compiler/compile/create_module.ts b/src/compiler/compile/create_module.ts
index 037b2b396e..c9f925c4b4 100644
--- a/src/compiler/compile/create_module.ts
+++ b/src/compiler/compile/create_module.ts
@@ -26,7 +26,7 @@ export default function create_module(
helpers.sort((a, b) => (a.name < b.name) ? -1 : 1);
globals.sort((a, b) => (a.name < b.name) ? -1 : 1);
-
+
const formatter = wrappers[format];
if (!formatter) {
@@ -43,7 +43,7 @@ function edit_source(source, sveltePath) {
}
function get_internal_globals(
- globals: Array<{ name: string; alias: Identifier }>,
+ globals: Array<{ name: string; alias: Identifier }>,
helpers: Array<{ name: string; alias: Identifier }>
) {
return globals.length > 0 && {
@@ -66,7 +66,7 @@ function get_internal_globals(
init: helpers.find(({ name }) => name === 'globals').alias
}]
};
-}
+}
function esm(
program: any,
@@ -93,12 +93,15 @@ function esm(
const internal_globals = get_internal_globals(globals, helpers);
// edit user imports
- imports.forEach(node => {
- node.source.value = edit_source(node.source.value, sveltePath);
- });
- exports_from.forEach(node => {
- node.source!.value = edit_source(node.source!.value, sveltePath);
- });
+ function rewrite_import(node) {
+ const value = edit_source(node.source.value, sveltePath);
+ if (node.source.value !== value) {
+ node.source.value = value;
+ node.source.raw = null;
+ }
+ }
+ imports.forEach(rewrite_import);
+ exports_from.forEach(rewrite_import);
const exports = module_exports.length > 0 && {
type: 'ExportNamedDeclaration',
diff --git a/test/js/samples/custom-svelte-path/_config.js b/test/js/samples/custom-svelte-path/_config.js
new file mode 100644
index 0000000000..19a7366845
--- /dev/null
+++ b/test/js/samples/custom-svelte-path/_config.js
@@ -0,0 +1,5 @@
+export default {
+ options: {
+ sveltePath: 'a/b/svelte'
+ }
+};
diff --git a/test/js/samples/custom-svelte-path/expected.js b/test/js/samples/custom-svelte-path/expected.js
new file mode 100644
index 0000000000..3210f216d3
--- /dev/null
+++ b/test/js/samples/custom-svelte-path/expected.js
@@ -0,0 +1,64 @@
+/* generated by Svelte vX.Y.Z */
+import {
+ SvelteComponent,
+ append,
+ detach,
+ element,
+ init,
+ insert,
+ noop,
+ safe_not_equal,
+ set_data,
+ text
+} from "a/b/svelte/internal";
+
+import { onMount } from "a/b/svelte";
+
+function create_fragment(ctx) {
+ let h1;
+ let t0;
+ let t1;
+ let t2;
+
+ return {
+ c() {
+ h1 = element("h1");
+ t0 = text("Hello ");
+ t1 = text(/*name*/ ctx[0]);
+ t2 = text("!");
+ },
+ m(target, anchor) {
+ insert(target, h1, anchor);
+ append(h1, t0);
+ append(h1, t1);
+ append(h1, t2);
+ },
+ p(ctx, [dirty]) {
+ if (dirty & /*name*/ 1) set_data(t1, /*name*/ ctx[0]);
+ },
+ i: noop,
+ o: noop,
+ d(detaching) {
+ if (detaching) detach(h1);
+ }
+ };
+}
+
+function instance($$self, $$props, $$invalidate) {
+ let name = '';
+
+ onMount(() => {
+ $$invalidate(0, name = 'world');
+ });
+
+ return [name];
+}
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance, create_fragment, safe_not_equal, {});
+ }
+}
+
+export default Component;
\ No newline at end of file
diff --git a/test/js/samples/custom-svelte-path/input.svelte b/test/js/samples/custom-svelte-path/input.svelte
new file mode 100644
index 0000000000..03d31e7c7b
--- /dev/null
+++ b/test/js/samples/custom-svelte-path/input.svelte
@@ -0,0 +1,9 @@
+
+
+Hello {name}!
\ No newline at end of file
From 3f11232d241bc721eb084229da720b6079cdee6c Mon Sep 17 00:00:00 2001
From: Conduitry
Date: Tue, 12 Oct 2021 16:16:44 -0400
Subject: [PATCH 5/8] -> v3.43.2
---
CHANGELOG.md | 4 ++++
package-lock.json | 4 ++--
package.json | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 59bdc33c5b..883fdcd56f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Svelte changelog
+## 3.43.2
+
+* Fix regression where user-specified `import`s were not rewritten according to the `sveltePath` option ([#6834](https://github.com/sveltejs/svelte/issues/6834))
+
## 3.43.1
* Prevent a rejecting promise used in `{#await}` during SSR from appearing as an unhandled rejection ([#6789](https://github.com/sveltejs/svelte/issues/6789))
diff --git a/package-lock.json b/package-lock.json
index 872f3c61ea..4ea2ce35bc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "svelte",
- "version": "3.43.1",
+ "version": "3.43.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "svelte",
- "version": "3.43.1",
+ "version": "3.43.2",
"license": "MIT",
"devDependencies": {
"@ampproject/remapping": "^0.3.0",
diff --git a/package.json b/package.json
index 5b67d2c541..511ca60e05 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "svelte",
- "version": "3.43.1",
+ "version": "3.43.2",
"description": "Cybernetically enhanced web apps",
"module": "index.mjs",
"main": "index",
From be1eff0305236fbf0c103ba94638d8d6c428a77b Mon Sep 17 00:00:00 2001
From: Bjorn Lu <34116392+bluwy@users.noreply.github.com>
Date: Mon, 18 Oct 2021 01:04:35 +0800
Subject: [PATCH 6/8] [feat] add enableSourcemap option (#6835)
---
site/content/docs/04-compile-time.md | 2 ++
src/compiler/compile/Component.ts | 30 ++++++++++++-------
src/compiler/compile/index.ts | 3 +-
src/compiler/compile/render_dom/index.ts | 13 ++++++--
src/compiler/compile/render_ssr/index.ts | 5 +++-
.../compile/utils/check_enable_sourcemap.ts | 10 +++++++
src/compiler/interfaces.ts | 3 ++
test/sourcemaps/index.ts | 12 ++++----
.../samples/no-sourcemap/_config.js | 5 ++++
.../samples/no-sourcemap/input.svelte | 11 +++++++
test/sourcemaps/samples/no-sourcemap/test.js | 4 +++
.../samples/only-css-sourcemap/_config.js | 5 ++++
.../samples/only-css-sourcemap/input.svelte | 11 +++++++
.../samples/only-css-sourcemap/test.js | 4 +++
.../samples/only-js-sourcemap/_config.js | 5 ++++
.../samples/only-js-sourcemap/input.svelte | 11 +++++++
.../samples/only-js-sourcemap/test.js | 4 +++
17 files changed, 117 insertions(+), 21 deletions(-)
create mode 100644 src/compiler/compile/utils/check_enable_sourcemap.ts
create mode 100644 test/sourcemaps/samples/no-sourcemap/_config.js
create mode 100644 test/sourcemaps/samples/no-sourcemap/input.svelte
create mode 100644 test/sourcemaps/samples/no-sourcemap/test.js
create mode 100644 test/sourcemaps/samples/only-css-sourcemap/_config.js
create mode 100644 test/sourcemaps/samples/only-css-sourcemap/input.svelte
create mode 100644 test/sourcemaps/samples/only-css-sourcemap/test.js
create mode 100644 test/sourcemaps/samples/only-js-sourcemap/_config.js
create mode 100644 test/sourcemaps/samples/only-js-sourcemap/input.svelte
create mode 100644 test/sourcemaps/samples/only-js-sourcemap/test.js
diff --git a/site/content/docs/04-compile-time.md b/site/content/docs/04-compile-time.md
index ed6977f81f..8e709d7c37 100644
--- a/site/content/docs/04-compile-time.md
+++ b/site/content/docs/04-compile-time.md
@@ -82,6 +82,8 @@ The following options can be passed to the compiler. None are required:
| `loopGuardTimeout` | 0 | A `number` that tells Svelte to break the loop if it blocks the thread for more than `loopGuardTimeout` ms. This is useful to prevent infinite loops. **Only available when `dev: true`**
| `preserveComments` | `false` | If `true`, your HTML comments will be preserved during server-side rendering. By default, they are stripped out.
| `preserveWhitespace` | `false` | If `true`, whitespace inside and between elements is kept as you typed it, rather than removed or collapsed to a single space where possible.
+| `sourcemap` | `object | string` | An initial sourcemap that will be merged into the final output sourcemap. This is usually the preprocessor sourcemap.
+| `enableSourcemap` | `boolean | { js: boolean; css: boolean; }` | If `true`, Svelte generate sourcemaps for components. Use an object with `js` or `css` for more granular control of sourcemap generation. By default, this is `true`.
| `outputFilename` | `null` | A `string` used for your JavaScript sourcemap.
| `cssOutputFilename` | `null` | A `string` used for your CSS sourcemap.
| `sveltePath` | `"svelte"` | The location of the `svelte` package. Any imports from `svelte` or `svelte/[module]` will be modified accordingly.
diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts
index 202e14fd98..4d4cf909fd 100644
--- a/src/compiler/compile/Component.ts
+++ b/src/compiler/compile/Component.ts
@@ -36,6 +36,7 @@ import { clone } from '../utils/clone';
import compiler_warnings from './compiler_warnings';
import compiler_errors from './compiler_errors';
import { extract_ignores_above_position, extract_svelte_ignore_from_comments } from '../utils/extract_svelte_ignore';
+import check_enable_sourcemap from './utils/check_enable_sourcemap';
interface ComponentOptions {
namespace?: string;
@@ -343,21 +344,28 @@ export default class Component {
? { code: null, map: null }
: result.css;
- const sourcemap_source_filename = get_sourcemap_source_filename(compile_options);
+ const js_sourcemap_enabled = check_enable_sourcemap(compile_options.enableSourcemap, 'js');
- js = print(program, {
- sourceMapSource: sourcemap_source_filename
- });
+ if (!js_sourcemap_enabled) {
+ js = print(program);
+ js.map = null;
+ } else {
+ const sourcemap_source_filename = get_sourcemap_source_filename(compile_options);
- js.map.sources = [
- sourcemap_source_filename
- ];
+ js = print(program, {
+ sourceMapSource: sourcemap_source_filename
+ });
- js.map.sourcesContent = [
- this.source
- ];
+ js.map.sources = [
+ sourcemap_source_filename
+ ];
- js.map = apply_preprocessor_sourcemap(sourcemap_source_filename, js.map, compile_options.sourcemap as (string | RawSourceMap | DecodedSourceMap));
+ js.map.sourcesContent = [
+ this.source
+ ];
+
+ js.map = apply_preprocessor_sourcemap(sourcemap_source_filename, js.map, compile_options.sourcemap as (string | RawSourceMap | DecodedSourceMap));
+ }
}
return {
diff --git a/src/compiler/compile/index.ts b/src/compiler/compile/index.ts
index 96b24bceee..afe9c56cf4 100644
--- a/src/compiler/compile/index.ts
+++ b/src/compiler/compile/index.ts
@@ -13,6 +13,7 @@ const valid_options = [
'name',
'filename',
'sourcemap',
+ 'enableSourcemap',
'generate',
'errorMode',
'varsReport',
@@ -82,7 +83,7 @@ function validate_options(options: CompileOptions, warnings: Warning[]) {
}
export default function compile(source: string, options: CompileOptions = {}) {
- options = Object.assign({ generate: 'dom', dev: false }, options);
+ options = Object.assign({ generate: 'dom', dev: false, enableSourcemap: true }, options);
const stats = new Stats();
const warnings = [];
diff --git a/src/compiler/compile/render_dom/index.ts b/src/compiler/compile/render_dom/index.ts
index f74f4cdf1c..89af0c297c 100644
--- a/src/compiler/compile/render_dom/index.ts
+++ b/src/compiler/compile/render_dom/index.ts
@@ -10,6 +10,7 @@ import { ImportDeclaration, ClassDeclaration, FunctionExpression, Node, Statemen
import { apply_preprocessor_sourcemap } from '../../utils/mapped_code';
import { RawSourceMap, DecodedSourceMap } from '@ampproject/remapping/dist/types/types';
import { flatten } from '../../utils/flatten';
+import check_enable_sourcemap from '../utils/check_enable_sourcemap';
export default function dom(
component: Component,
@@ -34,9 +35,15 @@ export default function dom(
const css = component.stylesheet.render(options.filename, !options.customElement);
- css.map = apply_preprocessor_sourcemap(options.filename, css.map, options.sourcemap as string | RawSourceMap | DecodedSourceMap);
+ const css_sourcemap_enabled = check_enable_sourcemap(options.enableSourcemap, 'css');
- const styles = component.stylesheet.has_styles && options.dev
+ if (css_sourcemap_enabled) {
+ css.map = apply_preprocessor_sourcemap(options.filename, css.map, options.sourcemap as string | RawSourceMap | DecodedSourceMap);
+ } else {
+ css.map = null;
+ }
+
+ const styles = css_sourcemap_enabled && component.stylesheet.has_styles && options.dev
? `${css.code}\n/*# sourceMappingURL=${css.map.toUrl()} */`
: css.code;
@@ -521,7 +528,7 @@ export default function dom(
constructor(options) {
super();
- ${css.code && b`this.shadowRoot.innerHTML = \`\`;`}
+ ${css.code && b`this.shadowRoot.innerHTML = \`\`;`}
@init(this, { target: this.shadowRoot, props: ${init_props}, customElement: true }, ${definition}, ${has_create_fragment ? 'create_fragment' : 'null'}, ${not_equal}, ${prop_indexes}, null, ${dirty});
diff --git a/src/compiler/compile/render_ssr/index.ts b/src/compiler/compile/render_ssr/index.ts
index b35a6ce6ff..9d2c1cc60b 100644
--- a/src/compiler/compile/render_ssr/index.ts
+++ b/src/compiler/compile/render_ssr/index.ts
@@ -10,6 +10,7 @@ import { extract_names } from 'periscopic';
import { walk } from 'estree-walker';
import { invalidate } from '../render_dom/invalidate';
+import check_enable_sourcemap from '../utils/check_enable_sourcemap';
export default function ssr(
component: Component,
@@ -200,11 +201,13 @@ export default function ssr(
main
].filter(Boolean);
+ const css_sourcemap_enabled = check_enable_sourcemap(options.enableSourcemap, 'css');
+
const js = b`
${css.code ? b`
const #css = {
code: "${css.code}",
- map: ${css.map ? string_literal(css.map.toString()) : 'null'}
+ map: ${css_sourcemap_enabled && css.map ? string_literal(css.map.toString()) : 'null'}
};` : null}
${component.extract_javascript(component.ast.module)}
diff --git a/src/compiler/compile/utils/check_enable_sourcemap.ts b/src/compiler/compile/utils/check_enable_sourcemap.ts
new file mode 100644
index 0000000000..51f07c353a
--- /dev/null
+++ b/src/compiler/compile/utils/check_enable_sourcemap.ts
@@ -0,0 +1,10 @@
+import { EnableSourcemap } from '../../interfaces';
+
+export default function check_enable_sourcemap(
+ enable_sourcemap: EnableSourcemap,
+ namespace: keyof Extract
+) {
+ return typeof enable_sourcemap === 'boolean'
+ ? enable_sourcemap
+ : enable_sourcemap[namespace];
+}
diff --git a/src/compiler/interfaces.ts b/src/compiler/interfaces.ts
index 7446c4c14b..b999fbd803 100644
--- a/src/compiler/interfaces.ts
+++ b/src/compiler/interfaces.ts
@@ -131,6 +131,8 @@ export interface Warning {
export type ModuleFormat = 'esm' | 'cjs';
+export type EnableSourcemap = boolean | { js: boolean; css: boolean };
+
export type CssHashGetter = (args: {
name: string;
filename: string | undefined;
@@ -147,6 +149,7 @@ export interface CompileOptions {
varsReport?: 'full' | 'strict' | false;
sourcemap?: object | string;
+ enableSourcemap?: EnableSourcemap;
outputFilename?: string;
cssOutputFilename?: string;
sveltePath?: string;
diff --git a/test/sourcemaps/index.ts b/test/sourcemaps/index.ts
index 903629c06b..fc021cd6a7 100644
--- a/test/sourcemaps/index.ts
+++ b/test/sourcemaps/index.ts
@@ -85,11 +85,13 @@ describe('sourcemaps', () => {
);
}
- assert.deepEqual(
- js.map.sources.slice().sort(),
- (config.js_map_sources || ['input.svelte']).sort(),
- 'js.map.sources is wrong'
- );
+ if (js.map) {
+ assert.deepEqual(
+ js.map.sources.slice().sort(),
+ (config.js_map_sources || ['input.svelte']).sort(),
+ 'js.map.sources is wrong'
+ );
+ }
if (css.map) {
assert.deepEqual(
css.map.sources.slice().sort(),
diff --git a/test/sourcemaps/samples/no-sourcemap/_config.js b/test/sourcemaps/samples/no-sourcemap/_config.js
new file mode 100644
index 0000000000..5b84d40554
--- /dev/null
+++ b/test/sourcemaps/samples/no-sourcemap/_config.js
@@ -0,0 +1,5 @@
+export default {
+ compile_options: {
+ enableSourcemap: false
+ }
+};
diff --git a/test/sourcemaps/samples/no-sourcemap/input.svelte b/test/sourcemaps/samples/no-sourcemap/input.svelte
new file mode 100644
index 0000000000..6d39eaad0e
--- /dev/null
+++ b/test/sourcemaps/samples/no-sourcemap/input.svelte
@@ -0,0 +1,11 @@
+
+
+{foo}
+
+
diff --git a/test/sourcemaps/samples/no-sourcemap/test.js b/test/sourcemaps/samples/no-sourcemap/test.js
new file mode 100644
index 0000000000..127459a54e
--- /dev/null
+++ b/test/sourcemaps/samples/no-sourcemap/test.js
@@ -0,0 +1,4 @@
+export function test({ assert, js, css }) {
+ assert.equal(js.map, null);
+ assert.equal(css.map, null);
+}
diff --git a/test/sourcemaps/samples/only-css-sourcemap/_config.js b/test/sourcemaps/samples/only-css-sourcemap/_config.js
new file mode 100644
index 0000000000..767e10a4b9
--- /dev/null
+++ b/test/sourcemaps/samples/only-css-sourcemap/_config.js
@@ -0,0 +1,5 @@
+export default {
+ compile_options: {
+ enableSourcemap: { css: true }
+ }
+};
diff --git a/test/sourcemaps/samples/only-css-sourcemap/input.svelte b/test/sourcemaps/samples/only-css-sourcemap/input.svelte
new file mode 100644
index 0000000000..6d39eaad0e
--- /dev/null
+++ b/test/sourcemaps/samples/only-css-sourcemap/input.svelte
@@ -0,0 +1,11 @@
+
+
+{foo}
+
+
diff --git a/test/sourcemaps/samples/only-css-sourcemap/test.js b/test/sourcemaps/samples/only-css-sourcemap/test.js
new file mode 100644
index 0000000000..a7ac6a9b0b
--- /dev/null
+++ b/test/sourcemaps/samples/only-css-sourcemap/test.js
@@ -0,0 +1,4 @@
+export function test({ assert, js, css }) {
+ assert.equal(js.map, null);
+ assert.notEqual(css.map, null);
+}
diff --git a/test/sourcemaps/samples/only-js-sourcemap/_config.js b/test/sourcemaps/samples/only-js-sourcemap/_config.js
new file mode 100644
index 0000000000..0b3b7987f1
--- /dev/null
+++ b/test/sourcemaps/samples/only-js-sourcemap/_config.js
@@ -0,0 +1,5 @@
+export default {
+ compile_options: {
+ enableSourcemap: { js: true }
+ }
+};
diff --git a/test/sourcemaps/samples/only-js-sourcemap/input.svelte b/test/sourcemaps/samples/only-js-sourcemap/input.svelte
new file mode 100644
index 0000000000..6d39eaad0e
--- /dev/null
+++ b/test/sourcemaps/samples/only-js-sourcemap/input.svelte
@@ -0,0 +1,11 @@
+
+
+{foo}
+
+
diff --git a/test/sourcemaps/samples/only-js-sourcemap/test.js b/test/sourcemaps/samples/only-js-sourcemap/test.js
new file mode 100644
index 0000000000..b150653c3d
--- /dev/null
+++ b/test/sourcemaps/samples/only-js-sourcemap/test.js
@@ -0,0 +1,4 @@
+export function test({ assert, js, css }) {
+ assert.notEqual(js.map, null);
+ assert.equal(css.map, null);
+}
From e055570765dbaf41efb2af880f9b5110adc6888c Mon Sep 17 00:00:00 2001
From: Conduitry
Date: Sun, 17 Oct 2021 13:07:27 -0400
Subject: [PATCH 7/8] -> v3.44.0
---
CHANGELOG.md | 4 ++++
package-lock.json | 4 ++--
package.json | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 883fdcd56f..81ef8805d0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Svelte changelog
+## 3.44.0
+
+* Add `enableSourcemap` compiler option ([#6835](https://github.com/sveltejs/svelte/pull/6835))
+
## 3.43.2
* Fix regression where user-specified `import`s were not rewritten according to the `sveltePath` option ([#6834](https://github.com/sveltejs/svelte/issues/6834))
diff --git a/package-lock.json b/package-lock.json
index 4ea2ce35bc..e8bc9889a7 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "svelte",
- "version": "3.43.2",
+ "version": "3.44.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "svelte",
- "version": "3.43.2",
+ "version": "3.44.0",
"license": "MIT",
"devDependencies": {
"@ampproject/remapping": "^0.3.0",
diff --git a/package.json b/package.json
index 511ca60e05..60ee4f179d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "svelte",
- "version": "3.43.2",
+ "version": "3.44.0",
"description": "Cybernetically enhanced web apps",
"module": "index.mjs",
"main": "index",
From 883c47b45de057726e44cd07b880bce37b1cef43 Mon Sep 17 00:00:00 2001
From: Conduitry
Date: Sun, 17 Oct 2021 13:16:12 -0400
Subject: [PATCH 8/8] [site] fix escaping in table of compiler options
---
site/content/docs/04-compile-time.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/site/content/docs/04-compile-time.md b/site/content/docs/04-compile-time.md
index 8e709d7c37..843daf2f84 100644
--- a/site/content/docs/04-compile-time.md
+++ b/site/content/docs/04-compile-time.md
@@ -82,8 +82,8 @@ The following options can be passed to the compiler. None are required:
| `loopGuardTimeout` | 0 | A `number` that tells Svelte to break the loop if it blocks the thread for more than `loopGuardTimeout` ms. This is useful to prevent infinite loops. **Only available when `dev: true`**
| `preserveComments` | `false` | If `true`, your HTML comments will be preserved during server-side rendering. By default, they are stripped out.
| `preserveWhitespace` | `false` | If `true`, whitespace inside and between elements is kept as you typed it, rather than removed or collapsed to a single space where possible.
-| `sourcemap` | `object | string` | An initial sourcemap that will be merged into the final output sourcemap. This is usually the preprocessor sourcemap.
-| `enableSourcemap` | `boolean | { js: boolean; css: boolean; }` | If `true`, Svelte generate sourcemaps for components. Use an object with `js` or `css` for more granular control of sourcemap generation. By default, this is `true`.
+| `sourcemap` | `object \| string` | An initial sourcemap that will be merged into the final output sourcemap. This is usually the preprocessor sourcemap.
+| `enableSourcemap` | `boolean \| { js: boolean; css: boolean; }` | If `true`, Svelte generate sourcemaps for components. Use an object with `js` or `css` for more granular control of sourcemap generation. By default, this is `true`.
| `outputFilename` | `null` | A `string` used for your JavaScript sourcemap.
| `cssOutputFilename` | `null` | A `string` used for your CSS sourcemap.
| `sveltePath` | `"svelte"` | The location of the `svelte` package. Any imports from `svelte` or `svelte/[module]` will be modified accordingly.