Skip to content
This repository was archived by the owner on Oct 13, 2022. It is now read-only.

Commit 0952b40

Browse files
committed
update to Svelte v2
1 parent 2be3c09 commit 0952b40

File tree

10 files changed

+31
-35
lines changed

10 files changed

+31
-35
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
"marked": "^0.3.7",
2525
"node-fetch": "^2.0.0",
2626
"npm-run-all": "^4.1.2",
27-
"sapper": "^0.10.2",
27+
"sapper": "^0.11.1",
2828
"serve": "^6.4.10",
2929
"serve-static": "^1.13.1",
30-
"svelte": "^1.57.1",
30+
"svelte": "^2.4.4",
3131
"svelte-loader": "^2.3.1",
3232
"webpack": "^4.1.0"
3333
},
@@ -36,6 +36,6 @@
3636
},
3737
"devDependencies": {
3838
"git-branch-is": "^0.1.0",
39-
"now": "^10.2.2"
39+
"now": "^11.1.7"
4040
}
4141
}

routes/4xx.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<:Head>
1+
<svelte:head>
22
<title>Sapper • Military-grade progressive web apps, powered by Svelte</title>
3-
</:Head>
3+
</svelte:head>
44

55
<Layout>
6-
<h1>{{error.message}}</h1>
7-
<p>Error code {{status}}</p>
6+
<h1>{error.message}</h1>
7+
<p>Error code {status}</p>
88
</Layout>
99

1010
<style>

routes/5xx.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<:Head>
1+
<svelte:head>
22
<title>Sapper • Military-grade progressive web apps, powered by Svelte</title>
3-
</:Head>
3+
</svelte:head>
44

55
<Layout>
66
<h1>Internal server error</h1>
7-
<p>{{error.message}}</p>
7+
<p>{error.message}</p>
88
</Layout>
99

1010
<style>

routes/_components/GuideContents.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<ul class='guide-toc'>
2-
{{#each $guide_contents as section}}
2+
{#each $guide_contents as section}
33
<li>
4-
<a class='section {{section.slug === $activeGuideSection ? "active": ""}}' href='guide#{{section.slug}}'>{{section.metadata.title}}</a>
5-
{{#each section.subsections as subsection}}
6-
<a class='subsection {{subsection.slug === $activeGuideSection ? "active": ""}}' href='guide#{{subsection.slug}}'>{{subsection.title}}</a>
7-
{{/each}}
4+
<a class='section {section.slug === $activeGuideSection ? "active": ""}' href='guide#{section.slug}'>{section.metadata.title}</a>
5+
{#each section.subsections as subsection}
6+
<a class='subsection {subsection.slug === $activeGuideSection ? "active": ""}' href='guide#{subsection.slug}'>{subsection.title}</a>
7+
{/each}
88
</li>
9-
{{/each}}
9+
{/each}
1010
</ul>
1111

1212
<style>

routes/_components/Layout.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Nav :page/>
1+
<Nav {page}/>
22

33
<div>
44
<slot></slot>

routes/_components/Nav.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<div class='{{open ? "open": "closed"}} mousecatcher' on:click='set({ open: false })'></div>
1+
<div class='{open ? "open": "closed"} mousecatcher' on:click='set({ open: false })'></div>
22

33
<div class='container'>
4-
<span class="menu-link" on:click='toggleOpen()'>{{open ? 'Close' : 'Menu'}}</span>
4+
<span class="menu-link" on:click='toggleOpen()'>{open ? 'Close' : 'Menu'}</span>
55
<a href='.' class='logo'>Sapper</a>
66
</div>
77

8-
<nav ref:nav class='{{open ? "open": "closed"}}' on:click='set({ open: false })'>
8+
<nav ref:nav class='{open ? "open": "closed"}' on:click='set({ open: false })'>
99
<ul class='primary'>
10-
<li><a rel='prefetch' class='{{page === "guide" ? "active": ""}}' href='guide'>Guide</a></li>
10+
<li><a rel='prefetch' class='{page === "guide" ? "active": ""}' href='guide'>Guide</a></li>
1111
<li><a href='https://gitter.im/sveltejs/svelte'>Chat</a></li>
1212
<li><a href='https://svelte.technology'>Svelte</a></li>
1313
<li><a href='https://github.com/sveltejs/sapper'>GitHub</a></li>

routes/guide.html

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
<:Head>
1+
<svelte:head>
22
<title>Learn Sapper</title>
3-
</:Head>
3+
</svelte:head>
44

55
<Layout page='guide'>
66
<div ref:container class='content'>
7-
{{#each sections as section}}
8-
<section id='{{section.slug}}'>
7+
{#each sections as section}
8+
<section id='{section.slug}'>
99
<h2>
10-
{{section.metadata.title}}
11-
<small><a href='https://github.com/sveltejs/sapper.svelte.technology/edit/master/content/guide/{{section.file}}'>edit this section</a></small>
10+
{section.metadata.title}
11+
<small><a href='https://github.com/sveltejs/sapper.svelte.technology/edit/master/content/guide/{section.file}'>edit this section</a></small>
1212
</h2>
1313

14-
{{{section.html}}}
14+
{@html section.html}
1515
</section>
16-
{{/each}}
16+
{/each}
1717
</div>
1818

1919
<div class='sidebar'>

routes/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<:Head>
1+
<svelte:head>
22
<title>Sapper • Military-grade progressive web apps, powered by Svelte</title>
3-
</:Head>
3+
</svelte:head>
44

55
<Layout>
66
<div class='hero'>

webpack/client.config.js

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ module.exports = {
1919
loader: 'svelte-loader',
2020
options: {
2121
hydratable: true,
22-
cascade: false,
23-
store: true,
2422
hotReload: true
2523
}
2624
}

webpack/server.config.js

-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ module.exports = {
2020
loader: 'svelte-loader',
2121
options: {
2222
css: false,
23-
cascade: false,
24-
store: true,
2523
generate: 'ssr'
2624
}
2725
}

0 commit comments

Comments
 (0)