diff --git a/CHANGELOG.md b/CHANGELOG.md
index a3fb361e5f..b93a6a7fd1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@
* Fix function calls in `` props that use contextual values ([#5565](https://github.com/sveltejs/svelte/issues/5565))
* Fix handling aborted transitions in `{:else}` blocks ([#5573](https://github.com/sveltejs/svelte/issues/5573))
* Add `Element` and `Node` to known globals ([#5586](https://github.com/sveltejs/svelte/issues/5586))
+* Fix internal `import`s so that we're exposing a valid ES module ([#5617](https://github.com/sveltejs/svelte/issues/5617))
## 3.29.4
diff --git a/README.md b/README.md
index 9fbada7aa3..d1befaf1ce 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
-
+
diff --git a/package-lock.json b/package-lock.json
index e04cc22175..5d4aa46575 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -144,8 +144,8 @@
}
},
"@sveltejs/eslint-config": {
- "version": "github:sveltejs/eslint-config#54081d752d199dba97db9f578665c87f18469da3",
- "from": "github:sveltejs/eslint-config#v5.5.0",
+ "version": "github:sveltejs/eslint-config#cca8177349dd5a02b19a5865afc4a7066921409a",
+ "from": "github:sveltejs/eslint-config#v5.6.0",
"dev": true
},
"@tootallnate/once": {
diff --git a/package.json b/package.json
index a0f0b9e455..75e5c9e21f 100644
--- a/package.json
+++ b/package.json
@@ -63,7 +63,7 @@
"@rollup/plugin-sucrase": "^3.0.0",
"@rollup/plugin-typescript": "^2.0.1",
"@rollup/plugin-virtual": "^2.0.0",
- "@sveltejs/eslint-config": "github:sveltejs/eslint-config#v5.5.0",
+ "@sveltejs/eslint-config": "github:sveltejs/eslint-config#v5.6.0",
"@types/mocha": "^7.0.0",
"@types/node": "^8.10.53",
"@typescript-eslint/eslint-plugin": "^3.0.2",
diff --git a/rollup.config.js b/rollup.config.js
index 82a2b9ae34..e9ee666337 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -30,12 +30,12 @@ export default [
{
file: `index.mjs`,
format: 'esm',
- paths: id => id.startsWith('svelte/') && `${id.replace('svelte', '.')}`
+ paths: id => id.startsWith('svelte/') && `${id.replace('svelte', '.')}/index.mjs`
},
{
file: `index.js`,
format: 'cjs',
- paths: id => id.startsWith('svelte/') && `${id.replace('svelte', '.')}`
+ paths: id => id.startsWith('svelte/') && `${id.replace('svelte', '.')}/index.js`
}
],
external,
@@ -50,12 +50,12 @@ export default [
{
file: `${dir}/index.mjs`,
format: 'esm',
- paths: id => id.startsWith('svelte/') && `${id.replace('svelte', '..')}`
+ paths: id => id.startsWith('svelte/') && `${id.replace('svelte', '..')}/index.mjs`
},
{
file: `${dir}/index.js`,
format: 'cjs',
- paths: id => id.startsWith('svelte/') && `${id.replace('svelte', '..')}`
+ paths: id => id.startsWith('svelte/') && `${id.replace('svelte', '..')}/index.js`
}
],
external,
diff --git a/site/content/blog/2020-11-01-whats-new-in-svelte-november-2020.md b/site/content/blog/2020-11-01-whats-new-in-svelte-november-2020.md
new file mode 100644
index 0000000000..433bafaa29
--- /dev/null
+++ b/site/content/blog/2020-11-01-whats-new-in-svelte-november-2020.md
@@ -0,0 +1,46 @@
+---
+title: What's new in Svelte: November 2020
+description: Slot forwarding fixes, SvelteKit for faster local development, and more from Svelte Summit
+author: Daniel Sandoval
+authorURL: https://desandoval.net
+---
+
+Welcome back to the "What's new in Svelte" series! This month, we're covering new features & bug fixes, last month's Svelte Summit and some stand-out sites and libraries...
+
+## New features & impactful bug fixes
+
+1. Destructuring Promises now works as expected by using the `{#await}` syntax
+ (**3.29.3**, [Example](https://svelte.dev/repl/3fd4e2cecfa14d629961478f1dac2445?version=3.29.3))
+2. Slot forwarding (released in 3.29.0) should no longer hang during compilation (**3.29.3**, [Example](https://svelte.dev/repl/29959e70103f4868a6525c0734934936?version=3.29.3))
+3. Better typings for the `get` function in `svelte/store` and on lifecycle hooks (**3.29.1**)
+
+**What's going on in Sapper?**
+
+Sapper got some new types in its `preload` function, which will make typing easier if you are using TypeScript. See the [Sapper docs](https://sapper.svelte.dev/docs#Typing_the_function) on how to use them. There also were fixes to `preload` links in exported sites. Route layouts got a few fixes too - including ensuring CSS is applied to nested route layouts. You can also better organize your files now that extensions with multiple dots are supported. (**0.28.10**)
+
+
+For all the features and bugfixes see the CHANGELOGs for [Svelte](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md) and [Sapper](https://github.com/sveltejs/sapper/blob/master/CHANGELOG.md).
+
+
+## [Svelte Summit](https://sveltesummit.com/) was Svelte-tacular!
+- Rich Harris demoed the possible future of Svelte development in a talk titled "Futuristic Web Development". The not-yet-public project is called SvelteKit (name may change) and will bring a first-class developer experience and more flexibility for build outputs. If you want to get the full sneak-peek, [check out the video](https://www.youtube.com/watch?v=qSfdtmcZ4d0).
+- 17 speakers made the best of the conference's virtual format... From floating heads to seamless demos, Svelte developers from every skill level will find something of interest in this year's [YouTube playlist](https://www.youtube.com/playlist?list=PL8bMgX1kyZThM1sbYCoWdTcpiYysJsSeu)
+
+---
+
+## Community Showcase
+- [Svelte Lab](https://sveltelab.app/) showcases a variety of components, visualizations and interactions that can be achieved in Svelte. You can click into any component to see its source or edit it, using the site's built-in REPL
+- [svelte-electron-boilerplate](https://github.com/hjalmar/svelte-electron-boilerplate) is a fast way to get up and running with a Svelte app built in the desktop javascript framework, Electron
+- [React Hooks in Svelte](https://github.com/joshnuss/react-hooks-in-svelte) showcases examples of common React Hooks ported to Svelte.
+- [gurlic](https://gurlic.com/) is a social network and internet experiment that is super snappy thanks to Svelte
+- [Interference 2020](https://interference2020.org/) visualizes reported foreign interference in the 2020 U.S. elections. You can learn more about how it was built in [YYY's talk at Svelte Summit]()
+- [jitsi-svelte](https://github.com/relm-us/jitsi-svelte) lets you easily create your own custom Jitsi client by providing out-of-the-box components built with Svelte
+- [Ellx](https://ellx.io/) is part spreadsheet, part notebook and part IDE. It's super smooth thanks to Svelte 😎
+- [This New Zealand news site](https://www.nzherald.co.nz/nz/election-2020-latest-results-party-vote-electorate-vote-and-full-data/5CFVO4ENKNQDE3SICRRNPU5GZM/) breaks down the results of the 2020 Parliamentary elections using Svelte
+- [Budibase](https://github.com/Budibase/budibase) is a no-code app builder, powered by Svelte
+- [Svelt-yjs](https://github.com/relm-us/svelt-yjs) combines the collaborative, local-first technology of Yjs with the power of Svelte to enable multiple users across the internet to stay in sync.
+- [tabler-icons-svelte](https://github.com/benflap/tabler-icons-svelte) is a Svelte wrapper for over 850 free MIT-licensed high-quality SVG icons for you to use in your web projects.
+
+## See you next month!
+
+Got an idea for something to add to the Showcase? Want to get involved more with Svelte? We're always looking for maintainers, contributors and fanatics... Check out the [Svelte Society](https://sveltesociety.dev/), [Reddit](https://www.reddit.com/r/sveltejs/) and [Discord](https://discord.com/invite/yy75DKs) to get involved!
diff --git a/site/content/blog/2020-11-05-whats-the-deal-with-sveltekit.md b/site/content/blog/2020-11-05-whats-the-deal-with-sveltekit.md
new file mode 100644
index 0000000000..f780cd0226
--- /dev/null
+++ b/site/content/blog/2020-11-05-whats-the-deal-with-sveltekit.md
@@ -0,0 +1,103 @@
+---
+title: What's the deal with SvelteKit?
+description: We're rethinking how to build Svelte apps. Here's what you need to know
+author: Rich Harris
+authorURL: https://twitter.com/rich_harris
+---
+
+
+
+If you attended [Svelte Summit](https://sveltesummit.com/) last month you may have seen my talk, Futuristic Web Development, in which I finally tackled one of the most frequently asked questions about Svelte: when will Sapper reach version 1.0?
+
+The answer: never.
+
+This was slightly tongue-in-cheek — as the talk explains, it's really more of a rewrite of Sapper coupled with a rebrand — but it raised a lot of new questions from the community, and it's time we offered a bit more clarity on what you can expect from Sapper's successor, SvelteKit.
+
+
+
+
+## What's Sapper?
+
+[Sapper](https://sapper.svelte.dev) is an *app framework* (or 'metaframework') built on top of Svelte (which is a *component* framework). Its job is to make it easy to build Svelte apps with all the modern best practices like server-side rendering (SSR) and code-splitting, and to provide a project structure that makes development productive and fun. It uses *filesystem-based routing* (as popularised by [Next](https://nextjs.org/) and adopted by many other frameworks, albeit with some enhancements) — your project's file structure mirrors the structure of the app itself.
+
+While the Svelte homepage and documentation encourages you to [degit](https://github.com/Rich-Harris/degit) the [sveltejs/template](https://github.com/sveltejs/template) repo to start building an app, Sapper has long been our recommended way to build apps; this very blog post is (at the time of writing!) rendered with Sapper.
+
+
+## Why are we migrating to something new?
+
+Firstly, the distinction between [sveltejs/template](https://github.com/sveltejs/template) and [sveltejs/sapper-template](https://github.com/sveltejs/sapper-template) is confusing, particularly to newcomers to Svelte. Having a single recommended way to start building apps with Svelte will bring enormous benefits: we simplify onboarding, reduce the maintenance and support burden, and can potentially begin to explore the new possibilities that are unlocked by having a predictable project structure. (This last part is deliberately vague because it will take time to fully understand what those possibilities are.)
+
+Aside from all that, we've been tempted by the thought of rewriting Sapper for a while. This is partly because the codebase has become a little unkempt over the years ([Sapper started in 2017](/blog/sapper-towards-the-ideal-web-app-framework)), but mostly because the web has changed a lot recently, and it's time to rethink some of our foundational assumptions.
+
+
+## How is this new thing different?
+
+The first of those foundational assumptions is that you need to use a module bundler like [webpack](https://webpack.js.org/) or [Rollup](http://rollupjs.org/) to build apps. These tools trace the dependency graph of your application, analysing and transforming code along the way (turning Svelte components to JS modules, for example), in order to create bundles of code that can run anywhere. As the original creator of Rollup, I can attest that it is a surprisingly complex problem with fiendish edge cases.
+
+You certainly needed a bundler several years ago, because browsers didn't natively support the `import` keyword, but it's much less true today. Right now, we're seeing the rise of the *unbundled development* workflow, which is radically simpler: instead of eagerly bundling your app, a dev server can serve modules (converted to JavaScript, if necessary) *on-demand*, meaning startup is essentially instantaneous however large your app becomes.
+
+[Snowpack](https://www.snowpack.dev/) is at the vanguard of this movement, and it's what powers SvelteKit. It's astonishingly fast, and has a beautiful development experience (hot module reloading, error overlays and so on), and we've been working closely with the Snowpack team on features like SSR. The hot module reloading is particularly revelatory if you're used to using Sapper with Rollup (which has never had first-class HMR support owing to its architecture, which prioritises the most efficient output).
+
+That's not to say we're abandoning bundlers altogether. It's still essential to optimise your app for production, and SvelteKit uses Rollup to make your apps as fast and lean as they possibly can be (which includes things like extracting styles into static `.css` files).
+
+The other foundational assumption is that a server-rendered app needs, well, a server. Sapper effectively has two modes — `sapper build`, which creates a standalone app that has to run on a Node server, and `sapper export` which bakes your app out as a collection of static files suitable for hosting on services like GitHub Pages.
+
+Static files can go pretty much anywhere, but running a Node server (and monitoring/scaling it etc) is less straightforward. Nowadays we're witnessing a shift towards *serverless platforms*, in which you as the app author don't need to think about the server your code is running on, with all the attendant complexity. You can get Sapper apps running on serverless platforms, thanks to things like [vercel-sapper](https://github.com/thgh/vercel-sapper), but it's certainly not what you'd call idiomatic.
+
+
+
+SvelteKit fully embraces the serverless paradigm, and will launch with support for all the major serverless providers, with an 'adapter' API for targeting any platforms that we don't officially cater to. In addition, we'll be able to do partial pre-rendering, which means that static pages can be generated at build time but dynamic ones get rendered on-demand.
+
+
+## When can I start using it?
+
+If you're feeling brave, you can start right now:
+
+```bash
+npm init svelte@next
+```
+
+This will scaffold a new project and install the `@sveltejs/kit` CLI, which provides the tools for developing and building an app.
+
+We don't recommend it though! There are no docs, and we won't be able to offer any form of support. It's also likely to break often.
+
+The work is being done in a private monorepo while we're still in exploration mode. Our plan is to get a public beta ready and announce it here once we've closed a few issues — the repo itself will remain private at that time, but we'll create a place to collect feedback from the YOLO crowd. After that, we'll work towards a 1.0 release which will involve opening the repo up.
+
+I'm not going to make any firm promises about timings, because I don't like to break promises. But I *think* we're talking about weeks rather than months.
+
+
+## What if I don't want to use SvelteKit?
+
+You won't have to — it will always be possible to use Svelte as a standalone package or via a bundler integration like [rollup-plugin-svelte](https://github.com/sveltejs/rollup-plugin-svelte). We think it's essential that you can bend Svelte to fit your workflow, however esoteric, and use third-party app frameworks like [Elder.js](https://github.com/Elderjs/elderjs), [Routify](https://routify.dev/), [Plenti](https://plenti.co/), [Crown](https://crownframework.com/), [JungleJS](https://www.junglejs.org/) and others.
+
+
+## TypeScript?
+
+Don't worry, we won't launch without full TypeScript support.
+
+
+## How can I migrate my existing Sapper apps?
+
+For the most part, it should be relatively straightforward to migrate a Sapper codebase.
+
+There are some unavoidable changes (being able to run on serverless platforms means we need to replace custom `server.js` files and `(req, res) => {...}` functions with more portable equivalents), and we're taking the opportunity to fix a few design flaws, but on the whole a SvelteKit app will feel very familiar to Sapper users.
+
+Detailed migration guides will accompany the 1.0 launch.
+
+
+## How can I contribute?
+
+Keep your eyes peeled for announcements about when we'll launch the public beta and open up the repo. (Also, blog post TODO but I would be remiss if I didn't mention that we now have an [OpenCollective](https://opencollective.com/svelte) where you can contribute financially to the project if it's been valuable to you. Many, many thanks to those of you who already have.)
+
+
+## Where can I learn more?
+
+Follow [@sveltejs](https://twitter.com/sveltejs) and [@SvelteSociety](https://twitter.com/SvelteSociety) on Twitter, and visit [svelte.dev/chat](https://svelte.dev/chat). You should also subscribe to [Svelte Radio](https://www.svelteradio.com/), where Kevin and his co-hosts will grill me about this project on an upcoming episode (and between now and next week when we record it, [reply to this Twitter thread](https://twitter.com/Rich_Harris/status/1323376048571121665) with your additional questions).
\ No newline at end of file
diff --git a/site/content/docs/03-run-time.md b/site/content/docs/03-run-time.md
index 3b6df3071d..846e09d774 100644
--- a/site/content/docs/03-run-time.md
+++ b/site/content/docs/03-run-time.md
@@ -777,7 +777,7 @@ The `flip` function calculates the start and end position of an element and anim
* `delay` (`number`, default 0) — milliseconds before starting
* `duration` (`number` | `function`, default `d => Math.sqrt(d) * 120`) — see below
-* `easing` (`function`, default [`cubicOut`](docs#cubicOut)) — an [easing function](docs#svelte_easing)
+* `easing` (`function`, default `cubicOut`) — an [easing function](docs#svelte_easing)
`duration` can be be provided as either:
diff --git a/site/src/routes/blog/[slug].svelte b/site/src/routes/blog/[slug].svelte
index b97b5ef136..236d649d56 100644
--- a/site/src/routes/blog/[slug].svelte
+++ b/site/src/routes/blog/[slug].svelte
@@ -172,17 +172,4 @@
margin: 2em auto;
}
}
-
- /* @media (min-width: 1460px) {
- .post :global(iframe) {
- width: 1360px;
- margin: 2em -280px;
- }
- }
-
- @media (min-height: 800px) {
- .post :global(iframe) {
- height: 640px;
- }
- } */
diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts
index d2542c9830..6e7e41f385 100644
--- a/src/compiler/compile/Component.ts
+++ b/src/compiler/compile/Component.ts
@@ -267,17 +267,13 @@ export default class Component {
this.helpers.set(name, alias);
node.name = alias.name;
}
- }
-
- else if (node.name[0] !== '#' && !is_valid(node.name)) {
+ } else if (node.name[0] !== '#' && !is_valid(node.name)) {
// this hack allows x`foo.${bar}` where bar could be invalid
const literal: Literal = { type: 'Literal', value: node.name };
if (parent.type === 'Property' && key === 'key') {
parent.key = literal;
- }
-
- else if (parent.type === 'MemberExpression' && key === 'property') {
+ } else if (parent.type === 'MemberExpression' && key === 'property') {
parent.property = literal;
parent.computed = true;
}
diff --git a/src/compiler/compile/css/Selector.ts b/src/compiler/compile/css/Selector.ts
index e20aa43fb6..e910f4333c 100644
--- a/src/compiler/compile/css/Selector.ts
+++ b/src/compiler/compile/css/Selector.ts
@@ -248,25 +248,17 @@ function block_might_apply_to_node(block: Block, node: Element): BlockAppliesToN
if (selector.type === 'ClassSelector') {
if (!attribute_matches(node, 'class', name, '~=', false) && !node.classes.some(c => c.name === name)) return BlockAppliesToNode.NotPossible;
- }
-
- else if (selector.type === 'IdSelector') {
+ } else if (selector.type === 'IdSelector') {
if (!attribute_matches(node, 'id', name, '=', false)) return BlockAppliesToNode.NotPossible;
- }
-
- else if (selector.type === 'AttributeSelector') {
+ } else if (selector.type === 'AttributeSelector') {
if (
!(whitelist_attribute_selector.has(node.name.toLowerCase()) && whitelist_attribute_selector.get(node.name.toLowerCase()).has(selector.name.name.toLowerCase())) &&
!attribute_matches(node, selector.name.name, selector.value && unquote(selector.value), selector.matcher, selector.flags)) {
return BlockAppliesToNode.NotPossible;
}
- }
-
- else if (selector.type === 'TypeSelector') {
+ } else if (selector.type === 'TypeSelector') {
if (node.name.toLowerCase() !== name.toLowerCase() && name !== '*') return BlockAppliesToNode.NotPossible;
- }
-
- else {
+ } else {
return BlockAppliesToNode.UnknownSelectorType;
}
}
diff --git a/src/compiler/compile/css/Stylesheet.ts b/src/compiler/compile/css/Stylesheet.ts
index 5547c6eb0c..b0dab12b19 100644
--- a/src/compiler/compile/css/Stylesheet.ts
+++ b/src/compiler/compile/css/Stylesheet.ts
@@ -167,9 +167,7 @@ class Atrule {
this.children.forEach(child => {
child.apply(node);
});
- }
-
- else if (is_keyframes_node(this.node)) {
+ } else if (is_keyframes_node(this.node)) {
this.children.forEach((rule: Rule) => {
rule.selectors.forEach(selector => {
selector.used = true;
diff --git a/src/compiler/compile/css/gather_possible_values.ts b/src/compiler/compile/css/gather_possible_values.ts
index 4390e23c8d..e5560e4f87 100644
--- a/src/compiler/compile/css/gather_possible_values.ts
+++ b/src/compiler/compile/css/gather_possible_values.ts
@@ -5,14 +5,10 @@ export const UNKNOWN = {};
export function gather_possible_values(node: Node, set: Set) {
if (node.type === 'Literal') {
set.add(node.value);
- }
-
- else if (node.type === 'ConditionalExpression') {
+ } else if (node.type === 'ConditionalExpression') {
gather_possible_values(node.consequent, set);
gather_possible_values(node.alternate, set);
- }
-
- else {
+ } else {
set.add(UNKNOWN);
}
}
diff --git a/src/compiler/compile/nodes/Animation.ts b/src/compiler/compile/nodes/Animation.ts
index 88c9175d04..3a21a52e5f 100644
--- a/src/compiler/compile/nodes/Animation.ts
+++ b/src/compiler/compile/nodes/Animation.ts
@@ -27,7 +27,7 @@ export default class Animation extends Node {
// TODO can we relax the 'immediate child' rule?
component.error(this, {
code: 'invalid-animation',
- message: 'An element that use the animate directive must be the immediate child of a keyed each block'
+ message: 'An element that uses the animate directive must be the immediate child of a keyed each block'
});
}
diff --git a/src/compiler/compile/nodes/Attribute.ts b/src/compiler/compile/nodes/Attribute.ts
index 97d2fd7b2e..3844c750a2 100644
--- a/src/compiler/compile/nodes/Attribute.ts
+++ b/src/compiler/compile/nodes/Attribute.ts
@@ -38,9 +38,7 @@ export default class Attribute extends Node {
this.chunks = null;
this.is_static = false;
- }
-
- else {
+ } else {
this.name = info.name;
this.is_true = info.value === true;
this.is_static = true;
diff --git a/src/compiler/compile/nodes/Body.ts b/src/compiler/compile/nodes/Body.ts
index 74c63b1f57..f004b90e24 100644
--- a/src/compiler/compile/nodes/Body.ts
+++ b/src/compiler/compile/nodes/Body.ts
@@ -13,9 +13,7 @@ export default class Body extends Node {
info.attributes.forEach(node => {
if (node.type === 'EventHandler') {
this.handlers.push(new EventHandler(component, this, scope, node));
- }
-
- else {
+ } else {
// TODO there shouldn't be anything else here...
}
});
diff --git a/src/compiler/compile/nodes/EachBlock.ts b/src/compiler/compile/nodes/EachBlock.ts
index 38cc976e6f..8b8e7d251a 100644
--- a/src/compiler/compile/nodes/EachBlock.ts
+++ b/src/compiler/compile/nodes/EachBlock.ts
@@ -61,7 +61,7 @@ export default class EachBlock extends AbstractBlock {
const child = this.children.find(child => !!(child as Element).animation);
component.error((child as Element).animation, {
code: 'invalid-animation',
- message: 'An element that use the animate directive must be the sole child of a keyed each block'
+ message: 'An element that uses the animate directive must be the sole child of a keyed each block'
});
}
}
diff --git a/src/compiler/compile/nodes/Window.ts b/src/compiler/compile/nodes/Window.ts
index d0ad313c6f..fef003c6e4 100644
--- a/src/compiler/compile/nodes/Window.ts
+++ b/src/compiler/compile/nodes/Window.ts
@@ -28,9 +28,7 @@ export default class Window extends Node {
info.attributes.forEach(node => {
if (node.type === 'EventHandler') {
this.handlers.push(new EventHandler(component, this, scope, node));
- }
-
- else if (node.type === 'Binding') {
+ } else if (node.type === 'Binding') {
if (node.expression.type !== 'Identifier') {
const { parts } = flatten_reference(node.expression);
@@ -64,13 +62,9 @@ export default class Window extends Node {
}
this.bindings.push(new Binding(component, this, scope, node));
- }
-
- else if (node.type === 'Action') {
+ } else if (node.type === 'Action') {
this.actions.push(new Action(component, this, scope, node));
- }
-
- else {
+ } else {
// TODO there shouldn't be anything else here...
}
});
diff --git a/src/compiler/compile/nodes/shared/Expression.ts b/src/compiler/compile/nodes/shared/Expression.ts
index ef134f4359..1fc23830bd 100644
--- a/src/compiler/compile/nodes/shared/Expression.ts
+++ b/src/compiler/compile/nodes/shared/Expression.ts
@@ -261,17 +261,13 @@ export default class Expression {
hoistable: true,
referenced: true
});
- }
-
- else if (contextual_dependencies.size === 0) {
+ } else if (contextual_dependencies.size === 0) {
// function can be hoisted inside the component init
component.partly_hoisted.push(declaration);
block.renderer.add_to_context(id.name);
this.replace(block.renderer.reference(id));
- }
-
- else {
+ } else {
// we need a combo block/init recipe
const deps = Array.from(contextual_dependencies);
const function_expression = node as FunctionExpression;
diff --git a/src/compiler/compile/render_dom/wrappers/Element/StyleAttribute.ts b/src/compiler/compile/render_dom/wrappers/Element/StyleAttribute.ts
index 06ead11a3c..27157f46e4 100644
--- a/src/compiler/compile/render_dom/wrappers/Element/StyleAttribute.ts
+++ b/src/compiler/compile/render_dom/wrappers/Element/StyleAttribute.ts
@@ -164,9 +164,7 @@ function get_style_value(chunks: Array) {
break;
}
- }
-
- else {
+ } else {
value.push(chunk);
}
}
diff --git a/src/compiler/compile/render_dom/wrappers/Element/index.ts b/src/compiler/compile/render_dom/wrappers/Element/index.ts
index c6b88357a8..d273326a20 100644
--- a/src/compiler/compile/render_dom/wrappers/Element/index.ts
+++ b/src/compiler/compile/render_dom/wrappers/Element/index.ts
@@ -745,9 +745,7 @@ export default class ElementWrapper extends Wrapper {
}
block.chunks.destroy.push(b`if (detaching && ${name}) ${name}.end();`);
- }
-
- else {
+ } else {
const intro_name = intro && block.get_unique_name(`${this.var.name}_intro`);
const outro_name = outro && block.get_unique_name(`${this.var.name}_outro`);
@@ -920,22 +918,16 @@ function to_html(wrappers: Array deltas.get(old_key)) {
diff --git a/src/runtime/internal/transitions.ts b/src/runtime/internal/transitions.ts
index 343a8c82e4..21d67a12ba 100644
--- a/src/runtime/internal/transitions.ts
+++ b/src/runtime/internal/transitions.ts
@@ -318,9 +318,7 @@ export function create_bidirectional_transition(node: Element & ElementCSSInline
}
running_program = null;
- }
-
- else if (now >= running_program.start) {
+ } else if (now >= running_program.start) {
const p = now - running_program.start;
t = running_program.a + running_program.d * easing(p / running_program.duration);
tick(t, 1 - t);
diff --git a/test/validator/samples/animation-not-in-each/errors.json b/test/validator/samples/animation-not-in-each/errors.json
index 67e2ceb7c2..c737617f98 100644
--- a/test/validator/samples/animation-not-in-each/errors.json
+++ b/test/validator/samples/animation-not-in-each/errors.json
@@ -1,6 +1,6 @@
[{
"code": "invalid-animation",
- "message": "An element that use the animate directive must be the immediate child of a keyed each block",
+ "message": "An element that uses the animate directive must be the immediate child of a keyed each block",
"start": {
"line": 5,
"column": 5,
@@ -12,4 +12,4 @@
"character": 55
},
"pos": 44
-}]
\ No newline at end of file
+}]
diff --git a/test/validator/samples/animation-not-in-keyed-each/errors.json b/test/validator/samples/animation-not-in-keyed-each/errors.json
index 1081589e6f..3e0b2d3c0c 100644
--- a/test/validator/samples/animation-not-in-keyed-each/errors.json
+++ b/test/validator/samples/animation-not-in-keyed-each/errors.json
@@ -1,6 +1,6 @@
[{
"code": "invalid-animation",
- "message": "An element that use the animate directive must be the immediate child of a keyed each block",
+ "message": "An element that uses the animate directive must be the immediate child of a keyed each block",
"start": {
"line": 6,
"column": 6,
@@ -12,4 +12,4 @@
"character": 80
},
"pos": 69
-}]
\ No newline at end of file
+}]
diff --git a/test/validator/samples/animation-siblings/errors.json b/test/validator/samples/animation-siblings/errors.json
index af15113b94..3def56f0a5 100644
--- a/test/validator/samples/animation-siblings/errors.json
+++ b/test/validator/samples/animation-siblings/errors.json
@@ -1,6 +1,6 @@
[{
"code": "invalid-animation",
- "message": "An element that use the animate directive must be the sole child of a keyed each block",
+ "message": "An element that uses the animate directive must be the sole child of a keyed each block",
"start": {
"line": 6,
"column": 6,
@@ -12,4 +12,4 @@
"character": 88
},
"pos": 77
-}]
\ No newline at end of file
+}]