\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/00-introduction/03-nested-components/App.svelte b/site/content/examples/00-introduction/03-nested-components/App.svelte
index bb97f50ace..0b200112ab 100644
--- a/site/content/examples/00-introduction/03-nested-components/App.svelte
+++ b/site/content/examples/00-introduction/03-nested-components/App.svelte
@@ -2,13 +2,13 @@
import Nested from './Nested.svelte';
+
These styles...
+
+
-
-
These styles...
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/04-events/00-dom-events/App.svelte b/site/content/examples/04-events/00-dom-events/App.svelte
index f26112f06c..de1f664112 100644
--- a/site/content/examples/04-events/00-dom-events/App.svelte
+++ b/site/content/examples/04-events/00-dom-events/App.svelte
@@ -7,10 +7,10 @@
}
-
-
The mouse position is {m.x} x {m.y}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/examples/04-events/01-inline-handlers/App.svelte b/site/content/examples/04-events/01-inline-handlers/App.svelte
index f0fd6ff17a..36fed40a4f 100644
--- a/site/content/examples/04-events/01-inline-handlers/App.svelte
+++ b/site/content/examples/04-events/01-inline-handlers/App.svelte
@@ -2,10 +2,10 @@
let m = { x: 0, y: 0 };
-
-
The mouse position is {m.x} x {m.y}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/examples/04-events/05-dom-event-forwarding/CustomButton.svelte b/site/content/examples/04-events/05-dom-event-forwarding/CustomButton.svelte
index f521c1f471..4004ffbf29 100644
--- a/site/content/examples/04-events/05-dom-event-forwarding/CustomButton.svelte
+++ b/site/content/examples/04-events/05-dom-event-forwarding/CustomButton.svelte
@@ -1,3 +1,7 @@
+
+
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/05-bindings/04-textarea-inputs/App.svelte b/site/content/examples/05-bindings/04-textarea-inputs/App.svelte
index 5a9e18f79d..0d02d7ba2e 100644
--- a/site/content/examples/05-bindings/04-textarea-inputs/App.svelte
+++ b/site/content/examples/05-bindings/04-textarea-inputs/App.svelte
@@ -3,10 +3,10 @@
let text = `Some words are *italic*, some are **bold**`;
-
-
-{@html marked(text)}
\ No newline at end of file
+{@html marked(text)}
+
+
\ No newline at end of file
diff --git a/site/content/examples/05-bindings/06-select-bindings/App.svelte b/site/content/examples/05-bindings/06-select-bindings/App.svelte
index 3f1e7fa7e1..a3607a6f4f 100644
--- a/site/content/examples/05-bindings/06-select-bindings/App.svelte
+++ b/site/content/examples/05-bindings/06-select-bindings/App.svelte
@@ -14,10 +14,6 @@
}
-
-
- {format(time)}
- click anywhere to {paused ? 'play' : 'pause'} / drag to seek
- {format(duration)}
-
-
-
+
\ No newline at end of file
diff --git a/site/content/examples/05-bindings/10-dimensions/App.svelte b/site/content/examples/05-bindings/10-dimensions/App.svelte
index ca992599c1..c955aeba8e 100644
--- a/site/content/examples/05-bindings/10-dimensions/App.svelte
+++ b/site/content/examples/05-bindings/10-dimensions/App.svelte
@@ -5,11 +5,6 @@
let text = 'edit me';
-
-
@@ -17,4 +12,9 @@
{text}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/examples/05-bindings/11-bind-this/App.svelte b/site/content/examples/05-bindings/11-bind-this/App.svelte
index 439d240670..8612e8f5e3 100644
--- a/site/content/examples/05-bindings/11-bind-this/App.svelte
+++ b/site/content/examples/05-bindings/11-bind-this/App.svelte
@@ -38,6 +38,12 @@
});
+
+
-
-
+
\ No newline at end of file
diff --git a/site/content/examples/05-bindings/12-component-bindings/Keypad.svelte b/site/content/examples/05-bindings/12-component-bindings/Keypad.svelte
index c457a15cb5..631f7964e2 100644
--- a/site/content/examples/05-bindings/12-component-bindings/Keypad.svelte
+++ b/site/content/examples/05-bindings/12-component-bindings/Keypad.svelte
@@ -10,19 +10,6 @@
const submit = () => dispatch('submit');
-
-
@@ -37,4 +24,17 @@
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/examples/06-lifecycle/00-onmount/App.svelte b/site/content/examples/06-lifecycle/00-onmount/App.svelte
index 1b83727627..b6c3100e58 100644
--- a/site/content/examples/06-lifecycle/00-onmount/App.svelte
+++ b/site/content/examples/06-lifecycle/00-onmount/App.svelte
@@ -9,6 +9,20 @@
});
+
\ No newline at end of file
diff --git a/site/content/examples/06-lifecycle/02-update/App.svelte b/site/content/examples/06-lifecycle/02-update/App.svelte
index 419e763c57..ee3bca32df 100644
--- a/site/content/examples/06-lifecycle/02-update/App.svelte
+++ b/site/content/examples/06-lifecycle/02-update/App.svelte
@@ -51,6 +51,20 @@
}
+
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/11-easing/00-easing/Grid.svelte b/site/content/examples/11-easing/00-easing/Grid.svelte
index e704f46cf7..c0c9d47913 100644
--- a/site/content/examples/11-easing/00-easing/Grid.svelte
+++ b/site/content/examples/11-easing/00-easing/Grid.svelte
@@ -2,19 +2,6 @@
export let x, y;
-
-
\ No newline at end of file
+/>
+
+
diff --git a/site/content/examples/12-svg/01-clock/App.svelte b/site/content/examples/12-svg/01-clock/App.svelte
index 49d3a7f809..44f7e484a1 100644
--- a/site/content/examples/12-svg/01-clock/App.svelte
+++ b/site/content/examples/12-svg/01-clock/App.svelte
@@ -20,44 +20,6 @@
});
-
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/examples/12-svg/02-bar-chart/App.svelte b/site/content/examples/12-svg/02-bar-chart/App.svelte
index 30c374b67e..d44c0e67cf 100644
--- a/site/content/examples/12-svg/02-bar-chart/App.svelte
+++ b/site/content/examples/12-svg/02-bar-chart/App.svelte
@@ -33,6 +33,42 @@
$: barWidth = innerWidth / xTicks.length;
+
US birthrate by year
+
+
+
+
+
-
-
US birthrate by year
-
-
-
-
+
\ No newline at end of file
diff --git a/site/content/examples/12-svg/03-area-chart/App.svelte b/site/content/examples/12-svg/03-area-chart/App.svelte
index 98ff070411..2fe39280e4 100644
--- a/site/content/examples/12-svg/03-area-chart/App.svelte
+++ b/site/content/examples/12-svg/03-area-chart/App.svelte
@@ -108,4 +108,4 @@
.path-area {
fill: rgba(0,100,100,0.2);
}
-
+
\ No newline at end of file
diff --git a/site/content/examples/12-svg/04-scatterplot/App.svelte b/site/content/examples/12-svg/04-scatterplot/App.svelte
index 42a0660b87..1ceb1d221c 100644
--- a/site/content/examples/12-svg/04-scatterplot/App.svelte
+++ b/site/content/examples/12-svg/04-scatterplot/App.svelte
@@ -3,6 +3,15 @@
import data from './data.js';
+
+
Anscombe's quartet
+
+
+
+
+
+
+
-
-
-
Anscombe's quartet
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/12-svg/04-scatterplot/Scatterplot.svelte b/site/content/examples/12-svg/04-scatterplot/Scatterplot.svelte
index f7a46899fa..7ae113ab06 100644
--- a/site/content/examples/12-svg/04-scatterplot/Scatterplot.svelte
+++ b/site/content/examples/12-svg/04-scatterplot/Scatterplot.svelte
@@ -92,4 +92,4 @@
.y-axis text {
text-anchor: end;
}
-
+
\ No newline at end of file
diff --git a/site/content/examples/12-svg/05-svg-transitions/App.svelte b/site/content/examples/12-svg/05-svg-transitions/App.svelte
index 6e1e636b20..7f3a774a2c 100644
--- a/site/content/examples/12-svg/05-svg-transitions/App.svelte
+++ b/site/content/examples/12-svg/05-svg-transitions/App.svelte
@@ -7,6 +7,38 @@
let visible = true;
+{#if visible}
+
+
+
-{/if}
-
-
-
- toggle me
-
-
-
+
\ No newline at end of file
diff --git a/site/content/examples/13-actions/00-actions/App.svelte b/site/content/examples/13-actions/00-actions/App.svelte
index 171f82762c..4548a5cbb6 100644
--- a/site/content/examples/13-actions/00-actions/App.svelte
+++ b/site/content/examples/13-actions/00-actions/App.svelte
@@ -25,6 +25,16 @@
}
+
+
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/14-classes/00-classes/App.svelte b/site/content/examples/14-classes/00-classes/App.svelte
index 4da386991d..1073242bcf 100644
--- a/site/content/examples/14-classes/00-classes/App.svelte
+++ b/site/content/examples/14-classes/00-classes/App.svelte
@@ -2,17 +2,6 @@
let current = 'foo';
-
-
baz
\ No newline at end of file
+>baz
+
+
\ No newline at end of file
diff --git a/site/content/examples/14-classes/01-class-shorthand/App.svelte b/site/content/examples/14-classes/01-class-shorthand/App.svelte
index 0f4e0d9f24..c91385e4e5 100644
--- a/site/content/examples/14-classes/01-class-shorthand/App.svelte
+++ b/site/content/examples/14-classes/01-class-shorthand/App.svelte
@@ -2,12 +2,6 @@
let big = false;
-
-
big
@@ -15,4 +9,10 @@
some {big ? 'big' : 'small'} text
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/examples/15-composition/00-slots/Box.svelte b/site/content/examples/15-composition/00-slots/Box.svelte
index 7ed13f386f..b17fdbe60d 100644
--- a/site/content/examples/15-composition/00-slots/Box.svelte
+++ b/site/content/examples/15-composition/00-slots/Box.svelte
@@ -1,3 +1,7 @@
+
+
+
+
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/15-composition/01-slot-fallbacks/Box.svelte b/site/content/examples/15-composition/01-slot-fallbacks/Box.svelte
index 66c580632c..bdaf61b874 100644
--- a/site/content/examples/15-composition/01-slot-fallbacks/Box.svelte
+++ b/site/content/examples/15-composition/01-slot-fallbacks/Box.svelte
@@ -1,3 +1,9 @@
+
+
+ no content was provided
+
+
+
-
-
-
- no content was provided
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/15-composition/02-named-slots/ContactCard.svelte b/site/content/examples/15-composition/02-named-slots/ContactCard.svelte
index 1acf290943..87bd392afa 100644
--- a/site/content/examples/15-composition/02-named-slots/ContactCard.svelte
+++ b/site/content/examples/15-composition/02-named-slots/ContactCard.svelte
@@ -1,3 +1,23 @@
+
+
+
+ Unknown name
+
+
+
+
+
+ Unknown address
+
+
+
+
+
+ Unknown email
+
+
+
+
-
-
-
-
- Unknown name
-
-
-
-
-
- Unknown address
-
-
-
-
-
- Unknown email
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/15-composition/03-slot-props/App.svelte b/site/content/examples/15-composition/03-slot-props/App.svelte
index 36772a5077..299cd336a6 100644
--- a/site/content/examples/15-composition/03-slot-props/App.svelte
+++ b/site/content/examples/15-composition/03-slot-props/App.svelte
@@ -2,19 +2,6 @@
import Hoverable from './Hoverable.svelte';
-
-
{#if active}
@@ -43,4 +30,17 @@
Hover over me!
{/if}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/examples/15-composition/04-conditional-slots/Profile.svelte b/site/content/examples/15-composition/04-conditional-slots/Profile.svelte
index 09026cd6d6..834c23dc14 100644
--- a/site/content/examples/15-composition/04-conditional-slots/Profile.svelte
+++ b/site/content/examples/15-composition/04-conditional-slots/Profile.svelte
@@ -1,15 +1,3 @@
-
-
Name
@@ -22,3 +10,15 @@
{/if}
+
+
\ No newline at end of file
diff --git a/site/content/examples/15-composition/05-modal/Modal.svelte b/site/content/examples/15-composition/05-modal/Modal.svelte
index 4a5329b05b..baa57824bc 100644
--- a/site/content/examples/15-composition/05-modal/Modal.svelte
+++ b/site/content/examples/15-composition/05-modal/Modal.svelte
@@ -78,4 +78,4 @@
button {
display: block;
}
-
+
\ No newline at end of file
diff --git a/site/content/examples/16-context/00-context-api/Map.svelte b/site/content/examples/16-context/00-context-api/Map.svelte
index 0282cbc311..059fcca45b 100644
--- a/site/content/examples/16-context/00-context-api/Map.svelte
+++ b/site/content/examples/16-context/00-context-api/Map.svelte
@@ -36,15 +36,15 @@
});
+
+ {#if map}
+
+ {/if}
+
+
-
-
- {#if map}
-
- {/if}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/17-special-elements/00-svelte-self/File.svelte b/site/content/examples/17-special-elements/00-svelte-self/File.svelte
index e34686101a..8a0048dd68 100644
--- a/site/content/examples/17-special-elements/00-svelte-self/File.svelte
+++ b/site/content/examples/17-special-elements/00-svelte-self/File.svelte
@@ -3,12 +3,12 @@
$: type = name.slice(name.lastIndexOf('.') + 1);
+{name}
+
-
-{name}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/17-special-elements/00-svelte-self/Folder.svelte b/site/content/examples/17-special-elements/00-svelte-self/Folder.svelte
index c25bb2a93d..f5f0a7b194 100644
--- a/site/content/examples/17-special-elements/00-svelte-self/Folder.svelte
+++ b/site/content/examples/17-special-elements/00-svelte-self/Folder.svelte
@@ -10,6 +10,22 @@
}
+{name}
+
+{#if expanded}
+
-{/if}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/17-special-elements/01-svelte-component/BlueThing.svelte b/site/content/examples/17-special-elements/01-svelte-component/BlueThing.svelte
index f9130d9d65..eb7ba64163 100644
--- a/site/content/examples/17-special-elements/01-svelte-component/BlueThing.svelte
+++ b/site/content/examples/17-special-elements/01-svelte-component/BlueThing.svelte
@@ -1,5 +1,7 @@
-
+Blue thing
-blue thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/17-special-elements/01-svelte-component/GreenThing.svelte b/site/content/examples/17-special-elements/01-svelte-component/GreenThing.svelte
index 9cbee235d3..ed2aa49f27 100644
--- a/site/content/examples/17-special-elements/01-svelte-component/GreenThing.svelte
+++ b/site/content/examples/17-special-elements/01-svelte-component/GreenThing.svelte
@@ -1,5 +1,7 @@
-
+Green thing
-green thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/17-special-elements/01-svelte-component/RedThing.svelte b/site/content/examples/17-special-elements/01-svelte-component/RedThing.svelte
index 42f5e4c672..365f226492 100644
--- a/site/content/examples/17-special-elements/01-svelte-component/RedThing.svelte
+++ b/site/content/examples/17-special-elements/01-svelte-component/RedThing.svelte
@@ -1,5 +1,7 @@
-
+Red thing
-red thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/17-special-elements/02-svelte-window/App.svelte b/site/content/examples/17-special-elements/02-svelte-window/App.svelte
index 845d666dff..8452f160b0 100644
--- a/site/content/examples/17-special-elements/02-svelte-window/App.svelte
+++ b/site/content/examples/17-special-elements/02-svelte-window/App.svelte
@@ -8,6 +8,17 @@
}
+
+
+
+ {#if key}
+ {key === ' ' ? 'Space' : key}
+
{keyCode}
+ {:else}
+
Focus this window and press any key
+ {/if}
+
+
-
-
-
-
- {#if key}
- {key === ' ' ? 'Space' : key}
-
{keyCode}
- {:else}
-
Focus this window and press any key
- {/if}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/17-special-elements/03-svelte-window-bindings/App.svelte b/site/content/examples/17-special-elements/03-svelte-window-bindings/App.svelte
index 3dbfd43f21..28831a6d31 100644
--- a/site/content/examples/17-special-elements/03-svelte-window-bindings/App.svelte
+++ b/site/content/examples/17-special-elements/03-svelte-window-bindings/App.svelte
@@ -85,4 +85,4 @@
padding: 0;
background-color: rgb(253, 174, 51);
}
-
+
\ No newline at end of file
diff --git a/site/content/examples/17-special-elements/04-svelte-body/App.svelte b/site/content/examples/17-special-elements/04-svelte-body/App.svelte
index ac946962eb..d3245ab447 100644
--- a/site/content/examples/17-special-elements/04-svelte-body/App.svelte
+++ b/site/content/examples/17-special-elements/04-svelte-body/App.svelte
@@ -5,6 +5,18 @@
const handleMouseleave = () => hereKitty = false;
+
+
+
+
+
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/examples/18-module-context/01-module-exports/AudioPlayer.svelte b/site/content/examples/18-module-context/01-module-exports/AudioPlayer.svelte
index 4e3d191dbf..561c7094a4 100644
--- a/site/content/examples/18-module-context/01-module-exports/AudioPlayer.svelte
+++ b/site/content/examples/18-module-context/01-module-exports/AudioPlayer.svelte
@@ -31,13 +31,6 @@
}
-
-
{title}
{composer} / performed by {performer}
@@ -49,4 +42,11 @@
controls
{src}
>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/examples/20-7guis/02-7guis-temperature/App.svelte b/site/content/examples/20-7guis/02-7guis-temperature/App.svelte
index 503fb080ea..fce279ed76 100644
--- a/site/content/examples/20-7guis/02-7guis-temperature/App.svelte
+++ b/site/content/examples/20-7guis/02-7guis-temperature/App.svelte
@@ -1,13 +1,3 @@
-
- °c =
- °f
-
-
-
+
+
+ °c =
+ °f
+
+
\ No newline at end of file
diff --git a/site/content/examples/20-7guis/03-7guis-flight-booker/App.svelte b/site/content/examples/20-7guis/03-7guis-flight-booker/App.svelte
index 82b23596b7..f9484aa360 100644
--- a/site/content/examples/20-7guis/03-7guis-flight-booker/App.svelte
+++ b/site/content/examples/20-7guis/03-7guis-flight-booker/App.svelte
@@ -37,14 +37,6 @@
}
-
-
-{/if}
+{/if}
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/04-group-inputs/app-b/App.svelte b/site/content/tutorial/06-bindings/04-group-inputs/app-b/App.svelte
index a46c61c7e7..b12704b87d 100644
--- a/site/content/tutorial/06-bindings/04-group-inputs/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/04-group-inputs/app-b/App.svelte
@@ -49,4 +49,4 @@
You ordered {scoops} {scoops === 1 ? 'scoop' : 'scoops'}
of {join(flavours)}
-{/if}
+{/if}
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/05-textarea-inputs/app-a/App.svelte b/site/content/tutorial/06-bindings/05-textarea-inputs/app-a/App.svelte
index a5919d9799..12ac68880c 100644
--- a/site/content/tutorial/06-bindings/05-textarea-inputs/app-a/App.svelte
+++ b/site/content/tutorial/06-bindings/05-textarea-inputs/app-a/App.svelte
@@ -3,10 +3,10 @@
let value = `Some words are *italic*, some are **bold**`;
-
-
-{@html marked(value)}
\ No newline at end of file
+{@html marked(value)}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/05-textarea-inputs/app-b/App.svelte b/site/content/tutorial/06-bindings/05-textarea-inputs/app-b/App.svelte
index be338bf47f..7775ab6319 100644
--- a/site/content/tutorial/06-bindings/05-textarea-inputs/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/05-textarea-inputs/app-b/App.svelte
@@ -3,10 +3,10 @@
let value = `Some words are *italic*, some are **bold**`;
-
-
-{@html marked(value)}
\ No newline at end of file
+{@html marked(value)}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/06-select-bindings/app-a/App.svelte b/site/content/tutorial/06-bindings/06-select-bindings/app-a/App.svelte
index b6f50b935e..a70b928809 100644
--- a/site/content/tutorial/06-bindings/06-select-bindings/app-a/App.svelte
+++ b/site/content/tutorial/06-bindings/06-select-bindings/app-a/App.svelte
@@ -14,10 +14,6 @@
}
-
-
- {format(time)}
- click anywhere to {paused ? 'play' : 'pause'} / drag to seek
- {format(duration)}
-
-
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/10-media-elements/app-b/App.svelte b/site/content/tutorial/06-bindings/10-media-elements/app-b/App.svelte
index 6135105d6a..63e6cd7e21 100644
--- a/site/content/tutorial/06-bindings/10-media-elements/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/10-media-elements/app-b/App.svelte
@@ -51,6 +51,32 @@
}
+
- {format(time)}
- click anywhere to {paused ? 'play' : 'pause'} / drag to seek
- {format(duration)}
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/11-dimensions/app-a/App.svelte b/site/content/tutorial/06-bindings/11-dimensions/app-a/App.svelte
index 62e92cd536..67bb5db8af 100644
--- a/site/content/tutorial/06-bindings/11-dimensions/app-a/App.svelte
+++ b/site/content/tutorial/06-bindings/11-dimensions/app-a/App.svelte
@@ -5,12 +5,6 @@
let text = 'edit me';
-
-
@@ -18,4 +12,10 @@
{text}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/11-dimensions/app-b/App.svelte b/site/content/tutorial/06-bindings/11-dimensions/app-b/App.svelte
index 920c74d276..fbed44dadc 100644
--- a/site/content/tutorial/06-bindings/11-dimensions/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/11-dimensions/app-b/App.svelte
@@ -5,12 +5,6 @@
let text = 'edit me';
-
-
@@ -18,4 +12,10 @@
{text}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/12-bind-this/app-a/App.svelte b/site/content/tutorial/06-bindings/12-bind-this/app-a/App.svelte
index f8f93edc2b..ed9cfa6112 100644
--- a/site/content/tutorial/06-bindings/12-bind-this/app-a/App.svelte
+++ b/site/content/tutorial/06-bindings/12-bind-this/app-a/App.svelte
@@ -36,6 +36,11 @@
});
+
+
-
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/12-bind-this/app-b/App.svelte b/site/content/tutorial/06-bindings/12-bind-this/app-b/App.svelte
index 17005e273a..4e537bd90a 100644
--- a/site/content/tutorial/06-bindings/12-bind-this/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/12-bind-this/app-b/App.svelte
@@ -36,6 +36,12 @@
});
+
+
-
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/13-component-bindings/app-a/Keypad.svelte b/site/content/tutorial/06-bindings/13-component-bindings/app-a/Keypad.svelte
index c457a15cb5..631f7964e2 100644
--- a/site/content/tutorial/06-bindings/13-component-bindings/app-a/Keypad.svelte
+++ b/site/content/tutorial/06-bindings/13-component-bindings/app-a/Keypad.svelte
@@ -10,19 +10,6 @@
const submit = () => dispatch('submit');
-
-
12
@@ -37,4 +24,17 @@
clear0submit
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/13-component-bindings/app-b/Keypad.svelte b/site/content/tutorial/06-bindings/13-component-bindings/app-b/Keypad.svelte
index c457a15cb5..631f7964e2 100644
--- a/site/content/tutorial/06-bindings/13-component-bindings/app-b/Keypad.svelte
+++ b/site/content/tutorial/06-bindings/13-component-bindings/app-b/Keypad.svelte
@@ -10,19 +10,6 @@
const submit = () => dispatch('submit');
-
-
12
@@ -37,4 +24,17 @@
clear0submit
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/07-lifecycle/01-onmount/app-a/App.svelte b/site/content/tutorial/07-lifecycle/01-onmount/app-a/App.svelte
index e8306d1957..f76c377ad3 100644
--- a/site/content/tutorial/07-lifecycle/01-onmount/app-a/App.svelte
+++ b/site/content/tutorial/07-lifecycle/01-onmount/app-a/App.svelte
@@ -2,20 +2,6 @@
let photos = [];
-
-
Photo album
@@ -28,4 +14,18 @@
loading...
{/each}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/07-lifecycle/01-onmount/app-b/App.svelte b/site/content/tutorial/07-lifecycle/01-onmount/app-b/App.svelte
index 1b83727627..831914fa6a 100644
--- a/site/content/tutorial/07-lifecycle/01-onmount/app-b/App.svelte
+++ b/site/content/tutorial/07-lifecycle/01-onmount/app-b/App.svelte
@@ -9,20 +9,6 @@
});
-
-
Photo album
@@ -35,4 +21,18 @@
loading...
{/each}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/09-motion/01-tweened/app-a/App.svelte b/site/content/tutorial/09-motion/01-tweened/app-a/App.svelte
index 75c814add2..a4f828264c 100644
--- a/site/content/tutorial/09-motion/01-tweened/app-a/App.svelte
+++ b/site/content/tutorial/09-motion/01-tweened/app-a/App.svelte
@@ -4,13 +4,6 @@
const progress = writable(0);
-
-
@@ -31,4 +24,11 @@
100%
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/09-motion/01-tweened/app-b/App.svelte b/site/content/tutorial/09-motion/01-tweened/app-b/App.svelte
index 83f3b50a04..ee3c7a1b5d 100644
--- a/site/content/tutorial/09-motion/01-tweened/app-b/App.svelte
+++ b/site/content/tutorial/09-motion/01-tweened/app-b/App.svelte
@@ -8,13 +8,6 @@
});
-
-
@@ -35,4 +28,11 @@
100%
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/09-motion/02-spring/app-a/App.svelte b/site/content/tutorial/09-motion/02-spring/app-a/App.svelte
index 813c6366b1..aa8a406c2b 100644
--- a/site/content/tutorial/09-motion/02-spring/app-a/App.svelte
+++ b/site/content/tutorial/09-motion/02-spring/app-a/App.svelte
@@ -5,11 +5,6 @@
let size = writable(10);
-
-
stiffness ({coords.stiffness})
@@ -28,4 +23,15 @@
on:mouseup="{() => size.set(10)}"
>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/09-motion/02-spring/app-b/App.svelte b/site/content/tutorial/09-motion/02-spring/app-b/App.svelte
index 2cb0fd1eb7..d8a0287c2c 100644
--- a/site/content/tutorial/09-motion/02-spring/app-b/App.svelte
+++ b/site/content/tutorial/09-motion/02-spring/app-b/App.svelte
@@ -9,11 +9,6 @@
let size = spring(10);
-
-
stiffness ({coords.stiffness})
@@ -32,4 +27,14 @@
on:mouseup="{() => size.set(10)}"
>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/10-transitions/04-custom-css-transitions/app-a/App.svelte b/site/content/tutorial/10-transitions/04-custom-css-transitions/app-a/App.svelte
index d1f044360d..872c2e4aa3 100644
--- a/site/content/tutorial/10-transitions/04-custom-css-transitions/app-a/App.svelte
+++ b/site/content/tutorial/10-transitions/04-custom-css-transitions/app-a/App.svelte
@@ -11,6 +11,17 @@
}
+
+
+ visible
+
+
+{#if visible}
+
+ transitions!
+
+{/if}
+
-
-
-
- visible
-
-
-{#if visible}
-
- transitions!
-
-{/if}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/10-transitions/04-custom-css-transitions/app-b/App.svelte b/site/content/tutorial/10-transitions/04-custom-css-transitions/app-b/App.svelte
index 6e8dfcaf08..a98f38272a 100644
--- a/site/content/tutorial/10-transitions/04-custom-css-transitions/app-b/App.svelte
+++ b/site/content/tutorial/10-transitions/04-custom-css-transitions/app-b/App.svelte
@@ -22,6 +22,17 @@
}
+
+
+ visible
+
+
+{#if visible}
+
+ transitions!
+
+{/if}
+
-
-
-
- visible
-
-
-{#if visible}
-
- transitions!
-
-{/if}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/10-transitions/07-local-transitions/app-a/App.svelte b/site/content/tutorial/10-transitions/07-local-transitions/app-a/App.svelte
index ed93815c0d..2e01048cc0 100644
--- a/site/content/tutorial/10-transitions/07-local-transitions/app-a/App.svelte
+++ b/site/content/tutorial/10-transitions/07-local-transitions/app-a/App.svelte
@@ -6,13 +6,6 @@
let items = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'];
-
-
show list
@@ -29,4 +22,11 @@
{item}
{/each}
-{/if}
\ No newline at end of file
+{/if}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/10-transitions/07-local-transitions/app-b/App.svelte b/site/content/tutorial/10-transitions/07-local-transitions/app-b/App.svelte
index 3d569cfcbb..46603a8b53 100644
--- a/site/content/tutorial/10-transitions/07-local-transitions/app-b/App.svelte
+++ b/site/content/tutorial/10-transitions/07-local-transitions/app-b/App.svelte
@@ -6,13 +6,6 @@
let items = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'];
-
-
show list
@@ -29,4 +22,11 @@
{item}
{/each}
-{/if}
\ No newline at end of file
+{/if}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/10-transitions/08-deferred-transitions/app-a/App.svelte b/site/content/tutorial/10-transitions/08-deferred-transitions/app-a/App.svelte
index f05c581390..3b6c6776a6 100644
--- a/site/content/tutorial/10-transitions/08-deferred-transitions/app-a/App.svelte
+++ b/site/content/tutorial/10-transitions/08-deferred-transitions/app-a/App.svelte
@@ -145,4 +145,4 @@
label:hover button {
opacity: 1;
}
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/10-transitions/08-deferred-transitions/app-b/App.svelte b/site/content/tutorial/10-transitions/08-deferred-transitions/app-b/App.svelte
index b7447ca7de..f3a26915a3 100644
--- a/site/content/tutorial/10-transitions/08-deferred-transitions/app-b/App.svelte
+++ b/site/content/tutorial/10-transitions/08-deferred-transitions/app-b/App.svelte
@@ -152,4 +152,4 @@
label:hover button {
opacity: 1;
}
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/11-animations/01-animate/app-a/App.svelte b/site/content/tutorial/11-animations/01-animate/app-a/App.svelte
index b7447ca7de..f3a26915a3 100644
--- a/site/content/tutorial/11-animations/01-animate/app-a/App.svelte
+++ b/site/content/tutorial/11-animations/01-animate/app-a/App.svelte
@@ -152,4 +152,4 @@
label:hover button {
opacity: 1;
}
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/11-animations/01-animate/app-b/App.svelte b/site/content/tutorial/11-animations/01-animate/app-b/App.svelte
index 0d232bf02b..5c5e76331d 100644
--- a/site/content/tutorial/11-animations/01-animate/app-b/App.svelte
+++ b/site/content/tutorial/11-animations/01-animate/app-b/App.svelte
@@ -155,4 +155,4 @@
label:hover button {
opacity: 1;
}
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/13-classes/01-classes/app-a/App.svelte b/site/content/tutorial/13-classes/01-classes/app-a/App.svelte
index baa2543562..f0db8b3214 100644
--- a/site/content/tutorial/13-classes/01-classes/app-a/App.svelte
+++ b/site/content/tutorial/13-classes/01-classes/app-a/App.svelte
@@ -2,17 +2,6 @@
let current = 'foo';
-
-
baz
\ No newline at end of file
+>baz
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/13-classes/01-classes/app-b/App.svelte b/site/content/tutorial/13-classes/01-classes/app-b/App.svelte
index a8861ad537..00851567ef 100644
--- a/site/content/tutorial/13-classes/01-classes/app-b/App.svelte
+++ b/site/content/tutorial/13-classes/01-classes/app-b/App.svelte
@@ -2,17 +2,6 @@
let current = 'foo';
-
-
baz
\ No newline at end of file
+>baz
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/13-classes/02-class-shorthand/app-a/App.svelte b/site/content/tutorial/13-classes/02-class-shorthand/app-a/App.svelte
index 5ff6497230..d944a63313 100644
--- a/site/content/tutorial/13-classes/02-class-shorthand/app-a/App.svelte
+++ b/site/content/tutorial/13-classes/02-class-shorthand/app-a/App.svelte
@@ -2,12 +2,6 @@
let big = false;
-
-
big
@@ -15,4 +9,10 @@
some {big ? 'big' : 'small'} text
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/13-classes/02-class-shorthand/app-b/App.svelte b/site/content/tutorial/13-classes/02-class-shorthand/app-b/App.svelte
index 0f4e0d9f24..c91385e4e5 100644
--- a/site/content/tutorial/13-classes/02-class-shorthand/app-b/App.svelte
+++ b/site/content/tutorial/13-classes/02-class-shorthand/app-b/App.svelte
@@ -2,12 +2,6 @@
let big = false;
-
-
big
@@ -15,4 +9,10 @@
some {big ? 'big' : 'small'} text
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/01-slots/app-a/Box.svelte b/site/content/tutorial/14-composition/01-slots/app-a/Box.svelte
index 62f0b92dc0..e199b8ce81 100644
--- a/site/content/tutorial/14-composition/01-slots/app-a/Box.svelte
+++ b/site/content/tutorial/14-composition/01-slots/app-a/Box.svelte
@@ -1,3 +1,7 @@
+
+
+
+
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/01-slots/app-b/Box.svelte b/site/content/tutorial/14-composition/01-slots/app-b/Box.svelte
index 7ed13f386f..b17fdbe60d 100644
--- a/site/content/tutorial/14-composition/01-slots/app-b/Box.svelte
+++ b/site/content/tutorial/14-composition/01-slots/app-b/Box.svelte
@@ -1,3 +1,7 @@
+
+
+
+
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/02-slot-fallbacks/app-a/Box.svelte b/site/content/tutorial/14-composition/02-slot-fallbacks/app-a/Box.svelte
index 7ed13f386f..b17fdbe60d 100644
--- a/site/content/tutorial/14-composition/02-slot-fallbacks/app-a/Box.svelte
+++ b/site/content/tutorial/14-composition/02-slot-fallbacks/app-a/Box.svelte
@@ -1,3 +1,7 @@
+
+
+
+
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/02-slot-fallbacks/app-b/Box.svelte b/site/content/tutorial/14-composition/02-slot-fallbacks/app-b/Box.svelte
index 66c580632c..bdaf61b874 100644
--- a/site/content/tutorial/14-composition/02-slot-fallbacks/app-b/Box.svelte
+++ b/site/content/tutorial/14-composition/02-slot-fallbacks/app-b/Box.svelte
@@ -1,3 +1,9 @@
+
+
+ no content was provided
+
+
+
-
-
-
- no content was provided
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/03-named-slots/app-a/ContactCard.svelte b/site/content/tutorial/14-composition/03-named-slots/app-a/ContactCard.svelte
index c09404a282..4d8ba30e75 100644
--- a/site/content/tutorial/14-composition/03-named-slots/app-a/ContactCard.svelte
+++ b/site/content/tutorial/14-composition/03-named-slots/app-a/ContactCard.svelte
@@ -1,3 +1,23 @@
+
+
+
+ Unknown name
+
+
+
+
+
+ Unknown address
+
+
+
+
+
+ Unknown email
+
+
+
+
-
-
-
-
- Unknown name
-
-
-
-
-
- Unknown address
-
-
-
-
-
- Unknown email
-
-
-
\ No newline at end of file
+ .address {
+ background-image: url(tutorial/icons/map-marker.svg);
+ }
+ .email {
+ background-image: url(tutorial/icons/email.svg);
+ }
+ .missing {
+ color: #999;
+ }
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/03-named-slots/app-b/ContactCard.svelte b/site/content/tutorial/14-composition/03-named-slots/app-b/ContactCard.svelte
index 1acf290943..0348b70c55 100644
--- a/site/content/tutorial/14-composition/03-named-slots/app-b/ContactCard.svelte
+++ b/site/content/tutorial/14-composition/03-named-slots/app-b/ContactCard.svelte
@@ -1,3 +1,23 @@
+
+
+
+ Unknown name
+
+
+
+
+
+ Unknown address
+
+
+
+
+
+ Unknown email
+
+
+
+
-
-
-
-
- Unknown name
-
-
-
-
-
- Unknown address
-
-
-
-
-
- Unknown email
-
-
-
\ No newline at end of file
+ .address {
+ background-image: url(tutorial/icons/map-marker.svg);
+ }
+ .email {
+ background-image: url(tutorial/icons/email.svg);
+ }
+ .missing {
+ color: #999;
+ }
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-optional-slots/app-a/App.svelte b/site/content/tutorial/14-composition/04-optional-slots/app-a/App.svelte
index 80a4df59f8..19537cb4b3 100755
--- a/site/content/tutorial/14-composition/04-optional-slots/app-a/App.svelte
+++ b/site/content/tutorial/14-composition/04-optional-slots/app-a/App.svelte
@@ -3,32 +3,6 @@
import Comment from './Comment.svelte'
-
-
Projects
@@ -55,3 +29,29 @@
/>
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-optional-slots/app-a/Comment.svelte b/site/content/tutorial/14-composition/04-optional-slots/app-a/Comment.svelte
index 8d15ffa882..b3c10febf5 100755
--- a/site/content/tutorial/14-composition/04-optional-slots/app-a/Comment.svelte
+++ b/site/content/tutorial/14-composition/04-optional-slots/app-a/Comment.svelte
@@ -5,6 +5,19 @@
$: avatar = `https://ui-avatars.com/api/?name=${name.replace(/ /g, '+')}&rounded=true&background=ff3e00&color=fff&bold=true`;
+
+
+
+
+
{name}
+
+
+
+
+
+
+
+
-
-
-
-
-
-
{name}
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-optional-slots/app-a/Project.svelte b/site/content/tutorial/14-composition/04-optional-slots/app-a/Project.svelte
index 38d19fc638..2d98458966 100755
--- a/site/content/tutorial/14-composition/04-optional-slots/app-a/Project.svelte
+++ b/site/content/tutorial/14-composition/04-optional-slots/app-a/Project.svelte
@@ -4,6 +4,17 @@
export let totalTasks = 0;
+
+
+
{title}
+
{tasksCompleted}/{totalTasks} tasks completed
+
+
+
Comments
+
+
+
+
-
-
-
-
{title}
-
{tasksCompleted}/{totalTasks} tasks completed
-
-
-
Comments
-
-
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-optional-slots/app-b/App.svelte b/site/content/tutorial/14-composition/04-optional-slots/app-b/App.svelte
index 80a4df59f8..19537cb4b3 100755
--- a/site/content/tutorial/14-composition/04-optional-slots/app-b/App.svelte
+++ b/site/content/tutorial/14-composition/04-optional-slots/app-b/App.svelte
@@ -3,32 +3,6 @@
import Comment from './Comment.svelte'
-
-
Projects
@@ -55,3 +29,29 @@
/>
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-optional-slots/app-b/Comment.svelte b/site/content/tutorial/14-composition/04-optional-slots/app-b/Comment.svelte
index 8d15ffa882..b3c10febf5 100755
--- a/site/content/tutorial/14-composition/04-optional-slots/app-b/Comment.svelte
+++ b/site/content/tutorial/14-composition/04-optional-slots/app-b/Comment.svelte
@@ -5,6 +5,19 @@
$: avatar = `https://ui-avatars.com/api/?name=${name.replace(/ /g, '+')}&rounded=true&background=ff3e00&color=fff&bold=true`;
+
+
+
+
+
{name}
+
+
+
+
+
+
+
+
-
-
-
-
-
-
{name}
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-optional-slots/app-b/Project.svelte b/site/content/tutorial/14-composition/04-optional-slots/app-b/Project.svelte
index 87a1d0c3ac..39f55abd18 100755
--- a/site/content/tutorial/14-composition/04-optional-slots/app-b/Project.svelte
+++ b/site/content/tutorial/14-composition/04-optional-slots/app-b/Project.svelte
@@ -4,6 +4,19 @@
export let totalTasks = 0;
+
+
+
{title}
+
{tasksCompleted}/{totalTasks} tasks completed
+
+ {#if $$slots.comments}
+
+
Comments
+
+
+ {/if}
+
+
-
-
-
-
{title}
-
{tasksCompleted}/{totalTasks} tasks completed
-
- {#if $$slots.comments}
-
-
Comments
-
-
- {/if}
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/05-slot-props/app-a/App.svelte b/site/content/tutorial/14-composition/05-slot-props/app-a/App.svelte
index 65f714f2c5..e95b4cbe93 100644
--- a/site/content/tutorial/14-composition/05-slot-props/app-a/App.svelte
+++ b/site/content/tutorial/14-composition/05-slot-props/app-a/App.svelte
@@ -2,6 +2,16 @@
import Hoverable from './Hoverable.svelte';
+
+
+ {#if hovering}
+
I am being hovered upon.
+ {:else}
+
Hover over me!
+ {/if}
+
+
+
-
-
-
- {#if hovering}
-
I am being hovered upon.
- {:else}
-
Hover over me!
- {/if}
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/05-slot-props/app-b/App.svelte b/site/content/tutorial/14-composition/05-slot-props/app-b/App.svelte
index 36772a5077..299cd336a6 100644
--- a/site/content/tutorial/14-composition/05-slot-props/app-b/App.svelte
+++ b/site/content/tutorial/14-composition/05-slot-props/app-b/App.svelte
@@ -2,19 +2,6 @@
import Hoverable from './Hoverable.svelte';
-
-
{#if active}
@@ -43,4 +30,17 @@
Hover over me!
{/if}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/15-context/01-context-api/app-a/Map.svelte b/site/content/tutorial/15-context/01-context-api/app-a/Map.svelte
index 888f42da39..c6a660a49f 100644
--- a/site/content/tutorial/15-context/01-context-api/app-a/Map.svelte
+++ b/site/content/tutorial/15-context/01-context-api/app-a/Map.svelte
@@ -34,15 +34,15 @@
});
+
+ {#if map}
+
+ {/if}
+
+
-
-
- {#if map}
-
- {/if}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/15-context/01-context-api/app-b/Map.svelte b/site/content/tutorial/15-context/01-context-api/app-b/Map.svelte
index 0282cbc311..059fcca45b 100644
--- a/site/content/tutorial/15-context/01-context-api/app-b/Map.svelte
+++ b/site/content/tutorial/15-context/01-context-api/app-b/Map.svelte
@@ -36,15 +36,15 @@
});
+
+ {#if map}
+
+ {/if}
+
+
-
-
- {#if map}
-
- {/if}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/app-a/File.svelte b/site/content/tutorial/16-special-elements/01-svelte-self/app-a/File.svelte
index e34686101a..8a0048dd68 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/app-a/File.svelte
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/app-a/File.svelte
@@ -3,12 +3,12 @@
$: type = name.slice(name.lastIndexOf('.') + 1);
+{name}
+
-
-{name}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/app-a/Folder.svelte b/site/content/tutorial/16-special-elements/01-svelte-self/app-a/Folder.svelte
index add7fb96d3..20096e805e 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/app-a/Folder.svelte
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/app-a/Folder.svelte
@@ -10,6 +10,22 @@
}
+{name}
+
+{#if expanded}
+
-{/if}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/app-b/File.svelte b/site/content/tutorial/16-special-elements/01-svelte-self/app-b/File.svelte
index e34686101a..8a0048dd68 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/app-b/File.svelte
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/app-b/File.svelte
@@ -3,12 +3,12 @@
$: type = name.slice(name.lastIndexOf('.') + 1);
+{name}
+
-
-{name}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/app-b/Folder.svelte b/site/content/tutorial/16-special-elements/01-svelte-self/app-b/Folder.svelte
index c25bb2a93d..f5f0a7b194 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/app-b/Folder.svelte
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/app-b/Folder.svelte
@@ -10,6 +10,22 @@
}
+{name}
+
+{#if expanded}
+
-{/if}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/02-svelte-component/app-a/BlueThing.svelte b/site/content/tutorial/16-special-elements/02-svelte-component/app-a/BlueThing.svelte
index f9130d9d65..eb7ba64163 100644
--- a/site/content/tutorial/16-special-elements/02-svelte-component/app-a/BlueThing.svelte
+++ b/site/content/tutorial/16-special-elements/02-svelte-component/app-a/BlueThing.svelte
@@ -1,5 +1,7 @@
-
+Blue thing
-blue thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/02-svelte-component/app-a/GreenThing.svelte b/site/content/tutorial/16-special-elements/02-svelte-component/app-a/GreenThing.svelte
index 9cbee235d3..ed2aa49f27 100644
--- a/site/content/tutorial/16-special-elements/02-svelte-component/app-a/GreenThing.svelte
+++ b/site/content/tutorial/16-special-elements/02-svelte-component/app-a/GreenThing.svelte
@@ -1,5 +1,7 @@
-
+Green thing
-green thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/02-svelte-component/app-a/RedThing.svelte b/site/content/tutorial/16-special-elements/02-svelte-component/app-a/RedThing.svelte
index 42f5e4c672..365f226492 100644
--- a/site/content/tutorial/16-special-elements/02-svelte-component/app-a/RedThing.svelte
+++ b/site/content/tutorial/16-special-elements/02-svelte-component/app-a/RedThing.svelte
@@ -1,5 +1,7 @@
-
+Red thing
-red thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/02-svelte-component/app-b/BlueThing.svelte b/site/content/tutorial/16-special-elements/02-svelte-component/app-b/BlueThing.svelte
index f9130d9d65..eb7ba64163 100644
--- a/site/content/tutorial/16-special-elements/02-svelte-component/app-b/BlueThing.svelte
+++ b/site/content/tutorial/16-special-elements/02-svelte-component/app-b/BlueThing.svelte
@@ -1,5 +1,7 @@
-
+Blue thing
-blue thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/02-svelte-component/app-b/GreenThing.svelte b/site/content/tutorial/16-special-elements/02-svelte-component/app-b/GreenThing.svelte
index 9cbee235d3..ed2aa49f27 100644
--- a/site/content/tutorial/16-special-elements/02-svelte-component/app-b/GreenThing.svelte
+++ b/site/content/tutorial/16-special-elements/02-svelte-component/app-b/GreenThing.svelte
@@ -1,5 +1,7 @@
-
+Green thing
-green thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/02-svelte-component/app-b/RedThing.svelte b/site/content/tutorial/16-special-elements/02-svelte-component/app-b/RedThing.svelte
index 42f5e4c672..365f226492 100644
--- a/site/content/tutorial/16-special-elements/02-svelte-component/app-b/RedThing.svelte
+++ b/site/content/tutorial/16-special-elements/02-svelte-component/app-b/RedThing.svelte
@@ -1,5 +1,7 @@
-
+Red thing
-red thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/03-svelte-window/app-a/App.svelte b/site/content/tutorial/16-special-elements/03-svelte-window/app-a/App.svelte
index 9fe2bf526c..24c9a6368a 100644
--- a/site/content/tutorial/16-special-elements/03-svelte-window/app-a/App.svelte
+++ b/site/content/tutorial/16-special-elements/03-svelte-window/app-a/App.svelte
@@ -8,6 +8,17 @@
}
+
+
+
+ {#if key}
+ {key === ' ' ? 'Space' : key}
+
{keyCode}
+ {:else}
+
Focus this window and press any key
+ {/if}
+
+
-
-
-
-
- {#if key}
- {key === ' ' ? 'Space' : key}
-
{keyCode}
- {:else}
-
Focus this window and press any key
- {/if}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/03-svelte-window/app-b/App.svelte b/site/content/tutorial/16-special-elements/03-svelte-window/app-b/App.svelte
index 845d666dff..026dfa94f7 100644
--- a/site/content/tutorial/16-special-elements/03-svelte-window/app-b/App.svelte
+++ b/site/content/tutorial/16-special-elements/03-svelte-window/app-b/App.svelte
@@ -8,6 +8,17 @@
}
+
+
+
+ {#if key}
+ {key === ' ' ? 'Space' : key}
+
{keyCode}
+ {:else}
+
Focus this window and press any key
+ {/if}
+
+
-
-
-
-
- {#if key}
- {key === ' ' ? 'Space' : key}
-
{keyCode}
- {:else}
-
Focus this window and press any key
- {/if}
-
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-a/App.svelte b/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-a/App.svelte
index 04b4de5cf2..ba51140ff4 100644
--- a/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-a/App.svelte
+++ b/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-a/App.svelte
@@ -85,4 +85,4 @@
padding: 0;
background-color: rgb(253, 174, 51);
}
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-b/App.svelte b/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-b/App.svelte
index 15c2aa0ebc..2fc076b991 100644
--- a/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-b/App.svelte
+++ b/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-b/App.svelte
@@ -85,4 +85,4 @@
padding: 0;
background-color: rgb(253, 174, 51);
}
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/07-svelte-options/app-a/Todo.svelte b/site/content/tutorial/16-special-elements/07-svelte-options/app-a/Todo.svelte
index 5e0dbca300..57d4dcc79a 100644
--- a/site/content/tutorial/16-special-elements/07-svelte-options/app-a/Todo.svelte
+++ b/site/content/tutorial/16-special-elements/07-svelte-options/app-a/Todo.svelte
@@ -11,15 +11,15 @@
});
-
-
{todo.done ? '👍': ''} {todo.text}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/07-svelte-options/app-b/Todo.svelte b/site/content/tutorial/16-special-elements/07-svelte-options/app-b/Todo.svelte
index e7ddcedc47..fa81d35989 100644
--- a/site/content/tutorial/16-special-elements/07-svelte-options/app-b/Todo.svelte
+++ b/site/content/tutorial/16-special-elements/07-svelte-options/app-b/Todo.svelte
@@ -13,15 +13,15 @@
});
-
-
{todo.done ? '👍': ''} {todo.text}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/App.svelte b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/App.svelte
index 35f2586857..442ff07d26 100644
--- a/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/App.svelte
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/App.svelte
@@ -7,4 +7,4 @@
All rights reserved.
Copyright (c) 2019 Svelte Industries
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/Box.svelte b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/Box.svelte
index 16c17f90ef..ed389182a7 100644
--- a/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/Box.svelte
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/Box.svelte
@@ -1,9 +1,15 @@
+
+ No header was provided
+
Some content between header and footer
+
+
+
-
-
- No header was provided
-
Some content between header and footer
-
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/App.svelte b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/App.svelte
index 6f55903ece..e66b026d90 100644
--- a/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/App.svelte
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/App.svelte
@@ -7,4 +7,4 @@
All rights reserved.
Copyright (c) 2019 Svelte Industries
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/Box.svelte b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/Box.svelte
index 16c17f90ef..ed389182a7 100644
--- a/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/Box.svelte
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/Box.svelte
@@ -1,9 +1,15 @@
+
+ No header was provided
+
Some content between header and footer
+
+
+
-
-
- No header was provided
-
Some content between header and footer
-
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/08-svelte-fragment/text.md b/site/content/tutorial/16-special-elements/08-svelte-fragment/text.md
index fca7aeb844..2103404799 100644
--- a/site/content/tutorial/16-special-elements/08-svelte-fragment/text.md
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/text.md
@@ -8,6 +8,12 @@ In the example notice how we applied a flex layout with a gap of `1em` to the bo
```sv
+
+ No header was provided
+
Some content between header and footer
+
+
+
-
-
- No header was provided
-
Some content between header and footer
-
-
```
However, the content in the footer is not spaced out according to this rhythm because wrapping it in a div created a new flow layout.
diff --git a/site/content/tutorial/17-module-context/01-sharing-code/app-a/AudioPlayer.svelte b/site/content/tutorial/17-module-context/01-sharing-code/app-a/AudioPlayer.svelte
index 12d3a78c41..179bdacffe 100644
--- a/site/content/tutorial/17-module-context/01-sharing-code/app-a/AudioPlayer.svelte
+++ b/site/content/tutorial/17-module-context/01-sharing-code/app-a/AudioPlayer.svelte
@@ -12,13 +12,6 @@
}
-
-
{title}
{composer} / performed by {performer}
@@ -30,4 +23,19 @@
controls
{src}
>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/17-module-context/01-sharing-code/app-b/AudioPlayer.svelte b/site/content/tutorial/17-module-context/01-sharing-code/app-b/AudioPlayer.svelte
index 609f9f1af0..3352074a2c 100644
--- a/site/content/tutorial/17-module-context/01-sharing-code/app-b/AudioPlayer.svelte
+++ b/site/content/tutorial/17-module-context/01-sharing-code/app-b/AudioPlayer.svelte
@@ -17,13 +17,6 @@
}
-
-
{title}
{composer} / performed by {performer}
@@ -35,4 +28,19 @@
controls
{src}
>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/17-module-context/02-module-exports/app-a/AudioPlayer.svelte b/site/content/tutorial/17-module-context/02-module-exports/app-a/AudioPlayer.svelte
index 27dbe1993b..90f3c67551 100644
--- a/site/content/tutorial/17-module-context/02-module-exports/app-a/AudioPlayer.svelte
+++ b/site/content/tutorial/17-module-context/02-module-exports/app-a/AudioPlayer.svelte
@@ -25,13 +25,6 @@
}
-
-
{title}
{composer} / performed by {performer}
@@ -43,4 +36,19 @@
controls
{src}
>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/17-module-context/02-module-exports/app-b/AudioPlayer.svelte b/site/content/tutorial/17-module-context/02-module-exports/app-b/AudioPlayer.svelte
index 4e3d191dbf..f28e8b0c7f 100644
--- a/site/content/tutorial/17-module-context/02-module-exports/app-b/AudioPlayer.svelte
+++ b/site/content/tutorial/17-module-context/02-module-exports/app-b/AudioPlayer.svelte
@@ -31,13 +31,6 @@
}
-
-
{title}
{composer} / performed by {performer}
@@ -49,4 +42,19 @@
controls
{src}
>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/19-next-steps/01-congratulations/app-a/App.svelte b/site/content/tutorial/19-next-steps/01-congratulations/app-a/App.svelte
index 2e72fafe23..b1bd64dea0 100644
--- a/site/content/tutorial/19-next-steps/01-congratulations/app-a/App.svelte
+++ b/site/content/tutorial/19-next-steps/01-congratulations/app-a/App.svelte
@@ -33,6 +33,10 @@
});
+{#each confetti as c}
+ {c.character}
+{/each}
+
-
-{#each confetti as c}
- {c.character}
-{/each}
\ No newline at end of file
+
\ No newline at end of file
From a39fc8de728ba292523828e1cf6f6254f125c640 Mon Sep 17 00:00:00 2001
From: Mohammed Al-Qurafi
Date: Sat, 24 Apr 2021 17:10:02 +0300
Subject: [PATCH 007/298] Add "context" typing to SvelteComponent constructor
options (#6236)
---
CHANGELOG.md | 1 +
src/runtime/internal/dev.ts | 34 +++++++++++++++-------------------
2 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 85281d4326..27812b982e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
* Avoid recreating DOM elements during hydration ([#6204](https://github.com/sveltejs/svelte/pull/6204))
* Add missing function overload for `derived` to allow explicitly setting an initial value for non-async derived stores ([#6172](https://github.com/sveltejs/svelte/pull/6172))
* Pass full markup source to script/style preprocessors ([#6169](https://github.com/sveltejs/svelte/pull/6169))
+* Add "context" typing to SvelteComponent constructor options ([#6236](https://github.com/sveltejs/svelte/pull/6236))
## 3.37.0
diff --git a/src/runtime/internal/dev.ts b/src/runtime/internal/dev.ts
index 99ff067474..8e67b0f61b 100644
--- a/src/runtime/internal/dev.ts
+++ b/src/runtime/internal/dev.ts
@@ -104,6 +104,16 @@ export interface SvelteComponentDev {
$destroy(): void;
[accessor: string]: any;
}
+interface IComponentOptions {
+ target: Element;
+ anchor?: Element;
+ props?: Props;
+ context?: Map;
+ hydrate?: boolean;
+ intro?: boolean;
+ $$inline?: boolean;
+}
+
/**
* Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
*/
@@ -130,14 +140,7 @@ export class SvelteComponentDev extends SvelteComponent {
*/
$$slot_def: any;
- constructor(options: {
- target: Element;
- anchor?: Element;
- props?: Props;
- hydrate?: boolean;
- intro?: boolean;
- $$inline?: boolean;
- }) {
+ constructor(options: IComponentOptions) {
if (!options || (!options.target && !options.$$inline)) {
throw new Error("'target' is a required option");
}
@@ -174,9 +177,9 @@ export interface SvelteComponentTyped<
/**
* Base class to create strongly typed Svelte components.
* This only exists for typing purposes and should be used in `.d.ts` files.
- *
+ *
* ### Example:
- *
+ *
* You have component library on npm called `component-library`, from which
* you export a component called `MyComponent`. For Svelte+TypeScript users,
* you want to provide typings. Therefore you create a `index.d.ts`:
@@ -193,7 +196,7 @@ export interface SvelteComponentTyped<
*
*
* ```
- *
+ *
* #### Why not make this part of `SvelteComponent(Dev)`?
* Because
* ```ts
@@ -229,14 +232,7 @@ export class SvelteComponentTyped<
*/
$$slot_def: Slots;
- constructor(options: {
- target: Element;
- anchor?: Element;
- props?: Props;
- hydrate?: boolean;
- intro?: boolean;
- $$inline?: boolean;
- }) {
+ constructor(options: IComponentOptions) {
super(options);
}
}
From 4633697214387763c95f92b4d3d83bf69e08698b Mon Sep 17 00:00:00 2001
From: halfnelson
Date: Sat, 1 May 2021 00:10:49 +1000
Subject: [PATCH 008/298] Don't auto change to svg namespace when in foreign
namespace (#6261)
---
src/compiler/compile/nodes/Element.ts | 6 ++++--
.../_config.js | 7 +++++--
.../main.svelte | 5 +++--
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts
index 77cb2e062d..c9529fcbcb 100644
--- a/src/compiler/compile/nodes/Element.ts
+++ b/src/compiler/compile/nodes/Element.ts
@@ -107,8 +107,10 @@ function get_namespace(parent: Element, element: Element, explicit_namespace: st
: null);
}
- if (svg.test(element.name.toLowerCase())) return namespaces.svg;
- if (parent_element.name.toLowerCase() === 'foreignobject') return null;
+ if (parent_element.namespace !== namespaces.foreign) {
+ if (svg.test(element.name.toLowerCase())) return namespaces.svg;
+ if (parent_element.name.toLowerCase() === 'foreignobject') return null;
+ }
return parent_element.namespace;
}
diff --git a/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/_config.js b/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/_config.js
index 1225c64fc2..0439aca06a 100644
--- a/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/_config.js
+++ b/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/_config.js
@@ -1,9 +1,11 @@
-// Test support for the `foreign` namespace preserving attribute case.
+// Test support for the `foreign` namespace preserving attribute case,
+// including ensuring that SVG elements don't interfere.
export default {
html: `
-
+
+
`,
options: {
@@ -16,5 +18,6 @@ export default {
const attr = sel => target.querySelector(sel).attributes[0].name;
assert.equal(attr('page'), 'horizontalAlignment');
assert.equal(attr('button'), 'textWrap');
+ assert.equal(attr('text'), 'wordWrap');
}
};
diff --git a/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/main.svelte b/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/main.svelte
index 6300ab3b63..52b3e646e1 100644
--- a/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/main.svelte
+++ b/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/main.svelte
@@ -1,3 +1,4 @@
-
-
\ No newline at end of file
+
+
+
From 6d5a200e04703be195c722943d20b6da0d795ea2 Mon Sep 17 00:00:00 2001
From: Conduitry
Date: Fri, 30 Apr 2021 10:13:57 -0400
Subject: [PATCH 009/298] update changelog
---
CHANGELOG.md | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 27812b982e..5aede1999a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,10 +2,11 @@
## Unreleased
-* Avoid recreating DOM elements during hydration ([#6204](https://github.com/sveltejs/svelte/pull/6204))
+* Avoid recreating DOM elements during hydration ([#1067](https://github.com/sveltejs/svelte/issues/1067))
* Add missing function overload for `derived` to allow explicitly setting an initial value for non-async derived stores ([#6172](https://github.com/sveltejs/svelte/pull/6172))
-* Pass full markup source to script/style preprocessors ([#6169](https://github.com/sveltejs/svelte/pull/6169))
-* Add "context" typing to SvelteComponent constructor options ([#6236](https://github.com/sveltejs/svelte/pull/6236))
+* Pass full markup source to `script`/`style` preprocessors ([#6169](https://github.com/sveltejs/svelte/pull/6169))
+* Add missing "context" typing to `SvelteComponent` constructor options ([#6236](https://github.com/sveltejs/svelte/pull/6236))
+* Don't automatically switch to `svg` namespace when in `foreign` namespace ([#6257](https://github.com/sveltejs/svelte/issues/6257))
## 3.37.0
From 00e58e7bc85411894d16ebf864750f24e2639655 Mon Sep 17 00:00:00 2001
From: "Lyu, Wei-Da" <36730922+jasonlyu123@users.noreply.github.com>
Date: Fri, 30 Apr 2021 22:18:07 +0800
Subject: [PATCH 010/298] Fix {#await} block scope when updating (#6219)
---
.../compile/render_dom/wrappers/AwaitBlock.ts | 19 ++-----
src/runtime/internal/await_block.ts | 14 +++++
.../await-with-update-catch-scope/_config.js | 51 +++++++++++++++++++
.../await-with-update-catch-scope/main.svelte | 13 +++++
4 files changed, 81 insertions(+), 16 deletions(-)
create mode 100644 test/runtime/samples/await-with-update-catch-scope/_config.js
create mode 100644 test/runtime/samples/await-with-update-catch-scope/main.svelte
diff --git a/src/compiler/compile/render_dom/wrappers/AwaitBlock.ts b/src/compiler/compile/render_dom/wrappers/AwaitBlock.ts
index cc186d1c02..637d32676c 100644
--- a/src/compiler/compile/render_dom/wrappers/AwaitBlock.ts
+++ b/src/compiler/compile/render_dom/wrappers/AwaitBlock.ts
@@ -232,14 +232,7 @@ export default class AwaitBlockWrapper extends Wrapper {
const dependencies = this.node.expression.dynamic_dependencies();
- let update_child_context;
- if (this.then.value && this.catch.value) {
- update_child_context = b`#child_ctx[${this.then.value_index}] = #child_ctx[${this.catch.value_index}] = ${info}.resolved;`;
- } else if (this.then.value) {
- update_child_context = b`#child_ctx[${this.then.value_index}] = ${info}.resolved;`;
- } else if (this.catch.value) {
- update_child_context = b`#child_ctx[${this.catch.value_index}] = ${info}.resolved;`;
- }
+ const update_await_block_branch = b`@update_await_block_branch(${info}, #ctx, #dirty)`;
if (dependencies.length > 0) {
const condition = x`
@@ -256,9 +249,7 @@ export default class AwaitBlockWrapper extends Wrapper {
if (${condition}) {
} else {
- const #child_ctx = #ctx.slice();
- ${update_child_context}
- ${info}.block.p(#child_ctx, #dirty);
+ ${update_await_block_branch}
}
`);
} else {
@@ -269,11 +260,7 @@ export default class AwaitBlockWrapper extends Wrapper {
} else {
if (this.pending.block.has_update_method) {
block.chunks.update.push(b`
- {
- const #child_ctx = #ctx.slice();
- ${update_child_context}
- ${info}.block.p(#child_ctx, #dirty);
- }
+ ${update_await_block_branch}
`);
}
}
diff --git a/src/runtime/internal/await_block.ts b/src/runtime/internal/await_block.ts
index b93f216b32..ea6e8a187f 100644
--- a/src/runtime/internal/await_block.ts
+++ b/src/runtime/internal/await_block.ts
@@ -83,3 +83,17 @@ export function handle_promise(promise, info) {
info.resolved = promise;
}
}
+
+export function update_await_block_branch(info, ctx, dirty) {
+ const child_ctx = ctx.slice();
+ const { resolved } = info;
+
+ if (info.current === info.then) {
+ child_ctx[info.value] = resolved;
+ }
+ if (info.current === info.catch) {
+ child_ctx[info.error] = resolved;
+ }
+
+ info.block.p(child_ctx, dirty);
+}
diff --git a/test/runtime/samples/await-with-update-catch-scope/_config.js b/test/runtime/samples/await-with-update-catch-scope/_config.js
new file mode 100644
index 0000000000..4c60ef2150
--- /dev/null
+++ b/test/runtime/samples/await-with-update-catch-scope/_config.js
@@ -0,0 +1,51 @@
+export default {
+ props: {
+ thePromise: new Promise((_) => {})
+ },
+
+ html: `
+
+text
\ No newline at end of file
diff --git a/test/css/samples/global-compound-selector/input.svelte b/test/css/samples/global-compound-selector/input.svelte
new file mode 100644
index 0000000000..347ae3ac55
--- /dev/null
+++ b/test/css/samples/global-compound-selector/input.svelte
@@ -0,0 +1,21 @@
+
text
+
texttext
+text
+
+
\ No newline at end of file
diff --git a/test/css/samples/global/expected.css b/test/css/samples/global/expected.css
index 698a44038b..64891e17fd 100644
--- a/test/css/samples/global/expected.css
+++ b/test/css/samples/global/expected.css
@@ -1 +1 @@
-div{color:red}div.foo{color:blue}.foo{font-weight:bold}
\ No newline at end of file
+div{color:red}div.foo.svelte-xyz{color:blue}div.foo{color:pink}.foo{font-weight:bold}
\ No newline at end of file
diff --git a/test/css/samples/global/input.svelte b/test/css/samples/global/input.svelte
index 0350c826f5..31ac143940 100644
--- a/test/css/samples/global/input.svelte
+++ b/test/css/samples/global/input.svelte
@@ -10,6 +10,10 @@
color: blue;
}
+ :global(div.foo) {
+ color: pink;
+ }
+
:global(.foo) {
font-weight: bold;
}
diff --git a/test/validator/samples/css-invalid-global/errors.json b/test/validator/samples/css-invalid-global/errors.json
deleted file mode 100644
index 63ed908342..0000000000
--- a/test/validator/samples/css-invalid-global/errors.json
+++ /dev/null
@@ -1,15 +0,0 @@
-[{
- "code": "css-invalid-global",
- "message": ":global(...) must be the first element in a compound selector",
- "start": {
- "line": 2,
- "column": 5,
- "character": 13
- },
- "end": {
- "line": 2,
- "column": 18,
- "character": 26
- },
- "pos": 13
-}]
\ No newline at end of file
diff --git a/test/validator/samples/css-invalid-global/input.svelte b/test/validator/samples/css-invalid-global/input.svelte
deleted file mode 100644
index 518674424a..0000000000
--- a/test/validator/samples/css-invalid-global/input.svelte
+++ /dev/null
@@ -1,5 +0,0 @@
-
\ No newline at end of file
From ce55e10df57af83c46519be0c4d99ffea761a7a1 Mon Sep 17 00:00:00 2001
From: Conduitry
Date: Fri, 30 Apr 2021 10:37:18 -0400
Subject: [PATCH 013/298] update changelog
---
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9bc63083c9..8ad7945649 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
## Unreleased
* Avoid recreating DOM elements during hydration ([#1067](https://github.com/sveltejs/svelte/issues/1067))
+* Support `:global()` as part of compound CSS selectors ([#6222](https://github.com/sveltejs/svelte/issues/6222))
* Add missing function overload for `derived` to allow explicitly setting an initial value for non-async derived stores ([#6172](https://github.com/sveltejs/svelte/pull/6172))
* Fix scope leak when updating an `{#await}` block ([#6173](https://github.com/sveltejs/svelte/issues/6173))
* Pass full markup source to `script`/`style` preprocessors ([#6169](https://github.com/sveltejs/svelte/pull/6169))
From 02b49a1bb413be4250f7e4a0e381ccda7efa1a0f Mon Sep 17 00:00:00 2001
From: Tan Li Hau
Date: Fri, 30 Apr 2021 23:36:36 +0800
Subject: [PATCH 014/298] implement passing CSS custom properties to components
(#6237)
---
src/compiler/compile/nodes/InlineComponent.ts | 5 +
.../wrappers/InlineComponent/index.ts | 66 ++++-
.../render_ssr/handlers/InlineComponent.ts | 15 ++
test/helpers.ts | 8 +
test/runtime-puppeteer/assert.js | 54 ++++
test/runtime-puppeteer/index.ts | 250 ++++++++++++++++++
.../Slider.svelte | 17 ++
.../_config.js | 41 +++
.../main.svelte | 23 ++
.../Slider.svelte | 17 ++
.../_config.js | 27 ++
.../main.svelte | 15 ++
test/server-side-rendering/index.ts | 147 +++++-----
13 files changed, 610 insertions(+), 75 deletions(-)
create mode 100644 test/runtime-puppeteer/assert.js
create mode 100644 test/runtime-puppeteer/index.ts
create mode 100644 test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/Slider.svelte
create mode 100644 test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/_config.js
create mode 100644 test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/main.svelte
create mode 100644 test/runtime-puppeteer/samples/component-css-custom-properties/Slider.svelte
create mode 100644 test/runtime-puppeteer/samples/component-css-custom-properties/_config.js
create mode 100644 test/runtime-puppeteer/samples/component-css-custom-properties/main.svelte
diff --git a/src/compiler/compile/nodes/InlineComponent.ts b/src/compiler/compile/nodes/InlineComponent.ts
index 9990a8302d..c78f434527 100644
--- a/src/compiler/compile/nodes/InlineComponent.ts
+++ b/src/compiler/compile/nodes/InlineComponent.ts
@@ -18,6 +18,7 @@ export default class InlineComponent extends Node {
bindings: Binding[] = [];
handlers: EventHandler[] = [];
lets: Let[] = [];
+ css_custom_properties: Attribute[] = [];
children: INode[];
scope: TemplateScope;
@@ -46,6 +47,10 @@ export default class InlineComponent extends Node {
});
case 'Attribute':
+ if (node.name.startsWith('--')) {
+ this.css_custom_properties.push(new Attribute(component, this, scope, node));
+ break;
+ }
// fallthrough
case 'Spread':
this.attributes.push(new Attribute(component, this, scope, node));
diff --git a/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts b/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts
index c6299321f4..2ea149a848 100644
--- a/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts
+++ b/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts
@@ -18,6 +18,7 @@ import { extract_names } from 'periscopic';
import mark_each_block_bindings from '../shared/mark_each_block_bindings';
import { string_to_member_expression } from '../../../utils/string_to_member_expression';
import SlotTemplate from '../../../nodes/SlotTemplate';
+import { is_head } from '../shared/is_head';
type SlotDefinition = { block: Block; scope: TemplateScope; get_context?: Node; get_changes?: Node };
@@ -63,6 +64,10 @@ export default class InlineComponentWrapper extends Wrapper {
}
});
+ this.node.css_custom_properties.forEach(attr => {
+ block.add_dependencies(attr.dependencies);
+ });
+
this.var = {
type: 'Identifier',
name: (
@@ -146,6 +151,12 @@ export default class InlineComponentWrapper extends Wrapper {
}
}
+ const has_css_custom_properties = this.node.css_custom_properties.length > 0;
+ const css_custom_properties_wrapper = has_css_custom_properties ? block.get_unique_name('div') : null;
+ if (has_css_custom_properties) {
+ block.add_variable(css_custom_properties_wrapper);
+ }
+
const initial_props = this.slots.size > 0
? [
p`$$slots: {
@@ -491,17 +502,64 @@ export default class InlineComponentWrapper extends Wrapper {
${munged_handlers}
`);
+ if (has_css_custom_properties) {
+ block.chunks.create.push(b`${css_custom_properties_wrapper} = @element("div");`);
+ block.chunks.hydrate.push(b`@set_style(${css_custom_properties_wrapper}, "display", "contents");`);
+ this.node.css_custom_properties.forEach(attr => {
+ const dependencies = attr.get_dependencies();
+ const should_cache = attr.should_cache();
+ const last = should_cache && block.get_unique_name(`${attr.name.replace(/[^a-zA-Z_$]/g, '_')}_last`);
+ if (should_cache) block.add_variable(last);
+ const value = attr.get_value(block);
+ const init = should_cache ? x`${last} = ${value}` : value;
+
+ block.chunks.hydrate.push(b`@set_style(${css_custom_properties_wrapper}, "${attr.name}", ${init});`);
+ if (dependencies.length > 0) {
+ let condition = block.renderer.dirty(dependencies);
+ if (should_cache) condition = x`${condition} && (${last} !== (${last} = ${value}))`;
+
+ block.chunks.update.push(b`
+ if (${condition}) {
+ @set_style(${css_custom_properties_wrapper}, "${attr.name}", ${should_cache ? last : value});
+ }
+ `);
+ }
+ });
+ }
block.chunks.create.push(b`@create_component(${name}.$$.fragment);`);
if (parent_nodes && this.renderer.options.hydratable) {
+ let nodes = parent_nodes;
+ if (has_css_custom_properties) {
+ nodes = block.get_unique_name(`${css_custom_properties_wrapper.name}_nodes`);
+ block.chunks.claim.push(b`
+ ${css_custom_properties_wrapper} = @claim_element(${parent_nodes}, "DIV", { style: true })
+ var ${nodes} = @children(${css_custom_properties_wrapper});
+ `);
+ }
block.chunks.claim.push(
- b`@claim_component(${name}.$$.fragment, ${parent_nodes});`
+ b`@claim_component(${name}.$$.fragment, ${nodes});`
);
}
- block.chunks.mount.push(
- b`@mount_component(${name}, ${parent_node || '#target'}, ${parent_node ? 'null' : '#anchor'});`
- );
+ if (has_css_custom_properties) {
+ if (parent_node) {
+ block.chunks.mount.push(b`@append(${parent_node}, ${css_custom_properties_wrapper})`);
+ if (is_head(parent_node)) {
+ block.chunks.destroy.push(b`@detach(${css_custom_properties_wrapper});`);
+ }
+ } else {
+ block.chunks.mount.push(b`@insert(#target, ${css_custom_properties_wrapper}, #anchor);`);
+ // TODO we eventually need to consider what happens to elements
+ // that belong to the same outgroup as an outroing element...
+ block.chunks.destroy.push(b`if (detaching) @detach(${css_custom_properties_wrapper});`);
+ }
+ block.chunks.mount.push(b`@mount_component(${name}, ${css_custom_properties_wrapper}, null);`);
+ } else {
+ block.chunks.mount.push(
+ b`@mount_component(${name}, ${parent_node || '#target'}, ${parent_node ? 'null' : '#anchor'});`
+ );
+ }
block.chunks.intro.push(b`
@transition_in(${name}.$$.fragment, #local);
diff --git a/src/compiler/compile/render_ssr/handlers/InlineComponent.ts b/src/compiler/compile/render_ssr/handlers/InlineComponent.ts
index c4116e6591..2b3ca5fbcb 100644
--- a/src/compiler/compile/render_ssr/handlers/InlineComponent.ts
+++ b/src/compiler/compile/render_ssr/handlers/InlineComponent.ts
@@ -1,4 +1,5 @@
import { string_literal } from '../../utils/stringify';
+import { get_attribute_value } from './shared/get_attribute_value';
import Renderer, { RenderOptions } from '../Renderer';
import InlineComponent from '../../nodes/InlineComponent';
import { p, x } from 'code-red';
@@ -86,5 +87,19 @@ export default function(node: InlineComponent, renderer: Renderer, options: Rend
${slot_fns}
}`;
+ if (node.css_custom_properties.length > 0) {
+ renderer.add_string('
');
+
+ raf.tick(75);
+ assert.equal(div.foo, 0.75);
+
+ raf.tick(100);
+ assert.equal(div.foo, 1);
+ }
+};
diff --git a/test/runtime/samples/transition-js-slot-2/main.svelte b/test/runtime/samples/transition-js-slot-2/main.svelte
new file mode 100644
index 0000000000..2d45b5ca30
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-2/main.svelte
@@ -0,0 +1,18 @@
+
+
+
+ {name}
+
From 1b4c83c41f234c67db64a997c1621d1a45274936 Mon Sep 17 00:00:00 2001
From: Conduitry
Date: Fri, 30 Apr 2021 12:07:56 -0400
Subject: [PATCH 024/298] update changelog
---
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 09400fbcd5..4311befab4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
* Avoid recreating DOM elements during hydration ([#1067](https://github.com/sveltejs/svelte/issues/1067))
* Support passing CSS custom properties to component ([#5628](https://github.com/sveltejs/svelte/issues/5628))
* Support `:global()` as part of compound CSS selectors ([#6222](https://github.com/sveltejs/svelte/issues/6222))
+* Fix updating `` contents when there's an aborted transition ([#3542](https://github.com/sveltejs/svelte/issues/3542))
* Fix setting boolean attributes on custom elements ([#5951](https://github.com/sveltejs/svelte/issues/5951))
* Add missing function overload for `derived` to allow explicitly setting an initial value for non-async derived stores ([#6172](https://github.com/sveltejs/svelte/pull/6172))
* Fix dynamic `href` values erroneously triggering a11y warnings ([#5990](https://github.com/sveltejs/svelte/issues/5990))
From b3a642c3d30cbffe962c0df42f3766ce718506cc Mon Sep 17 00:00:00 2001
From: Conduitry
Date: Fri, 30 Apr 2021 12:32:24 -0400
Subject: [PATCH 025/298] -> v3.38.0
---
CHANGELOG.md | 2 +-
package-lock.json | 2 +-
package.json | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4311befab4..836b3bad70 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,6 @@
# Svelte changelog
-## Unreleased
+## 3.38.0
* Avoid recreating DOM elements during hydration ([#1067](https://github.com/sveltejs/svelte/issues/1067))
* Support passing CSS custom properties to component ([#5628](https://github.com/sveltejs/svelte/issues/5628))
diff --git a/package-lock.json b/package-lock.json
index 453e482ef1..49e9b92bce 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "svelte",
- "version": "3.37.0",
+ "version": "3.38.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index 51600a7989..683a9a405a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "svelte",
- "version": "3.37.0",
+ "version": "3.38.0",
"description": "Cybernetically enhanced web apps",
"module": "index.mjs",
"main": "index",
From 94bfeae5d560e229b8add61838ce1804c7d74c90 Mon Sep 17 00:00:00 2001
From: Tan Li Hau
Date: Sat, 1 May 2021 23:08:30 +0800
Subject: [PATCH 026/298] fix claim_text (#6275)
---
src/runtime/internal/dom.ts | 2 +-
test/hydration/samples/claim-text/Component.svelte | 5 +++++
test/hydration/samples/claim-text/Layout.svelte | 2 ++
test/hydration/samples/claim-text/_after.html | 3 +++
test/hydration/samples/claim-text/_before.html | 5 +++++
test/hydration/samples/claim-text/main.svelte | 8 ++++++++
6 files changed, 24 insertions(+), 1 deletion(-)
create mode 100644 test/hydration/samples/claim-text/Component.svelte
create mode 100644 test/hydration/samples/claim-text/Layout.svelte
create mode 100644 test/hydration/samples/claim-text/_after.html
create mode 100644 test/hydration/samples/claim-text/_before.html
create mode 100644 test/hydration/samples/claim-text/main.svelte
diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts
index 03f076df5e..b0cc2c5841 100644
--- a/src/runtime/internal/dom.ts
+++ b/src/runtime/internal/dom.ts
@@ -216,7 +216,7 @@ export function claim_text(nodes, data) {
const node = nodes[i];
if (node.nodeType === 3) {
node.data = '' + data;
- return nodes.shift();
+ return nodes.splice(i, 1)[0];
}
}
diff --git a/test/hydration/samples/claim-text/Component.svelte b/test/hydration/samples/claim-text/Component.svelte
new file mode 100644
index 0000000000..c4a56edceb
--- /dev/null
+++ b/test/hydration/samples/claim-text/Component.svelte
@@ -0,0 +1,5 @@
+
+ Title
+
+
+There should be one
diff --git a/test/hydration/samples/claim-text/Layout.svelte b/test/hydration/samples/claim-text/Layout.svelte
new file mode 100644
index 0000000000..b37cf18832
--- /dev/null
+++ b/test/hydration/samples/claim-text/Layout.svelte
@@ -0,0 +1,2 @@
+
This p and the slot below are direct children of the root.
+
diff --git a/test/hydration/samples/claim-text/_after.html b/test/hydration/samples/claim-text/_after.html
new file mode 100644
index 0000000000..6f79ed7159
--- /dev/null
+++ b/test/hydration/samples/claim-text/_after.html
@@ -0,0 +1,3 @@
+
This p and the slot below are direct children of the root.
+
+There should be one
\ No newline at end of file
diff --git a/test/hydration/samples/claim-text/_before.html b/test/hydration/samples/claim-text/_before.html
new file mode 100644
index 0000000000..e5653f47fe
--- /dev/null
+++ b/test/hydration/samples/claim-text/_before.html
@@ -0,0 +1,5 @@
+
This p and the slot below are direct children of the root.
+
+There should be one
+
+
\ No newline at end of file
diff --git a/test/hydration/samples/claim-text/main.svelte b/test/hydration/samples/claim-text/main.svelte
new file mode 100644
index 0000000000..46c001589d
--- /dev/null
+++ b/test/hydration/samples/claim-text/main.svelte
@@ -0,0 +1,8 @@
+
+
+
+
+
\ No newline at end of file
From 166a61aa26bda01dada25c6dbceb17be9c16be78 Mon Sep 17 00:00:00 2001
From: Conduitry
Date: Sat, 1 May 2021 11:10:09 -0400
Subject: [PATCH 027/298] -> v3.38.1
---
CHANGELOG.md | 4 ++++
package-lock.json | 2 +-
package.json | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 836b3bad70..12502063cb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Svelte changelog
+## 3.38.1
+
+* Fix hydration regression ([#6274](https://github.com/sveltejs/svelte/issues/6274))
+
## 3.38.0
* Avoid recreating DOM elements during hydration ([#1067](https://github.com/sveltejs/svelte/issues/1067))
diff --git a/package-lock.json b/package-lock.json
index 49e9b92bce..54c47977a0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "svelte",
- "version": "3.38.0",
+ "version": "3.38.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index 683a9a405a..2049141ca7 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "svelte",
- "version": "3.38.0",
+ "version": "3.38.1",
"description": "Cybernetically enhanced web apps",
"module": "index.mjs",
"main": "index",
From 7b6526ed704bd9979b99c9387f00445ded36ca13 Mon Sep 17 00:00:00 2001
From: Daniel Sandoval
Date: Sat, 1 May 2021 09:35:42 -0700
Subject: [PATCH 028/298] "What's new in Svelte" May newsletter (#6243)
---
...2021-05-01-whats-new-in-svelte-may-2021.md | 76 +++++++++++++++++++
1 file changed, 76 insertions(+)
create mode 100644 site/content/blog/2021-05-01-whats-new-in-svelte-may-2021.md
diff --git a/site/content/blog/2021-05-01-whats-new-in-svelte-may-2021.md b/site/content/blog/2021-05-01-whats-new-in-svelte-may-2021.md
new file mode 100644
index 0000000000..070bb38825
--- /dev/null
+++ b/site/content/blog/2021-05-01-whats-new-in-svelte-may-2021.md
@@ -0,0 +1,76 @@
+---
+title: What's new in Svelte: May 2021
+description: Working toward SvelteKit 1.0 and a showcase full of SvelteKit sites!
+author: Daniel Sandoval
+authorURL: https://desandoval.net
+---
+
+Last week, Svelte Summit blew us away with a mountain of content! [Check out the full recording](https://www.youtube.com/watch?v=fnr9XWvjJHw) or an audio-only (p)review [on Svelte Radio](https://www.svelteradio.com/episodes/svelte-summit-party-episode). Now let's get into this month's news...
+
+## New features in the Svelte Compiler
+- `:global()` is now supported as part of compound CSS selectors (**3.38.0**, [Example](https://svelte.dev/repl/54148fd2af484f2c84977c94e523c7c5?version=3.38.0))
+- CSS custom properties can now be passed to components for use cases such as theming (**3.38.0**, [Docs coming soon](https://github.com/sveltejs/svelte/issues/6268))
+
+## New in SvelteKit
+- [kit.svelte.dev](https://kit.svelte.dev/) has a fresh new look and the [SvelteKit Demo Site](https://netlify.demo.svelte.dev/) got a fresh set of paint. Check it out by running `npm init svelte@next`
+- You can now use `@sveltejs/adapter-static` to create a single-page app or SPA by specifying a fallback page ([PR](https://github.com/sveltejs/kit/pull/1181), [Docs](https://github.com/sveltejs/kit/tree/master/packages/adapter-static))
+- Disable Server-side Rendering (SSR) app-wide or on a page-by-page basis ([PR](https://github.com/sveltejs/kit/pull/713), [Docs](https://kit.svelte.dev/docs#ssr-and-javascript-ssr))
+- Error messages thrown during pre-rendering are now much more informative and readable ([PR](https://github.com/sveltejs/kit/pull/1062), [Docs](https://kit.svelte.dev/docs#layouts-error-pages))
+- Layouts can now be reset to prevent pages from inheriting the root layout. This is useful if you have a specific layout for a page or i18n variation ([PR](https://github.com/sveltejs/kit/pull/1061), [Docs](https://kit.svelte.dev/docs#layouts-resets))
+- `fetch` in SvelteKit code will now use the environment-provided implementation, whenever possible. If `fetch` is unavailable, it will be polyfilled by adapters ([PR](https://github.com/sveltejs/kit/pull/1066), [Docs](https://kit.svelte.dev/docs#loading-input-fetch))
+
+## New in Svelte & Language Tools
+- `svelte-preprocess` now supports the "extends" field of the tsconfig.json (4.7.2)
+- HTML `style` attributes now have hover & auto-complete. Foreign namespaces and ESM configs are now supported in the Svelte language server & extensions
+- The Svelte language tools can now infer slot/event types from their props if a generic relationship between them was defined
+
+---
+
+## Community Showcase
+
+**Apps & Sites**
+
+- [gitpod.io](https://github.com/gitpod-io/website) recently rewrote its site with SvelteKit
+- [highlight eel](https://highlighteel.com/) is a web-based editor to mark your favorite parts of any YouTube video to clip and share with anyone
+- [The Far Star Mission](https://thefarstar.apotheus.net/) is an interactive audiobook companion to the album, The Far Star by Apotheus
+- [JavaScript quiz](https://github.com/nclskfm/javascript-quiz) is a small quiz application that saves your answers locally
+- [ExtensionPay](https://extensionpay.com/) lets developers accept secure payments in browser extensions with no backend server code.
+- [mk48.io](https://mk48.io/) is a naval warship game made with SvelteKit
+- [Frog Safety](https://frog-safety.vercel.app/) is a guide for African Dwarf Frogs and the API freshwater master kit
+- [Stardew Valley Character Preview](https://github.com/overscore-media/stardew-valley-character-preview) loads your character's attributes from your Stardew Valley savefile and lets you play around with different outfits, colours, and accessories.
+
+
+**Demos, Libraries, Tools & Components**
+
+- [svelte-parallax](https://github.com/kindoflew/svelte-parallax) is a spring-based parallax component for Svelte
+- [@svelte-plugins/viewable](https://github.com/svelte-plugins/viewable) is a simple rule-based approach to tracking element viewability.
+- [Sveltekit-JUI](https://github.com/Wolfr/sveltekit-jui) is a kit of UI components to be used in conjunction with Svelte and Svelte Kit.
+- [EZGesture](https://github.com/mhmd-22/ezgesture#integrating-with-other-frameworks) makes it easy to add gestures functionality with simple native DOM events
+
+**Want to contribute your own component?** Submit a [Component](https://sveltesociety.dev/components) to the Svelte Society site by making [a PR to this file](https://github.com/svelte-society/sveltesociety.dev/blob/master/src/pages/components/components.json).
+
+
+**Starters**
+- [How to use Vercel Analytics with SvelteKit](https://ivoberger.com/posts/using-vercel-analytics-with-svelte-kit) teaches how to track Web Vitals across your users' devices
+- [Asp.NETCore + Svelte + Vite](https://github.com/Kiho/aspcore-spa-cli/tree/master/samples/SviteSample) connects the three frameworks with SpaCliMiddleware (VS2019)
+- [Add CoffeeScript to Svelte](https://github.com/Leftium/coffeescript-adder) is an experimental command to run to add CoffeeScript to your SvelteKit project or Vite-powered Svelte app
+- [Adds Supabase to Svelte](https://github.com/joshnuss/svelte-supabase) is an experimental command to run to add Supabase to your SvelteKit project
+- [svelte-babylon](https://github.com/SectorXUSA/svelte-babylon) lets you use BabylonJS like A-Frame through reactive Svelte Components
+
+**Looking for a starter or integration?** Check out [svelte-adders](https://github.com/svelte-add/svelte-adders) and a number of other integration examples at [sveltejs/integrations](https://github.com/sveltejs/integrations)
+
+
+**Learning Resources**
+- [Amazing macOS Dock animation in Svelte](https://dev.to/puruvj/amazing-macos-dock-animation-in-svelte-5hfb) demonstrates how nice Svelte and popmotion look together
+- [Solving the Tower of Hanoi with recursive Svelte templates](https://geoffrich.net/posts/svelte-tower-of-hanoi/) incorporates the `` element into a common computer science problem
+- [DIY SvelteKit CDK adapter](https://dev.to/juranki/diy-sveltekit-cdk-adapter-3enp) puts together SvelteKit and AWS CDK
+- Fireship's [Svelte in 100 Seconds](https://www.youtube.com/watch?v=rv3Yq-B8qp4) is a quick and easy introduction to Svelte's core concepts
+- [Tech Downtime](https://www.youtube.com/watch?v=tsePBA2JC7o&list=PLualcIC6WNK1LHIYx2Tg9AQfTQDv4zNPu) has been diving into SvelteKit in this playlist - from getting up and running to debugging.
+- lihautan's latest video updates in the [Svelte 101](https://www.youtube.com/watch?v=rwYgOU0WmVk&list=PLoKaNN3BjQX3mxDEVG3oGJx2ByXnue_gR&index=59) and [Svelte Store](https://www.youtube.com/watch?v=p4GmT0trCPE&list=PLoKaNN3BjQX3fG-XOSwsPHtnV8FUY6lgK&index=19) playlists cover slots, stores and context - and when to use which
+- [DavidParkerW](https://www.youtube.com/c/DavidParkerW/playlists) has been exploring Svelte, Sapper and SvelteKit in some real-world scenarios, like [displaying a blog post list from an API](https://www.youtube.com/watch?v=kAPVFgFnxaM&list=PLPqKsyEGhUna6cvm6d4vZNI6gbt_0S4Xx&index=15)
+
+
+
+## See you next month!
+
+Got something to add? Join us on [Svelte Society](https://sveltesociety.dev/), [Reddit](https://www.reddit.com/r/sveltejs/) and [Discord](https://discord.com/invite/yy75DKs)!
From 341160f782a2e4bd8d8fda9f614de43a1d300728 Mon Sep 17 00:00:00 2001
From: Alex Iglesias
Date: Mon, 3 May 2021 17:27:11 +0200
Subject: [PATCH 029/298] [Tutorial] Update Chapter 19 to reference SvelteKit
(#6284)
---
.../content/tutorial/19-next-steps/01-congratulations/text.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/site/content/tutorial/19-next-steps/01-congratulations/text.md b/site/content/tutorial/19-next-steps/01-congratulations/text.md
index c4436113bc..558cf6bda6 100644
--- a/site/content/tutorial/19-next-steps/01-congratulations/text.md
+++ b/site/content/tutorial/19-next-steps/01-congratulations/text.md
@@ -6,6 +6,6 @@ You've now finished the Svelte tutorial and are ready to start building apps. Yo
To get set up in your local development environment, check out [the quickstart guide](blog/the-easiest-way-to-get-started).
-If you're looking for a more expansive framework that includes routing, server-side rendering and everything else, take a look at [Sapper](https://sapper.svelte.dev).
+If you're looking for a more expansive framework that includes routing, server-side rendering and everything else, take a look at [SvelteKit](https://kit.svelte.dev).
-Most importantly: since you're now a member of the Svelte community, you should [join our friendly Discord chatroom](chat). That's where you'll find fellow Svelte users, and it's where we plan the future of the framework.
\ No newline at end of file
+Most importantly: since you're now a member of the Svelte community, you should [join our friendly Discord chatroom](chat). That's where you'll find fellow Svelte users, and it's where we plan the future of the framework.
From 6d16e9260642b1fcc70fa4a24be9fd49985112d1 Mon Sep 17 00:00:00 2001
From: Conduitry
Date: Mon, 3 May 2021 16:37:19 -0400
Subject: [PATCH 030/298] Revert hydration optimisation (#6290)
Co-authored-by: haveyaseen
---
CHANGELOG.md | 4 ++
src/runtime/internal/Component.ts | 4 +-
src/runtime/internal/dom.ts | 48 +++----------------
.../element-nested-sibling/_after.html | 4 ++
.../element-nested-sibling/_before.html | 4 ++
.../samples/element-nested-sibling/_config.js | 19 ++++++++
.../element-nested-sibling/main.svelte | 6 +++
.../samples/expression-sibling/_after.html | 1 +
.../samples/expression-sibling/_before.html | 1 +
.../samples/expression-sibling/_config.js | 19 ++++++++
.../samples/expression-sibling/main.svelte | 1 +
11 files changed, 66 insertions(+), 45 deletions(-)
create mode 100644 test/hydration/samples/element-nested-sibling/_after.html
create mode 100644 test/hydration/samples/element-nested-sibling/_before.html
create mode 100644 test/hydration/samples/element-nested-sibling/_config.js
create mode 100644 test/hydration/samples/element-nested-sibling/main.svelte
create mode 100644 test/hydration/samples/expression-sibling/_after.html
create mode 100644 test/hydration/samples/expression-sibling/_before.html
create mode 100644 test/hydration/samples/expression-sibling/_config.js
create mode 100644 test/hydration/samples/expression-sibling/main.svelte
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 12502063cb..4120fe787e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Svelte changelog
+## Unreleased
+
+* Revert hydration optimisation for the time being
+
## 3.38.1
* Fix hydration regression ([#6274](https://github.com/sveltejs/svelte/issues/6274))
diff --git a/src/runtime/internal/Component.ts b/src/runtime/internal/Component.ts
index a191e5d83b..32de46506a 100644
--- a/src/runtime/internal/Component.ts
+++ b/src/runtime/internal/Component.ts
@@ -1,7 +1,7 @@
import { add_render_callback, flush, schedule_update, dirty_components } from './scheduler';
import { current_component, set_current_component } from './lifecycle';
import { blank_object, is_empty, is_function, run, run_all, noop } from './utils';
-import { children, detach, start_hydrating, end_hydrating } from './dom';
+import { children, detach } from './dom';
import { transition_in } from './transitions';
interface Fragment {
@@ -150,7 +150,6 @@ export function init(component, options, instance, create_fragment, not_equal, p
if (options.target) {
if (options.hydrate) {
- start_hydrating();
const nodes = children(options.target);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment!.l(nodes);
@@ -162,7 +161,6 @@ export function init(component, options, instance, create_fragment, not_equal, p
if (options.intro) transition_in(component.$$.fragment);
mount_component(component, options.target, options.anchor, options.customElement);
- end_hydrating();
flush();
}
diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts
index b0cc2c5841..40471c2980 100644
--- a/src/runtime/internal/dom.ts
+++ b/src/runtime/internal/dom.ts
@@ -1,47 +1,15 @@
import { has_prop } from './utils';
-// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM
-// at the end of hydration without touching the remaining nodes.
-let is_hydrating = false;
-const nodes_to_detach = new Set();
-
-export function start_hydrating() {
- is_hydrating = true;
-}
-export function end_hydrating() {
- is_hydrating = false;
-
- for (const node of nodes_to_detach) {
- node.parentNode.removeChild(node);
- }
-
- nodes_to_detach.clear();
-}
-
export function append(target: Node, node: Node) {
- if (is_hydrating) {
- nodes_to_detach.delete(node);
- }
- if (node.parentNode !== target) {
- target.appendChild(node);
- }
+ target.appendChild(node);
}
export function insert(target: Node, node: Node, anchor?: Node) {
- if (is_hydrating) {
- nodes_to_detach.delete(node);
- }
- if (node.parentNode !== target || (anchor && node.nextSibling !== anchor)) {
- target.insertBefore(node, anchor || null);
- }
+ target.insertBefore(node, anchor || null);
}
export function detach(node: Node) {
- if (is_hydrating) {
- nodes_to_detach.add(node);
- } else if (node.parentNode) {
- node.parentNode.removeChild(node);
- }
+ node.parentNode.removeChild(node);
}
export function destroy_each(iterations, detaching) {
@@ -186,9 +154,8 @@ export function children(element) {
}
export function claim_element(nodes, name, attributes, svg) {
- while (nodes.length > 0) {
- const node = nodes.shift();
-
+ for (let i = 0; i < nodes.length; i += 1) {
+ const node = nodes[i];
if (node.nodeName === name) {
let j = 0;
const remove = [];
@@ -201,10 +168,7 @@ export function claim_element(nodes, name, attributes, svg) {
for (let k = 0; k < remove.length; k++) {
node.removeAttribute(remove[k]);
}
-
- return node;
- } else {
- detach(node);
+ return nodes.splice(i, 1)[0];
}
}
diff --git a/test/hydration/samples/element-nested-sibling/_after.html b/test/hydration/samples/element-nested-sibling/_after.html
new file mode 100644
index 0000000000..d011cf6e38
--- /dev/null
+++ b/test/hydration/samples/element-nested-sibling/_after.html
@@ -0,0 +1,4 @@
+
+ 1
+ 2
+
diff --git a/test/hydration/samples/element-nested-sibling/_before.html b/test/hydration/samples/element-nested-sibling/_before.html
new file mode 100644
index 0000000000..d011cf6e38
--- /dev/null
+++ b/test/hydration/samples/element-nested-sibling/_before.html
@@ -0,0 +1,4 @@
+