diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 0000000000..d632634540
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1 @@
+open_collective: svelte
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index 2aa885cfcb..0000000000
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,56 +0,0 @@
----
-name: Bug report
-about: Create a report to help us improve
-title: ''
-labels: 'Bug'
-assignees: ''
-
----
-
-## Is this about svelte@next? This project is currently in a pre-release stage and breaking changes may occur at any time. Please do not post any kind of bug reports or questions on GitHub about it.
-
-**Describe the bug**
-A clear and concise description of what the bug is.
-
-**Logs**
-Please include browser console and server logs around the time this bug occurred.
-
-**To Reproduce**
-To help us help you, if you've found a bug please consider the following:
-
-* If you can demonstrate the bug using https://svelte.dev/repl, please do.
-* If that's not possible, we recommend creating a small repo that illustrates the problem.
-* Reproductions should be small, self-contained, correct examples – http://sscce.org.
-
-Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster.
-
-**Expected behavior**
-A clear and concise description of what you expected to happen.
-
-**Stacktraces**
-If you have a stack trace to include, we recommend putting inside a `` block for the sake of the thread's readability:
-
-
- Stack trace
-
- Stack trace goes here...
-
-
-**Information about your Svelte project:**
-To make your life easier, just run `npx envinfo --system --npmPackages svelte,rollup,webpack --binaries --browsers` and paste the output here.
-
-- Your browser and the version: (e.x. Chrome 52.1, Firefox 48.0, IE 10)
-
-- Your operating system: (e.x. OS X 10, Ubuntu Linux 19.10, Windows XP, etc)
-
-- Svelte version (Please check you can reproduce the issue with the latest release!)
-
-- Whether your project uses Webpack or Rollup
-
-**Severity**
-How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Svelte entirely?
-
-Note: the more honest and specific you are here the more we will take you seriously.
-
-**Additional context**
-Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 0000000000..38a971864b
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,50 @@
+name: "\U0001F41E Bug report"
+description: Report an issue with Svelte
+labels: ["triage: bug"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for taking the time to fill out this bug report!
+ - type: textarea
+ id: bug-description
+ attributes:
+ label: Describe the bug
+ description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
+ placeholder: Bug description
+ validations:
+ required: true
+ - type: textarea
+ id: reproduction
+ attributes:
+ label: Reproduction
+ description: Please provide a link to a repo or REPL that can reproduce the problem you ran into. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided within a reasonable time-frame, the issue will be closed.
+ placeholder: Reproduction
+ validations:
+ required: true
+ - type: textarea
+ id: logs
+ attributes:
+ label: Logs
+ description: "Please include browser console and server logs around the time this bug occurred. Optional if provided reproduction. Please try not to insert an image but copy paste the log text."
+ render: shell
+ - type: textarea
+ id: system-info
+ attributes:
+ label: System Info
+ description: Output of `npx envinfo --system --npmPackages svelte,rollup,webpack --binaries --browsers`
+ render: shell
+ placeholder: System, Binaries, Browsers
+ validations:
+ required: true
+ - type: dropdown
+ id: severity
+ attributes:
+ label: Severity
+ description: Select the severity of this issue
+ options:
+ - annoyance
+ - blocking an upgrade
+ - blocking all usage of svelte
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000000..ee3e5a41b9
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,5 @@
+blank_issues_enabled: false
+contact_links:
+ - name: Discord Chat
+ url: https://svelte.dev/chat
+ about: Ask questions and discuss with other Svelte users in real time.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
deleted file mode 100644
index 923bfdb50c..0000000000
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-title: ''
-labels: 'New Feature'
-assignees: ''
-
----
-
-
-
-**Is your feature request related to a problem? Please describe.**
-A clear and concise description of what the problem is. For example: I'm always frustrated when [...]
-
-**Describe the solution you'd like**
-A clear and concise description of what you want to happen.
-
-**Describe alternatives you've considered**
-A clear and concise description of any alternative solutions or features you've considered.
-
-**How important is this feature to you?**
-Note: the more honest and specific you are here the more we will take you seriously.
-
-**Additional context**
-Add any other context or screenshots about the feature request here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 0000000000..2174f851a0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,42 @@
+name: "Feature Request"
+description: Request a new Svelte feature
+labels: [enhancement]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for taking the time to request this feature! If your feature request is complex or substantial enough to warrant in-depth discussion, maintainers may close the issue and ask you to open an [RFC](https://github.com/sveltejs/rfcs).
+ - type: textarea
+ id: problem
+ attributes:
+ label: Describe the problem
+ description: Please provide a clear and concise description the problem this feature would solve. The more information you can provide here, the better.
+ placeholder: I'm always frustrated when...
+ validations:
+ required: true
+ - type: textarea
+ id: solution
+ attributes:
+ label: Describe the proposed solution
+ description: Please provide a clear and concise description of what you would like to happen.
+ placeholder: I would like to see...
+ validations:
+ required: true
+ - type: textarea
+ id: alternatives
+ attributes:
+ label: Alternatives considered
+ description: "Please provide a clear and concise description of any alternative solutions or features you've considered."
+ validations:
+ required: true
+ - type: dropdown
+ id: importance
+ attributes:
+ label: Importance
+ description: How important is this feature to you?
+ options:
+ - nice to have
+ - would make my life easier
+ - i cannot use svelte without it
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/questions-and-help.md b/.github/ISSUE_TEMPLATE/questions-and-help.md
deleted file mode 100644
index a6e0dc6e19..0000000000
--- a/.github/ISSUE_TEMPLATE/questions-and-help.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-name: Questions and help
-about: If you think you need help with something related to Svelte
-title: ''
-labels: 'Question'
-assignees: ''
-
----
-
-This issue tracker is intended to collect bug reports and feature requests.
-
-For help with installation, information on how features work, or questions about specific features of Svelte, please come and join us in the [Svelte Discord](https://svelte.dev/chat), or ask your question on [Stack Overflow](https://stackoverflow.com/questions/tagged/svelte). Any issues open for help requests will be closed to keep from clogging up the issue tracker.
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index d14a0f9fe4..7de5a35e13 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,5 +1,6 @@
### Before submitting the PR, please make sure you do the following
- [ ] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
+- [ ] Prefix your PR title with `[feat]`, `[fix]`, `[chore]`, or `[docs]`.
- [ ] This message body should clearly illustrate what problems it solves.
- [ ] Ideally, include a test that fails without this PR but passes with it.
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4e04386fcc..bbfde04f67 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -3,34 +3,39 @@ on: [push, pull_request]
jobs:
Tests:
runs-on: ${{ matrix.os }}
- timeout-minutes: 10
+ timeout-minutes: 15
strategy:
matrix:
- node-version: [8, 10, 12, 14]
+ node-version: [8, 10, 12, 14, 16]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- - uses: actions/checkout@v1
- - uses: actions/setup-node@v1
- with:
- node-version: ${{ matrix.node-version }}
- - run: npm install
- - run: npm test
- env:
- CI: true
+ - uses: actions/checkout@v1
+ - uses: actions/setup-node@v2
+ with:
+ node-version: ${{ matrix.node-version }}
+ cache: npm
+ - run: npm install
+ - run: npm test
+ env:
+ CI: true
Lint:
runs-on: ubuntu-latest
- timeout-minutes: 2
+ timeout-minutes: 5
steps:
- - uses: actions/checkout@v1
- - uses: actions/setup-node@v1
- - run: 'npm i && npm run lint'
+ - uses: actions/checkout@v1
+ - uses: actions/setup-node@v2
+ with:
+ cache: npm
+ - run: 'npm i && npm run lint'
Unit:
runs-on: ${{ matrix.os }}
- timeout-minutes: 5
+ timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- - uses: actions/checkout@v1
- - uses: actions/setup-node@v1
- - run: 'npm i && npm run test:unit'
+ - uses: actions/checkout@v1
+ - uses: actions/setup-node@v2
+ with:
+ cache: npm
+ - run: 'npm i && npm run test:unit'
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 0000000000..ea6e0f5a60
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,28 @@
+name: Docs
+
+on:
+ push:
+ branches:
+ - master
+ paths:
+ - site/content/**
+
+jobs:
+ release:
+ name: Deploy docs
+ runs-on: ubuntu-latest
+ steps:
+ - name: my-app-install token
+ id: github-app
+ uses: getsentry/action-github-app-token@v1
+ with:
+ app_id: ${{ secrets.GH_APP_ID }}
+ private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
+
+ - name: run deploy docs workflow
+ uses: 'sveltejs/action-deploy-docs/dispatch@main'
+ with:
+ repo: 'svelte'
+ branch: 'master'
+ docs_path: 'site/content'
+ token: ${{ steps.github-app.outputs.token }}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index bddabf688b..228136cbc8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,7 @@ node_modules
/compiler.d.ts
/compiler.*js
/index.*js
+/ssr.*js
/internal
/store
/easing
@@ -22,16 +23,3 @@ node_modules
_actual*.*
_output
/types
-
-/site/cypress/screenshots/
-/site/__sapper__/
-/site/.env
-/site/.sessions
-/site/static/svelte-app.json
-/site/static/contributors.jpg
-/site/static/workers
-/site/static/organisations
-/site/scripts/svelte-app
-/site/scripts/community
-/site/src/routes/_contributors.js
-/site/src/routes/_components/WhosUsingSvelte.*
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 53c16b612a..39dc47b387 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,201 @@
# Svelte changelog
+## 3.45.0
+
+* Fix non-boolean attribute rendering in SSR to render truthy values as-is ([#6121](https://github.com/sveltejs/svelte/issues/6121))
+* Fix binding to a member expression also invalidating the member property ([#6921](https://github.com/sveltejs/svelte/issues/6921))
+* Fix default values in `{#each}`/etc. destructurings not being considered references for the purposes of compiler warnings ([#6964](https://github.com/sveltejs/svelte/issues/6964))
+* Fix `{:else if}` value incorrectly being cached ([#7043](https://github.com/sveltejs/svelte/pull/7043))
+* Add `a11y-no-redundant-roles` warning ([#7067](https://github.com/sveltejs/svelte/pull/7067))
+* Fix code generation error with arrow functions whose bodies are object destructuring assignments ([#7087](https://github.com/sveltejs/svelte/issues/7087))
+
+## 3.44.3
+
+* Fix `bind:this` binding inside `onMount` for manually instantiated component ([#6760](https://github.com/sveltejs/svelte/issues/6760))
+* Prevent cursor jumps with one-way binding for other `type="text"`-like ` `s ([#6941](https://github.com/sveltejs/svelte/pull/6941))
+* Exclude `async` loops from `loopGuardTimeout` ([#6945](https://github.com/sveltejs/svelte/issues/6945))
+
+## 3.44.2
+
+* Fix overly restrictive preprocessor types ([#6904](https://github.com/sveltejs/svelte/pull/6904))
+* More specific typing for crossfade function - returns a tuple, not an array ([#6926](https://github.com/sveltejs/svelte/issues/6926))
+* Add `URLSearchParams` as a known global ([#6938](https://github.com/sveltejs/svelte/pull/6938))
+* Add `types` field to `exports` map ([#6939](https://github.com/sveltejs/svelte/issues/6939))
+
+## 3.44.1
+
+* Fix code generation when a multi-line `return` statement contains comments ([code-red#36](https://github.com/Rich-Harris/code-red/issues/36))
+* Fix code generation when `for`/`if`/`while` statements have empty bodies ([#6884](https://github.com/sveltejs/svelte/issues/6884))
+
+## 3.44.0
+
+* Add `enableSourcemap` compiler option ([#6835](https://github.com/sveltejs/svelte/pull/6835))
+
+## 3.43.2
+
+* Fix regression where user-specified `import`s were not rewritten according to the `sveltePath` option ([#6834](https://github.com/sveltejs/svelte/issues/6834))
+
+## 3.43.1
+
+* Prevent a rejecting promise used in `{#await}` during SSR from appearing as an unhandled rejection ([#6789](https://github.com/sveltejs/svelte/issues/6789))
+
+## 3.43.0
+
+* Use export map to expose no-op versions of lifecycle functions for SSR ([#6743](https://github.com/sveltejs/svelte/pull/6743))
+* Prefer `context` passed to component constructor, even when running synchronously in another component ([#6753](https://github.com/sveltejs/svelte/issues/6753))
+* Handle preprocessors that return empty sourcemaps ([#6757](https://github.com/sveltejs/svelte/pull/6757))
+
+## 3.42.6
+
+* Hide private preprocess typings ([#6622](https://github.com/sveltejs/svelte/issues/6622))
+* Fix reactive function in `{:else if}` expression not being properly re-run ([#6727](https://github.com/sveltejs/svelte/pull/6727))
+
+## 3.42.5
+
+* In `draw` transition, account for `stroke-linecap` in determining length ([#4540](https://github.com/sveltejs/svelte/issues/4540))
+* Fix regression with destructuring assignments with default values ([#6699](https://github.com/sveltejs/svelte/issues/6699))
+
+## 3.42.4
+
+* Only apply optimized `src` attribute handling when in an `html` namespace ([#6575](https://github.com/sveltejs/svelte/issues/6575))
+* Fix styles for transitions and animations being attached to the wrong `document` in `
-{/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..d97db41f0b 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
@@ -17,17 +17,17 @@
Size
-
+
One scoop
-
+
Two scoops
-
+
Three scoops
@@ -35,7 +35,7 @@
{#each menu as flavour}
-
+
{flavour}
{/each}
@@ -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/04-group-inputs/text.md b/site/content/tutorial/06-bindings/04-group-inputs/text.md
index 97edb8db76..b48b23921f 100644
--- a/site/content/tutorial/06-bindings/04-group-inputs/text.md
+++ b/site/content/tutorial/06-bindings/04-group-inputs/text.md
@@ -7,7 +7,7 @@ If you have multiple inputs relating to the same value, you can use `bind:group`
Add `bind:group` to each input:
```html
-
+
```
In this case, we could make the code simpler by moving the checkbox inputs into an `each` block. First, add a `menu` variable to the `
-
+{@html marked(value)}
-{@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..dbeaf9b67b 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
@@ -1,12 +1,12 @@
-
+{@html marked(value)}
-{@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 @@
}
-
-
Insecurity questions
-selected question {selected ? selected.id : '[waiting...]'}
\ No newline at end of file
+selected question {selected ? selected.id : '[waiting...]'}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/06-select-bindings/app-b/App.svelte b/site/content/tutorial/06-bindings/06-select-bindings/app-b/App.svelte
index 3f1e7fa7e1..c584c95b0e 100644
--- a/site/content/tutorial/06-bindings/06-select-bindings/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/06-select-bindings/app-b/App.svelte
@@ -14,10 +14,6 @@
}
-
-
Insecurity questions
-selected question {selected ? selected.id : '[waiting...]'}
\ No newline at end of file
+selected question {selected ? selected.id : '[waiting...]'}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/06-select-bindings/text.md b/site/content/tutorial/06-bindings/06-select-bindings/text.md
index f4972557ab..b9cf2de6ec 100644
--- a/site/content/tutorial/06-bindings/06-select-bindings/text.md
+++ b/site/content/tutorial/06-bindings/06-select-bindings/text.md
@@ -2,7 +2,7 @@
title: Select bindings
---
-We can also use `bind:value` with `` elements. Update line 24:
+We can also use `bind:value` with `` elements. Update line 20:
```html
@@ -10,4 +10,4 @@ We can also use `bind:value` with `` elements. Update line 24:
Note that the `` values are objects rather than strings. Svelte doesn't mind.
-> Because we haven't set an initial value of `selected`, the binding will set it to the default value (the first in the list) automatically. Be careful though — until the binding is initialised, `selected` remains undefined, so we can't blindly reference e.g. `selected.id` in the template.
\ No newline at end of file
+> Because we haven't set an initial value of `selected`, the binding will set it to the default value (the first in the list) automatically. Be careful though — until the binding is initialised, `selected` remains undefined, so we can't blindly reference e.g. `selected.id` in the template.
diff --git a/site/content/tutorial/06-bindings/07-multiple-select-bindings/text.md b/site/content/tutorial/06-bindings/07-multiple-select-bindings/text.md
index f6137d3f1d..e607100c56 100644
--- a/site/content/tutorial/06-bindings/07-multiple-select-bindings/text.md
+++ b/site/content/tutorial/06-bindings/07-multiple-select-bindings/text.md
@@ -4,7 +4,7 @@ title: Select multiple
A select can have a `multiple` attribute, in which case it will populate an array rather than selecting a single value.
-Returning to our [earlier ice cream example](tutorial/group-inputs), we can replace the checkboxes with a ``:
+Returning to our [earlier ice cream example](/tutorial/group-inputs), we can replace the checkboxes with a ``:
```html
Flavours
@@ -16,4 +16,6 @@ Returning to our [earlier ice cream example](tutorial/group-inputs), we can repl
{/each}
-```
\ No newline at end of file
+```
+
+> Press and hold the `control` key (or the `command` key on MacOS) for selecting multiple options.
diff --git a/site/content/tutorial/06-bindings/09-each-block-bindings/app-a/App.svelte b/site/content/tutorial/06-bindings/09-each-block-bindings/app-a/App.svelte
index 4a2eae9147..b0323eb00a 100644
--- a/site/content/tutorial/06-bindings/09-each-block-bindings/app-a/App.svelte
+++ b/site/content/tutorial/06-bindings/09-each-block-bindings/app-a/App.svelte
@@ -16,12 +16,6 @@
$: remaining = todos.filter(t => !t.done).length;
-
-
Todos
{#each todos as todo}
@@ -47,3 +41,9 @@
Clear completed
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/09-each-block-bindings/app-b/App.svelte b/site/content/tutorial/06-bindings/09-each-block-bindings/app-b/App.svelte
index ff91612ec5..b42cbe3b0a 100644
--- a/site/content/tutorial/06-bindings/09-each-block-bindings/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/09-each-block-bindings/app-b/App.svelte
@@ -16,12 +16,6 @@
$: remaining = todos.filter(t => !t.done).length;
-
-
Todos
{#each todos as todo}
@@ -47,3 +41,9 @@
Clear completed
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/09-each-block-bindings/text.md b/site/content/tutorial/06-bindings/09-each-block-bindings/text.md
index 7e50966c32..9c352703f1 100644
--- a/site/content/tutorial/06-bindings/09-each-block-bindings/text.md
+++ b/site/content/tutorial/06-bindings/09-each-block-bindings/text.md
@@ -5,15 +5,17 @@ title: Each block bindings
You can even bind to properties inside an `each` block.
```html
-
+{#each todos as todo}
+
-
+
+{/each}
```
-> Note that interacting with these ` ` elements will mutate the array. If you prefer to work with immutable data, you should avoid these bindings and use event handlers instead.
\ No newline at end of file
+> Note that interacting with these ` ` elements will mutate the array. If you prefer to work with immutable data, you should avoid these bindings and use event handlers instead.
diff --git a/site/content/tutorial/06-bindings/10-media-elements/app-a/App.svelte b/site/content/tutorial/06-bindings/10-media-elements/app-a/App.svelte
index 122b2cf9e9..33d6e3f6eb 100644
--- a/site/content/tutorial/06-bindings/10-media-elements/app-a/App.svelte
+++ b/site/content/tutorial/06-bindings/10-media-elements/app-a/App.svelte
@@ -7,37 +7,35 @@
let showControls = true;
let showControlsTimeout;
- function handleMousemove(e) {
+ // Used to track time of last mouse down event
+ let lastMouseDown;
+
+ function handleMove(e) {
// Make the controls visible, but fade out after
// 2.5 seconds of inactivity
clearTimeout(showControlsTimeout);
showControlsTimeout = setTimeout(() => showControls = false, 2500);
showControls = true;
- if (!(e.buttons & 1)) return; // mouse not down
if (!duration) return; // video not loaded yet
+ if (e.type !== 'touchmove' && !(e.buttons & 1)) return; // mouse not down
+ const clientX = e.type === 'touchmove' ? e.touches[0].clientX : e.clientX;
const { left, right } = this.getBoundingClientRect();
- time = duration * (e.clientX - left) / (right - left);
+ time = duration * (clientX - left) / (right - left);
}
+ // we can't rely on the built-in click event, because it fires
+ // after a drag — we have to listen for clicks ourselves
function handleMousedown(e) {
- // we can't rely on the built-in click event, because it fires
- // after a drag — we have to listen for clicks ourselves
+ lastMouseDown = new Date();
+ }
- function handleMouseup() {
+ function handleMouseup(e) {
+ if (new Date() - lastMouseDown < 300) {
if (paused) e.target.play();
else e.target.pause();
- cancel();
- }
-
- function cancel() {
- e.target.removeEventListener('mouseup', handleMouseup);
}
-
- e.target.addEventListener('mouseup', handleMouseup);
-
- setTimeout(cancel, 200);
}
function format(seconds) {
@@ -51,6 +49,31 @@
}
+Caminandes: Llamigos
+From Blender Studio . CC-BY
+
+
+
+
+
+
+
+
+
+
+ {format(time)}
+ click anywhere to {paused ? 'play' : 'pause'} / drag to seek
+ {format(duration)}
+
+
+
+
-
-Caminandes: Llamigos
-From Blender Open Projects . CC-BY
-
-
-
-
-
-
-
-
-
-
- {format(time)}
- click anywhere to {paused ? 'play' : 'pause'} / drag to seek
- {format(duration)}
-
-
-
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..8048f7e133 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
@@ -7,37 +7,35 @@
let showControls = true;
let showControlsTimeout;
- function handleMousemove(e) {
+ // Used to track time of last mouse down event
+ let lastMouseDown;
+
+ function handleMove(e) {
// Make the controls visible, but fade out after
// 2.5 seconds of inactivity
clearTimeout(showControlsTimeout);
showControlsTimeout = setTimeout(() => showControls = false, 2500);
showControls = true;
- if (!(e.buttons & 1)) return; // mouse not down
if (!duration) return; // video not loaded yet
+ if (e.type !== 'touchmove' && !(e.buttons & 1)) return; // mouse not down
+ const clientX = e.type === 'touchmove' ? e.touches[0].clientX : e.clientX;
const { left, right } = this.getBoundingClientRect();
- time = duration * (e.clientX - left) / (right - left);
+ time = duration * (clientX - left) / (right - left);
}
+ // we can't rely on the built-in click event, because it fires
+ // after a drag — we have to listen for clicks ourselves
function handleMousedown(e) {
- // we can't rely on the built-in click event, because it fires
- // after a drag — we have to listen for clicks ourselves
+ lastMouseDown = new Date();
+ }
- function handleMouseup() {
+ function handleMouseup(e) {
+ if (new Date() - lastMouseDown < 300) {
if (paused) e.target.play();
else e.target.pause();
- cancel();
- }
-
- function cancel() {
- e.target.removeEventListener('mouseup', handleMouseup);
}
-
- e.target.addEventListener('mouseup', handleMouseup);
-
- setTimeout(cancel, 200);
}
function format(seconds) {
@@ -51,6 +49,34 @@
}
+Caminandes: Llamigos
+From Blender Studio . CC-BY
+
+
+
+
+
+
+
+
+
+
+ {format(time)}
+ click anywhere to {paused ? 'play' : 'pause'} / drag to seek
+ {format(duration)}
+
+
+
+
-
-Caminandes: Llamigos
-From Blender Open Projects . CC-BY
-
-
-
-
-
-
-
-
-
-
- {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/text.md b/site/content/tutorial/06-bindings/10-media-elements/text.md
index 0a854f19e9..b63c5368ff 100644
--- a/site/content/tutorial/06-bindings/10-media-elements/text.md
+++ b/site/content/tutorial/06-bindings/10-media-elements/text.md
@@ -4,18 +4,21 @@ title: Media elements
The `` and `` elements have several properties that you can bind to. This example demonstrates a few of them.
-On line 116, add `currentTime={time}`, `duration` and `paused` bindings:
+On line 62, add `currentTime={time}`, `duration` and `paused` bindings:
```html
+ bind:paused>
+
+
```
> `bind:duration` is equivalent to `bind:duration={duration}`
@@ -41,4 +44,4 @@ The complete set of bindings for `` and `` is as follows — six *
* `volume` — a value between 0 and 1
* `muted` — a boolean value where true is muted
-Videos additionally have readonly `videoWidth` and `videoHeight` bindings.
\ No newline at end of file
+Videos additionally have readonly `videoWidth` and `videoHeight` bindings.
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..9c30979ace 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
@@ -15,7 +15,7 @@
for (let p = 0; p < imageData.data.length; p += 4) {
const i = p / 4;
const x = i % canvas.width;
- const y = i / canvas.height >>> 0;
+ const y = i / canvas.width >>> 0;
const r = 64 + (128 * x / canvas.width) + (64 * Math.sin(t / 1000));
const g = 64 + (128 * y / canvas.height) + (64 * Math.cos(t / 1000));
@@ -36,17 +36,17 @@
});
+
+
-
-
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..5714f3149a 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
@@ -15,7 +15,7 @@
for (let p = 0; p < imageData.data.length; p += 4) {
const i = p / 4;
const x = i % canvas.width;
- const y = i / canvas.height >>> 0;
+ const y = i / canvas.width >>> 0;
const r = 64 + (128 * x / canvas.width) + (64 * Math.sin(t / 1000));
const g = 64 + (128 * y / canvas.height) + (64 * Math.cos(t / 1000));
@@ -36,18 +36,18 @@
});
+
+
-
-
diff --git a/site/content/tutorial/06-bindings/12-bind-this/text.md b/site/content/tutorial/06-bindings/12-bind-this/text.md
index 4784b6b13f..6602e4de76 100644
--- a/site/content/tutorial/06-bindings/12-bind-this/text.md
+++ b/site/content/tutorial/06-bindings/12-bind-this/text.md
@@ -12,4 +12,4 @@ The readonly `this` binding applies to every element (and component) and allows
>
```
-Note that the value of `canvas` will be `undefined` until the component has mounted, so we put the logic inside the `onMount` [lifecycle function](tutorial/onmount).
+Note that the value of `canvas` will be `undefined` until the component has mounted, so we put the logic inside the `onMount` [lifecycle function](/tutorial/onmount).
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');
-
-
1
2
@@ -37,4 +24,17 @@
clear
0
submit
-
\ 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');
-
-
1
2
@@ -37,4 +24,17 @@
clear
0
submit
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/14-component-this/app-a/App.svelte b/site/content/tutorial/06-bindings/14-component-this/app-a/App.svelte
new file mode 100644
index 0000000000..41a6a10d3d
--- /dev/null
+++ b/site/content/tutorial/06-bindings/14-component-this/app-a/App.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/site/content/tutorial/06-bindings/14-component-this/app-a/InputField.svelte b/site/content/tutorial/06-bindings/14-component-this/app-a/InputField.svelte
new file mode 100644
index 0000000000..e2b04b93ed
--- /dev/null
+++ b/site/content/tutorial/06-bindings/14-component-this/app-a/InputField.svelte
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/14-component-this/app-b/App.svelte b/site/content/tutorial/06-bindings/14-component-this/app-b/App.svelte
new file mode 100644
index 0000000000..f14332b398
--- /dev/null
+++ b/site/content/tutorial/06-bindings/14-component-this/app-b/App.svelte
@@ -0,0 +1,9 @@
+
+
+
+
+ field.focus()}>Focus field
diff --git a/site/content/tutorial/06-bindings/14-component-this/app-b/InputField.svelte b/site/content/tutorial/06-bindings/14-component-this/app-b/InputField.svelte
new file mode 100644
index 0000000000..e2b04b93ed
--- /dev/null
+++ b/site/content/tutorial/06-bindings/14-component-this/app-b/InputField.svelte
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/14-component-this/text.md b/site/content/tutorial/06-bindings/14-component-this/text.md
new file mode 100644
index 0000000000..e389dbbacf
--- /dev/null
+++ b/site/content/tutorial/06-bindings/14-component-this/text.md
@@ -0,0 +1,23 @@
+---
+title: Binding to component instances
+---
+
+Just as you can bind to DOM elements, you can bind to component instances themselves. For example, we can bind the instance of `` to a variable named `field` in the same way we did when binding DOM Elements
+
+```html
+
+
+
+```
+
+Now we can programmatically interact with this component using `field`.
+
+```html
+
+ Focus field
+
+```
+
+> Note that we can't do `{field.focus}` since field is undefined when the button is first rendered and throws an error.
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/07-lifecycle/01-onmount/text.md b/site/content/tutorial/07-lifecycle/01-onmount/text.md
index 54b385e889..f24fce5fc2 100644
--- a/site/content/tutorial/07-lifecycle/01-onmount/text.md
+++ b/site/content/tutorial/07-lifecycle/01-onmount/text.md
@@ -4,7 +4,7 @@ title: onMount
Every component has a *lifecycle* that starts when it is created, and ends when it is destroyed. There are a handful of functions that allow you to run code at key moments during that lifecycle.
-The one you'll use most frequently is `onMount`, which runs after the component is first rendered to the DOM. We briefly encountered it [earlier](tutorial/bind-this) when we needed to interact with a `` element after it had been rendered.
+The one you'll use most frequently is `onMount`, which runs after the component is first rendered to the DOM. We briefly encountered it [earlier](/tutorial/bind-this) when we needed to interact with a `` element after it had been rendered.
We'll add an `onMount` handler that loads some data over the network:
diff --git a/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/App.svelte b/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/App.svelte
index 28cdb73d0d..8fdca8d81d 100644
--- a/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/App.svelte
+++ b/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/App.svelte
@@ -1,10 +1,20 @@
-
- The page has been open for
- {seconds} {seconds === 1 ? 'second' : 'seconds'}
-
\ No newline at end of file
+
+
{open ? 'Close' : 'Open'} Timer
+
+ The Timer component has been open for
+ {seconds} {seconds === 1 ? 'second' : 'seconds'}
+
+ {#if open}
+
+ {/if}
+
diff --git a/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/Timer.svelte b/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/Timer.svelte
new file mode 100644
index 0000000000..0eb5a7461d
--- /dev/null
+++ b/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/Timer.svelte
@@ -0,0 +1,20 @@
+
+
+
+ This component executes a callback every
+ {interval} millisecond{interval === 1 ? '' : 's'}
+
+
+
diff --git a/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/utils.js b/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/utils.js
index 7b65e75c8c..64ab7e50c7 100644
--- a/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/utils.js
+++ b/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/utils.js
@@ -1,5 +1,9 @@
import { onDestroy } from 'svelte';
export function onInterval(callback, milliseconds) {
- // implementation goes here
+ const interval = setInterval(callback, milliseconds);
+
+ onDestroy(() => {
+ // Fix the memory leak here
+ });
}
\ No newline at end of file
diff --git a/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/App.svelte b/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/App.svelte
index 93a721ef44..49936b6617 100644
--- a/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/App.svelte
+++ b/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/App.svelte
@@ -1,11 +1,20 @@
-
- The page has been open for
- {seconds} {seconds === 1 ? 'second' : 'seconds'}
-
\ No newline at end of file
+
+
{open ? 'Close' : 'Open'} Timer
+
+ The Timer component has been open for
+ {seconds} {seconds === 1 ? 'second' : 'seconds'}
+
+ {#if open}
+
+ {/if}
+
diff --git a/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/Timer.svelte b/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/Timer.svelte
new file mode 100644
index 0000000000..0eb5a7461d
--- /dev/null
+++ b/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/Timer.svelte
@@ -0,0 +1,20 @@
+
+
+
+ This component executes a callback every
+ {interval} millisecond{interval === 1 ? '' : 's'}
+
+
+
diff --git a/site/content/tutorial/07-lifecycle/02-ondestroy/text.md b/site/content/tutorial/07-lifecycle/02-ondestroy/text.md
index 647fbaa160..34bbf83cbf 100644
--- a/site/content/tutorial/07-lifecycle/02-ondestroy/text.md
+++ b/site/content/tutorial/07-lifecycle/02-ondestroy/text.md
@@ -10,8 +10,8 @@ For example, we can add a `setInterval` function when our component initialises,
@@ -37,7 +37,9 @@ export function onInterval(callback, milliseconds) {
-```
\ No newline at end of file
+```
+
+Open and close the timer a few times and make sure the counter keeps ticking and the CPU load increases. This is due to a memory leak as the previous timers are not deleted. Don't forget to refresh the page before solving the example.
\ No newline at end of file
diff --git a/site/content/tutorial/07-lifecycle/03-update/text.md b/site/content/tutorial/07-lifecycle/03-update/text.md
index 40e071630a..0255e845a8 100644
--- a/site/content/tutorial/07-lifecycle/03-update/text.md
+++ b/site/content/tutorial/07-lifecycle/03-update/text.md
@@ -2,7 +2,7 @@
title: beforeUpdate and afterUpdate
---
-The `beforeUpdate` function schedules work to happen immediately before the DOM has been updated. `afterUpdate` is its counterpart, used for running code once the DOM is in sync with your data.
+The `beforeUpdate` function schedules work to happen immediately before the DOM is updated. `afterUpdate` is its counterpart, used for running code once the DOM is in sync with your data.
Together, they're useful for doing things imperatively that are difficult to achieve in a purely state-driven way, like updating the scroll position of an element.
@@ -21,4 +21,4 @@ afterUpdate(() => {
});
```
-Note that `beforeUpdate` will first run before the component has mounted, so we need to check for the existence of `div` before reading its properties.
\ No newline at end of file
+Note that `beforeUpdate` will first run before the component has mounted, so we need to check for the existence of `div` before reading its properties.
diff --git a/site/content/tutorial/08-stores/01-writable-stores/app-a/App.svelte b/site/content/tutorial/08-stores/01-writable-stores/app-a/App.svelte
index ee542f789d..f2a4023f25 100644
--- a/site/content/tutorial/08-stores/01-writable-stores/app-a/App.svelte
+++ b/site/content/tutorial/08-stores/01-writable-stores/app-a/App.svelte
@@ -6,7 +6,7 @@
let count_value;
- const unsubscribe = count.subscribe(value => {
+ count.subscribe(value => {
count_value = value;
});
@@ -15,4 +15,4 @@
-
\ No newline at end of file
+
diff --git a/site/content/tutorial/08-stores/01-writable-stores/app-b/App.svelte b/site/content/tutorial/08-stores/01-writable-stores/app-b/App.svelte
index ee542f789d..c77563e354 100644
--- a/site/content/tutorial/08-stores/01-writable-stores/app-b/App.svelte
+++ b/site/content/tutorial/08-stores/01-writable-stores/app-b/App.svelte
@@ -6,7 +6,7 @@
let count_value;
- const unsubscribe = count.subscribe(value => {
+ count.subscribe(value => {
count_value = value;
});
diff --git a/site/content/tutorial/08-stores/01-writable-stores/text.md b/site/content/tutorial/08-stores/01-writable-stores/text.md
index 57c27411ea..247ef86e8d 100644
--- a/site/content/tutorial/08-stores/01-writable-stores/text.md
+++ b/site/content/tutorial/08-stores/01-writable-stores/text.md
@@ -24,4 +24,4 @@ Finally, in `Resetter.svelte`, implement `reset`:
function reset() {
count.set(0);
}
-```
\ No newline at end of file
+```
diff --git a/site/content/tutorial/08-stores/02-auto-subscriptions/app-a/App.svelte b/site/content/tutorial/08-stores/02-auto-subscriptions/app-a/App.svelte
index ee542f789d..f2a4023f25 100644
--- a/site/content/tutorial/08-stores/02-auto-subscriptions/app-a/App.svelte
+++ b/site/content/tutorial/08-stores/02-auto-subscriptions/app-a/App.svelte
@@ -6,7 +6,7 @@
let count_value;
- const unsubscribe = count.subscribe(value => {
+ count.subscribe(value => {
count_value = value;
});
@@ -15,4 +15,4 @@
-
\ No newline at end of file
+
diff --git a/site/content/tutorial/08-stores/02-auto-subscriptions/text.md b/site/content/tutorial/08-stores/02-auto-subscriptions/text.md
index af584261f4..fc7967f658 100644
--- a/site/content/tutorial/08-stores/02-auto-subscriptions/text.md
+++ b/site/content/tutorial/08-stores/02-auto-subscriptions/text.md
@@ -2,9 +2,18 @@
title: Auto-subscriptions
---
-The app in the previous example works, but there's a subtle bug — the `unsubscribe` function never gets called. If the component was instantiated and destroyed many times, this would result in a *memory leak*.
+The app in the previous example works, but there's a subtle bug — the store is subscribed to, but never unsubscribed. If the component was instantiated and destroyed many times, this would result in a *memory leak*.
-One way to fix it would be to use the `onDestroy` [lifecycle hook](tutorial/ondestroy):
+Start by declaring `unsubscribe` in `App.svelte`:
+
+```js
+const unsubscribe = count.subscribe(value => {
+ count_value = value;
+});
+```
+> Calling a `subscribe` method returns an `unsubscribe` function.
+
+You now declared `unsubscribe`, but it still needs to be called, for example through the `onDestroy` [lifecycle hook](/tutorial/ondestroy):
```html
-
-
@@ -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..4bb475157c 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
@@ -13,7 +13,7 @@
return `
transform: scale(${eased}) rotate(${eased * 1080}deg);
color: hsl(
- ${~~(t * 360)},
+ ${Math.trunc(t * 360)},
${Math.min(100, 1000 - 1000 * t)}%,
${Math.min(50, 500 - 500 * t)}%
);`
@@ -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/04-custom-css-transitions/text.md b/site/content/tutorial/10-transitions/04-custom-css-transitions/text.md
index 0745a5924d..138d3de3b6 100644
--- a/site/content/tutorial/10-transitions/04-custom-css-transitions/text.md
+++ b/site/content/tutorial/10-transitions/04-custom-css-transitions/text.md
@@ -23,7 +23,7 @@ The function takes two arguments — the node to which the transition is applied
* `delay` — milliseconds before the transition begins
* `duration` — length of the transition in milliseconds
-* `easing` — a `p => t` easing function (see the chapter on [tweening](tutorial/tweened))
+* `easing` — a `p => t` easing function (see the chapter on [tweening](/tutorial/tweened))
* `css` — a `(t, u) => css` function, where `u === 1 - t`
* `tick` — a `(t, u) => {...}` function that has some effect on the node
@@ -59,7 +59,7 @@ We can get a lot more creative though. Let's make something truly gratuitous:
return `
transform: scale(${eased}) rotate(${eased * 1080}deg);
color: hsl(
- ${~~(t * 360)},
+ ${Math.trunc(t * 360)},
${Math.min(100, 1000 - 1000 * t)}%,
${Math.min(50, 500 - 500 * t)}%
);`
diff --git a/site/content/tutorial/10-transitions/05-custom-js-transitions/app-a/App.svelte b/site/content/tutorial/10-transitions/05-custom-js-transitions/app-a/App.svelte
index 11a8ec3ef5..7ce4a86e92 100644
--- a/site/content/tutorial/10-transitions/05-custom-js-transitions/app-a/App.svelte
+++ b/site/content/tutorial/10-transitions/05-custom-js-transitions/app-a/App.svelte
@@ -16,7 +16,7 @@
{#if visible}
-
+
The quick brown fox jumps over the lazy dog
-{/if}
\ No newline at end of file
+{/if}
diff --git a/site/content/tutorial/10-transitions/05-custom-js-transitions/app-b/App.svelte b/site/content/tutorial/10-transitions/05-custom-js-transitions/app-b/App.svelte
index 396c793639..563803387b 100644
--- a/site/content/tutorial/10-transitions/05-custom-js-transitions/app-b/App.svelte
+++ b/site/content/tutorial/10-transitions/05-custom-js-transitions/app-b/App.svelte
@@ -1,7 +1,7 @@
-
-
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/07-local-transitions/text.md b/site/content/tutorial/10-transitions/07-local-transitions/text.md
index 400fbcaacb..7b9b0ce7f4 100644
--- a/site/content/tutorial/10-transitions/07-local-transitions/text.md
+++ b/site/content/tutorial/10-transitions/07-local-transitions/text.md
@@ -6,7 +6,7 @@ Ordinarily, transitions will play on elements when any container block is added
Instead, we'd like transitions to play only when individual items are added and removed — in other words, when the user drags the slider.
-We can achieve this with a *local* transition, which only plays when the immediate parent block is added or removed:
+We can achieve this with a *local* transition, which only plays when the block with the transition itself is added or removed:
```html
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/10-transitions/09-key-blocks/app-a/App.svelte b/site/content/tutorial/10-transitions/09-key-blocks/app-a/App.svelte
new file mode 100644
index 0000000000..3385a02339
--- /dev/null
+++ b/site/content/tutorial/10-transitions/09-key-blocks/app-a/App.svelte
@@ -0,0 +1,19 @@
+
+
+
+ The number is:
+
+ {number}
+
+
+
+
{
+ number += 1;
+ }}>
+ Increment
+
diff --git a/site/content/tutorial/10-transitions/09-key-blocks/app-b/App.svelte b/site/content/tutorial/10-transitions/09-key-blocks/app-b/App.svelte
new file mode 100644
index 0000000000..0e40dc57d1
--- /dev/null
+++ b/site/content/tutorial/10-transitions/09-key-blocks/app-b/App.svelte
@@ -0,0 +1,21 @@
+
+
+
+ The number is:
+ {#key number}
+
+ {number}
+
+ {/key}
+
+
+
{
+ number += 1;
+ }}>
+ Increment
+
diff --git a/site/content/tutorial/10-transitions/09-key-blocks/text.md b/site/content/tutorial/10-transitions/09-key-blocks/text.md
new file mode 100644
index 0000000000..05a54d592a
--- /dev/null
+++ b/site/content/tutorial/10-transitions/09-key-blocks/text.md
@@ -0,0 +1,16 @@
+---
+title: Key blocks
+---
+
+Key blocks destroy and recreate their contents when the value of an expression changes.
+
+```html
+{#key value}
+
{value}
+{/key}
+```
+
+This is useful if you want an element to play its transition whenever a value changes instead of only when the element enters or leaves the DOM.
+
+Wrap the `
` element in a key block depending on `number`. This will make the
+animation play whenever you press the increment button.
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/11-animations/01-animate/text.md b/site/content/tutorial/11-animations/01-animate/text.md
index 9a1808e259..fc09f39cad 100644
--- a/site/content/tutorial/11-animations/01-animate/text.md
+++ b/site/content/tutorial/11-animations/01-animate/text.md
@@ -2,7 +2,7 @@
title: The animate directive
---
-In the [previous chapter](tutorial/deferred-transitions), we used deferred transitions to create the illusion of motion as elements move from one todo list to the other.
+In the [previous chapter](/tutorial/deferred-transitions), we used deferred transitions to create the illusion of motion as elements move from one todo list to the other.
To complete the illusion, we also need to apply motion to the elements that *aren't* transitioning. For this, we use the `animate` directive.
diff --git a/site/content/tutorial/12-actions/01-actions/app-a/App.svelte b/site/content/tutorial/12-actions/01-actions/app-a/App.svelte
index feacc44c52..40b4ea2673 100644
--- a/site/content/tutorial/12-actions/01-actions/app-a/App.svelte
+++ b/site/content/tutorial/12-actions/01-actions/app-a/App.svelte
@@ -1,29 +1,16 @@
+ (showModal = true)}>Show Modal
+{#if showModal}
+ (showModal = false)}>
+ Click outside me!
+
+{/if}
+
-
-
\ No newline at end of file
diff --git a/site/content/tutorial/12-actions/01-actions/app-a/pannable.js b/site/content/tutorial/12-actions/01-actions/app-a/click_outside.js
similarity index 69%
rename from site/content/tutorial/12-actions/01-actions/app-a/pannable.js
rename to site/content/tutorial/12-actions/01-actions/app-a/click_outside.js
index 332cd3e147..c406f6e95c 100644
--- a/site/content/tutorial/12-actions/01-actions/app-a/pannable.js
+++ b/site/content/tutorial/12-actions/01-actions/app-a/click_outside.js
@@ -1,4 +1,4 @@
-export function pannable(node) {
+export function clickOutside(node) {
// setup work goes here...
return {
@@ -6,4 +6,4 @@ export function pannable(node) {
// ...cleanup goes here
}
};
-}
\ No newline at end of file
+}
diff --git a/site/content/tutorial/12-actions/01-actions/app-b/App.svelte b/site/content/tutorial/12-actions/01-actions/app-b/App.svelte
index 171f82762c..bd990a5360 100644
--- a/site/content/tutorial/12-actions/01-actions/app-b/App.svelte
+++ b/site/content/tutorial/12-actions/01-actions/app-b/App.svelte
@@ -1,30 +1,16 @@
+ (showModal = true)}>Show Modal
+{#if showModal}
+ (showModal = false)}>
+ Click outside me!
+
+{/if}
+
-
-
\ No newline at end of file
diff --git a/site/content/tutorial/12-actions/01-actions/app-b/click_outside.js b/site/content/tutorial/12-actions/01-actions/app-b/click_outside.js
new file mode 100644
index 0000000000..e8983c1457
--- /dev/null
+++ b/site/content/tutorial/12-actions/01-actions/app-b/click_outside.js
@@ -0,0 +1,15 @@
+export function clickOutside(node) {
+ const handleClick = (event) => {
+ if (!node.contains(event.target)) {
+ node.dispatchEvent(new CustomEvent("outclick"));
+ }
+ };
+
+ document.addEventListener("click", handleClick, true);
+
+ return {
+ destroy() {
+ document.removeEventListener("click", handleClick, true);
+ }
+ };
+}
diff --git a/site/content/tutorial/12-actions/01-actions/app-b/pannable.js b/site/content/tutorial/12-actions/01-actions/app-b/pannable.js
deleted file mode 100644
index f7d15328be..0000000000
--- a/site/content/tutorial/12-actions/01-actions/app-b/pannable.js
+++ /dev/null
@@ -1,47 +0,0 @@
-export function pannable(node) {
- let x;
- let y;
-
- function handleMousedown(event) {
- x = event.clientX;
- y = event.clientY;
-
- node.dispatchEvent(new CustomEvent('panstart', {
- detail: { x, y }
- }));
-
- window.addEventListener('mousemove', handleMousemove);
- window.addEventListener('mouseup', handleMouseup);
- }
-
- function handleMousemove(event) {
- const dx = event.clientX - x;
- const dy = event.clientY - y;
- x = event.clientX;
- y = event.clientY;
-
- node.dispatchEvent(new CustomEvent('panmove', {
- detail: { x, y, dx, dy }
- }));
- }
-
- function handleMouseup(event) {
- x = event.clientX;
- y = event.clientY;
-
- node.dispatchEvent(new CustomEvent('panend', {
- detail: { x, y }
- }));
-
- window.removeEventListener('mousemove', handleMousemove);
- window.removeEventListener('mouseup', handleMouseup);
- }
-
- node.addEventListener('mousedown', handleMousedown);
-
- return {
- destroy() {
- node.removeEventListener('mousedown', handleMousedown);
- }
- };
-}
\ No newline at end of file
diff --git a/site/content/tutorial/12-actions/01-actions/text.md b/site/content/tutorial/12-actions/01-actions/text.md
index 3706b31e7c..dfe75c192f 100644
--- a/site/content/tutorial/12-actions/01-actions/text.md
+++ b/site/content/tutorial/12-actions/01-actions/text.md
@@ -4,85 +4,45 @@ title: The use directive
Actions are essentially element-level lifecycle functions. They're useful for things like:
-* interfacing with third-party libraries
-* lazy-loaded images
-* tooltips
-* adding custom event handlers
+- interfacing with third-party libraries
+- lazy-loaded images
+- tooltips
+- adding custom event handlers
-In this app, we want to make the orange box 'pannable'. It has event handlers for the `panstart`, `panmove` and `panend` events, but these aren't native DOM events. We have to dispatch them ourselves. First, import the `pannable` function...
+In this app, we want to make the orange modal close when the user clicks outside it. It has an event handler for the `outclick` event, but it isn't a native DOM event. We have to dispatch it ourselves. First, import the `clickOutside` function...
```js
-import { pannable } from './pannable.js';
+import { clickOutside } from "./click_outside.js";
```
...then use it with the element:
```html
-
+
+ Click outside me!
+
```
-Open the `pannable.js` file. Like transition functions, an action function receives a `node` and some optional parameters, and returns an action object. That object can have a `destroy` function, which is called when the element is unmounted.
+Open the `click_outside.js` file. Like transition functions, an action function receives a `node` (which is the element that the action is applied to) and some optional parameters, and returns an action object. That object can have a `destroy` function, which is called when the element is unmounted.
-We want to fire `panstart` event when the user mouses down on the element, `panmove` events (with `dx` and `dy` properties showing how far the mouse moved) when they drag it, and `panend` events when they mouse up. One possible implementation looks like this:
+We want to fire the `outclick` event when the user clicks outside the orange box. One possible implementation looks like this:
```js
-export function pannable(node) {
- let x;
- let y;
-
- function handleMousedown(event) {
- x = event.clientX;
- y = event.clientY;
-
- node.dispatchEvent(new CustomEvent('panstart', {
- detail: { x, y }
- }));
-
- window.addEventListener('mousemove', handleMousemove);
- window.addEventListener('mouseup', handleMouseup);
- }
-
- function handleMousemove(event) {
- const dx = event.clientX - x;
- const dy = event.clientY - y;
- x = event.clientX;
- y = event.clientY;
-
- node.dispatchEvent(new CustomEvent('panmove', {
- detail: { x, y, dx, dy }
- }));
- }
-
- function handleMouseup(event) {
- x = event.clientX;
- y = event.clientY;
-
- node.dispatchEvent(new CustomEvent('panend', {
- detail: { x, y }
- }));
-
- window.removeEventListener('mousemove', handleMousemove);
- window.removeEventListener('mouseup', handleMouseup);
- }
+export function clickOutside(node) {
+ const handleClick = (event) => {
+ if (!node.contains(event.target)) {
+ node.dispatchEvent(new CustomEvent("outclick"));
+ }
+ };
- node.addEventListener('mousedown', handleMousedown);
+ document.addEventListener("click", handleClick, true);
return {
destroy() {
- node.removeEventListener('mousedown', handleMousedown);
- }
+ document.removeEventListener("click", handleClick, true);
+ },
};
}
```
-Update the `pannable` function and try moving the box around.
-
-> This implementation is for demonstration purposes — a more complete one would also consider touch events.
+Update the `clickOutside` function, click the button to show the modal and then click outside it to close it.
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..af21dbf379 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
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..6f07d2aecb 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
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`;
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
\ 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`;
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
\ 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..e94bd3f0cd 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
@@ -1,5 +1,5 @@
+
+
+
+
+
+
+ {#if map}
+
+ {/if}
+
+
-
-
- {#if map}
-
- {/if}
-
\ 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..bd4010e765 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
@@ -1,9 +1,9 @@
+
+
+
+
+
+
+ {#if map}
+
+ {/if}
+
+
-
-
- {#if map}
-
- {/if}
-
\ No newline at end of file
diff --git a/site/content/tutorial/15-context/01-context-api/text.md b/site/content/tutorial/15-context/01-context-api/text.md
index 96a716dfb0..efb6157652 100644
--- a/site/content/tutorial/15-context/01-context-api/text.md
+++ b/site/content/tutorial/15-context/01-context-api/text.md
@@ -11,7 +11,7 @@ There are two halves to the context API — `setContext` and `getContext`. If a
Let's set the context first. In `Map.svelte`, import `setContext` from `svelte` and `key` from `mapbox.js` and call `setContext`:
```js
-import { onMount, setContext } from 'svelte';
+import { onDestroy, setContext } from 'svelte';
import { mapbox, key } from './mapbox.js';
setContext(key, {
@@ -19,7 +19,7 @@ setContext(key, {
});
```
-The context object can be anything you like. Like [lifecycle functions](tutorial/onmount), `setContext` and `getContext` must be called during component initialisation; since `map` isn't created until the component has mounted, our context object contains a `getMap` function rather than `map` itself.
+The context object can be anything you like. Like [lifecycle functions](/tutorial/onmount), `setContext` and `getContext` must be called during component initialisation. Calling it afterwards - for example inside `onMount` - will throw an error. In this example, since `map` isn't created until the component has mounted, our context object contains a `getMap` function rather than `map` itself.
On the other side of the equation, in `MapMarker.svelte`, we can now get a reference to the Mapbox instance:
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/app-a/App.svelte b/site/content/tutorial/16-special-elements/01-svelte-self/app-a/App.svelte
index ff02fa6a42..de0b2e0179 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/app-a/App.svelte
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/app-a/App.svelte
@@ -3,39 +3,35 @@
let root = [
{
- type: 'folder',
name: 'Important work stuff',
files: [
- { type: 'file', name: 'quarterly-results.xlsx' }
+ { name: 'quarterly-results.xlsx' }
]
},
{
- type: 'folder',
name: 'Animal GIFs',
files: [
{
- type: 'folder',
name: 'Dogs',
files: [
- { type: 'file', name: 'treadmill.gif' },
- { type: 'file', name: 'rope-jumping.gif' }
+ { name: 'treadmill.gif' },
+ { name: 'rope-jumping.gif' }
]
},
{
- type: 'folder',
name: 'Goats',
files: [
- { type: 'file', name: 'parkour.gif' },
- { type: 'file', name: 'rampage.gif' }
+ { name: 'parkour.gif' },
+ { name: 'rampage.gif' }
]
},
- { type: 'file', name: 'cat-roomba.gif' },
- { type: 'file', name: 'duck-shuffle.gif' },
- { type: 'file', name: 'monkey-on-a-pig.gif' }
+ { name: 'cat-roomba.gif' },
+ { name: 'duck-shuffle.gif' },
+ { name: 'monkey-on-a-pig.gif' }
]
},
- { type: 'file', name: 'TODO.md' }
+ { name: 'TODO.md' }
];
-
\ 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..e769ab4841 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,6 +3,8 @@
$: type = name.slice(name.lastIndexOf('.') + 1);
+{name}
+
-
-{name}
\ 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..e93ffdc548 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,17 +10,33 @@
}
+{name}
+
+{#if expanded}
+
+ {#each files as file}
+
+ {#if file.files}
+
+ {:else}
+
+ {/if}
+
+ {/each}
+
+{/if}
+
-
-{name}
-
-{#if expanded}
-
- {#each files as file}
-
- {#if file.type === 'folder'}
-
- {:else}
-
- {/if}
-
- {/each}
-
-{/if}
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/app-b/App.svelte b/site/content/tutorial/16-special-elements/01-svelte-self/app-b/App.svelte
index ff02fa6a42..de0b2e0179 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/app-b/App.svelte
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/app-b/App.svelte
@@ -3,39 +3,35 @@
let root = [
{
- type: 'folder',
name: 'Important work stuff',
files: [
- { type: 'file', name: 'quarterly-results.xlsx' }
+ { name: 'quarterly-results.xlsx' }
]
},
{
- type: 'folder',
name: 'Animal GIFs',
files: [
{
- type: 'folder',
name: 'Dogs',
files: [
- { type: 'file', name: 'treadmill.gif' },
- { type: 'file', name: 'rope-jumping.gif' }
+ { name: 'treadmill.gif' },
+ { name: 'rope-jumping.gif' }
]
},
{
- type: 'folder',
name: 'Goats',
files: [
- { type: 'file', name: 'parkour.gif' },
- { type: 'file', name: 'rampage.gif' }
+ { name: 'parkour.gif' },
+ { name: 'rampage.gif' }
]
},
- { type: 'file', name: 'cat-roomba.gif' },
- { type: 'file', name: 'duck-shuffle.gif' },
- { type: 'file', name: 'monkey-on-a-pig.gif' }
+ { name: 'cat-roomba.gif' },
+ { name: 'duck-shuffle.gif' },
+ { name: 'monkey-on-a-pig.gif' }
]
},
- { type: 'file', name: 'TODO.md' }
+ { name: 'TODO.md' }
];
-
\ 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..e769ab4841 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,6 +3,8 @@
$: type = name.slice(name.lastIndexOf('.') + 1);
+{name}
+
-
-{name}
\ 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..d3fc3a431f 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,17 +10,33 @@
}
+{name}
+
+{#if expanded}
+
+ {#each files as file}
+
+ {#if file.files}
+
+ {:else}
+
+ {/if}
+
+ {/each}
+
+{/if}
+
-
-{name}
-
-{#if expanded}
-
- {#each files as file}
-
- {#if file.type === 'folder'}
-
- {:else}
-
- {/if}
-
- {/each}
-
-{/if}
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/text.md b/site/content/tutorial/16-special-elements/01-svelte-self/text.md
index c7946f6c6d..894a8efc3d 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/text.md
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/text.md
@@ -7,7 +7,7 @@ Svelte provides a variety of built-in elements. The first, ``, allo
It's useful for things like this folder tree view, where folders can contain *other* folders. In `Folder.svelte` we want to be able to do this...
```html
-{#if file.type === 'folder'}
+{#if file.files}
{:else}
@@ -17,7 +17,7 @@ It's useful for things like this folder tree view, where folders can contain *ot
...but that's impossible, because a module can't import itself. Instead, we use ``:
```html
-{#if file.type === 'folder'}
+{#if file.files}
{:else}
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/03-svelte-window/text.md b/site/content/tutorial/16-special-elements/03-svelte-window/text.md
index b581b3ada4..ea01dd3bdf 100644
--- a/site/content/tutorial/16-special-elements/03-svelte-window/text.md
+++ b/site/content/tutorial/16-special-elements/03-svelte-window/text.md
@@ -4,10 +4,10 @@ title:
Just as you can add event listeners to any DOM element, you can add event listeners to the `window` object with ``.
-On line 33, add the `keydown` listener:
+On line 11, add the `keydown` listener:
```html
```
-> As with DOM elements, you can add [event modifiers](tutorial/event-modifiers) like `preventDefault`.
+> As with DOM elements, you can add [event modifiers](/tutorial/event-modifiers) like `preventDefault`.
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/05-svelte-body/app-a/App.svelte b/site/content/tutorial/16-special-elements/05-svelte-body/app-a/App.svelte
index ad616582e5..e74bcc6a4c 100644
--- a/site/content/tutorial/16-special-elements/05-svelte-body/app-a/App.svelte
+++ b/site/content/tutorial/16-special-elements/05-svelte-body/app-a/App.svelte
@@ -5,6 +5,15 @@
const handleMouseleave = () => hereKitty = false;
+
+
+
+
+
-
-
-
-
-
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/05-svelte-body/app-b/App.svelte b/site/content/tutorial/16-special-elements/05-svelte-body/app-b/App.svelte
index ac946962eb..fddc8f8d0a 100644
--- a/site/content/tutorial/16-special-elements/05-svelte-body/app-b/App.svelte
+++ b/site/content/tutorial/16-special-elements/05-svelte-body/app-b/App.svelte
@@ -5,6 +5,18 @@
const handleMouseleave = () => hereKitty = false;
+
+
+
+
+
-
-
-
-
-
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/06-svelte-head/app-b/App.svelte b/site/content/tutorial/16-special-elements/06-svelte-head/app-b/App.svelte
index 38089c9fdd..8323b56ad0 100644
--- a/site/content/tutorial/16-special-elements/06-svelte-head/app-b/App.svelte
+++ b/site/content/tutorial/16-special-elements/06-svelte-head/app-b/App.svelte
@@ -1,5 +1,5 @@
-
+
-Hello world!
\ No newline at end of file
+Hello world!
diff --git a/site/content/tutorial/16-special-elements/06-svelte-head/text.md b/site/content/tutorial/16-special-elements/06-svelte-head/text.md
index 22dcc7fdab..a7876b9cbf 100644
--- a/site/content/tutorial/16-special-elements/06-svelte-head/text.md
+++ b/site/content/tutorial/16-special-elements/06-svelte-head/text.md
@@ -6,7 +6,7 @@ The `` element allows you to insert elements inside the `` of
```html
-
+
```
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/07-svelte-options/text.md b/site/content/tutorial/16-special-elements/07-svelte-options/text.md
index 60a9d3b0f8..1a0105a09a 100644
--- a/site/content/tutorial/16-special-elements/07-svelte-options/text.md
+++ b/site/content/tutorial/16-special-elements/07-svelte-options/text.md
@@ -2,7 +2,7 @@
title:
---
-Lastly, `` allows you to specify compiler options.
+The `` element allows you to specify compiler options.
We'll use the `immutable` option as an example. In this app, the `` component flashes whenever it receives new data. Clicking on one of the items toggles its `done` state by creating an updated `todos` array. This causes the *other* `` items to flash, even though they don't end up making any changes to the DOM.
@@ -27,4 +27,4 @@ The options that can be set here are:
* `namespace="..."` — the namespace where this component will be used, most commonly `"svg"`
* `tag="..."` — the name to use when compiling this component as a custom element
-Consult the [API reference](docs) for more information on these options.
\ No newline at end of file
+Consult the [API reference](/docs) for more information on these options.
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
new file mode 100644
index 0000000000..442ff07d26
--- /dev/null
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/App.svelte
@@ -0,0 +1,10 @@
+
+
+
+
+
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
new file mode 100644
index 0000000000..ed389182a7
--- /dev/null
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/Box.svelte
@@ -0,0 +1,20 @@
+
+
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
new file mode 100644
index 0000000000..e66b026d90
--- /dev/null
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/App.svelte
@@ -0,0 +1,10 @@
+
+
+
+
+ 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
new file mode 100644
index 0000000000..ed389182a7
--- /dev/null
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/Box.svelte
@@ -0,0 +1,20 @@
+
+
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
new file mode 100644
index 0000000000..2103404799
--- /dev/null
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/text.md
@@ -0,0 +1,35 @@
+---
+title:
+---
+
+The `` element allows you to place content in a named slot without wrapping it in a container DOM element. This keeps the flow layout of your document intact.
+
+In the example notice how we applied a flex layout with a gap of `1em` to the box.
+
+```sv
+
+
+
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.
+
+We can solve this by changing `` in the `App` component. Replace the `
` with `
`:
+
+```sv
+
+ All rights reserved.
+ Copyright (c) 2019 Svelte Industries
+
+```
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..9ce2dd648d 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
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..5b8256463e 100644
--- a/site/content/tutorial/19-next-steps/01-congratulations/text.md
+++ b/site/content/tutorial/19-next-steps/01-congratulations/text.md
@@ -2,10 +2,10 @@
title: Congratulations!
---
-You've now finished the Svelte tutorial and are ready to start building apps. You can refer back to individual chapters at any time (click the title above to reveal a dropdown) or continue your learning via the [API reference](docs), [Examples](examples) and [Blog](blog). If you're a Twitter user, you can get updates via [@sveltejs](https://twitter.com/sveltejs).
+You've now finished the Svelte tutorial and are ready to start building apps. You can refer back to individual chapters at any time (click the title above to reveal a dropdown) or continue your learning via the [API reference](/docs), [Examples](/examples) and [Blog](/blog). If you're a Twitter user, you can get updates via [@sveltejs](https://twitter.com/sveltejs).
-To get set up in your local development environment, check out [the quickstart guide](blog/the-easiest-way-to-get-started).
+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](https://svelte.dev/chat). That's where you'll find fellow Svelte users, and it's where we plan the future of the framework.
diff --git a/site/migrations/000-create-users.js b/site/migrations/000-create-users.js
deleted file mode 100644
index 76dde745a2..0000000000
--- a/site/migrations/000-create-users.js
+++ /dev/null
@@ -1,25 +0,0 @@
-exports.up = DB => {
- DB.sql(`
- create table if not exists users (
- id serial primary key,
- uid character varying(255) not null unique,
- name character varying(255),
- username character varying(255) not null,
- avatar text,
- github_token character varying(255),
- created_at timestamp with time zone NOT NULL DEFAULT now(),
- updated_at timestamp with time zone
- );
-
- create unique index if not exists users_pkey ON users(id int4_ops);
- create unique index if not exists users_uid_key ON users(uid text_ops);
- `);
-};
-
-exports.down = DB => {
- DB.sql(`
- drop table if exists users cascade;
- drop index if exists users_uid_key;
- drop index if exists users_pkey;
- `);
-};
diff --git a/site/migrations/001-create-gists.js b/site/migrations/001-create-gists.js
deleted file mode 100644
index 22293f5737..0000000000
--- a/site/migrations/001-create-gists.js
+++ /dev/null
@@ -1,24 +0,0 @@
-exports.up = DB => {
- DB.sql(`
- create table if not exists gists (
- id serial primary key,
- uid uuid NOT NULL DEFAULT gen_random_uuid(),
- user_id integer REFERENCES users(id) not null,
- name character varying(255) not null,
- files json not null,
- created_at timestamp with time zone NOT NULL DEFAULT now(),
- updated_at timestamp with time zone
- );
-
- create unique index if not exists gists_pkey ON gists(id int4_ops);
- create index if not exists gists_user_id_key ON gists(user_id int4_ops);
- `);
-};
-
-exports.down = DB => {
- DB.sql(`
- drop table if exists gists cascade;
- drop index if exists gists_user_id_key;
- drop index if exists gists_pkey;
- `);
-};
diff --git a/site/migrations/002-create-sessions.js b/site/migrations/002-create-sessions.js
deleted file mode 100644
index c24fc69115..0000000000
--- a/site/migrations/002-create-sessions.js
+++ /dev/null
@@ -1,15 +0,0 @@
-exports.up = DB => {
- DB.sql(`
- create table if not exists sessions (
- uid uuid NOT NULL PRIMARY KEY DEFAULT gen_random_uuid(),
- user_id integer REFERENCES users(id) not null,
- expiry timestamp without time zone DEFAULT now() + interval '1 year'
- );
- `);
-};
-
-exports.down = DB => {
- DB.sql(`
- drop table if exists sessions;
- `);
-};
diff --git a/site/package-lock.json b/site/package-lock.json
deleted file mode 100644
index 19166e56da..0000000000
--- a/site/package-lock.json
+++ /dev/null
@@ -1,4014 +0,0 @@
-{
- "name": "svelte.dev",
- "version": "1.0.0",
- "lockfileVersion": 1,
- "requires": true,
- "dependencies": {
- "@babel/code-frame": {
- "version": "7.12.11",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz",
- "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==",
- "dev": true,
- "requires": {
- "@babel/highlight": "^7.10.4"
- }
- },
- "@babel/compat-data": {
- "version": "7.12.7",
- "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.7.tgz",
- "integrity": "sha512-YaxPMGs/XIWtYqrdEOZOCPsVWfEoriXopnsz3/i7apYPXQ3698UFhS6dVT1KN5qOsWmVgw/FOrmQgpRaZayGsw==",
- "dev": true
- },
- "@babel/core": {
- "version": "7.12.10",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.10.tgz",
- "integrity": "sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w==",
- "dev": true,
- "requires": {
- "@babel/code-frame": "^7.10.4",
- "@babel/generator": "^7.12.10",
- "@babel/helper-module-transforms": "^7.12.1",
- "@babel/helpers": "^7.12.5",
- "@babel/parser": "^7.12.10",
- "@babel/template": "^7.12.7",
- "@babel/traverse": "^7.12.10",
- "@babel/types": "^7.12.10",
- "convert-source-map": "^1.7.0",
- "debug": "^4.1.0",
- "gensync": "^1.0.0-beta.1",
- "json5": "^2.1.2",
- "lodash": "^4.17.19",
- "semver": "^5.4.1",
- "source-map": "^0.5.0"
- }
- },
- "@babel/generator": {
- "version": "7.12.11",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz",
- "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==",
- "dev": true,
- "requires": {
- "@babel/types": "^7.12.11",
- "jsesc": "^2.5.1",
- "source-map": "^0.5.0"
- }
- },
- "@babel/helper-annotate-as-pure": {
- "version": "7.12.10",
- "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.10.tgz",
- "integrity": "sha512-XplmVbC1n+KY6jL8/fgLVXXUauDIB+lD5+GsQEh6F6GBF1dq1qy4DP4yXWzDKcoqXB3X58t61e85Fitoww4JVQ==",
- "dev": true,
- "requires": {
- "@babel/types": "^7.12.10"
- }
- },
- "@babel/helper-builder-binary-assignment-operator-visitor": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz",
- "integrity": "sha512-L0zGlFrGWZK4PbT8AszSfLTM5sDU1+Az/En9VrdT8/LmEiJt4zXt+Jve9DCAnQcbqDhCI+29y/L93mrDzddCcg==",
- "dev": true,
- "requires": {
- "@babel/helper-explode-assignable-expression": "^7.10.4",
- "@babel/types": "^7.10.4"
- }
- },
- "@babel/helper-compilation-targets": {
- "version": "7.12.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz",
- "integrity": "sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw==",
- "dev": true,
- "requires": {
- "@babel/compat-data": "^7.12.5",
- "@babel/helper-validator-option": "^7.12.1",
- "browserslist": "^4.14.5",
- "semver": "^5.5.0"
- }
- },
- "@babel/helper-create-class-features-plugin": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz",
- "integrity": "sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w==",
- "dev": true,
- "requires": {
- "@babel/helper-function-name": "^7.10.4",
- "@babel/helper-member-expression-to-functions": "^7.12.1",
- "@babel/helper-optimise-call-expression": "^7.10.4",
- "@babel/helper-replace-supers": "^7.12.1",
- "@babel/helper-split-export-declaration": "^7.10.4"
- }
- },
- "@babel/helper-create-regexp-features-plugin": {
- "version": "7.12.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.7.tgz",
- "integrity": "sha512-idnutvQPdpbduutvi3JVfEgcVIHooQnhvhx0Nk9isOINOIGYkZea1Pk2JlJRiUnMefrlvr0vkByATBY/mB4vjQ==",
- "dev": true,
- "requires": {
- "@babel/helper-annotate-as-pure": "^7.10.4",
- "regexpu-core": "^4.7.1"
- }
- },
- "@babel/helper-define-map": {
- "version": "7.10.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.5.tgz",
- "integrity": "sha512-fMw4kgFB720aQFXSVaXr79pjjcW5puTCM16+rECJ/plGS+zByelE8l9nCpV1GibxTnFVmUuYG9U8wYfQHdzOEQ==",
- "dev": true,
- "requires": {
- "@babel/helper-function-name": "^7.10.4",
- "@babel/types": "^7.10.5",
- "lodash": "^4.17.19"
- }
- },
- "@babel/helper-explode-assignable-expression": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.12.1.tgz",
- "integrity": "sha512-dmUwH8XmlrUpVqgtZ737tK88v07l840z9j3OEhCLwKTkjlvKpfqXVIZ0wpK3aeOxspwGrf/5AP5qLx4rO3w5rA==",
- "dev": true,
- "requires": {
- "@babel/types": "^7.12.1"
- }
- },
- "@babel/helper-function-name": {
- "version": "7.12.11",
- "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz",
- "integrity": "sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA==",
- "dev": true,
- "requires": {
- "@babel/helper-get-function-arity": "^7.12.10",
- "@babel/template": "^7.12.7",
- "@babel/types": "^7.12.11"
- }
- },
- "@babel/helper-get-function-arity": {
- "version": "7.12.10",
- "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz",
- "integrity": "sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag==",
- "dev": true,
- "requires": {
- "@babel/types": "^7.12.10"
- }
- },
- "@babel/helper-hoist-variables": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz",
- "integrity": "sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA==",
- "dev": true,
- "requires": {
- "@babel/types": "^7.10.4"
- }
- },
- "@babel/helper-member-expression-to-functions": {
- "version": "7.12.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz",
- "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==",
- "dev": true,
- "requires": {
- "@babel/types": "^7.12.7"
- }
- },
- "@babel/helper-module-imports": {
- "version": "7.12.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz",
- "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==",
- "dev": true,
- "requires": {
- "@babel/types": "^7.12.5"
- }
- },
- "@babel/helper-module-transforms": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz",
- "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==",
- "dev": true,
- "requires": {
- "@babel/helper-module-imports": "^7.12.1",
- "@babel/helper-replace-supers": "^7.12.1",
- "@babel/helper-simple-access": "^7.12.1",
- "@babel/helper-split-export-declaration": "^7.11.0",
- "@babel/helper-validator-identifier": "^7.10.4",
- "@babel/template": "^7.10.4",
- "@babel/traverse": "^7.12.1",
- "@babel/types": "^7.12.1",
- "lodash": "^4.17.19"
- }
- },
- "@babel/helper-optimise-call-expression": {
- "version": "7.12.10",
- "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.10.tgz",
- "integrity": "sha512-4tpbU0SrSTjjt65UMWSrUOPZTsgvPgGG4S8QSTNHacKzpS51IVWGDj0yCwyeZND/i+LSN2g/O63jEXEWm49sYQ==",
- "dev": true,
- "requires": {
- "@babel/types": "^7.12.10"
- }
- },
- "@babel/helper-plugin-utils": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz",
- "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==",
- "dev": true
- },
- "@babel/helper-remap-async-to-generator": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.12.1.tgz",
- "integrity": "sha512-9d0KQCRM8clMPcDwo8SevNs+/9a8yWVVmaE80FGJcEP8N1qToREmWEGnBn8BUlJhYRFz6fqxeRL1sl5Ogsed7A==",
- "dev": true,
- "requires": {
- "@babel/helper-annotate-as-pure": "^7.10.4",
- "@babel/helper-wrap-function": "^7.10.4",
- "@babel/types": "^7.12.1"
- }
- },
- "@babel/helper-replace-supers": {
- "version": "7.12.11",
- "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.11.tgz",
- "integrity": "sha512-q+w1cqmhL7R0FNzth/PLLp2N+scXEK/L2AHbXUyydxp828F4FEa5WcVoqui9vFRiHDQErj9Zof8azP32uGVTRA==",
- "dev": true,
- "requires": {
- "@babel/helper-member-expression-to-functions": "^7.12.7",
- "@babel/helper-optimise-call-expression": "^7.12.10",
- "@babel/traverse": "^7.12.10",
- "@babel/types": "^7.12.11"
- }
- },
- "@babel/helper-simple-access": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz",
- "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==",
- "dev": true,
- "requires": {
- "@babel/types": "^7.12.1"
- }
- },
- "@babel/helper-skip-transparent-expression-wrappers": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz",
- "integrity": "sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA==",
- "dev": true,
- "requires": {
- "@babel/types": "^7.12.1"
- }
- },
- "@babel/helper-split-export-declaration": {
- "version": "7.12.11",
- "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz",
- "integrity": "sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g==",
- "dev": true,
- "requires": {
- "@babel/types": "^7.12.11"
- }
- },
- "@babel/helper-validator-identifier": {
- "version": "7.12.11",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz",
- "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==",
- "dev": true
- },
- "@babel/helper-validator-option": {
- "version": "7.12.11",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.11.tgz",
- "integrity": "sha512-TBFCyj939mFSdeX7U7DDj32WtzYY7fDcalgq8v3fBZMNOJQNn7nOYzMaUCiPxPYfCup69mtIpqlKgMZLvQ8Xhw==",
- "dev": true
- },
- "@babel/helper-wrap-function": {
- "version": "7.12.3",
- "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.12.3.tgz",
- "integrity": "sha512-Cvb8IuJDln3rs6tzjW3Y8UeelAOdnpB8xtQ4sme2MSZ9wOxrbThporC0y/EtE16VAtoyEfLM404Xr1e0OOp+ow==",
- "dev": true,
- "requires": {
- "@babel/helper-function-name": "^7.10.4",
- "@babel/template": "^7.10.4",
- "@babel/traverse": "^7.10.4",
- "@babel/types": "^7.10.4"
- }
- },
- "@babel/helpers": {
- "version": "7.12.5",
- "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz",
- "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==",
- "dev": true,
- "requires": {
- "@babel/template": "^7.10.4",
- "@babel/traverse": "^7.12.5",
- "@babel/types": "^7.12.5"
- }
- },
- "@babel/highlight": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz",
- "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==",
- "dev": true,
- "requires": {
- "@babel/helper-validator-identifier": "^7.10.4",
- "chalk": "^2.0.0",
- "js-tokens": "^4.0.0"
- }
- },
- "@babel/parser": {
- "version": "7.12.11",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.11.tgz",
- "integrity": "sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg==",
- "dev": true
- },
- "@babel/plugin-proposal-async-generator-functions": {
- "version": "7.12.12",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.12.12.tgz",
- "integrity": "sha512-nrz9y0a4xmUrRq51bYkWJIO5SBZyG2ys2qinHsN0zHDHVsUaModrkpyWWWXfGqYQmOL3x9sQIcTNN/pBGpo09A==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/helper-remap-async-to-generator": "^7.12.1",
- "@babel/plugin-syntax-async-generators": "^7.8.0"
- }
- },
- "@babel/plugin-proposal-class-properties": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.12.1.tgz",
- "integrity": "sha512-cKp3dlQsFsEs5CWKnN7BnSHOd0EOW8EKpEjkoz1pO2E5KzIDNV9Ros1b0CnmbVgAGXJubOYVBOGCT1OmJwOI7w==",
- "dev": true,
- "requires": {
- "@babel/helper-create-class-features-plugin": "^7.12.1",
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-proposal-dynamic-import": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.12.1.tgz",
- "integrity": "sha512-a4rhUSZFuq5W8/OO8H7BL5zspjnc1FLd9hlOxIK/f7qG4a0qsqk8uvF/ywgBA8/OmjsapjpvaEOYItfGG1qIvQ==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/plugin-syntax-dynamic-import": "^7.8.0"
- }
- },
- "@babel/plugin-proposal-export-namespace-from": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.1.tgz",
- "integrity": "sha512-6CThGf0irEkzujYS5LQcjBx8j/4aQGiVv7J9+2f7pGfxqyKh3WnmVJYW3hdrQjyksErMGBPQrCnHfOtna+WLbw==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/plugin-syntax-export-namespace-from": "^7.8.3"
- }
- },
- "@babel/plugin-proposal-json-strings": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.12.1.tgz",
- "integrity": "sha512-GoLDUi6U9ZLzlSda2Df++VSqDJg3CG+dR0+iWsv6XRw1rEq+zwt4DirM9yrxW6XWaTpmai1cWJLMfM8qQJf+yw==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/plugin-syntax-json-strings": "^7.8.0"
- }
- },
- "@babel/plugin-proposal-logical-assignment-operators": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.12.1.tgz",
- "integrity": "sha512-k8ZmVv0JU+4gcUGeCDZOGd0lCIamU/sMtIiX3UWnUc5yzgq6YUGyEolNYD+MLYKfSzgECPcqetVcJP9Afe/aCA==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4"
- }
- },
- "@babel/plugin-proposal-nullish-coalescing-operator": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.12.1.tgz",
- "integrity": "sha512-nZY0ESiaQDI1y96+jk6VxMOaL4LPo/QDHBqL+SF3/vl6dHkTwHlOI8L4ZwuRBHgakRBw5zsVylel7QPbbGuYgg==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0"
- }
- },
- "@babel/plugin-proposal-numeric-separator": {
- "version": "7.12.7",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.7.tgz",
- "integrity": "sha512-8c+uy0qmnRTeukiGsjLGy6uVs/TFjJchGXUeBqlG4VWYOdJWkhhVPdQ3uHwbmalfJwv2JsV0qffXP4asRfL2SQ==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/plugin-syntax-numeric-separator": "^7.10.4"
- }
- },
- "@babel/plugin-proposal-object-rest-spread": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz",
- "integrity": "sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/plugin-syntax-object-rest-spread": "^7.8.0",
- "@babel/plugin-transform-parameters": "^7.12.1"
- }
- },
- "@babel/plugin-proposal-optional-catch-binding": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.12.1.tgz",
- "integrity": "sha512-hFvIjgprh9mMw5v42sJWLI1lzU5L2sznP805zeT6rySVRA0Y18StRhDqhSxlap0oVgItRsB6WSROp4YnJTJz0g==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/plugin-syntax-optional-catch-binding": "^7.8.0"
- }
- },
- "@babel/plugin-proposal-optional-chaining": {
- "version": "7.12.7",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.7.tgz",
- "integrity": "sha512-4ovylXZ0PWmwoOvhU2vhnzVNnm88/Sm9nx7V8BPgMvAzn5zDou3/Awy0EjglyubVHasJj+XCEkr/r1X3P5elCA==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1",
- "@babel/plugin-syntax-optional-chaining": "^7.8.0"
- }
- },
- "@babel/plugin-proposal-private-methods": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.12.1.tgz",
- "integrity": "sha512-mwZ1phvH7/NHK6Kf8LP7MYDogGV+DKB1mryFOEwx5EBNQrosvIczzZFTUmWaeujd5xT6G1ELYWUz3CutMhjE1w==",
- "dev": true,
- "requires": {
- "@babel/helper-create-class-features-plugin": "^7.12.1",
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-proposal-unicode-property-regex": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.1.tgz",
- "integrity": "sha512-MYq+l+PvHuw/rKUz1at/vb6nCnQ2gmJBNaM62z0OgH7B2W1D9pvkpYtlti9bGtizNIU1K3zm4bZF9F91efVY0w==",
- "dev": true,
- "requires": {
- "@babel/helper-create-regexp-features-plugin": "^7.12.1",
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-syntax-async-generators": {
- "version": "7.8.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz",
- "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.8.0"
- }
- },
- "@babel/plugin-syntax-class-properties": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz",
- "integrity": "sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-syntax-dynamic-import": {
- "version": "7.8.3",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz",
- "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.8.0"
- }
- },
- "@babel/plugin-syntax-export-namespace-from": {
- "version": "7.8.3",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz",
- "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.8.3"
- }
- },
- "@babel/plugin-syntax-json-strings": {
- "version": "7.8.3",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz",
- "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.8.0"
- }
- },
- "@babel/plugin-syntax-logical-assignment-operators": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz",
- "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-syntax-nullish-coalescing-operator": {
- "version": "7.8.3",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz",
- "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.8.0"
- }
- },
- "@babel/plugin-syntax-numeric-separator": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz",
- "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-syntax-object-rest-spread": {
- "version": "7.8.3",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz",
- "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.8.0"
- }
- },
- "@babel/plugin-syntax-optional-catch-binding": {
- "version": "7.8.3",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz",
- "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.8.0"
- }
- },
- "@babel/plugin-syntax-optional-chaining": {
- "version": "7.8.3",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz",
- "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.8.0"
- }
- },
- "@babel/plugin-syntax-top-level-await": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz",
- "integrity": "sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-arrow-functions": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.12.1.tgz",
- "integrity": "sha512-5QB50qyN44fzzz4/qxDPQMBCTHgxg3n0xRBLJUmBlLoU/sFvxVWGZF/ZUfMVDQuJUKXaBhbupxIzIfZ6Fwk/0A==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-async-to-generator": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.12.1.tgz",
- "integrity": "sha512-SDtqoEcarK1DFlRJ1hHRY5HvJUj5kX4qmtpMAm2QnhOlyuMC4TMdCRgW6WXpv93rZeYNeLP22y8Aq2dbcDRM1A==",
- "dev": true,
- "requires": {
- "@babel/helper-module-imports": "^7.12.1",
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/helper-remap-async-to-generator": "^7.12.1"
- }
- },
- "@babel/plugin-transform-block-scoped-functions": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.1.tgz",
- "integrity": "sha512-5OpxfuYnSgPalRpo8EWGPzIYf0lHBWORCkj5M0oLBwHdlux9Ri36QqGW3/LR13RSVOAoUUMzoPI/jpE4ABcHoA==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-block-scoping": {
- "version": "7.12.12",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.12.tgz",
- "integrity": "sha512-VOEPQ/ExOVqbukuP7BYJtI5ZxxsmegTwzZ04j1aF0dkSypGo9XpDHuOrABsJu+ie+penpSJheDJ11x1BEZNiyQ==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-classes": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.12.1.tgz",
- "integrity": "sha512-/74xkA7bVdzQTBeSUhLLJgYIcxw/dpEpCdRDiHgPJ3Mv6uC11UhjpOhl72CgqbBCmt1qtssCyB2xnJm1+PFjog==",
- "dev": true,
- "requires": {
- "@babel/helper-annotate-as-pure": "^7.10.4",
- "@babel/helper-define-map": "^7.10.4",
- "@babel/helper-function-name": "^7.10.4",
- "@babel/helper-optimise-call-expression": "^7.10.4",
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/helper-replace-supers": "^7.12.1",
- "@babel/helper-split-export-declaration": "^7.10.4",
- "globals": "^11.1.0"
- }
- },
- "@babel/plugin-transform-computed-properties": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.12.1.tgz",
- "integrity": "sha512-vVUOYpPWB7BkgUWPo4C44mUQHpTZXakEqFjbv8rQMg7TC6S6ZhGZ3otQcRH6u7+adSlE5i0sp63eMC/XGffrzg==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-destructuring": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.12.1.tgz",
- "integrity": "sha512-fRMYFKuzi/rSiYb2uRLiUENJOKq4Gnl+6qOv5f8z0TZXg3llUwUhsNNwrwaT/6dUhJTzNpBr+CUvEWBtfNY1cw==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-dotall-regex": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.1.tgz",
- "integrity": "sha512-B2pXeRKoLszfEW7J4Hg9LoFaWEbr/kzo3teWHmtFCszjRNa/b40f9mfeqZsIDLLt/FjwQ6pz/Gdlwy85xNckBA==",
- "dev": true,
- "requires": {
- "@babel/helper-create-regexp-features-plugin": "^7.12.1",
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-duplicate-keys": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.1.tgz",
- "integrity": "sha512-iRght0T0HztAb/CazveUpUQrZY+aGKKaWXMJ4uf9YJtqxSUe09j3wteztCUDRHs+SRAL7yMuFqUsLoAKKzgXjw==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-exponentiation-operator": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.1.tgz",
- "integrity": "sha512-7tqwy2bv48q+c1EHbXK0Zx3KXd2RVQp6OC7PbwFNt/dPTAV3Lu5sWtWuAj8owr5wqtWnqHfl2/mJlUmqkChKug==",
- "dev": true,
- "requires": {
- "@babel/helper-builder-binary-assignment-operator-visitor": "^7.10.4",
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-for-of": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.12.1.tgz",
- "integrity": "sha512-Zaeq10naAsuHo7heQvyV0ptj4dlZJwZgNAtBYBnu5nNKJoW62m0zKcIEyVECrUKErkUkg6ajMy4ZfnVZciSBhg==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-function-name": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.1.tgz",
- "integrity": "sha512-JF3UgJUILoFrFMEnOJLJkRHSk6LUSXLmEFsA23aR2O5CSLUxbeUX1IZ1YQ7Sn0aXb601Ncwjx73a+FVqgcljVw==",
- "dev": true,
- "requires": {
- "@babel/helper-function-name": "^7.10.4",
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-literals": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.1.tgz",
- "integrity": "sha512-+PxVGA+2Ag6uGgL0A5f+9rklOnnMccwEBzwYFL3EUaKuiyVnUipyXncFcfjSkbimLrODoqki1U9XxZzTvfN7IQ==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-member-expression-literals": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.1.tgz",
- "integrity": "sha512-1sxePl6z9ad0gFMB9KqmYofk34flq62aqMt9NqliS/7hPEpURUCMbyHXrMPlo282iY7nAvUB1aQd5mg79UD9Jg==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-modules-amd": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.12.1.tgz",
- "integrity": "sha512-tDW8hMkzad5oDtzsB70HIQQRBiTKrhfgwC/KkJeGsaNFTdWhKNt/BiE8c5yj19XiGyrxpbkOfH87qkNg1YGlOQ==",
- "dev": true,
- "requires": {
- "@babel/helper-module-transforms": "^7.12.1",
- "@babel/helper-plugin-utils": "^7.10.4",
- "babel-plugin-dynamic-import-node": "^2.3.3"
- }
- },
- "@babel/plugin-transform-modules-commonjs": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.12.1.tgz",
- "integrity": "sha512-dY789wq6l0uLY8py9c1B48V8mVL5gZh/+PQ5ZPrylPYsnAvnEMjqsUXkuoDVPeVK+0VyGar+D08107LzDQ6pag==",
- "dev": true,
- "requires": {
- "@babel/helper-module-transforms": "^7.12.1",
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/helper-simple-access": "^7.12.1",
- "babel-plugin-dynamic-import-node": "^2.3.3"
- }
- },
- "@babel/plugin-transform-modules-systemjs": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.12.1.tgz",
- "integrity": "sha512-Hn7cVvOavVh8yvW6fLwveFqSnd7rbQN3zJvoPNyNaQSvgfKmDBO9U1YL9+PCXGRlZD9tNdWTy5ACKqMuzyn32Q==",
- "dev": true,
- "requires": {
- "@babel/helper-hoist-variables": "^7.10.4",
- "@babel/helper-module-transforms": "^7.12.1",
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/helper-validator-identifier": "^7.10.4",
- "babel-plugin-dynamic-import-node": "^2.3.3"
- }
- },
- "@babel/plugin-transform-modules-umd": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.12.1.tgz",
- "integrity": "sha512-aEIubCS0KHKM0zUos5fIoQm+AZUMt1ZvMpqz0/H5qAQ7vWylr9+PLYurT+Ic7ID/bKLd4q8hDovaG3Zch2uz5Q==",
- "dev": true,
- "requires": {
- "@babel/helper-module-transforms": "^7.12.1",
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-named-capturing-groups-regex": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.1.tgz",
- "integrity": "sha512-tB43uQ62RHcoDp9v2Nsf+dSM8sbNodbEicbQNA53zHz8pWUhsgHSJCGpt7daXxRydjb0KnfmB+ChXOv3oADp1Q==",
- "dev": true,
- "requires": {
- "@babel/helper-create-regexp-features-plugin": "^7.12.1"
- }
- },
- "@babel/plugin-transform-new-target": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.1.tgz",
- "integrity": "sha512-+eW/VLcUL5L9IvJH7rT1sT0CzkdUTvPrXC2PXTn/7z7tXLBuKvezYbGdxD5WMRoyvyaujOq2fWoKl869heKjhw==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-object-super": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.1.tgz",
- "integrity": "sha512-AvypiGJH9hsquNUn+RXVcBdeE3KHPZexWRdimhuV59cSoOt5kFBmqlByorAeUlGG2CJWd0U+4ZtNKga/TB0cAw==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/helper-replace-supers": "^7.12.1"
- }
- },
- "@babel/plugin-transform-parameters": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.12.1.tgz",
- "integrity": "sha512-xq9C5EQhdPK23ZeCdMxl8bbRnAgHFrw5EOC3KJUsSylZqdkCaFEXxGSBuTSObOpiiHHNyb82es8M1QYgfQGfNg==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-property-literals": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.1.tgz",
- "integrity": "sha512-6MTCR/mZ1MQS+AwZLplX4cEySjCpnIF26ToWo942nqn8hXSm7McaHQNeGx/pt7suI1TWOWMfa/NgBhiqSnX0cQ==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-regenerator": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.12.1.tgz",
- "integrity": "sha512-gYrHqs5itw6i4PflFX3OdBPMQdPbF4bj2REIUxlMRUFk0/ZOAIpDFuViuxPjUL7YC8UPnf+XG7/utJvqXdPKng==",
- "dev": true,
- "requires": {
- "regenerator-transform": "^0.14.2"
- }
- },
- "@babel/plugin-transform-reserved-words": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.1.tgz",
- "integrity": "sha512-pOnUfhyPKvZpVyBHhSBoX8vfA09b7r00Pmm1sH+29ae2hMTKVmSp4Ztsr8KBKjLjx17H0eJqaRC3bR2iThM54A==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-runtime": {
- "version": "7.12.10",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.12.10.tgz",
- "integrity": "sha512-xOrUfzPxw7+WDm9igMgQCbO3cJKymX7dFdsgRr1eu9n3KjjyU4pptIXbXPseQDquw+W+RuJEJMHKHNsPNNm3CA==",
- "dev": true,
- "requires": {
- "@babel/helper-module-imports": "^7.12.5",
- "@babel/helper-plugin-utils": "^7.10.4",
- "semver": "^5.5.1"
- }
- },
- "@babel/plugin-transform-shorthand-properties": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.1.tgz",
- "integrity": "sha512-GFZS3c/MhX1OusqB1MZ1ct2xRzX5ppQh2JU1h2Pnfk88HtFTM+TWQqJNfwkmxtPQtb/s1tk87oENfXJlx7rSDw==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-spread": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.12.1.tgz",
- "integrity": "sha512-vuLp8CP0BE18zVYjsEBZ5xoCecMK6LBMMxYzJnh01rxQRvhNhH1csMMmBfNo5tGpGO+NhdSNW2mzIvBu3K1fng==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1"
- }
- },
- "@babel/plugin-transform-sticky-regex": {
- "version": "7.12.7",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.7.tgz",
- "integrity": "sha512-VEiqZL5N/QvDbdjfYQBhruN0HYjSPjC4XkeqW4ny/jNtH9gcbgaqBIXYEZCNnESMAGs0/K/R7oFGMhOyu/eIxg==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-template-literals": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.12.1.tgz",
- "integrity": "sha512-b4Zx3KHi+taXB1dVRBhVJtEPi9h1THCeKmae2qP0YdUHIFhVjtpqqNfxeVAa1xeHVhAy4SbHxEwx5cltAu5apw==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-typeof-symbol": {
- "version": "7.12.10",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.10.tgz",
- "integrity": "sha512-JQ6H8Rnsogh//ijxspCjc21YPd3VLVoYtAwv3zQmqAt8YGYUtdo5usNhdl4b9/Vir2kPFZl6n1h0PfUz4hJhaA==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-unicode-escapes": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.1.tgz",
- "integrity": "sha512-I8gNHJLIc7GdApm7wkVnStWssPNbSRMPtgHdmH3sRM1zopz09UWPS4x5V4n1yz/MIWTVnJ9sp6IkuXdWM4w+2Q==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/plugin-transform-unicode-regex": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.1.tgz",
- "integrity": "sha512-SqH4ClNngh/zGwHZOOQMTD+e8FGWexILV+ePMyiDJttAWRh5dhDL8rcl5lSgU3Huiq6Zn6pWTMvdPAb21Dwdyg==",
- "dev": true,
- "requires": {
- "@babel/helper-create-regexp-features-plugin": "^7.12.1",
- "@babel/helper-plugin-utils": "^7.10.4"
- }
- },
- "@babel/preset-env": {
- "version": "7.12.11",
- "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.11.tgz",
- "integrity": "sha512-j8Tb+KKIXKYlDBQyIOy4BLxzv1NUOwlHfZ74rvW+Z0Gp4/cI2IMDPBWAgWceGcE7aep9oL/0K9mlzlMGxA8yNw==",
- "dev": true,
- "requires": {
- "@babel/compat-data": "^7.12.7",
- "@babel/helper-compilation-targets": "^7.12.5",
- "@babel/helper-module-imports": "^7.12.5",
- "@babel/helper-plugin-utils": "^7.10.4",
- "@babel/helper-validator-option": "^7.12.11",
- "@babel/plugin-proposal-async-generator-functions": "^7.12.1",
- "@babel/plugin-proposal-class-properties": "^7.12.1",
- "@babel/plugin-proposal-dynamic-import": "^7.12.1",
- "@babel/plugin-proposal-export-namespace-from": "^7.12.1",
- "@babel/plugin-proposal-json-strings": "^7.12.1",
- "@babel/plugin-proposal-logical-assignment-operators": "^7.12.1",
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
- "@babel/plugin-proposal-numeric-separator": "^7.12.7",
- "@babel/plugin-proposal-object-rest-spread": "^7.12.1",
- "@babel/plugin-proposal-optional-catch-binding": "^7.12.1",
- "@babel/plugin-proposal-optional-chaining": "^7.12.7",
- "@babel/plugin-proposal-private-methods": "^7.12.1",
- "@babel/plugin-proposal-unicode-property-regex": "^7.12.1",
- "@babel/plugin-syntax-async-generators": "^7.8.0",
- "@babel/plugin-syntax-class-properties": "^7.12.1",
- "@babel/plugin-syntax-dynamic-import": "^7.8.0",
- "@babel/plugin-syntax-export-namespace-from": "^7.8.3",
- "@babel/plugin-syntax-json-strings": "^7.8.0",
- "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4",
- "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0",
- "@babel/plugin-syntax-numeric-separator": "^7.10.4",
- "@babel/plugin-syntax-object-rest-spread": "^7.8.0",
- "@babel/plugin-syntax-optional-catch-binding": "^7.8.0",
- "@babel/plugin-syntax-optional-chaining": "^7.8.0",
- "@babel/plugin-syntax-top-level-await": "^7.12.1",
- "@babel/plugin-transform-arrow-functions": "^7.12.1",
- "@babel/plugin-transform-async-to-generator": "^7.12.1",
- "@babel/plugin-transform-block-scoped-functions": "^7.12.1",
- "@babel/plugin-transform-block-scoping": "^7.12.11",
- "@babel/plugin-transform-classes": "^7.12.1",
- "@babel/plugin-transform-computed-properties": "^7.12.1",
- "@babel/plugin-transform-destructuring": "^7.12.1",
- "@babel/plugin-transform-dotall-regex": "^7.12.1",
- "@babel/plugin-transform-duplicate-keys": "^7.12.1",
- "@babel/plugin-transform-exponentiation-operator": "^7.12.1",
- "@babel/plugin-transform-for-of": "^7.12.1",
- "@babel/plugin-transform-function-name": "^7.12.1",
- "@babel/plugin-transform-literals": "^7.12.1",
- "@babel/plugin-transform-member-expression-literals": "^7.12.1",
- "@babel/plugin-transform-modules-amd": "^7.12.1",
- "@babel/plugin-transform-modules-commonjs": "^7.12.1",
- "@babel/plugin-transform-modules-systemjs": "^7.12.1",
- "@babel/plugin-transform-modules-umd": "^7.12.1",
- "@babel/plugin-transform-named-capturing-groups-regex": "^7.12.1",
- "@babel/plugin-transform-new-target": "^7.12.1",
- "@babel/plugin-transform-object-super": "^7.12.1",
- "@babel/plugin-transform-parameters": "^7.12.1",
- "@babel/plugin-transform-property-literals": "^7.12.1",
- "@babel/plugin-transform-regenerator": "^7.12.1",
- "@babel/plugin-transform-reserved-words": "^7.12.1",
- "@babel/plugin-transform-shorthand-properties": "^7.12.1",
- "@babel/plugin-transform-spread": "^7.12.1",
- "@babel/plugin-transform-sticky-regex": "^7.12.7",
- "@babel/plugin-transform-template-literals": "^7.12.1",
- "@babel/plugin-transform-typeof-symbol": "^7.12.10",
- "@babel/plugin-transform-unicode-escapes": "^7.12.1",
- "@babel/plugin-transform-unicode-regex": "^7.12.1",
- "@babel/preset-modules": "^0.1.3",
- "@babel/types": "^7.12.11",
- "core-js-compat": "^3.8.0",
- "semver": "^5.5.0"
- }
- },
- "@babel/preset-modules": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.4.tgz",
- "integrity": "sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/plugin-proposal-unicode-property-regex": "^7.4.4",
- "@babel/plugin-transform-dotall-regex": "^7.4.4",
- "@babel/types": "^7.4.4",
- "esutils": "^2.0.2"
- }
- },
- "@babel/runtime": {
- "version": "7.12.5",
- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz",
- "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==",
- "dev": true,
- "requires": {
- "regenerator-runtime": "^0.13.4"
- }
- },
- "@babel/runtime-corejs3": {
- "version": "7.12.5",
- "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.12.5.tgz",
- "integrity": "sha512-roGr54CsTmNPPzZoCP1AmDXuBoNao7tnSA83TXTwt+UK5QVyh1DIJnrgYRPWKCF2flqZQXwa7Yr8v7VmLzF0YQ==",
- "dev": true,
- "requires": {
- "core-js-pure": "^3.0.0",
- "regenerator-runtime": "^0.13.4"
- }
- },
- "@babel/template": {
- "version": "7.12.7",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz",
- "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==",
- "dev": true,
- "requires": {
- "@babel/code-frame": "^7.10.4",
- "@babel/parser": "^7.12.7",
- "@babel/types": "^7.12.7"
- }
- },
- "@babel/traverse": {
- "version": "7.12.12",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.12.tgz",
- "integrity": "sha512-s88i0X0lPy45RrLM8b9mz8RPH5FqO9G9p7ti59cToE44xFm1Q+Pjh5Gq4SXBbtb88X7Uy7pexeqRIQDDMNkL0w==",
- "dev": true,
- "requires": {
- "@babel/code-frame": "^7.12.11",
- "@babel/generator": "^7.12.11",
- "@babel/helper-function-name": "^7.12.11",
- "@babel/helper-split-export-declaration": "^7.12.11",
- "@babel/parser": "^7.12.11",
- "@babel/types": "^7.12.12",
- "debug": "^4.1.0",
- "globals": "^11.1.0",
- "lodash": "^4.17.19"
- }
- },
- "@babel/types": {
- "version": "7.12.12",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.12.tgz",
- "integrity": "sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ==",
- "dev": true,
- "requires": {
- "@babel/helper-validator-identifier": "^7.12.11",
- "lodash": "^4.17.19",
- "to-fast-properties": "^2.0.0"
- }
- },
- "@jimp/bmp": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.8.5.tgz",
- "integrity": "sha512-o/23j1RODQGGjvb2xg+9ZQCHc9uXa5XIoJuXHN8kh8AJBGD7JZYiHMwNHaxJRJvadimCKUeA5udZUJAoaPwrYg==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "bmp-js": "^0.1.0",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/core": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/core/-/core-0.8.5.tgz",
- "integrity": "sha512-Jto1IdL5HYg7uE15rpQjK6dfZJ6d6gRjUsVCPW50nIfXgWizaTibFEov90W9Bj+irwKrX2ntG3e3pZUyOC0COg==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "any-base": "^1.1.0",
- "buffer": "^5.2.0",
- "core-js": "^2.5.7",
- "exif-parser": "^0.1.12",
- "file-type": "^9.0.0",
- "load-bmfont": "^1.3.1",
- "mkdirp": "0.5.1",
- "phin": "^2.9.1",
- "pixelmatch": "^4.0.2",
- "tinycolor2": "^1.4.1"
- }
- },
- "@jimp/custom": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/custom/-/custom-0.8.5.tgz",
- "integrity": "sha512-hS4qHOcOIL+N93IprsIhFgr8F4XnC2oYd+lRaOKEOg3ptS2vQnceSTtcXsC0//mhq8AV6lNjpbfs1iseEZuTqg==",
- "dev": true,
- "requires": {
- "@jimp/core": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/gif": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/gif/-/gif-0.8.5.tgz",
- "integrity": "sha512-Mj8jmv4AS76OY+Hx/Xoyihj02SUZ2ELk+O5x89pODz1+NeGtSWHHjZjnSam9HYAjycvVI/lGJdk/7w0nWIV/yQ==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7",
- "omggif": "^1.0.9"
- }
- },
- "@jimp/jpeg": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/jpeg/-/jpeg-0.8.5.tgz",
- "integrity": "sha512-7kjTY0BiCpwRywk+oPfpLto7cLI+9G0mf4N1bv1Hn+VLQwcXFy2fHyl4qjqLbbY6u4cyZgqN+R8Pg6GRRzv0kw==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7",
- "jpeg-js": "^0.3.4"
- }
- },
- "@jimp/plugin-blit": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-0.8.5.tgz",
- "integrity": "sha512-r8Z1CwazaJwZCRbucQgrfprlGyH91tX7GubUsbWr+zy5/dRJAAgaPj/hcoHDwbh3zyiXp5BECKKzKW0x4reL4w==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-blur": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-0.8.5.tgz",
- "integrity": "sha512-UH5ywpV4YooUh9HXEsrNKDtojLCvIAAV0gywqn8EQeFyzwBJyXAvRNARJp7zr5OPLr9uGXkRLDCO9YyzdlXZng==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-color": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-0.8.5.tgz",
- "integrity": "sha512-7XHqcTQ8Y1zto1b9P1y8m1dzSjnOpBsD9OZG0beTpeJ5bgPX+hF5ZLmvcM6c5ljkINw5EUF1it07BYbkCxiGQA==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7",
- "tinycolor2": "^1.4.1"
- }
- },
- "@jimp/plugin-contain": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-0.8.5.tgz",
- "integrity": "sha512-ZkiPFx9L0yITiKtYTYLWyBsSIdxo/NARhNPRZXyVF9HmTWSLDUw1c2c1uvETKxDZTAVK+souYT14DwFWWdhsYA==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-cover": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-0.8.5.tgz",
- "integrity": "sha512-OdT4YAopLOhbhTUQV3R1v5ZZqIaUt3n3vJi/OfTbsak1t9UkPBVdmYPyhoont8zJdtdkF5dW16Ro1FTshytcww==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-crop": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-0.8.5.tgz",
- "integrity": "sha512-E1Hb+gfu2k74Gkqh96apAyVljsP5MjCH4TY6lECAAEcYKGH/XRhz6lY2dSEjCYE7KtiqjTZzWwYkgAvkwojj9Q==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-displace": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-0.8.5.tgz",
- "integrity": "sha512-fVgVYTS1HZzAXkg8Lg06PuirSUG5oXYaYYGL+3ZU4tmZn1pyZ+mZyfejpwtymETEYZnmymHoCT4xto19E/IRvA==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-dither": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-0.8.5.tgz",
- "integrity": "sha512-KSj2y8E3yK7tldjT/8ejqAWw5HFBjtWW6QkcxfW7FdV4c/nsXZXDkMbhqMZ7FkDuSYoAPeWUFeddrH4yipC5iA==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-flip": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-0.8.5.tgz",
- "integrity": "sha512-2QbGDkurPNAXZUeHLo/UA3tjh+AbAXWZKSdtoa1ArlASovRz8rqtA45YIRIkKrMH82TA3PZk8bgP2jaLKLrzww==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-gaussian": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-gaussian/-/plugin-gaussian-0.8.5.tgz",
- "integrity": "sha512-2zReC5GJcVAXtf3UgzFcHSYN277i02K9Yrhc1xJf3mti00s43uD++B5Ho7/mIo+HrntVvWhxqar7PARdq0lVIg==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-invert": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-invert/-/plugin-invert-0.8.5.tgz",
- "integrity": "sha512-GyMXPGheHdS14xfDceuZ9hrGm6gE9UG3PfTEjQbJmHMWippLC6yf8kombSudJlUf8q72YYSSXsSFKGgkHa67vA==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-mask": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-0.8.5.tgz",
- "integrity": "sha512-inD/++XO+MkmwXl9JGYQ8X2deyOZuq9i+dmugH/557p16B9Q6tvUQt5X1Yg5w7hhkLZ00BKOAJI9XoyCC1NFvQ==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-normalize": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-normalize/-/plugin-normalize-0.8.5.tgz",
- "integrity": "sha512-8YRWJWBT4NoSAbPhnjQJXGeaeWVrJAlGDv39A54oNH8Ry47fHcE0EN6zogQNpBuM34M6hRnZl4rOv1FIisaWdg==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-print": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-0.8.5.tgz",
- "integrity": "sha512-BviNpCiA/fEieOqsrWr1FkqyFuiG2izdyyg7zUqyeUTHPwqrTLvXO9cfP/ThG4hZpu5wMQ5QClWSqhZu1fAwxA==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7",
- "load-bmfont": "^1.4.0"
- }
- },
- "@jimp/plugin-resize": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-0.8.5.tgz",
- "integrity": "sha512-gIdmISuNmZQ1QwprnRC5VXVWQfKIiWineVQGebpMAG/aoFOLDXrVl939Irg7Fb/uOlSFTzpAbt1zpJ8YG/Mi2w==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-rotate": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-0.8.5.tgz",
- "integrity": "sha512-8T9wnL3gb+Z0ogMZmtyI6h3y7TuqW2a5SpFbzFUVF+lTZoAabXjEfX3CAozizCLaT+Duc5H2FJVemAHiyr+Dbw==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugin-scale": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-scale/-/plugin-scale-0.8.5.tgz",
- "integrity": "sha512-G+CDH9s7BsxJ4b+mKZ5SsiXwTAynBJ+7/9SwZFnICZJJvLd79Tws6VPXfSaKJZuWnGIX++L8jTGmFORCfLNkdg==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7"
- }
- },
- "@jimp/plugins": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/plugins/-/plugins-0.8.5.tgz",
- "integrity": "sha512-52na0wqfQ3uItIA+C9cJ1EXffhSmABgK7ETClDseUh9oGtynHzxZ97smnFf1ydLjXLrF89Gt+YBxWLyiBGgiZQ==",
- "dev": true,
- "requires": {
- "@jimp/plugin-blit": "^0.8.5",
- "@jimp/plugin-blur": "^0.8.5",
- "@jimp/plugin-color": "^0.8.5",
- "@jimp/plugin-contain": "^0.8.5",
- "@jimp/plugin-cover": "^0.8.5",
- "@jimp/plugin-crop": "^0.8.5",
- "@jimp/plugin-displace": "^0.8.5",
- "@jimp/plugin-dither": "^0.8.5",
- "@jimp/plugin-flip": "^0.8.5",
- "@jimp/plugin-gaussian": "^0.8.5",
- "@jimp/plugin-invert": "^0.8.5",
- "@jimp/plugin-mask": "^0.8.5",
- "@jimp/plugin-normalize": "^0.8.5",
- "@jimp/plugin-print": "^0.8.5",
- "@jimp/plugin-resize": "^0.8.5",
- "@jimp/plugin-rotate": "^0.8.5",
- "@jimp/plugin-scale": "^0.8.5",
- "core-js": "^2.5.7",
- "timm": "^1.6.1"
- }
- },
- "@jimp/png": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/png/-/png-0.8.5.tgz",
- "integrity": "sha512-zT89ucu8I2rsD3FIMIPLgr1OyKn4neD+5umwD3MY8AOB8+6tX5bFtnmTm3FzGJaJuibkK0wFl87eiaxnb+Megw==",
- "dev": true,
- "requires": {
- "@jimp/utils": "^0.8.5",
- "core-js": "^2.5.7",
- "pngjs": "^3.3.3"
- }
- },
- "@jimp/tiff": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/tiff/-/tiff-0.8.5.tgz",
- "integrity": "sha512-Z7uzDcbHuwDg+hy2+UJQ2s5O6sqYXmv6H1fmSf/2dxBrlGMzl8yTc2/BxLrGREeoidDDMcKmXYGAOp4uCsdJjw==",
- "dev": true,
- "requires": {
- "core-js": "^2.5.7",
- "utif": "^2.0.1"
- }
- },
- "@jimp/types": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/types/-/types-0.8.5.tgz",
- "integrity": "sha512-XUvpyebZGd1vyFiJyxUT4H9A3mKD7MV2MxjXnay3fNTrcow0UJJspmFw/w+G3TP/1dgrVC4K++gntjR6QWTzvg==",
- "dev": true,
- "requires": {
- "@jimp/bmp": "^0.8.5",
- "@jimp/gif": "^0.8.5",
- "@jimp/jpeg": "^0.8.5",
- "@jimp/png": "^0.8.5",
- "@jimp/tiff": "^0.8.5",
- "core-js": "^2.5.7",
- "timm": "^1.6.1"
- }
- },
- "@jimp/utils": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-0.8.5.tgz",
- "integrity": "sha512-D3+H4BiopDkhUKvKkZTPPJ53voqOkfMuk3r7YZNcLtXGLkchjjukC4056lNo7B0DzjBgowTYsQM3JjKnYNIYeg==",
- "dev": true,
- "requires": {
- "core-js": "^2.5.7"
- }
- },
- "@polka/redirect": {
- "version": "1.0.0-next.7",
- "resolved": "https://registry.npmjs.org/@polka/redirect/-/redirect-1.0.0-next.7.tgz",
- "integrity": "sha512-sHh1oVy9VBVhn41fOlrUdlxFkcbKrYdBcqePTSxvf2NqKu7UcMPZse/wDeQZk17A8cqDArKsR4m0MXd+3/Q83g=="
- },
- "@polka/send": {
- "version": "1.0.0-next.7",
- "resolved": "https://registry.npmjs.org/@polka/send/-/send-1.0.0-next.7.tgz",
- "integrity": "sha512-X/7sxWMfzuHuMXSls3SuOgfwcoNakuaNWciVS/KX3RML8NIPKQYgbhpqYPCujtXK9Z/KvW3/gzr2TUpabIJRMg=="
- },
- "@polka/url": {
- "version": "1.0.0-next.11",
- "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.11.tgz",
- "integrity": "sha512-3NsZsJIA/22P3QUyrEDNA2D133H4j224twJrdipXN38dpnIOzAbUDtOwkcJ5pXmn75w7LSQDjA4tO9dm1XlqlA=="
- },
- "@rollup/plugin-babel": {
- "version": "5.2.2",
- "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.2.2.tgz",
- "integrity": "sha512-MjmH7GvFT4TW8xFdIeFS3wqIX646y5tACdxkTO+khbHvS3ZcVJL6vkAHLw2wqPmkhwCfWHoNsp15VYNwW6JEJA==",
- "dev": true,
- "requires": {
- "@babel/helper-module-imports": "^7.10.4",
- "@rollup/pluginutils": "^3.1.0"
- }
- },
- "@rollup/plugin-commonjs": {
- "version": "17.0.0",
- "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-17.0.0.tgz",
- "integrity": "sha512-/omBIJG1nHQc+bgkYDuLpb/V08QyutP9amOrJRUSlYJZP+b/68gM//D8sxJe3Yry2QnYIr3QjR3x4AlxJEN3GA==",
- "dev": true,
- "requires": {
- "@rollup/pluginutils": "^3.1.0",
- "commondir": "^1.0.1",
- "estree-walker": "^2.0.1",
- "glob": "^7.1.6",
- "is-reference": "^1.2.1",
- "magic-string": "^0.25.7",
- "resolve": "^1.17.0"
- },
- "dependencies": {
- "estree-walker": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
- "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
- "dev": true
- }
- }
- },
- "@rollup/plugin-json": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz",
- "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==",
- "dev": true,
- "requires": {
- "@rollup/pluginutils": "^3.0.8"
- }
- },
- "@rollup/plugin-node-resolve": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.0.1.tgz",
- "integrity": "sha512-ltlsj/4Bhwwhb+Nb5xCz/6vieuEj2/BAkkqVIKmZwC7pIdl8srmgmglE4S0jFlZa32K4qvdQ6NHdmpRKD/LwoQ==",
- "dev": true,
- "requires": {
- "@rollup/pluginutils": "^3.1.0",
- "@types/resolve": "1.17.1",
- "builtin-modules": "^3.1.0",
- "deepmerge": "^4.2.2",
- "is-module": "^1.0.0",
- "resolve": "^1.19.0"
- }
- },
- "@rollup/plugin-replace": {
- "version": "2.3.4",
- "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.3.4.tgz",
- "integrity": "sha512-waBhMzyAtjCL1GwZes2jaE9MjuQ/DQF2BatH3fRivUF3z0JBFrU0U6iBNC/4WR+2rLKhaAhPWDNPYp4mI6RqdQ==",
- "dev": true,
- "requires": {
- "@rollup/pluginutils": "^3.1.0",
- "magic-string": "^0.25.7"
- }
- },
- "@rollup/pluginutils": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz",
- "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==",
- "dev": true,
- "requires": {
- "@types/estree": "0.0.39",
- "estree-walker": "^1.0.1",
- "picomatch": "^2.2.2"
- }
- },
- "@sindresorhus/slugify": {
- "version": "0.9.1",
- "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-0.9.1.tgz",
- "integrity": "sha512-b6heYM9dzZD13t2GOiEQTDE0qX+I1GyOotMwKh9VQqzuNiVdPVT8dM43fe9HNb/3ul+Qwd5oKSEDrDIfhq3bnQ==",
- "dev": true,
- "requires": {
- "escape-string-regexp": "^1.0.5",
- "lodash.deburr": "^4.1.0"
- }
- },
- "@sveltejs/site-kit": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/@sveltejs/site-kit/-/site-kit-1.2.5.tgz",
- "integrity": "sha512-fA1YWW4tYOxPRVocx+jF4S2LGamku8xeKx/+J5aY7ZCbwuo/c4VF+T0K7WuQRI8U6Dw3pJqdiCra+xH4TnCGRw==",
- "dev": true,
- "requires": {
- "@sindresorhus/slugify": "^0.9.1",
- "golden-fleece": "^1.0.9"
- }
- },
- "@sveltejs/svelte-repl": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/@sveltejs/svelte-repl/-/svelte-repl-0.2.1.tgz",
- "integrity": "sha512-ShNjMdsEAzGLu2PoogJEuWcV47E+1CsO8dNJ2wZcs7xyPsvuswp6KV1jFsBQmWZ+jLqtnRhlo6w2Mf43XOS/Dg==",
- "dev": true,
- "requires": {
- "codemirror": "^5.49.2",
- "estree-walker": "^0.9.0",
- "marked": "^0.8.2",
- "sourcemap-codec": "^1.4.6",
- "svelte-json-tree": "0.0.5",
- "yootils": "0.0.16"
- },
- "dependencies": {
- "estree-walker": {
- "version": "0.9.0",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.9.0.tgz",
- "integrity": "sha512-12U47o7XHUX329+x3FzNVjCx3SHEzMF0nkDv7r/HnBzX/xNTKxajBk6gyygaxrAFtLj39219oMfbtxv4KpaOiA==",
- "dev": true
- },
- "marked": {
- "version": "0.8.2",
- "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz",
- "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==",
- "dev": true
- }
- }
- },
- "@types/estree": {
- "version": "0.0.39",
- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
- "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
- "dev": true
- },
- "@types/node": {
- "version": "14.14.19",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.19.tgz",
- "integrity": "sha512-4nhBPStMK04rruRVtVc6cDqhu7S9GZai0fpXgPXrFpcPX6Xul8xnrjSdGB4KPBVYG/R5+fXWdCM8qBoiULWGPQ==",
- "dev": true
- },
- "@types/pg": {
- "version": "7.14.7",
- "resolved": "https://registry.npmjs.org/@types/pg/-/pg-7.14.7.tgz",
- "integrity": "sha512-ZnMOUidTP6Lwsb0bxHL6PVIL1lVC2CYNQWlA79kQ6nn0rK1/ynvkyN1wsR9pVZaP4WcCNioKT/2aU5UuLIQy2w==",
- "dev": true,
- "requires": {
- "@types/node": "*",
- "@types/pg-types": "*"
- }
- },
- "@types/pg-types": {
- "version": "1.11.5",
- "resolved": "https://registry.npmjs.org/@types/pg-types/-/pg-types-1.11.5.tgz",
- "integrity": "sha512-L8ogeT6vDzT1vxlW3KITTCt+BVXXVkLXfZ/XNm6UqbcJgxf+KPO7yjWx7dQQE8RW07KopL10x2gNMs41+IkMGQ==",
- "dev": true
- },
- "@types/resolve": {
- "version": "1.17.1",
- "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz",
- "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==",
- "dev": true,
- "requires": {
- "@types/node": "*"
- }
- },
- "ansi-colors": {
- "version": "3.2.3",
- "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz",
- "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==",
- "dev": true
- },
- "ansi-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
- "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
- "dev": true
- },
- "ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
- "dev": true,
- "requires": {
- "color-convert": "^1.9.0"
- }
- },
- "any-base": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/any-base/-/any-base-1.1.0.tgz",
- "integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==",
- "dev": true
- },
- "argparse": {
- "version": "1.0.10",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
- "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
- "dev": true,
- "requires": {
- "sprintf-js": "~1.0.2"
- }
- },
- "babel-plugin-dynamic-import-node": {
- "version": "2.3.3",
- "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz",
- "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==",
- "dev": true,
- "requires": {
- "object.assign": "^4.1.0"
- }
- },
- "balanced-match": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
- "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
- "dev": true
- },
- "base64-js": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
- "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
- "dev": true
- },
- "bmp-js": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/bmp-js/-/bmp-js-0.1.0.tgz",
- "integrity": "sha1-4Fpj95amwf8l9Hcex62twUjAcjM=",
- "dev": true
- },
- "brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
- "dev": true,
- "requires": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "browser-stdout": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
- "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
- "dev": true
- },
- "browserslist": {
- "version": "4.16.0",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.0.tgz",
- "integrity": "sha512-/j6k8R0p3nxOC6kx5JGAxsnhc9ixaWJfYc+TNTzxg6+ARaESAvQGV7h0uNOB4t+pLQJZWzcrMxXOxjgsCj3dqQ==",
- "dev": true,
- "requires": {
- "caniuse-lite": "^1.0.30001165",
- "colorette": "^1.2.1",
- "electron-to-chromium": "^1.3.621",
- "escalade": "^3.1.1",
- "node-releases": "^1.1.67"
- }
- },
- "buffer": {
- "version": "5.7.1",
- "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
- "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
- "dev": true,
- "requires": {
- "base64-js": "^1.3.1",
- "ieee754": "^1.1.13"
- }
- },
- "buffer-equal": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz",
- "integrity": "sha1-kbx0sR6kBbyRa8aqkI+q+ltKrEs=",
- "dev": true
- },
- "buffer-equal-constant-time": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
- "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk="
- },
- "buffer-from": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
- "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
- "dev": true
- },
- "buffer-writer": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz",
- "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw=="
- },
- "builtin-modules": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz",
- "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==",
- "dev": true
- },
- "call-bind": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz",
- "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==",
- "dev": true,
- "requires": {
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.0.0"
- }
- },
- "camel-case": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz",
- "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=",
- "dev": true,
- "requires": {
- "no-case": "^2.2.0",
- "upper-case": "^1.1.1"
- }
- },
- "camelcase": {
- "version": "5.3.1",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
- "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
- "dev": true
- },
- "caniuse-lite": {
- "version": "1.0.30001171",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001171.tgz",
- "integrity": "sha512-5Alrh8TTYPG9IH4UkRqEBZoEToWRLvPbSQokvzSz0lii8/FOWKG4keO1HoYfPWs8IF/NH/dyNPg1cmJGvV3Zlg==",
- "dev": true
- },
- "chalk": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
- "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "^3.2.1",
- "escape-string-regexp": "^1.0.5",
- "supports-color": "^5.3.0"
- }
- },
- "clean-css": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz",
- "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==",
- "dev": true,
- "requires": {
- "source-map": "~0.6.0"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- }
- }
- },
- "clipboard": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz",
- "integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==",
- "optional": true,
- "requires": {
- "good-listener": "^1.2.2",
- "select": "^1.1.2",
- "tiny-emitter": "^2.0.0"
- }
- },
- "cliui": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
- "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
- "dev": true,
- "requires": {
- "string-width": "^3.1.0",
- "strip-ansi": "^5.2.0",
- "wrap-ansi": "^5.1.0"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
- "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
- "dev": true
- },
- "string-width": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
- "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
- "dev": true,
- "requires": {
- "emoji-regex": "^7.0.1",
- "is-fullwidth-code-point": "^2.0.0",
- "strip-ansi": "^5.1.0"
- }
- },
- "strip-ansi": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
- "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
- "dev": true,
- "requires": {
- "ansi-regex": "^4.1.0"
- }
- }
- }
- },
- "codemirror": {
- "version": "5.59.1",
- "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.59.1.tgz",
- "integrity": "sha512-d0SSW/PCCD4LoSCBPdnP0BzmZB1v3emomCUtVlIWgZHJ06yVeBOvBtOH7vYz707pfAvEeWbO9aP6akh8vl1V3w==",
- "dev": true
- },
- "color-convert": {
- "version": "1.9.3",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
- "dev": true,
- "requires": {
- "color-name": "1.1.3"
- }
- },
- "color-name": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
- "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
- "dev": true
- },
- "colorette": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz",
- "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==",
- "dev": true
- },
- "commander": {
- "version": "2.20.3",
- "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
- "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
- "dev": true
- },
- "commondir": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
- "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
- "dev": true
- },
- "concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
- "dev": true
- },
- "config": {
- "version": "3.3.3",
- "resolved": "https://registry.npmjs.org/config/-/config-3.3.3.tgz",
- "integrity": "sha512-T3RmZQEAji5KYqUQpziWtyGJFli6Khz7h0rpxDwYNjSkr5ynyTWwO7WpfjHzTXclNCDfSWQRcwMb+NwxJesCKw==",
- "dev": true,
- "optional": true,
- "requires": {
- "json5": "^2.1.1"
- }
- },
- "convert-source-map": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz",
- "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==",
- "dev": true,
- "requires": {
- "safe-buffer": "~5.1.1"
- },
- "dependencies": {
- "safe-buffer": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
- "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
- "dev": true
- }
- }
- },
- "cookie": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
- "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA=="
- },
- "core-js": {
- "version": "2.6.12",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
- "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
- "dev": true
- },
- "core-js-compat": {
- "version": "3.8.1",
- "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.8.1.tgz",
- "integrity": "sha512-a16TLmy9NVD1rkjUGbwuyWkiDoN0FDpAwrfLONvHFQx0D9k7J9y0srwMT8QP/Z6HE3MIFaVynEeYwZwPX1o5RQ==",
- "dev": true,
- "requires": {
- "browserslist": "^4.15.0",
- "semver": "7.0.0"
- },
- "dependencies": {
- "semver": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz",
- "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==",
- "dev": true
- }
- }
- },
- "core-js-pure": {
- "version": "3.8.1",
- "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.8.1.tgz",
- "integrity": "sha512-Se+LaxqXlVXGvmexKGPvnUIYC1jwXu1H6Pkyb3uBM5d8/NELMYCHs/4/roD7721NxrTLyv7e5nXd5/QLBO+10g==",
- "dev": true
- },
- "cross-spawn": {
- "version": "6.0.5",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
- "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
- "dev": true,
- "requires": {
- "nice-try": "^1.0.4",
- "path-key": "^2.0.1",
- "semver": "^5.5.0",
- "shebang-command": "^1.2.0",
- "which": "^1.2.9"
- }
- },
- "debug": {
- "version": "4.3.1",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
- "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
- "dev": true,
- "requires": {
- "ms": "2.1.2"
- },
- "dependencies": {
- "ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
- "dev": true
- }
- }
- },
- "decamelize": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
- "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
- "dev": true
- },
- "deepmerge": {
- "version": "4.2.2",
- "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz",
- "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==",
- "dev": true
- },
- "define-properties": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
- "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
- "dev": true,
- "requires": {
- "object-keys": "^1.0.12"
- }
- },
- "degit": {
- "version": "2.8.0",
- "resolved": "https://registry.npmjs.org/degit/-/degit-2.8.0.tgz",
- "integrity": "sha512-nxQr1Ep4NSGDIqQ3HSMNgnPYaxPfPhHdrpgSNO2EczO86zN7NJJ1i/59GM25vgC45ANQUazZ/3Z+iyeZCmGwhg==",
- "dev": true
- },
- "delegate": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
- "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==",
- "optional": true
- },
- "devalue": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/devalue/-/devalue-2.0.1.tgz",
- "integrity": "sha512-I2TiqT5iWBEyB8GRfTDP0hiLZ0YeDJZ+upDxjBfOC2lebO5LezQMv7QvIUTzdb64jQyAKLf1AHADtGN+jw6v8Q=="
- },
- "diff": {
- "version": "3.5.0",
- "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
- "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
- "dev": true
- },
- "do-not-zip": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/do-not-zip/-/do-not-zip-1.0.0.tgz",
- "integrity": "sha512-Pgd81ET43bhAGaN2Hq1zluSX1FmD7kl7KcV9ER/lawiLsRUB9pRA5y8r6us29Xk6BrINZETO8TjhYwtwafWUww=="
- },
- "dom-walk": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz",
- "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==",
- "dev": true
- },
- "dotenv": {
- "version": "8.2.0",
- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
- "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==",
- "dev": true
- },
- "ecdsa-sig-formatter": {
- "version": "1.0.11",
- "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
- "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
- "requires": {
- "safe-buffer": "^5.0.1"
- }
- },
- "electron-to-chromium": {
- "version": "1.3.633",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.633.tgz",
- "integrity": "sha512-bsVCsONiVX1abkWdH7KtpuDAhsQ3N3bjPYhROSAXE78roJKet0Y5wznA14JE9pzbwSZmSMAW6KiKYf1RvbTJkA==",
- "dev": true
- },
- "emoji-regex": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
- "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
- "dev": true
- },
- "error-ex": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
- "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
- "dev": true,
- "requires": {
- "is-arrayish": "^0.2.1"
- }
- },
- "es-abstract": {
- "version": "1.18.0-next.1",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
- "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
- "dev": true,
- "requires": {
- "es-to-primitive": "^1.2.1",
- "function-bind": "^1.1.1",
- "has": "^1.0.3",
- "has-symbols": "^1.0.1",
- "is-callable": "^1.2.2",
- "is-negative-zero": "^2.0.0",
- "is-regex": "^1.1.1",
- "object-inspect": "^1.8.0",
- "object-keys": "^1.1.1",
- "object.assign": "^4.1.1",
- "string.prototype.trimend": "^1.0.1",
- "string.prototype.trimstart": "^1.0.1"
- }
- },
- "es-to-primitive": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
- "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
- "dev": true,
- "requires": {
- "is-callable": "^1.1.4",
- "is-date-object": "^1.0.1",
- "is-symbol": "^1.0.2"
- }
- },
- "escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
- "dev": true
- },
- "escape-string-regexp": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
- "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
- "dev": true
- },
- "esm": {
- "version": "3.2.25",
- "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz",
- "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==",
- "dev": true
- },
- "esprima": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
- "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
- "dev": true
- },
- "estree-walker": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz",
- "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==",
- "dev": true
- },
- "esutils": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
- "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
- "dev": true
- },
- "exif-parser": {
- "version": "0.1.12",
- "resolved": "https://registry.npmjs.org/exif-parser/-/exif-parser-0.1.12.tgz",
- "integrity": "sha1-WKnS1ywCwfbwKg70qRZicrd2CSI=",
- "dev": true
- },
- "file-type": {
- "version": "9.0.0",
- "resolved": "https://registry.npmjs.org/file-type/-/file-type-9.0.0.tgz",
- "integrity": "sha512-Qe/5NJrgIOlwijpq3B7BEpzPFcgzggOTagZmkXQY4LA6bsXKTUstK7Wp12lEJ/mLKTpvIZxmIuRcLYWT6ov9lw==",
- "dev": true
- },
- "find-up": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
- "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
- "dev": true,
- "requires": {
- "locate-path": "^3.0.0"
- }
- },
- "flat": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz",
- "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==",
- "dev": true,
- "requires": {
- "is-buffer": "~2.0.3"
- }
- },
- "flru": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/flru/-/flru-1.0.2.tgz",
- "integrity": "sha512-kWyh8ADvHBFz6ua5xYOPnUroZTT/bwWfrCeL0Wj1dzG4/YOmOcfJ99W8dOVyyynJN35rZ9aCOtHChqQovV7yog=="
- },
- "fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
- "dev": true
- },
- "fsevents": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
- "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
- "dev": true,
- "optional": true
- },
- "function-bind": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
- "dev": true
- },
- "gensync": {
- "version": "1.0.0-beta.2",
- "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
- "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
- "dev": true
- },
- "get-caller-file": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
- "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
- "dev": true
- },
- "get-intrinsic": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz",
- "integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==",
- "dev": true,
- "requires": {
- "function-bind": "^1.1.1",
- "has": "^1.0.3",
- "has-symbols": "^1.0.1"
- }
- },
- "glob": {
- "version": "7.1.6",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
- "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
- "dev": true,
- "requires": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- }
- },
- "global": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz",
- "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==",
- "dev": true,
- "requires": {
- "min-document": "^2.19.0",
- "process": "^0.11.10"
- }
- },
- "globals": {
- "version": "11.12.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
- "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
- "dev": true
- },
- "golden-fleece": {
- "version": "1.0.9",
- "resolved": "https://registry.npmjs.org/golden-fleece/-/golden-fleece-1.0.9.tgz",
- "integrity": "sha512-YSwLaGMOgSBx9roJlNLL12c+FRiw7VECphinc6mGucphc/ZxTHgdEz6gmJqH6NOzYEd/yr64hwjom5pZ+tJVpg==",
- "dev": true
- },
- "good-listener": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
- "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
- "optional": true,
- "requires": {
- "delegate": "^3.1.2"
- }
- },
- "graceful-fs": {
- "version": "4.2.4",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
- "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
- "dev": true
- },
- "growl": {
- "version": "1.10.5",
- "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
- "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
- "dev": true
- },
- "has": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
- "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
- "dev": true,
- "requires": {
- "function-bind": "^1.1.1"
- }
- },
- "has-flag": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
- "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
- "dev": true
- },
- "has-symbols": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz",
- "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==",
- "dev": true
- },
- "he": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
- "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
- "dev": true
- },
- "hosted-git-info": {
- "version": "2.8.8",
- "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
- "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==",
- "dev": true
- },
- "html-minifier": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-4.0.0.tgz",
- "integrity": "sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig==",
- "dev": true,
- "requires": {
- "camel-case": "^3.0.0",
- "clean-css": "^4.2.1",
- "commander": "^2.19.0",
- "he": "^1.2.0",
- "param-case": "^2.1.1",
- "relateurl": "^0.2.7",
- "uglify-js": "^3.5.1"
- }
- },
- "http-link-header": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/http-link-header/-/http-link-header-1.0.3.tgz",
- "integrity": "sha512-nARK1wSKoBBrtcoESlHBx36c1Ln/gnbNQi1eB6MeTUefJIT3NvUOsV15bClga0k38f0q/kN5xxrGSDS3EFnm9w==",
- "dev": true
- },
- "httpie": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/httpie/-/httpie-1.1.2.tgz",
- "integrity": "sha512-VQ82oXG95oY1fQw/XecHuvcFBA+lZQ9Vwj1RfLcO8a7HpDd4cc2ukwpJt+TUlFaLUAzZErylxWu6wclJ1rUhUQ=="
- },
- "ieee754": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
- "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
- "dev": true
- },
- "inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
- "dev": true,
- "requires": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "inherits": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
- },
- "interpret": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
- "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
- "dev": true
- },
- "is-arrayish": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
- "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
- "dev": true
- },
- "is-buffer": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz",
- "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==",
- "dev": true
- },
- "is-callable": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz",
- "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==",
- "dev": true
- },
- "is-core-module": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz",
- "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==",
- "dev": true,
- "requires": {
- "has": "^1.0.3"
- }
- },
- "is-date-object": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz",
- "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==",
- "dev": true
- },
- "is-fullwidth-code-point": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
- "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
- "dev": true
- },
- "is-function": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz",
- "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==",
- "dev": true
- },
- "is-module": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
- "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=",
- "dev": true
- },
- "is-negative-zero": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz",
- "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==",
- "dev": true
- },
- "is-reference": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz",
- "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==",
- "dev": true,
- "requires": {
- "@types/estree": "*"
- }
- },
- "is-regex": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz",
- "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==",
- "dev": true,
- "requires": {
- "has-symbols": "^1.0.1"
- }
- },
- "is-symbol": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
- "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==",
- "dev": true,
- "requires": {
- "has-symbols": "^1.0.1"
- }
- },
- "isexe": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
- "dev": true
- },
- "jest-worker": {
- "version": "26.6.2",
- "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz",
- "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==",
- "dev": true,
- "requires": {
- "@types/node": "*",
- "merge-stream": "^2.0.0",
- "supports-color": "^7.0.0"
- },
- "dependencies": {
- "has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true
- },
- "supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "requires": {
- "has-flag": "^4.0.0"
- }
- }
- }
- },
- "jimp": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/jimp/-/jimp-0.8.5.tgz",
- "integrity": "sha512-BW7t/+TCgKpqZw/wHFwqF/A/Tyk43RmzRHyMBdqfOepqunUrajt0RTqowdWyFo4CS2FmD8pFiYfefWjpXFWrCA==",
- "dev": true,
- "requires": {
- "@jimp/custom": "^0.8.5",
- "@jimp/plugins": "^0.8.5",
- "@jimp/types": "^0.8.5",
- "core-js": "^2.5.7",
- "regenerator-runtime": "^0.13.3"
- }
- },
- "jpeg-js": {
- "version": "0.3.7",
- "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.3.7.tgz",
- "integrity": "sha512-9IXdWudL61npZjvLuVe/ktHiA41iE8qFyLB+4VDTblEsWBzeg8WQTlktdUK4CdncUqtUgUg0bbOmTE2bKBKaBQ==",
- "dev": true
- },
- "js-tokens": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
- "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
- "dev": true
- },
- "js-yaml": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
- "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
- "dev": true,
- "requires": {
- "argparse": "^1.0.7",
- "esprima": "^4.0.0"
- }
- },
- "jsesc": {
- "version": "2.5.2",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
- "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
- "dev": true
- },
- "json-parse-better-errors": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
- "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
- "dev": true
- },
- "json5": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz",
- "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==",
- "dev": true,
- "requires": {
- "minimist": "^1.2.5"
- }
- },
- "jsonwebtoken": {
- "version": "8.5.1",
- "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz",
- "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==",
- "requires": {
- "jws": "^3.2.2",
- "lodash.includes": "^4.3.0",
- "lodash.isboolean": "^3.0.3",
- "lodash.isinteger": "^4.0.4",
- "lodash.isnumber": "^3.0.3",
- "lodash.isplainobject": "^4.0.6",
- "lodash.isstring": "^4.0.1",
- "lodash.once": "^4.0.0",
- "ms": "^2.1.1",
- "semver": "^5.6.0"
- }
- },
- "jwa": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz",
- "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==",
- "requires": {
- "buffer-equal-constant-time": "1.0.1",
- "ecdsa-sig-formatter": "1.0.11",
- "safe-buffer": "^5.0.1"
- }
- },
- "jws": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
- "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
- "requires": {
- "jwa": "^1.4.1",
- "safe-buffer": "^5.0.1"
- }
- },
- "load-bmfont": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/load-bmfont/-/load-bmfont-1.4.1.tgz",
- "integrity": "sha512-8UyQoYmdRDy81Brz6aLAUhfZLwr5zV0L3taTQ4hju7m6biuwiWiJXjPhBJxbUQJA8PrkvJ/7Enqmwk2sM14soA==",
- "dev": true,
- "requires": {
- "buffer-equal": "0.0.1",
- "mime": "^1.3.4",
- "parse-bmfont-ascii": "^1.0.3",
- "parse-bmfont-binary": "^1.0.5",
- "parse-bmfont-xml": "^1.1.4",
- "phin": "^2.9.1",
- "xhr": "^2.0.1",
- "xtend": "^4.0.0"
- },
- "dependencies": {
- "mime": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
- "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
- "dev": true
- }
- }
- },
- "load-json-file": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
- "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
- "dev": true,
- "requires": {
- "graceful-fs": "^4.1.2",
- "parse-json": "^4.0.0",
- "pify": "^3.0.0",
- "strip-bom": "^3.0.0"
- }
- },
- "locate-path": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
- "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
- "dev": true,
- "requires": {
- "p-locate": "^3.0.0",
- "path-exists": "^3.0.0"
- }
- },
- "lodash": {
- "version": "4.17.20",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
- "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
- "dev": true
- },
- "lodash.deburr": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz",
- "integrity": "sha1-3bG7s+8HRYwBd7oH3hRCLLAz/5s=",
- "dev": true
- },
- "lodash.includes": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
- "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8="
- },
- "lodash.isboolean": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",
- "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY="
- },
- "lodash.isinteger": {
- "version": "4.0.4",
- "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
- "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M="
- },
- "lodash.isnumber": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz",
- "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w="
- },
- "lodash.isplainobject": {
- "version": "4.0.6",
- "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
- "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs="
- },
- "lodash.isstring": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz",
- "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE="
- },
- "lodash.once": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
- "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w="
- },
- "log-symbols": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz",
- "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==",
- "dev": true,
- "requires": {
- "chalk": "^2.0.1"
- }
- },
- "lower-case": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz",
- "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=",
- "dev": true
- },
- "magic-string": {
- "version": "0.25.7",
- "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
- "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
- "dev": true,
- "requires": {
- "sourcemap-codec": "^1.4.4"
- }
- },
- "marked": {
- "version": "1.2.7",
- "resolved": "https://registry.npmjs.org/marked/-/marked-1.2.7.tgz",
- "integrity": "sha512-No11hFYcXr/zkBvL6qFmAp1z6BKY3zqLMHny/JN/ey+al7qwCM2+CMBL9BOgqMxZU36fz4cCWfn2poWIf7QRXA=="
- },
- "memorystream": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
- "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=",
- "dev": true
- },
- "merge-stream": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
- "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
- "dev": true
- },
- "mime": {
- "version": "2.4.7",
- "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.7.tgz",
- "integrity": "sha512-dhNd1uA2u397uQk3Nv5LM4lm93WYDUXFn3Fu291FJerns4jyTudqhIWe4W04YLy7Uk1tm1Ore04NpjRvQp/NPA=="
- },
- "min-document": {
- "version": "2.19.0",
- "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz",
- "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=",
- "dev": true,
- "requires": {
- "dom-walk": "^0.1.0"
- }
- },
- "minimatch": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
- "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
- "dev": true,
- "requires": {
- "brace-expansion": "^1.1.7"
- }
- },
- "minimist": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
- "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
- "dev": true
- },
- "mkdirp": {
- "version": "0.5.1",
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
- "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
- "dev": true,
- "requires": {
- "minimist": "0.0.8"
- },
- "dependencies": {
- "minimist": {
- "version": "0.0.8",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
- "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
- "dev": true
- }
- }
- },
- "mocha": {
- "version": "6.2.3",
- "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.3.tgz",
- "integrity": "sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg==",
- "dev": true,
- "requires": {
- "ansi-colors": "3.2.3",
- "browser-stdout": "1.3.1",
- "debug": "3.2.6",
- "diff": "3.5.0",
- "escape-string-regexp": "1.0.5",
- "find-up": "3.0.0",
- "glob": "7.1.3",
- "growl": "1.10.5",
- "he": "1.2.0",
- "js-yaml": "3.13.1",
- "log-symbols": "2.2.0",
- "minimatch": "3.0.4",
- "mkdirp": "0.5.4",
- "ms": "2.1.1",
- "node-environment-flags": "1.0.5",
- "object.assign": "4.1.0",
- "strip-json-comments": "2.0.1",
- "supports-color": "6.0.0",
- "which": "1.3.1",
- "wide-align": "1.1.3",
- "yargs": "13.3.2",
- "yargs-parser": "13.1.2",
- "yargs-unparser": "1.6.0"
- },
- "dependencies": {
- "debug": {
- "version": "3.2.6",
- "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
- "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
- "dev": true,
- "requires": {
- "ms": "^2.1.1"
- }
- },
- "glob": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
- "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
- "dev": true,
- "requires": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- }
- },
- "mkdirp": {
- "version": "0.5.4",
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz",
- "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==",
- "dev": true,
- "requires": {
- "minimist": "^1.2.5"
- }
- },
- "ms": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
- "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
- "dev": true
- },
- "object.assign": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz",
- "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==",
- "dev": true,
- "requires": {
- "define-properties": "^1.1.2",
- "function-bind": "^1.1.1",
- "has-symbols": "^1.0.0",
- "object-keys": "^1.0.11"
- }
- },
- "supports-color": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz",
- "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==",
- "dev": true,
- "requires": {
- "has-flag": "^3.0.0"
- }
- }
- }
- },
- "ms": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
- },
- "nice-try": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
- "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
- "dev": true
- },
- "no-case": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz",
- "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==",
- "dev": true,
- "requires": {
- "lower-case": "^1.1.1"
- }
- },
- "node-environment-flags": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz",
- "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==",
- "dev": true,
- "requires": {
- "object.getownpropertydescriptors": "^2.0.3",
- "semver": "^5.7.0"
- }
- },
- "node-fetch": {
- "version": "2.6.1",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
- "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
- "dev": true
- },
- "node-pg-migrate": {
- "version": "3.23.3",
- "resolved": "https://registry.npmjs.org/node-pg-migrate/-/node-pg-migrate-3.23.3.tgz",
- "integrity": "sha512-2ZfkzcVbM8wGMXgZiixIZhgSx2VFvTlhG+hFWyefFzhNhqZrsr0bzRcM3VMDFTnTJ8h/EnIJVMyR135JRQnBsA==",
- "dev": true,
- "requires": {
- "@types/pg": "^7.4.0",
- "config": ">=1.0.0",
- "decamelize": "^3.2.0",
- "dotenv": ">=1.0.0",
- "lodash": "~4.17.0",
- "mkdirp": "~0.5.0",
- "yargs": "~14.2.0"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
- "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
- "dev": true
- },
- "decamelize": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-3.2.0.tgz",
- "integrity": "sha512-4TgkVUsmmu7oCSyGBm5FvfMoACuoh9EOidm7V5/J2X2djAwwt57qb3F2KMP2ITqODTCSwb+YRV+0Zqrv18k/hw==",
- "dev": true,
- "requires": {
- "xregexp": "^4.2.4"
- }
- },
- "string-width": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
- "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
- "dev": true,
- "requires": {
- "emoji-regex": "^7.0.1",
- "is-fullwidth-code-point": "^2.0.0",
- "strip-ansi": "^5.1.0"
- }
- },
- "strip-ansi": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
- "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
- "dev": true,
- "requires": {
- "ansi-regex": "^4.1.0"
- }
- },
- "yargs": {
- "version": "14.2.3",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz",
- "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==",
- "dev": true,
- "requires": {
- "cliui": "^5.0.0",
- "decamelize": "^1.2.0",
- "find-up": "^3.0.0",
- "get-caller-file": "^2.0.1",
- "require-directory": "^2.1.1",
- "require-main-filename": "^2.0.0",
- "set-blocking": "^2.0.0",
- "string-width": "^3.0.0",
- "which-module": "^2.0.0",
- "y18n": "^4.0.0",
- "yargs-parser": "^15.0.1"
- },
- "dependencies": {
- "decamelize": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
- "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
- "dev": true
- }
- }
- },
- "yargs-parser": {
- "version": "15.0.1",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz",
- "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==",
- "dev": true,
- "requires": {
- "camelcase": "^5.0.0",
- "decamelize": "^1.2.0"
- },
- "dependencies": {
- "decamelize": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
- "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
- "dev": true
- }
- }
- }
- }
- },
- "node-releases": {
- "version": "1.1.67",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz",
- "integrity": "sha512-V5QF9noGFl3EymEwUYzO+3NTDpGfQB4ve6Qfnzf3UNydMhjQRVPR1DZTuvWiLzaFJYw2fmDwAfnRNEVb64hSIg==",
- "dev": true
- },
- "normalize-package-data": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
- "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
- "dev": true,
- "requires": {
- "hosted-git-info": "^2.1.4",
- "resolve": "^1.10.0",
- "semver": "2 || 3 || 4 || 5",
- "validate-npm-package-license": "^3.0.1"
- }
- },
- "npm-run-all": {
- "version": "4.1.5",
- "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz",
- "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "^3.2.1",
- "chalk": "^2.4.1",
- "cross-spawn": "^6.0.5",
- "memorystream": "^0.3.1",
- "minimatch": "^3.0.4",
- "pidtree": "^0.3.0",
- "read-pkg": "^3.0.0",
- "shell-quote": "^1.6.1",
- "string.prototype.padend": "^3.0.0"
- }
- },
- "object-inspect": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz",
- "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==",
- "dev": true
- },
- "object-keys": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
- "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
- "dev": true
- },
- "object.assign": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz",
- "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==",
- "dev": true,
- "requires": {
- "call-bind": "^1.0.0",
- "define-properties": "^1.1.3",
- "has-symbols": "^1.0.1",
- "object-keys": "^1.1.1"
- }
- },
- "object.getownpropertydescriptors": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.1.tgz",
- "integrity": "sha512-6DtXgZ/lIZ9hqx4GtZETobXLR/ZLaa0aqV0kzbn80Rf8Z2e/XFnhA0I7p07N2wH8bBBltr2xQPi6sbKWAY2Eng==",
- "dev": true,
- "requires": {
- "call-bind": "^1.0.0",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.18.0-next.1"
- }
- },
- "omggif": {
- "version": "1.0.10",
- "resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz",
- "integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==",
- "dev": true
- },
- "once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
- "dev": true,
- "requires": {
- "wrappy": "1"
- }
- },
- "p-limit": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
- "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
- "dev": true,
- "requires": {
- "p-try": "^2.0.0"
- }
- },
- "p-locate": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
- "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
- "dev": true,
- "requires": {
- "p-limit": "^2.0.0"
- }
- },
- "p-try": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
- "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
- "dev": true
- },
- "packet-reader": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz",
- "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ=="
- },
- "pako": {
- "version": "1.0.11",
- "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
- "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
- "dev": true
- },
- "param-case": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz",
- "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=",
- "dev": true,
- "requires": {
- "no-case": "^2.2.0"
- }
- },
- "parse-bmfont-ascii": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz",
- "integrity": "sha1-Eaw8P/WPfCAgqyJ2kHkQjU36AoU=",
- "dev": true
- },
- "parse-bmfont-binary": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/parse-bmfont-binary/-/parse-bmfont-binary-1.0.6.tgz",
- "integrity": "sha1-0Di0dtPp3Z2x4RoLDlOiJ5K2kAY=",
- "dev": true
- },
- "parse-bmfont-xml": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/parse-bmfont-xml/-/parse-bmfont-xml-1.1.4.tgz",
- "integrity": "sha512-bjnliEOmGv3y1aMEfREMBJ9tfL3WR0i0CKPj61DnSLaoxWR3nLrsQrEbCId/8rF4NyRF0cCqisSVXyQYWM+mCQ==",
- "dev": true,
- "requires": {
- "xml-parse-from-string": "^1.0.0",
- "xml2js": "^0.4.5"
- }
- },
- "parse-headers": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.3.tgz",
- "integrity": "sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA==",
- "dev": true
- },
- "parse-json": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
- "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
- "dev": true,
- "requires": {
- "error-ex": "^1.3.1",
- "json-parse-better-errors": "^1.0.1"
- }
- },
- "path-exists": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
- "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
- "dev": true
- },
- "path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
- "dev": true
- },
- "path-key": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
- "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
- "dev": true
- },
- "path-parse": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
- "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
- "dev": true
- },
- "path-type": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
- "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
- "dev": true,
- "requires": {
- "pify": "^3.0.0"
- }
- },
- "pg": {
- "version": "7.18.2",
- "resolved": "https://registry.npmjs.org/pg/-/pg-7.18.2.tgz",
- "integrity": "sha512-Mvt0dGYMwvEADNKy5PMQGlzPudKcKKzJds/VbOeZJpb6f/pI3mmoXX0JksPgI3l3JPP/2Apq7F36O63J7mgveA==",
- "requires": {
- "buffer-writer": "2.0.0",
- "packet-reader": "1.0.0",
- "pg-connection-string": "0.1.3",
- "pg-packet-stream": "^1.1.0",
- "pg-pool": "^2.0.10",
- "pg-types": "^2.1.0",
- "pgpass": "1.x",
- "semver": "4.3.2"
- },
- "dependencies": {
- "semver": {
- "version": "4.3.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.2.tgz",
- "integrity": "sha1-x6BxWKgL7dBSNVt3DYLWZA+AO+c="
- }
- }
- },
- "pg-connection-string": {
- "version": "0.1.3",
- "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-0.1.3.tgz",
- "integrity": "sha1-2hhHsglA5C7hSSvq9l1J2RskXfc="
- },
- "pg-int8": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
- "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw=="
- },
- "pg-packet-stream": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/pg-packet-stream/-/pg-packet-stream-1.1.0.tgz",
- "integrity": "sha512-kRBH0tDIW/8lfnnOyTwKD23ygJ/kexQVXZs7gEyBljw4FYqimZFxnMMx50ndZ8In77QgfGuItS5LLclC2TtjYg=="
- },
- "pg-pool": {
- "version": "2.0.10",
- "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-2.0.10.tgz",
- "integrity": "sha512-qdwzY92bHf3nwzIUcj+zJ0Qo5lpG/YxchahxIN8+ZVmXqkahKXsnl2aiJPHLYN9o5mB/leG+Xh6XKxtP7e0sjg=="
- },
- "pg-types": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
- "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
- "requires": {
- "pg-int8": "1.0.1",
- "postgres-array": "~2.0.0",
- "postgres-bytea": "~1.0.0",
- "postgres-date": "~1.0.4",
- "postgres-interval": "^1.1.0"
- }
- },
- "pgpass": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.4.tgz",
- "integrity": "sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w==",
- "requires": {
- "split2": "^3.1.1"
- }
- },
- "phin": {
- "version": "2.9.3",
- "resolved": "https://registry.npmjs.org/phin/-/phin-2.9.3.tgz",
- "integrity": "sha512-CzFr90qM24ju5f88quFC/6qohjC144rehe5n6DH900lgXmUe86+xCKc10ev56gRKC4/BkHUoG4uSiQgBiIXwDA==",
- "dev": true
- },
- "picomatch": {
- "version": "2.2.2",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
- "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
- "dev": true
- },
- "pidtree": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz",
- "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==",
- "dev": true
- },
- "pify": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
- "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
- "dev": true
- },
- "pixelmatch": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-4.0.2.tgz",
- "integrity": "sha1-j0fc7FARtHe2fbA8JDvB8wheiFQ=",
- "dev": true,
- "requires": {
- "pngjs": "^3.0.0"
- }
- },
- "pngjs": {
- "version": "3.4.0",
- "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz",
- "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==",
- "dev": true
- },
- "polka": {
- "version": "1.0.0-next.11",
- "resolved": "https://registry.npmjs.org/polka/-/polka-1.0.0-next.11.tgz",
- "integrity": "sha512-M/HBkS6ILksrDq7uvktCTev81OzuLwNtpxMyYdUhxLKQlMWdsu789XMotQU+p8JY8CM8vx8ML0HudyWjRus/lg==",
- "requires": {
- "@polka/url": "^1.0.0-next.11",
- "trouter": "^3.1.0"
- }
- },
- "postgres-array": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
- "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA=="
- },
- "postgres-bytea": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
- "integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU="
- },
- "postgres-date": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
- "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q=="
- },
- "postgres-interval": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
- "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
- "requires": {
- "xtend": "^4.0.0"
- }
- },
- "prism-svelte": {
- "version": "0.4.7",
- "resolved": "https://registry.npmjs.org/prism-svelte/-/prism-svelte-0.4.7.tgz",
- "integrity": "sha512-yABh19CYbM24V7aS7TuPYRNMqthxwbvx6FF/Rw920YbyBWO3tnyPIqRMgHuSVsLmuHkkBS1Akyof463FVdkeDQ=="
- },
- "prismjs": {
- "version": "1.23.0",
- "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.23.0.tgz",
- "integrity": "sha512-c29LVsqOaLbBHuIbsTxaKENh1N2EQBOHaWv7gkHN4dgRbxSREqDnDbtFJYdpPauS4YCplMSNCABQ6Eeor69bAA==",
- "requires": {
- "clipboard": "^2.0.0"
- }
- },
- "process": {
- "version": "0.11.10",
- "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
- "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=",
- "dev": true
- },
- "randombytes": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
- "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
- "dev": true,
- "requires": {
- "safe-buffer": "^5.1.0"
- }
- },
- "read-pkg": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
- "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
- "dev": true,
- "requires": {
- "load-json-file": "^4.0.0",
- "normalize-package-data": "^2.3.2",
- "path-type": "^3.0.0"
- }
- },
- "readable-stream": {
- "version": "3.6.0",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
- "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
- "requires": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- }
- },
- "rechoir": {
- "version": "0.6.2",
- "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
- "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
- "dev": true,
- "requires": {
- "resolve": "^1.1.6"
- }
- },
- "regenerate": {
- "version": "1.4.2",
- "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz",
- "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==",
- "dev": true
- },
- "regenerate-unicode-properties": {
- "version": "8.2.0",
- "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz",
- "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==",
- "dev": true,
- "requires": {
- "regenerate": "^1.4.0"
- }
- },
- "regenerator-runtime": {
- "version": "0.13.7",
- "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz",
- "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==",
- "dev": true
- },
- "regenerator-transform": {
- "version": "0.14.5",
- "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz",
- "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==",
- "dev": true,
- "requires": {
- "@babel/runtime": "^7.8.4"
- }
- },
- "regexparam": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/regexparam/-/regexparam-1.3.0.tgz",
- "integrity": "sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g=="
- },
- "regexpu-core": {
- "version": "4.7.1",
- "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz",
- "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==",
- "dev": true,
- "requires": {
- "regenerate": "^1.4.0",
- "regenerate-unicode-properties": "^8.2.0",
- "regjsgen": "^0.5.1",
- "regjsparser": "^0.6.4",
- "unicode-match-property-ecmascript": "^1.0.4",
- "unicode-match-property-value-ecmascript": "^1.2.0"
- }
- },
- "regjsgen": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz",
- "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==",
- "dev": true
- },
- "regjsparser": {
- "version": "0.6.4",
- "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz",
- "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==",
- "dev": true,
- "requires": {
- "jsesc": "~0.5.0"
- },
- "dependencies": {
- "jsesc": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
- "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
- "dev": true
- }
- }
- },
- "relateurl": {
- "version": "0.2.7",
- "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz",
- "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=",
- "dev": true
- },
- "require-directory": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
- "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
- "dev": true
- },
- "require-main-filename": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
- "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
- "dev": true
- },
- "require-relative": {
- "version": "0.8.7",
- "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz",
- "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=",
- "dev": true
- },
- "resolve": {
- "version": "1.19.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
- "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
- "dev": true,
- "requires": {
- "is-core-module": "^2.1.0",
- "path-parse": "^1.0.6"
- }
- },
- "rollup": {
- "version": "2.35.1",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.35.1.tgz",
- "integrity": "sha512-q5KxEyWpprAIcainhVy6HfRttD9kutQpHbeqDTWnqAFNJotiojetK6uqmcydNMymBEtC4I8bCYR+J3mTMqeaUA==",
- "dev": true,
- "requires": {
- "fsevents": "~2.1.2"
- }
- },
- "rollup-plugin-svelte": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.0.0.tgz",
- "integrity": "sha512-cw4yv/5v1NQV3nPbpOJtikgkB+9mfSJaqKUdq7x5fVQJnwLtcdc2JOszBs5pBY+SemTs5pmJbdEMseEavbUtjQ==",
- "dev": true,
- "requires": {
- "require-relative": "^0.8.7",
- "rollup-pluginutils": "^2.8.2"
- }
- },
- "rollup-plugin-terser": {
- "version": "7.0.2",
- "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz",
- "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==",
- "dev": true,
- "requires": {
- "@babel/code-frame": "^7.10.4",
- "jest-worker": "^26.2.1",
- "serialize-javascript": "^4.0.0",
- "terser": "^5.0.0"
- }
- },
- "rollup-pluginutils": {
- "version": "2.8.2",
- "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz",
- "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==",
- "dev": true,
- "requires": {
- "estree-walker": "^0.6.1"
- },
- "dependencies": {
- "estree-walker": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz",
- "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==",
- "dev": true
- }
- }
- },
- "safe-buffer": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
- "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
- },
- "sapper": {
- "version": "0.28.10",
- "resolved": "https://registry.npmjs.org/sapper/-/sapper-0.28.10.tgz",
- "integrity": "sha512-Z6OpuDOHxiRHKd7JCjHaDe8uOM2fFZxpTLsj/0Ib4sM034xstEvNNUtdY7Pg/a85kP3cFCnkNiM1v7W37vzDGg==",
- "dev": true,
- "requires": {
- "html-minifier": "^4.0.0",
- "http-link-header": "^1.0.2",
- "shimport": "^2.0.4",
- "source-map": "^0.6.1",
- "sourcemap-codec": "^1.4.6",
- "string-hash": "^1.1.3"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- }
- }
- },
- "sax": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
- "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
- "dev": true
- },
- "select": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
- "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=",
- "optional": true
- },
- "semver": {
- "version": "5.7.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
- "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
- },
- "serialize-javascript": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz",
- "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==",
- "dev": true,
- "requires": {
- "randombytes": "^2.1.0"
- }
- },
- "set-blocking": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
- "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
- "dev": true
- },
- "shebang-command": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
- "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
- "dev": true,
- "requires": {
- "shebang-regex": "^1.0.0"
- }
- },
- "shebang-regex": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
- "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
- "dev": true
- },
- "shell-quote": {
- "version": "1.7.2",
- "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz",
- "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==",
- "dev": true
- },
- "shelljs": {
- "version": "0.8.4",
- "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz",
- "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==",
- "dev": true,
- "requires": {
- "glob": "^7.0.0",
- "interpret": "^1.0.0",
- "rechoir": "^0.6.2"
- }
- },
- "shimport": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/shimport/-/shimport-2.0.4.tgz",
- "integrity": "sha512-5YOyQqYkOFSkPFnpS87De6BYzDiZBc8FS4/aTuGZiST+WmXSwWRoaNRHqyVOeEpSx9wlgYWg9WYfCuzD/11/qA==",
- "dev": true
- },
- "sirv": {
- "version": "1.0.10",
- "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.10.tgz",
- "integrity": "sha512-H5EZCoZaggEUQy8ocKsF7WAToGuZhjJlLvM3XOef46CbdIgbNeQ1p32N1PCuCjkVYwrAVOSMacN6CXXgIzuspg==",
- "requires": {
- "@polka/url": "^1.0.0-next.9",
- "mime": "^2.3.1",
- "totalist": "^1.0.0"
- }
- },
- "source-map": {
- "version": "0.5.7",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
- "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
- "dev": true
- },
- "source-map-support": {
- "version": "0.5.19",
- "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
- "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
- "dev": true,
- "requires": {
- "buffer-from": "^1.0.0",
- "source-map": "^0.6.0"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- }
- }
- },
- "sourcemap-codec": {
- "version": "1.4.8",
- "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
- "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
- "dev": true
- },
- "spdx-correct": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
- "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==",
- "dev": true,
- "requires": {
- "spdx-expression-parse": "^3.0.0",
- "spdx-license-ids": "^3.0.0"
- }
- },
- "spdx-exceptions": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
- "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==",
- "dev": true
- },
- "spdx-expression-parse": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
- "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
- "dev": true,
- "requires": {
- "spdx-exceptions": "^2.1.0",
- "spdx-license-ids": "^3.0.0"
- }
- },
- "spdx-license-ids": {
- "version": "3.0.7",
- "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz",
- "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==",
- "dev": true
- },
- "split2": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz",
- "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==",
- "requires": {
- "readable-stream": "^3.0.0"
- }
- },
- "sprintf-js": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
- "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
- "dev": true
- },
- "string-hash": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz",
- "integrity": "sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=",
- "dev": true
- },
- "string-width": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
- "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
- "dev": true,
- "requires": {
- "is-fullwidth-code-point": "^2.0.0",
- "strip-ansi": "^4.0.0"
- }
- },
- "string.prototype.padend": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.1.tgz",
- "integrity": "sha512-eCzTASPnoCr5Ht+Vn1YXgm8SB015hHKgEIMu9Nr9bQmLhRBxKRfmzSj/IQsxDFc8JInJDDFA0qXwK+xxI7wDkg==",
- "dev": true,
- "requires": {
- "call-bind": "^1.0.0",
- "define-properties": "^1.1.3",
- "es-abstract": "^1.18.0-next.1"
- }
- },
- "string.prototype.trimend": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz",
- "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==",
- "dev": true,
- "requires": {
- "call-bind": "^1.0.0",
- "define-properties": "^1.1.3"
- }
- },
- "string.prototype.trimstart": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz",
- "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==",
- "dev": true,
- "requires": {
- "call-bind": "^1.0.0",
- "define-properties": "^1.1.3"
- }
- },
- "string_decoder": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
- "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
- "requires": {
- "safe-buffer": "~5.2.0"
- }
- },
- "strip-ansi": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
- "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
- "dev": true,
- "requires": {
- "ansi-regex": "^3.0.0"
- }
- },
- "strip-bom": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
- "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
- "dev": true
- },
- "strip-json-comments": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
- "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
- "dev": true
- },
- "supports-color": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
- "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
- "dev": true,
- "requires": {
- "has-flag": "^3.0.0"
- }
- },
- "svelte": {
- "version": "3.31.0",
- "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.31.0.tgz",
- "integrity": "sha512-r+n8UJkDqoQm1b+3tA3Lh6mHXKpcfOSOuEuIo5gE2W9wQYi64RYX/qE6CZBDDsP/H4M+N426JwY7XGH4xASvGQ==",
- "dev": true
- },
- "svelte-json-tree": {
- "version": "0.0.5",
- "resolved": "https://registry.npmjs.org/svelte-json-tree/-/svelte-json-tree-0.0.5.tgz",
- "integrity": "sha512-kTcOVlsldI2neszYNQAfFCt+u62OWWAZgpeoW9RN3hjtJCWI5bkVj0gtljZWUlyEWTfgpmag5L5AHDKg8w8ZmQ==",
- "dev": true
- },
- "terser": {
- "version": "5.5.1",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.5.1.tgz",
- "integrity": "sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ==",
- "dev": true,
- "requires": {
- "commander": "^2.20.0",
- "source-map": "~0.7.2",
- "source-map-support": "~0.5.19"
- },
- "dependencies": {
- "source-map": {
- "version": "0.7.3",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
- "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
- "dev": true
- }
- }
- },
- "timm": {
- "version": "1.7.1",
- "resolved": "https://registry.npmjs.org/timm/-/timm-1.7.1.tgz",
- "integrity": "sha512-IjZc9KIotudix8bMaBW6QvMuq64BrJWFs1+4V0lXwWGQZwH+LnX87doAYhem4caOEusRP9/g6jVDQmZ8XOk1nw==",
- "dev": true
- },
- "tiny-emitter": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
- "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
- "optional": true
- },
- "tinycolor2": {
- "version": "1.4.2",
- "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.2.tgz",
- "integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==",
- "dev": true
- },
- "to-fast-properties": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
- "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
- "dev": true
- },
- "totalist": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz",
- "integrity": "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g=="
- },
- "trouter": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/trouter/-/trouter-3.1.0.tgz",
- "integrity": "sha512-3Swwu638QQWOefHLss9cdyLi5/9BKYmXZEXpH0KOFfB9YZwUAwHbDAcoYxaHfqAeFvbi/LqAK7rGkhCr1v1BJA==",
- "requires": {
- "regexparam": "^1.3.0"
- }
- },
- "uglify-js": {
- "version": "3.12.4",
- "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.12.4.tgz",
- "integrity": "sha512-L5i5jg/SHkEqzN18gQMTWsZk3KelRsfD1wUVNqtq0kzqWQqcJjyL8yc1o8hJgRrWqrAl2mUFbhfznEIoi7zi2A==",
- "dev": true
- },
- "unicode-canonical-property-names-ecmascript": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
- "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==",
- "dev": true
- },
- "unicode-match-property-ecmascript": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz",
- "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==",
- "dev": true,
- "requires": {
- "unicode-canonical-property-names-ecmascript": "^1.0.4",
- "unicode-property-aliases-ecmascript": "^1.0.4"
- }
- },
- "unicode-match-property-value-ecmascript": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz",
- "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==",
- "dev": true
- },
- "unicode-property-aliases-ecmascript": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz",
- "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==",
- "dev": true
- },
- "upper-case": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz",
- "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=",
- "dev": true
- },
- "utif": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/utif/-/utif-2.0.1.tgz",
- "integrity": "sha512-Z/S1fNKCicQTf375lIP9G8Sa1H/phcysstNrrSdZKj1f9g58J4NMgb5IgiEZN9/nLMPDwF0W7hdOe9Qq2IYoLg==",
- "dev": true,
- "requires": {
- "pako": "^1.0.5"
- }
- },
- "util-deprecate": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
- "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
- },
- "validate-npm-package-license": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
- "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
- "dev": true,
- "requires": {
- "spdx-correct": "^3.0.0",
- "spdx-expression-parse": "^3.0.0"
- }
- },
- "which": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
- "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
- "dev": true,
- "requires": {
- "isexe": "^2.0.0"
- }
- },
- "which-module": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
- "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
- "dev": true
- },
- "wide-align": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
- "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
- "dev": true,
- "requires": {
- "string-width": "^1.0.2 || 2"
- }
- },
- "wrap-ansi": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
- "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
- "dev": true,
- "requires": {
- "ansi-styles": "^3.2.0",
- "string-width": "^3.0.0",
- "strip-ansi": "^5.0.0"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
- "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
- "dev": true
- },
- "string-width": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
- "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
- "dev": true,
- "requires": {
- "emoji-regex": "^7.0.1",
- "is-fullwidth-code-point": "^2.0.0",
- "strip-ansi": "^5.1.0"
- }
- },
- "strip-ansi": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
- "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
- "dev": true,
- "requires": {
- "ansi-regex": "^4.1.0"
- }
- }
- }
- },
- "wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
- "dev": true
- },
- "xhr": {
- "version": "2.6.0",
- "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz",
- "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==",
- "dev": true,
- "requires": {
- "global": "~4.4.0",
- "is-function": "^1.0.1",
- "parse-headers": "^2.0.0",
- "xtend": "^4.0.0"
- }
- },
- "xml-parse-from-string": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz",
- "integrity": "sha1-qQKekp09vN7RafPG4oI42VpdWig=",
- "dev": true
- },
- "xml2js": {
- "version": "0.4.23",
- "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
- "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
- "dev": true,
- "requires": {
- "sax": ">=0.6.0",
- "xmlbuilder": "~11.0.0"
- }
- },
- "xmlbuilder": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
- "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
- "dev": true
- },
- "xregexp": {
- "version": "4.4.1",
- "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.4.1.tgz",
- "integrity": "sha512-2u9HwfadaJaY9zHtRRnH6BY6CQVNQKkYm3oLtC9gJXXzfsbACg5X5e4EZZGVAH+YIfa+QA9lsFQTTe3HURF3ag==",
- "dev": true,
- "requires": {
- "@babel/runtime-corejs3": "^7.12.1"
- }
- },
- "xtend": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
- "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
- },
- "y18n": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
- "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==",
- "dev": true
- },
- "yargs": {
- "version": "13.3.2",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz",
- "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==",
- "dev": true,
- "requires": {
- "cliui": "^5.0.0",
- "find-up": "^3.0.0",
- "get-caller-file": "^2.0.1",
- "require-directory": "^2.1.1",
- "require-main-filename": "^2.0.0",
- "set-blocking": "^2.0.0",
- "string-width": "^3.0.0",
- "which-module": "^2.0.0",
- "y18n": "^4.0.0",
- "yargs-parser": "^13.1.2"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
- "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
- "dev": true
- },
- "string-width": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
- "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
- "dev": true,
- "requires": {
- "emoji-regex": "^7.0.1",
- "is-fullwidth-code-point": "^2.0.0",
- "strip-ansi": "^5.1.0"
- }
- },
- "strip-ansi": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
- "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
- "dev": true,
- "requires": {
- "ansi-regex": "^4.1.0"
- }
- }
- }
- },
- "yargs-parser": {
- "version": "13.1.2",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz",
- "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==",
- "dev": true,
- "requires": {
- "camelcase": "^5.0.0",
- "decamelize": "^1.2.0"
- }
- },
- "yargs-unparser": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz",
- "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==",
- "dev": true,
- "requires": {
- "flat": "^4.1.0",
- "lodash": "^4.17.15",
- "yargs": "^13.3.0"
- }
- },
- "yootils": {
- "version": "0.0.16",
- "resolved": "https://registry.npmjs.org/yootils/-/yootils-0.0.16.tgz",
- "integrity": "sha512-aIVecm5ucOzwhtKbl0zkfg0ZSOUR9c2da0k8cIc9umjjzkvVCWUUX/UHZ1CLPsv4wmJLqt0aWeLB7p9n9JDwYQ=="
- }
- }
-}
diff --git a/site/package.json b/site/package.json
deleted file mode 100644
index 6c1513b61d..0000000000
--- a/site/package.json
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- "name": "svelte.dev",
- "version": "1.0.0",
- "description": "Docs and examples for Svelte",
- "scripts": {
- "dev": "npm run copy-workers && sapper dev",
- "copy-workers": "node scripts/copy-workers.js",
- "migrate": "node-pg-migrate -r dotenv/config",
- "build": "npm run copy-workers && sapper build --legacy",
- "update": "node scripts/update_template.js && node scripts/get-contributors.js && node scripts/update_whos_using.js",
- "start": "node __sapper__/build",
- "test": "mocha -r esm test/**",
- "deploy": "make deploy"
- },
- "dependencies": {
- "@polka/redirect": "^1.0.0-next.7",
- "@polka/send": "^1.0.0-next.7",
- "cookie": "^0.4.0",
- "devalue": "^2.0.0",
- "do-not-zip": "^1.0.0",
- "flru": "^1.0.2",
- "httpie": "^1.1.2",
- "jsonwebtoken": "^8.5.1",
- "marked": "^1.0.0",
- "pg": "^7.12.1",
- "polka": "^1.0.0-next.9",
- "prism-svelte": "^0.4.3",
- "prismjs": "^1.21.0",
- "sirv": "^1.0.0",
- "yootils": "0.0.16"
- },
- "devDependencies": {
- "@babel/core": "^7.6.0",
- "@babel/plugin-syntax-dynamic-import": "^7.2.0",
- "@babel/plugin-transform-runtime": "^7.6.0",
- "@babel/preset-env": "^7.6.0",
- "@babel/runtime": "^7.6.0",
- "@rollup/plugin-babel": "^5.0.0",
- "@rollup/plugin-commonjs": "^17.0.0",
- "@rollup/plugin-json": "^4.1.0",
- "@rollup/plugin-node-resolve": "^11.0.0",
- "@rollup/plugin-replace": "^2.2.0",
- "@sindresorhus/slugify": "^0.9.1",
- "@sveltejs/site-kit": "^1.2.5",
- "@sveltejs/svelte-repl": "^0.2.1",
- "degit": "^2.1.4",
- "dotenv": "^8.1.0",
- "esm": "^3.2.25",
- "jimp": "^0.8.0",
- "mocha": "^6.2.0",
- "node-fetch": "^2.6.1",
- "node-pg-migrate": "^3.22.0",
- "npm-run-all": "^4.1.5",
- "rollup": "^2.30.0",
- "rollup-plugin-svelte": "^7.0.0",
- "rollup-plugin-terser": "^7.0.0",
- "sapper": "^0.28.10",
- "shelljs": "^0.8.3",
- "svelte": "^3.12.0"
- },
- "engines": {
- "node": ">=10.0.0"
- }
-}
diff --git a/site/rollup.config.js b/site/rollup.config.js
deleted file mode 100644
index 44092beec3..0000000000
--- a/site/rollup.config.js
+++ /dev/null
@@ -1,122 +0,0 @@
-import 'dotenv/config';
-import babel from '@rollup/plugin-babel';
-import commonjs from '@rollup/plugin-commonjs';
-import json from '@rollup/plugin-json';
-import replace from '@rollup/plugin-replace';
-import resolve from '@rollup/plugin-node-resolve';
-import svelte from 'rollup-plugin-svelte';
-import { terser } from 'rollup-plugin-terser';
-import config from 'sapper/config/rollup.js';
-import pkg from './package.json';
-
-const mode = process.env.NODE_ENV;
-const dev = mode === 'development';
-const legacy = !!process.env.SAPPER_LEGACY_BUILD;
-
-if (!dev && !process.env.MAPBOX_ACCESS_TOKEN) {
- throw new Error('MAPBOX_ACCESS_TOKEN is missing. Please add the token in the .env file before generating the production build.');
-}
-
-const onwarn = (warning, onwarn) => (warning.code === 'CIRCULAR_DEPENDENCY' && /[/\\]@sapper[/\\]/.test(warning.message)) || onwarn(warning);
-const dedupe = importee => importee === 'svelte' || importee.startsWith('svelte/');
-
-export default {
- client: {
- input: config.client.input(),
- output: config.client.output(),
- plugins: [
- replace({
- 'process.browser': true,
- 'process.env.NODE_ENV': JSON.stringify(mode),
- 'process.env.MAPBOX_ACCESS_TOKEN': JSON.stringify(process.env.MAPBOX_ACCESS_TOKEN)
- }),
- svelte({
- compilerOptions: {
- dev,
- hydratable: true
- }
- }),
- resolve({
- browser: true,
- dedupe
- }),
- commonjs(),
- json(),
-
- legacy && babel({
- extensions: ['.js', '.mjs', '.html', '.svelte'],
- babelHelpers: 'runtime',
- exclude: ['node_modules/@babel/**'],
- presets: [
- ['@babel/preset-env', {
- targets: '> 0.25%, not dead'
- }]
- ],
- plugins: [
- '@babel/plugin-syntax-dynamic-import',
- ['@babel/plugin-transform-runtime', {
- useESModules: true
- }]
- ]
- }),
-
- !dev && terser({
- module: true
- })
- ],
-
- preserveEntrySignatures: false,
- onwarn
- },
-
- server: {
- input: config.server.input(),
- output: config.server.output(),
- plugins: [
- replace({
- 'process.browser': false,
- 'process.env.NODE_ENV': JSON.stringify(mode)
- }),
- svelte({
- compilerOptions: {
- dev,
- generate: 'ssr',
- hydratable: true
- },
- emitCss: false
- }),
- resolve({
- dedupe
- }),
- commonjs(),
- json()
- ],
- external: [
- 'yootils',
- 'codemirror',
- ...Object.keys(pkg.dependencies || {}).concat(
- require('module').builtinModules || Object.keys(process.binding('natives'))
- )
- ],
-
- preserveEntrySignatures: 'strict',
- onwarn
- },
-
- serviceworker: {
- input: config.serviceworker.input(),
- output: config.serviceworker.output(),
- plugins: [
- resolve(),
- replace({
- 'process.browser': true,
- 'process.env.NODE_ENV': JSON.stringify(mode)
- }),
- commonjs(),
- !dev && terser()
- ],
-
- preserveEntrySignatures: false,
- onwarn
- }
-};
diff --git a/site/scripts/copy-workers.js b/site/scripts/copy-workers.js
deleted file mode 100644
index 4856764ad0..0000000000
--- a/site/scripts/copy-workers.js
+++ /dev/null
@@ -1,4 +0,0 @@
-const sh = require('shelljs');
-
-sh.rm('-rf', 'static/workers');
-sh.cp('-r', 'node_modules/@sveltejs/svelte-repl/workers', 'static');
diff --git a/site/scripts/get-contributors.js b/site/scripts/get-contributors.js
deleted file mode 100644
index cb1facb874..0000000000
--- a/site/scripts/get-contributors.js
+++ /dev/null
@@ -1,53 +0,0 @@
-require('dotenv/config');
-const fs = require('fs');
-const fetch = require('node-fetch');
-const Jimp = require('jimp');
-
-process.chdir(__dirname);
-
-const base = `https://api.github.com/repos/sveltejs/svelte/contributors`;
-const { GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET } = process.env;
-
-const SIZE = 64;
-
-async function main() {
- const contributors = [];
- let page = 1;
-
- while (true) {
- const res = await fetch(`${base}?client_id=${GITHUB_CLIENT_ID}&client_secret=${GITHUB_CLIENT_SECRET}&per_page=100&page=${page++}`);
- const list = await res.json();
-
- if (list.length === 0) break;
-
- contributors.push(...list);
- }
-
- const authors = contributors
- .sort((a, b) => b.contributions - a.contributions);
-
- const sprite = new Jimp(SIZE * authors.length, SIZE);
-
- for (let i = 0; i < authors.length; i += 1) {
- const author = authors[i];
- console.log(`${i + 1} / ${authors.length}: ${author.login}`);
-
- const image_data = await fetch(author.avatar_url);
- const buffer = await image_data.arrayBuffer();
-
- const image = await Jimp.read(buffer);
- image.resize(SIZE, SIZE);
-
- sprite.composite(image, i * SIZE, 0);
- }
-
- await sprite.quality(80).write(`../static/contributors.jpg`);
- // TODO: Optimizing the static/contributors.jpg image should probably get automated as well
- console.log('remember to additionally optimize the resulting /static/contributors.jpg image file via e.g. https://squoosh.app ');
-
- const str = `[\n\t${authors.map(a => `'${a.login}'`).join(',\n\t')}\n]`;
-
- fs.writeFileSync(`../src/routes/_contributors.js`, `export default ${str};`);
-}
-
-main();
\ No newline at end of file
diff --git a/site/scripts/get-example-thumbnails/index.js b/site/scripts/get-example-thumbnails/index.js
deleted file mode 100644
index 770fca852f..0000000000
--- a/site/scripts/get-example-thumbnails/index.js
+++ /dev/null
@@ -1,67 +0,0 @@
-const fs = require('fs');
-const puppeteer = require('puppeteer');
-const Jimp = require('jimp');
-const c = require('kleur');
-
-const slugs = [];
-
-fs.readdirSync(`content/examples`).forEach(group_dir => {
- fs.readdirSync(`content/examples/${group_dir}`).filter(file => file !== 'meta.json').map(example_dir => {
- const slug = example_dir.replace(/^\d+-/, '');
- slugs.push(slug);
- });
-});
-
-async function main() {
- const browser = await puppeteer.launch({
- defaultViewport: {
- width: 400 * 10 / 4,
- height: 400 + 42,
- deviceScaleFactor: 2
- }
- });
-
- const page = await browser.newPage();
-
- for (const slug of slugs) {
- try {
- const output_file = `static/examples/thumbnails/${slug}.jpg`;
- if (fs.existsSync(output_file)) {
- console.log(c.gray(`skipping ${slug}`));
- continue;
- }
-
- console.log(slug);
- await page.goto(`http://localhost:3000/repl/embed?example=${slug}`);
-
- await page.waitForSelector('iframe.inited[title=Result]');
- await page.waitFor(1500);
- const iframe = await page.$('iframe.inited[title=Result]');
- const buffer = await iframe.screenshot();
-
- const image = await Jimp.read(buffer);
- console.log(image.bitmap.width, image.bitmap.height);
- image.crop(3, 3, image.bitmap.width - 6, image.bitmap.height - 6);
- image.autocrop();
- // image.scale(0.25);
-
- if (image.bitmap.width > 200 || image.bitmap.height > 200) {
- const scale = Math.min(
- 200 / image.bitmap.width,
- 200 / image.bitmap.height
- );
-
- image.scale(scale);
- }
-
- await image.quality(75).write(output_file);
- } catch (err) {
- console.log(c.bold().red(`failed to screenshot ${slug}`));
- console.log(err);
- }
- }
-
- await browser.close();
-}
-
-main();
\ No newline at end of file
diff --git a/site/scripts/get-examples-from-tutorials/index.js b/site/scripts/get-examples-from-tutorials/index.js
deleted file mode 100644
index f828a089be..0000000000
--- a/site/scripts/get-examples-from-tutorials/index.js
+++ /dev/null
@@ -1,74 +0,0 @@
-const sander = require('sander');
-
-process.chdir(`${__dirname}/../..`);
-
-function extract_frontmatter(markdown) {
- const match = /---\r?\n([\s\S]+?)\r?\n---/.exec(markdown);
- const frontMatter = match[1];
- const content = markdown.slice(match[0].length);
-
- const metadata = {};
- frontMatter.split('\n').forEach(pair => {
- const colonIndex = pair.indexOf(':');
- metadata[pair.slice(0, colonIndex).trim()] = pair
- .slice(colonIndex + 1)
- .trim();
- });
-
- return { metadata, content };
-}
-
-const tutorial_sections = sander.readdirSync(`content/tutorial`).map(section_dir => {
- const section_slug = section_dir.replace(/^\d+-/, '');
-
- const meta = JSON.parse(sander.readFileSync(`content/tutorial/${section_dir}/meta.json`, { encoding: 'utf-8' }));
-
- const chapters = sander.readdirSync(`content/tutorial/${section_dir}`).map(chapter_dir => {
- const app_dir = `content/tutorial/${section_dir}/${chapter_dir}/app-b`;
- if (!sander.existsSync(app_dir)) return;
-
- const markdown = sander.readFileSync(`content/tutorial/${section_dir}/${chapter_dir}/text.md`, { encoding: 'utf-8' });
- const { metadata } = extract_frontmatter(markdown);
-
- const chapter_slug = chapter_dir.replace(/^\d+-/, '');
-
- return {
- slug: chapter_slug,
- title: metadata.title,
- files: sander.readdirSync(app_dir).map(name => {
- return {
- name,
- source: sander.readFileSync(`${app_dir}/${name}`, { encoding: 'utf-8' })
- };
- })
- };
- }).filter(Boolean);
-
- return {
- slug: section_slug,
- title: meta.title,
- chapters
- };
-}).filter(section => section.chapters.length > 0);
-
-const pad = i => i < 10 ? `0${i}` : i;
-
-tutorial_sections.forEach((section, i) => {
- const section_dir = `${pad(i)}-${section.slug}`;
-
- sander.writeFileSync(`content/examples/${section_dir}/meta.json`, JSON.stringify({
- title: section.title
- }, null, '\t'));
-
- section.chapters.forEach((chapter, i) => {
- const chapter_dir = `${pad(i)}-${chapter.slug}`;
-
- sander.writeFileSync(`content/examples/${section_dir}/${chapter_dir}/meta.json`, JSON.stringify({
- title: chapter.title
- }, null, '\t'));
-
- chapter.files.forEach(file => {
- sander.writeFileSync(`content/examples/${section_dir}/${chapter_dir}/${file.name}`, file.source);
- });
- });
-});
\ No newline at end of file
diff --git a/site/scripts/update_template.js b/site/scripts/update_template.js
deleted file mode 100644
index 9d897c064f..0000000000
--- a/site/scripts/update_template.js
+++ /dev/null
@@ -1,25 +0,0 @@
-const sh = require('shelljs');
-const fs = require('fs');
-
-sh.cd(__dirname + '/../');
-
-// fetch svelte app
-sh.rm('-rf','scripts/svelte-app');
-sh.exec('npx degit sveltejs/template scripts/svelte-app');
-
-// remove src (will be recreated client-side) and node_modules
-sh.rm('-rf', 'scripts/svelte-app/src');
-sh.rm('-rf', 'scripts/svelte-app/node_modules');
-
-// build svelte-app.json
-const appPath = 'scripts/svelte-app';
-const files = [];
-
-for (const path of sh.find(appPath).filter(p => fs.lstatSync(p).isFile()) ) {
- const bytes = fs.readFileSync(path);
- const string = bytes.toString();
- const data = bytes.compare(Buffer.from(string)) === 0 ? string : [...bytes];
- files.push({ path: path.slice(appPath.length + 1), data });
-}
-
-fs.writeFileSync('static/svelte-app.json', JSON.stringify(files));
\ No newline at end of file
diff --git a/site/scripts/update_whos_using.js b/site/scripts/update_whos_using.js
deleted file mode 100644
index 36bc3bdc53..0000000000
--- a/site/scripts/update_whos_using.js
+++ /dev/null
@@ -1,13 +0,0 @@
-const sh = require('shelljs');
-
-sh.cd(__dirname + '/../');
-
-// fetch community repo
-sh.rm('-rf','scripts/community');
-sh.exec('npx degit sveltejs/community scripts/community');
-
-// copy over relevant files
-sh.cp('scripts/community/whos-using-svelte/WhosUsingSvelte.svelte', 'src/routes/_components/WhosUsingSvelte.svelte');
-sh.cp('scripts/community/whos-using-svelte/WhosUsingSvelte.js', 'src/routes/_components/WhosUsingSvelte.js');
-sh.rm('-rf', 'static/organisations');
-sh.cp('-r', 'scripts/community/whos-using-svelte/organisations', 'static');
diff --git a/site/src/client.js b/site/src/client.js
deleted file mode 100644
index bda299367b..0000000000
--- a/site/src/client.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import '@sveltejs/site-kit/base.css';
-import * as sapper from '@sapper/app';
-
-sapper.start({
- target: document.querySelector('#sapper')
-});
\ No newline at end of file
diff --git a/site/src/components/IntersectionObserver.svelte b/site/src/components/IntersectionObserver.svelte
deleted file mode 100644
index 210fd524fd..0000000000
--- a/site/src/components/IntersectionObserver.svelte
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/site/src/components/Lazy.svelte b/site/src/components/Lazy.svelte
deleted file mode 100644
index ef81d68f00..0000000000
--- a/site/src/components/Lazy.svelte
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/site/src/components/PreloadingIndicator.svelte b/site/src/components/PreloadingIndicator.svelte
deleted file mode 100644
index 8b88029abb..0000000000
--- a/site/src/components/PreloadingIndicator.svelte
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-{#if visible}
-
-{/if}
-
-{#if p >= 0.4}
-
-{/if}
\ No newline at end of file
diff --git a/site/src/components/Repl/InputOutputToggle.svelte b/site/src/components/Repl/InputOutputToggle.svelte
deleted file mode 100644
index 8233ee58b2..0000000000
--- a/site/src/components/Repl/InputOutputToggle.svelte
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
- input
-
- output
-
\ No newline at end of file
diff --git a/site/src/components/Repl/ReplWidget.svelte b/site/src/components/Repl/ReplWidget.svelte
deleted file mode 100644
index e83d53fb4d..0000000000
--- a/site/src/components/Repl/ReplWidget.svelte
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
-
-
-
-
- {#if process.browser}
-
- {/if}
-
-
- {#if mobile}
-
- {/if}
-
diff --git a/site/src/components/ScreenToggle.svelte b/site/src/components/ScreenToggle.svelte
deleted file mode 100644
index a70d35bdeb..0000000000
--- a/site/src/components/ScreenToggle.svelte
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
- {#each labels as label, index}
- offset = index}
- >
- {label}
-
- {/each}
-
diff --git a/site/src/config.js b/site/src/config.js
deleted file mode 100644
index a97ea46599..0000000000
--- a/site/src/config.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// REPL props
-
-export const svelteUrl = `https://unpkg.com/svelte@3`;
-export const rollupUrl = `https://unpkg.com/rollup@1/dist/rollup.browser.js`;
-export const mapbox_setup = `window.MAPBOX_ACCESS_TOKEN = process.env.MAPBOX_ACCESS_TOKEN;`;
diff --git a/site/src/routes/_components/Contributors.svelte b/site/src/routes/_components/Contributors.svelte
deleted file mode 100644
index 74eb3fa50f..0000000000
--- a/site/src/routes/_components/Contributors.svelte
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-{#each contributors as contributor, i}
-
- {contributor}
-
-{/each}
diff --git a/site/src/routes/_components/Example.svelte b/site/src/routes/_components/Example.svelte
deleted file mode 100644
index c07b4be0b5..0000000000
--- a/site/src/routes/_components/Example.svelte
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- {#if intersecting}
-
-
- {/if}
-
-
-
-
\ No newline at end of file
diff --git a/site/src/routes/_error.svelte b/site/src/routes/_error.svelte
deleted file mode 100644
index 9d35dd905f..0000000000
--- a/site/src/routes/_error.svelte
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
- {status}
-
-
-
- {#if online}
-
Yikes!
-
- {#if error.message}
-
{status}: {error.message}
- {:else}
-
Encountered a {status} error
- {/if}
-
- {#if dev && error.stack}
-
{error.stack}
- {:else}
- {#if status >= 500}
-
Please try reloading the page.
- {/if}
-
-
If the error persists, please drop by Discord chatroom and let us know, or raise an issue on GitHub . Thanks!
- {/if}
- {:else}
-
It looks like you're offline
-
-
Reload the page once you've found the internet.
- {/if}
-
\ No newline at end of file
diff --git a/site/src/routes/_layout.svelte b/site/src/routes/_layout.svelte
deleted file mode 100644
index 55f4861880..0000000000
--- a/site/src/routes/_layout.svelte
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-{#if $preloading}
-
-{/if}
-
-{#if $page.path !== '/repl/embed'}
-
- Tutorial
- API
- Examples
- REPL
- Blog
- FAQ
-
- Sapper
-
-
-
-
-
-
-
-
-
-{/if}
-
-
-
-
-
-
diff --git a/site/src/routes/apps/index.json.js b/site/src/routes/apps/index.json.js
deleted file mode 100644
index e6a09d52c5..0000000000
--- a/site/src/routes/apps/index.json.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import send from '@polka/send';
-import { query } from '../../utils/db';
-
-export async function get(req, res) {
- if (req.user) {
- const page_size = 100;
- const offset = req.query.offset ? parseInt(req.query.offset) : 0;
- const rows = await query(`
- select g.uid, g.name, coalesce(g.updated_at, g.created_at) as updated_at
- from gists g
- where g.user_id = $1
- order by id desc
- limit ${page_size + 1}
- offset $2
- `, [req.user.id, offset]);
-
- rows.forEach(row => {
- row.uid = row.uid.replace(/-/g, '');
- });
-
- const more = rows.length > page_size;
- send(res, 200, { apps: rows.slice(0, page_size), offset: more ? offset + page_size : null });
- } else {
- send(res, 401);
- }
-}
diff --git a/site/src/routes/apps/index.svelte b/site/src/routes/apps/index.svelte
deleted file mode 100644
index 36cd1a904c..0000000000
--- a/site/src/routes/apps/index.svelte
+++ /dev/null
@@ -1,140 +0,0 @@
-
-
-
-
-
- Your apps • Svelte
-
-
-
- {#if user}
-
- Your apps
-
-
-
-
- {user.name || user.username}
- (log out )
-
-
-
-
-
-
- {#if offset !== null}
-
- {/if}
- {:else}
-
Please log in to see your saved apps.
- {/if}
-
-
-
diff --git a/site/src/routes/auth/_config.js b/site/src/routes/auth/_config.js
deleted file mode 100644
index 7d1669cd72..0000000000
--- a/site/src/routes/auth/_config.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export const oauth = 'https://github.com/login/oauth';
-export const baseurl = process.env.BASEURL;
-export const secure = baseurl && baseurl.startsWith('https:');
-
-export const client_id = process.env.GITHUB_CLIENT_ID;
-export const client_secret = process.env.GITHUB_CLIENT_SECRET;
\ No newline at end of file
diff --git a/site/src/routes/auth/callback.js b/site/src/routes/auth/callback.js
deleted file mode 100644
index 7979b1c21f..0000000000
--- a/site/src/routes/auth/callback.js
+++ /dev/null
@@ -1,54 +0,0 @@
-import send from '@polka/send';
-import devalue from 'devalue';
-import * as cookie from 'cookie';
-import * as httpie from 'httpie';
-import { parse, stringify } from 'querystring';
-import { sanitize_user, create_user, create_session } from '../../utils/auth';
-import { oauth, secure, client_id, client_secret } from './_config.js';
-
-export async function get(req, res) {
- try {
- // Trade "code" for "access_token"
- const r1 = await httpie.post(`${oauth}/access_token?` + stringify({
- code: req.query.code,
- client_id,
- client_secret,
- }));
-
- // Now fetch User details
- const { access_token } = parse(r1.data);
- const r2 = await httpie.get('https://api.github.com/user', {
- headers: {
- 'User-Agent': 'svelte.dev',
- Authorization: `token ${access_token}`
- }
- });
-
- const user = await create_user(r2.data, access_token);
- const session = await create_session(user);
-
- res.writeHead(200, {
- 'Set-Cookie': cookie.serialize('sid', session.uid, {
- maxAge: 31536000,
- path: '/',
- httpOnly: true,
- secure
- }),
- 'Content-Type': 'text/html; charset=utf-8'
- });
-
- res.end(`
-
- `);
- } catch (err) {
- console.error('GET /auth/callback', err);
- send(res, 500, err.data, {
- 'Content-Type': err.headers['content-type'],
- 'Content-Length': err.headers['content-length']
- });
- }
-}
\ No newline at end of file
diff --git a/site/src/routes/auth/login.js b/site/src/routes/auth/login.js
deleted file mode 100644
index 7240498418..0000000000
--- a/site/src/routes/auth/login.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import send from '@polka/send';
-import { stringify } from 'querystring';
-import { oauth, baseurl, client_id } from './_config.js';
-
-export const get = client_id
- ? (req, res) => {
- const Location = `${oauth}/authorize?` + stringify({
- scope: 'read:user',
- client_id,
- redirect_uri: `${baseurl}/auth/callback`,
- });
-
- send(res, 302, Location, { Location });
- }
- : (req, res) => {
- send(res, 500, `
-
- Missing .env file
- In order to use GitHub authentication, you will need to register an OAuth application and create a local .env file:
- GITHUB_CLIENT_ID=[YOUR_APP_ID]\nGITHUB_CLIENT_SECRET=[YOUR_APP_SECRET]\nBASEURL=http://localhost:3000
- The BASEURL variable should match the callback URL specified for your app.
- See also here
-
- `, {
- 'Content-Type': 'text/html; charset=utf-8'
- });
- };
\ No newline at end of file
diff --git a/site/src/routes/auth/logout.js b/site/src/routes/auth/logout.js
deleted file mode 100644
index 7e132f0a41..0000000000
--- a/site/src/routes/auth/logout.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import send from '@polka/send';
-import * as cookie from 'cookie';
-import { secure } from './_config.js';
-import { delete_session } from '../../utils/auth.js';
-
-export async function get(req, res) {
- await delete_session(req.cookies.sid);
-
- send(res, 200, '', {
- 'Set-Cookie': cookie.serialize('sid', '', {
- maxAge: -1,
- path: '/',
- httpOnly: true,
- secure
- })
- });
-}
\ No newline at end of file
diff --git a/site/src/routes/blog/[slug].json.js b/site/src/routes/blog/[slug].json.js
deleted file mode 100644
index ee41d5826d..0000000000
--- a/site/src/routes/blog/[slug].json.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import send from '@polka/send';
-import get_posts from './_posts.js';
-
-let lookup;
-
-export function get(req, res) {
- if (!lookup || process.env.NODE_ENV !== 'production') {
- lookup = new Map();
- get_posts().forEach(post => {
- lookup.set(post.slug, post);
- });
- }
-
- const post = lookup.get(req.params.slug);
-
- if (post) {
- res.setHeader('Cache-Control', `max-age=${5 * 60 * 1e3}`); // 5 minutes
- send(res, 200, post);
- } else {
- send(res, 404, { message: 'not found' });
- }
-}
diff --git a/site/src/routes/blog/[slug].svelte b/site/src/routes/blog/[slug].svelte
deleted file mode 100644
index 236d649d56..0000000000
--- a/site/src/routes/blog/[slug].svelte
+++ /dev/null
@@ -1,175 +0,0 @@
-
-
-
-
-
- {post.metadata.title}
-
-
-
-
-
-
-
- {post.metadata.title}
- {post.metadata.description}
-
- {post.metadata.author} {post.metadata.dateString}
-
- {@html post.html}
-
-
-
diff --git a/site/src/routes/blog/_posts.js b/site/src/routes/blog/_posts.js
deleted file mode 100644
index 2c86e13656..0000000000
--- a/site/src/routes/blog/_posts.js
+++ /dev/null
@@ -1,59 +0,0 @@
-import fs from 'fs';
-import path from 'path';
-import { extract_frontmatter, link_renderer } from '@sveltejs/site-kit/utils/markdown.js';
-import marked from 'marked';
-import { makeSlugProcessor } from '../../utils/slug';
-import { highlight } from '../../utils/highlight';
-import { SLUG_PRESERVE_UNICODE } from '../../../config';
-
-const makeSlug = makeSlugProcessor(SLUG_PRESERVE_UNICODE);
-
-export default function get_posts() {
- return fs
- .readdirSync('content/blog')
- .map(file => {
- if (path.extname(file) !== '.md') return;
-
- const match = /^(\d+-\d+-\d+)-(.+)\.md$/.exec(file);
- if (!match) throw new Error(`Invalid filename '${file}'`);
-
- const [, pubdate, slug] = match;
-
- const markdown = fs.readFileSync(`content/blog/${file}`, 'utf-8');
-
- const { content, metadata } = extract_frontmatter(markdown);
-
- const date = new Date(`${pubdate} EDT`); // cheeky hack
- metadata.pubdate = pubdate;
- metadata.dateString = date.toDateString();
-
- const renderer = new marked.Renderer();
-
- renderer.link = link_renderer;
-
- renderer.code = highlight;
-
- renderer.heading = (text, level, rawtext) => {
- const fragment = makeSlug(rawtext);
-
- return `
-
-
-
- ${text}
- `;
- };
-
- const html = marked(
- content.replace(/^\t+/gm, match => match.split('\t').join(' ')),
- { renderer }
- );
-
- return {
- html,
- metadata,
- slug
- };
- })
- .sort((a, b) => a.metadata.pubdate < b.metadata.pubdate ? 1 : -1);
-}
diff --git a/site/src/routes/blog/index.json.js b/site/src/routes/blog/index.json.js
deleted file mode 100644
index 75180e6e87..0000000000
--- a/site/src/routes/blog/index.json.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import send from '@polka/send';
-import get_posts from './_posts.js';
-
-let json;
-
-export function get(req, res) {
- if (!json || process.env.NODE_ENV !== 'production') {
- const posts = get_posts()
- .filter(post => !post.metadata.draft)
- .map(post => {
- return {
- slug: post.slug,
- metadata: post.metadata
- };
- });
-
- json = JSON.stringify(posts);
- }
-
- send(res, 200, json, {
- 'Content-Type': 'application/json',
- 'Cache-Control': `max-age=${5 * 60 * 1e3}` // 5 minutes
- });
-}
diff --git a/site/src/routes/blog/index.svelte b/site/src/routes/blog/index.svelte
deleted file mode 100644
index 9f4192975a..0000000000
--- a/site/src/routes/blog/index.svelte
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
- Blog • Svelte
-
-
-
-
-
-
-
-Blog
-
-
-
diff --git a/site/src/routes/blog/rss.xml.js b/site/src/routes/blog/rss.xml.js
deleted file mode 100644
index 544474b274..0000000000
--- a/site/src/routes/blog/rss.xml.js
+++ /dev/null
@@ -1,54 +0,0 @@
-import send from '@polka/send';
-import get_posts from '../blog/_posts.js';
-
-const months = ',Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(',');
-
-function formatPubdate(str) {
- const [y, m, d] = str.split('-');
- return `${d} ${months[+m]} ${y} 12:00 +0000`;
-}
-
-function escapeHTML(html) {
- const chars = {
- '"' : 'quot',
- "'": '#39',
- '&': 'amp',
- '<' : 'lt',
- '>' : 'gt'
- };
-
- return html.replace(/["'&<>]/g, c => `&${chars[c]};`);
-}
-
-const rss = `
-
-
-
-
- Svelte blog
- https://svelte.dev/blog
- News and information about the magical disappearing UI framework
-
- https://svelte.dev/favicon.png
- Svelte
- https://svelte.dev/blog
-
- ${get_posts().filter(post => !post.metadata.draft).map(post => `
- -
-
${escapeHTML(post.metadata.title)}
- https://svelte.dev/blog/${post.slug}
- ${escapeHTML(post.metadata.description)}
- ${formatPubdate(post.metadata.pubdate)}
-
- `).join('')}
-
-
-
-`.replace(/>[^\S]+/gm, '>').replace(/[^\S]+ file[0] !== '.' && path.extname(file) === '.md')
- .map(file => {
- const markdown = fs.readFileSync(`content/docs/${file}`, 'utf-8');
-
- const { content, metadata } = extract_frontmatter(markdown);
-
- const section_slug = make_slug(metadata.title);
-
- const subsections = [];
-
- const renderer = new marked.Renderer();
-
- let block_open = false;
-
- renderer.link = link_renderer;
-
- renderer.hr = () => {
- block_open = true;
-
- return '';
- };
-
- renderer.code = (source, lang) => {
- source = source.replace(/^ +/gm, match =>
- match.split(' ').join('\t')
- );
-
- const lines = source.split('\n');
-
- const meta = extract_metadata(lines[0], lang);
-
- let prefix = '';
- let className = 'code-block';
-
- if (meta) {
- source = lines.slice(1).join('\n');
- const filename = meta.filename || (lang === 'html' && 'App.svelte');
- if (filename) {
- prefix = `
${prefix} ${filename} `;
- className += ' named';
- }
- }
-
- if (meta && meta.hidden) return '';
-
- const html = `
${prefix}${highlight(source, lang)}
`;
-
- if (block_open) {
- block_open = false;
- return `
${html}
`;
- }
-
- return html;
- };
-
- renderer.heading = (text, level, rawtext) => {
- let slug;
-
- const match = /]*>(.+)<\/a>/.exec(text);
- if (match) {
- slug = match[1];
- text = match[2];
- } else {
- slug = make_slug(rawtext);
- }
-
- if (level === 3 || level === 4) {
- const title = text
- .replace(/<\/?code>/g, '')
- .replace(/\.(\w+)(\((.+)?\))?/, (m, $1, $2, $3) => {
- if ($3) return `.${$1}(...)`;
- if ($2) return `.${$1}()`;
- return `.${$1}`;
- });
-
- subsections.push({ slug, title, level });
- }
-
- return `
-
- 4 ? 'data-scrollignore' : ''}>
-
- ${text}
- `;
- };
-
- blockTypes.forEach(type => {
- const fn = renderer[type];
- renderer[type] = function() {
- return fn.apply(this, arguments);
- };
- });
-
- const html = marked(content, { renderer });
-
- const hashes = {};
-
- return {
- html: html.replace(/@@(\d+)/g, (m, id) => hashes[id] || m),
- metadata,
- subsections,
- slug: section_slug,
- file,
- };
- });
-}
diff --git a/site/src/routes/docs/index.json.js b/site/src/routes/docs/index.json.js
deleted file mode 100644
index 66d588a949..0000000000
--- a/site/src/routes/docs/index.json.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import send from '@polka/send';
-import get_sections from './_sections.js';
-
-let json;
-
-export function get(req, res) {
- if (!json || process.env.NODE_ENV !== 'production') {
- json = get_sections();
- }
-
- send(res, 200, json);
-}
diff --git a/site/src/routes/docs/index.svelte b/site/src/routes/docs/index.svelte
deleted file mode 100644
index a276b0edb7..0000000000
--- a/site/src/routes/docs/index.svelte
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
- API Docs • Svelte
-
-
-
-
-
-
-API Docs
-
diff --git a/site/src/routes/examples/[slug].json.js b/site/src/routes/examples/[slug].json.js
deleted file mode 100644
index 705a4e7e89..0000000000
--- a/site/src/routes/examples/[slug].json.js
+++ /dev/null
@@ -1,23 +0,0 @@
-import send from '@polka/send';
-import { get_example } from './_examples.js';
-
-const cache = new Map();
-
-export function get(req, res) {
- const { slug } = req.params;
-
- let example = cache.get(slug);
-
- if (!example || process.env.NODE_ENV !== 'production') {
- example = get_example(slug);
- if (example) cache.set(slug, example);
- }
-
- if (example) {
- send(res, 200, example);
- } else {
- send(res, 404, {
- error: 'not found'
- });
- }
-}
diff --git a/site/src/routes/examples/_TableOfContents.svelte b/site/src/routes/examples/_TableOfContents.svelte
deleted file mode 100644
index d5a8b7240f..0000000000
--- a/site/src/routes/examples/_TableOfContents.svelte
+++ /dev/null
@@ -1,116 +0,0 @@
-
-
-
-
-
- {#each sections as section}
-
- {section.title}
-
- {#each section.examples as example}
-
- {/each}
-
- {/each}
-
diff --git a/site/src/routes/examples/_examples.js b/site/src/routes/examples/_examples.js
deleted file mode 100644
index e4580d7fda..0000000000
--- a/site/src/routes/examples/_examples.js
+++ /dev/null
@@ -1,50 +0,0 @@
-import fs from 'fs';
-
-let lookup;
-const titles = new Map();
-
-export function get_examples() {
- lookup = new Map();
-
- return fs.readdirSync(`content/examples`).map(group_dir => {
- const metadata = JSON.parse(fs.readFileSync(`content/examples/${group_dir}/meta.json`, 'utf-8'));
-
- return {
- title: metadata.title,
- examples: fs.readdirSync(`content/examples/${group_dir}`).filter(file => file !== 'meta.json').map(example_dir => {
- const slug = example_dir.replace(/^\d+-/, '');
-
- if (lookup.has(slug)) throw new Error(`Duplicate example slug "${slug}"`);
- lookup.set(slug, `${group_dir}/${example_dir}`);
-
- const metadata = JSON.parse(fs.readFileSync(`content/examples/${group_dir}/${example_dir}/meta.json`, 'utf-8'));
- titles.set(slug, metadata.title);
-
- return {
- slug,
- title: metadata.title
- };
- })
- };
- });
-}
-
-export function get_example(slug) {
- if (!lookup || !lookup.has(slug)) get_examples();
-
- const dir = lookup.get(slug);
- const title = titles.get(slug);
-
- if (!dir || !title) return null;
-
- const files = fs.readdirSync(`content/examples/${dir}`)
- .filter(name => name[0] !== '.' && name !== 'meta.json')
- .map(name => {
- return {
- name,
- source: fs.readFileSync(`content/examples/${dir}/${name}`, 'utf-8')
- };
- });
-
- return { title, files };
-}
diff --git a/site/src/routes/examples/index.json.js b/site/src/routes/examples/index.json.js
deleted file mode 100644
index 09876e1993..0000000000
--- a/site/src/routes/examples/index.json.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import send from '@polka/send';
-import { get_examples } from './_examples.js';
-
-let cached;
-
-export function get(req, res) {
- try {
- if (!cached || process.env.NODE_ENV !== 'production') {
- cached = get_examples().filter(section => section.title);
- }
-
- send(res, 200, cached);
- } catch (e) {
- send(res, e.status || 500, {
- message: e.message
- });
- }
-}
diff --git a/site/src/routes/examples/index.svelte b/site/src/routes/examples/index.svelte
deleted file mode 100644
index 070f12b1ac..0000000000
--- a/site/src/routes/examples/index.svelte
+++ /dev/null
@@ -1,178 +0,0 @@
-
-
-
-
-
-
- {title} {title ? '•' : ''} Svelte Examples
-
-
-
-
-
-
-Examples
-
-
- {#if mobile}
-
- {/if}
-
-
-
diff --git a/site/src/routes/faq/_faqs.js b/site/src/routes/faq/_faqs.js
deleted file mode 100644
index fa48e02282..0000000000
--- a/site/src/routes/faq/_faqs.js
+++ /dev/null
@@ -1,58 +0,0 @@
-import fs from 'fs';
-import path from 'path';
-import { extract_frontmatter, link_renderer } from '@sveltejs/site-kit/utils/markdown.js';
-import marked from 'marked';
-import { makeSlugProcessor } from '../../utils/slug';
-import { highlight } from '../../utils/highlight';
-import { SLUG_PRESERVE_UNICODE } from '../../../config';
-
-const makeSlug = makeSlugProcessor(SLUG_PRESERVE_UNICODE);
-
-export default function get_faqs() {
- return fs
- .readdirSync('content/faq')
- .map(file => {
- if (path.extname(file) !== '.md') return;
-
- const match = /^([0-9]+)-(.+)\.md$/.exec(file);
- if (!match) throw new Error(`Invalid filename '${file}'`);
-
- const [, order, slug] = match;
-
- const markdown = fs.readFileSync(`content/faq/${file}`, 'utf-8');
-
- const { content, metadata } = extract_frontmatter(markdown);
-
- const renderer = new marked.Renderer();
-
- renderer.link = link_renderer;
-
- renderer.code = highlight;
-
- renderer.heading = (text, level, rawtext) => {
- const fragment = makeSlug(rawtext);
-
- return `
-
-
-
- ${text}
- `;
- };
-
- const answer = marked(
- content.replace(/^\t+/gm, match => match.split('\t').join(' ')),
- { renderer }
- );
-
- const fragment = makeSlug(slug);
-
- return {
- fragment,
- order,
- answer,
- metadata
- };
- })
- .sort((a, b) => a.order - b.order);
-}
diff --git a/site/src/routes/faq/index.json.js b/site/src/routes/faq/index.json.js
deleted file mode 100644
index b6810a984e..0000000000
--- a/site/src/routes/faq/index.json.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import send from '@polka/send';
-import get_faqs from './_faqs.js';
-
-let json;
-
-export function get(req, res) {
- if (!json || process.env.NODE_ENV !== 'production') {
- const faqs = get_faqs()
- .map(faq => {
- return {
- fragment: faq.fragment,
- answer: faq.answer,
- metadata: faq.metadata
- };
- });
-
- json = JSON.stringify(faqs);
- }
-
- send(res, 200, json, {
- 'Content-Type': 'application/json',
- 'Cache-Control': `max-age=${5 * 60 * 1e3}` // 5 minutes
- });
-}
diff --git a/site/src/routes/faq/index.svelte b/site/src/routes/faq/index.svelte
deleted file mode 100644
index c426f5bf3d..0000000000
--- a/site/src/routes/faq/index.svelte
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
- Frequently Asked Questions • Svelte
-
-
-
-
-
-
-
-
Frequently Asked Questions
- {#each faqs as faq}
-
-
-
-
-
- {faq.metadata.question}
-
- {@html faq.answer}
-
- {/each}
-
-
-
diff --git a/site/src/routes/index.svelte b/site/src/routes/index.svelte
deleted file mode 100644
index 3c84d6ea15..0000000000
--- a/site/src/routes/index.svelte
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
-
- Svelte • Cybernetically enhanced web apps
-
-
-
-
-
-
-Svelte
-
-
-
-
- Write less code
- Build boilerplate-free components using languages you already know — HTML, CSS and JavaScript
-
- learn more
-
-
-
- No virtual DOM
- Svelte compiles your code to tiny, framework-less vanilla JS — your app starts fast and stays fast
-
- learn more
-
-
-
- Truly reactive
- No more complex state management libraries — Svelte brings reactivity to JavaScript itself
-
- learn more
-
-
-
-
Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue do the bulk of their work in the browser , Svelte shifts that work into a compile step that happens when you build your app.
-
-
Instead of using techniques like virtual DOM diffing, Svelte writes code that surgically updates the DOM when the state of your app changes.
-
-
Read the introductory blog post to learn more.
-
-
-
-
-
-
-
- Svelte components are built on top of HTML. Just add data.
-
-
-
- CSS is component-scoped by default — no more style collisions or specificity wars. Or you can use your favourite CSS-in-JS library .
-
-
-
- Trigger efficient, granular updates by assigning to local variables. The compiler does the rest.
-
-
-
- Build beautiful UIs with a powerful, performant transition engine built right into the framework.
-
-
-
-
- Who's using Svelte?
-
-
-
-
-
- Contributors
-
- Svelte is free and open source software, made possible by the work of dozens of volunteers. Join us!
-
-
-
diff --git a/site/src/routes/repl/[id]/_components/AppControls/UserMenu.svelte b/site/src/routes/repl/[id]/_components/AppControls/UserMenu.svelte
deleted file mode 100644
index de400cbf29..0000000000
--- a/site/src/routes/repl/[id]/_components/AppControls/UserMenu.svelte
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-
{name}
-
-
- {#if showMenu}
-
- {/if}
-
-
-
diff --git a/site/src/routes/repl/[id]/_components/AppControls/index.svelte b/site/src/routes/repl/[id]/_components/AppControls/index.svelte
deleted file mode 100644
index c2e5684944..0000000000
--- a/site/src/routes/repl/[id]/_components/AppControls/index.svelte
+++ /dev/null
@@ -1,281 +0,0 @@
-
-
-
-
-
-
-
-
-
- {#if zen_mode}
-
- {:else}
-
- {/if}
-
-
-
-
-
-
- fork(false)} title="fork">
- {#if justForked}
-
- {:else}
-
- {/if}
-
-
-
- {#if justSaved}
-
- {:else}
-
- {/if}
-
-
- {#if $session.user}
-
- {:else}
-
-
- Log in to save
-
- {/if}
-
-
-
-
diff --git a/site/src/routes/repl/[id]/index.json.js b/site/src/routes/repl/[id]/index.json.js
deleted file mode 100644
index de41a4cecd..0000000000
--- a/site/src/routes/repl/[id]/index.json.js
+++ /dev/null
@@ -1,149 +0,0 @@
-import send from '@polka/send';
-import body from '../_utils/body.js';
-import * as httpie from 'httpie';
-import { query, find } from '../../../utils/db';
-import { get_example } from '../../examples/_examples.js';
-
-const { GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET } = process.env;
-
-async function import_gist(req, res) {
- const base = `https://api.github.com/gists/${req.params.id}`;
- const url = `${base}?client_id=${GITHUB_CLIENT_ID}&client_secret=${GITHUB_CLIENT_SECRET}`;
-
- try {
- const { data } = await httpie.get(url, {
- headers: {
- 'User-Agent': 'https://svelte.dev'
- }
- });
-
- // create owner if necessary...
- let user = await find(`select * from users where uid = $1`, [data.owner.id]);
-
- if (!user) {
- const { id, name, login, avatar_url } = data.owner;
-
- user = await find(`
- insert into users(uid, name, username, avatar)
- values ($1, $2, $3, $4)
- returning *
- `, [id, name, login, avatar_url]);
- }
-
- delete data.files['README.md'];
- delete data.files['meta.json'];
-
- const files = Object.keys(data.files).map(key => {
- const name = key.replace(/\.html$/, '.svelte');
-
- return {
- name,
- source: data.files[key].content
- };
- });
-
- // add gist to database...
- await query(`
- insert into gists(uid, user_id, name, files)
- values ($1, $2, $3, $4)
- `, [req.params.id, user.id, data.description, JSON.stringify(files)]);
-
- send(res, 200, {
- uid: req.params.id,
- name: data.description,
- files,
- owner: data.owner.id
- });
- } catch (err) {
- send(res, err.statusCode, { error: err.message });
- }
-}
-
-export async function get(req, res) {
- // is this an example?
- const example = get_example(req.params.id);
-
- if (example) {
- return send(res, 200, {
- relaxed: true,
- uid: req.params.id,
- name: example.title,
- files: example.files,
- owner: null
- });
- }
-
- if (process.env.NODE_ENV === 'development') {
- // In dev, proxy requests to load particular REPLs to the real server.
- // This avoids needing to connect to the real database server.
- req.pipe(
- require('https').request({ host: 'svelte.dev', path: req.url })
- ).once('response', res_proxy => {
- res_proxy.pipe(res);
- res.writeHead(res_proxy.statusCode, res_proxy.headers);
- }).once('error', () => res.end());
- return;
- }
-
- const [row] = await query(`
- select g.*, u.uid as owner from gists g
- left join users u on g.user_id = u.id
- where g.uid = $1 limit 1
- `, [req.params.id]); // via filename pattern
-
- if (!row) {
- return import_gist(req, res);
- }
-
- send(res, 200, {
- uid: row.uid.replace(/-/g, ''),
- name: row.name,
- files: row.files,
- owner: row.owner
- });
-}
-
-export async function patch(req, res) {
- const { user } = req;
- if (!user) return;
-
- let id;
- const uid = req.params.id;
-
- try {
- const [row] = await query(`select * from gists where uid = $1 limit 1`, [uid]);
- if (!row) return send(res, 404, { error: 'Gist not found' });
- if (row.user_id !== user.id) return send(res, 403, { error: 'Item does not belong to you' });
- id = row.id;
- } catch (err) {
- console.error('PATCH /gists @ select', err);
- return send(res, 500);
- }
-
- try {
- const obj = await body(req);
- obj.updated_at = 'now()';
- let k;
- const cols = [];
- const vals = [];
- for (k in obj) {
- cols.push(k);
- vals.push(k === 'files' ? JSON.stringify(obj[k]) : obj[k]);
- }
-
- const tmp = vals.map((x, i) => `$${i + 1}`).join(',');
- const set = `set (${cols.join(',')}) = (${tmp})`;
-
- const [row] = await query(`update gists ${set} where id = ${id} returning *`, vals);
-
- send(res, 200, {
- uid: row.uid.replace(/-/g, ''),
- name: row.name,
- files: row.files,
- owner: user.uid,
- });
- } catch (err) {
- console.error('PATCH /gists @ update', err);
- send(res, 500, { error: err.message });
- }
-}
diff --git a/site/src/routes/repl/[id]/index.svelte b/site/src/routes/repl/[id]/index.svelte
deleted file mode 100644
index 945678ba33..0000000000
--- a/site/src/routes/repl/[id]/index.svelte
+++ /dev/null
@@ -1,229 +0,0 @@
-
-
-
-
-
-
-
- {name} • REPL • Svelte
-
-
-
-
-
-
-
-
-
-
-
- {#if process.browser}
-
-
-
-
- {#if mobile}
-
- {/if}
- {/if}
-
diff --git a/site/src/routes/repl/_utils/body.js b/site/src/routes/repl/_utils/body.js
deleted file mode 100644
index 950208ab56..0000000000
--- a/site/src/routes/repl/_utils/body.js
+++ /dev/null
@@ -1,19 +0,0 @@
-export default function body(req) {
- return new Promise((fulfil, reject) => {
- let str = '';
-
- req.on('error', reject);
-
- req.on('data', chunk => {
- str += chunk;
- });
-
- req.on('end', () => {
- try {
- fulfil(JSON.parse(str));
- } catch (err) {
- reject(err);
- }
- });
- });
-}
\ No newline at end of file
diff --git a/site/src/routes/repl/_utils/downloadBlob.js b/site/src/routes/repl/_utils/downloadBlob.js
deleted file mode 100644
index d90ed40530..0000000000
--- a/site/src/routes/repl/_utils/downloadBlob.js
+++ /dev/null
@@ -1,11 +0,0 @@
-export default (blob, filename) => {
- const url = URL.createObjectURL(blob);
- const link = document.createElement('a');
- link.href = url;
- link.download = filename;
- link.style.display = 'none';
- document.body.appendChild(link);
- link.click();
- URL.revokeObjectURL(url);
- link.remove();
-};
diff --git a/site/src/routes/repl/create.json.js b/site/src/routes/repl/create.json.js
deleted file mode 100644
index 7bb809bd5f..0000000000
--- a/site/src/routes/repl/create.json.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import send from '@polka/send';
-import body from './_utils/body.js';
-import { query } from '../../utils/db';
-
-export async function post(req, res) {
- const { user } = req;
- if (!user) return; // response already sent
-
- try {
- const { name, files } = await body(req);
-
- const [row] = await query(`
- insert into gists(user_id, name, files)
- values ($1, $2, $3) returning *`, [user.id, name, JSON.stringify(files)]);
-
- send(res, 201, {
- uid: row.uid.replace(/-/g, ''),
- name: row.name,
- files: row.files,
- owner: user.uid,
- });
- } catch (err) {
- send(res, 500, {
- error: err.message
- });
- }
-}
diff --git a/site/src/routes/repl/embed.svelte b/site/src/routes/repl/embed.svelte
deleted file mode 100644
index b78e9e39c7..0000000000
--- a/site/src/routes/repl/embed.svelte
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
- REPL • Svelte
-
-
-
-
-
-
-
- {#if process.browser}
-
- {/if}
-
diff --git a/site/src/routes/repl/index.svelte b/site/src/routes/repl/index.svelte
deleted file mode 100644
index 0c7acfc9dc..0000000000
--- a/site/src/routes/repl/index.svelte
+++ /dev/null
@@ -1,16 +0,0 @@
-
\ No newline at end of file
diff --git a/site/src/routes/repl/local/[...file].js b/site/src/routes/repl/local/[...file].js
deleted file mode 100644
index 7bd1c6a82c..0000000000
--- a/site/src/routes/repl/local/[...file].js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { createReadStream } from 'fs';
-
-export function get(req, res) {
- const path = req.params.file.join('/');
- if (process.env.NODE_ENV !== 'development' || ('/' + path).includes('/.')) {
- res.writeHead(403);
- res.end();
- return;
- }
- createReadStream('../' + path)
- .on('error', () => {
- res.writeHead(403);
- res.end();
- })
- .pipe(res);
- res.writeHead(200, { 'Content-Type': 'text/javascript' });
-}
diff --git a/site/src/routes/tutorial/[slug]/_TableOfContents.svelte b/site/src/routes/tutorial/[slug]/_TableOfContents.svelte
deleted file mode 100644
index 97a298bcca..0000000000
--- a/site/src/routes/tutorial/[slug]/_TableOfContents.svelte
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- {selected.section.title} /
-
- {selected.chapter.title}
-
-
-
- {#each sections as section, i}
-
- {#each section.chapters as chapter, i}
- {String.fromCharCode(i + 97)}. {chapter.title}
- {/each}
-
- {/each}
-
-
-
-
-
-
-
diff --git a/site/src/routes/tutorial/[slug]/index.json.js b/site/src/routes/tutorial/[slug]/index.json.js
deleted file mode 100644
index 26f5d54b31..0000000000
--- a/site/src/routes/tutorial/[slug]/index.json.js
+++ /dev/null
@@ -1,102 +0,0 @@
-import * as fs from 'fs';
-import * as path from 'path';
-import marked from 'marked';
-import send from '@polka/send';
-import { extract_frontmatter, extract_metadata, link_renderer } from '@sveltejs/site-kit/utils/markdown';
-import { highlight } from '../../../utils/highlight';
-
-const cache = new Map();
-
-function find_tutorial(slug) {
- const sections = fs.readdirSync(`content/tutorial`);
-
- for (const section of sections) {
- const chapters = fs.readdirSync(`content/tutorial/${section}`).filter(dir => /^\d+/.test(dir));
- for (const chapter of chapters) {
- if (slug === chapter.replace(/^\d+-/, '')) {
- return { section, chapter };
- }
- }
- }
-}
-
-function get_tutorial(slug) {
- const found = find_tutorial(slug);
- if (!found) return found;
-
- const dir = `content/tutorial/${found.section}/${found.chapter}`;
-
- const markdown = fs.readFileSync(`${dir}/text.md`, 'utf-8');
- const app_a = fs.readdirSync(`${dir}/app-a`);
- const app_b = fs.existsSync(`${dir}/app-b`) && fs.readdirSync(`${dir}/app-b`);
-
- const { content } = extract_frontmatter(markdown);
-
- const renderer = new marked.Renderer();
-
- renderer.link = link_renderer;
-
- renderer.code = (source, lang) => {
- source = source.replace(/^ +/gm, match =>
- match.split(' ').join('\t')
- );
-
- const lines = source.split('\n');
-
- const meta = extract_metadata(lines[0], lang);
-
- let prefix = '';
- let className = 'code-block';
-
- if (meta) {
- source = lines.slice(1).join('\n');
- const filename = meta.filename || (lang === 'html' && 'App.svelte');
- if (filename) {
- prefix = `${prefix} ${filename} `;
- className += ' named';
- }
- }
-
- return `${prefix}${highlight(source, lang)}
`;
- };
-
- let html = marked(content, { renderer });
- if (found.chapter.startsWith('01')) {
- const meta = JSON.parse(fs.readFileSync(`content/tutorial/${found.section}/meta.json`));
- html = `${meta.title} \n${html}`;
- }
-
- function get_file(stage, file) {
- const ext = path.extname(file);
- const name = file.slice(0, -ext.length);
- const type = ext.slice(1);
-
- return {
- name,
- type,
- source: fs.readFileSync(`${dir}/${stage}/${file}`, 'utf-8')
- };
- }
-
- return {
- html,
- app_a: app_a.map(file => get_file('app-a', file)),
- app_b: app_b && app_b.map(file => get_file('app-b', file))
- };
-}
-
-export function get(req, res) {
- const { slug } = req.params;
-
- let tut = cache.get(slug);
- if (!tut || process.env.NODE_ENV !== 'production') {
- tut = get_tutorial(slug);
- cache.set(slug, tut);
- }
-
- if (tut) {
- send(res, 200, tut);
- } else {
- send(res, 404, { message: 'not found' });
- }
-}
diff --git a/site/src/routes/tutorial/[slug]/index.svelte b/site/src/routes/tutorial/[slug]/index.svelte
deleted file mode 100644
index be59665970..0000000000
--- a/site/src/routes/tutorial/[slug]/index.svelte
+++ /dev/null
@@ -1,319 +0,0 @@
-
-
-
-
-
-
-
- {selected.section.title} / {selected.chapter.title} • Svelte Tutorial
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {@html chapter.html}
-
-
- {#if chapter.app_b}
-
-
- {completed ? 'Reset' : 'Show me'}
-
- {/if}
-
- {#if selected.next}
-
Next
- {/if}
-
-
-
-
-
-
-
-
-
-
-
- {#if mobile}
-
- {/if}
-
diff --git a/site/src/routes/tutorial/_layout.svelte b/site/src/routes/tutorial/_layout.svelte
deleted file mode 100644
index c424fac2e6..0000000000
--- a/site/src/routes/tutorial/_layout.svelte
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/site/src/routes/tutorial/index.json.js b/site/src/routes/tutorial/index.json.js
deleted file mode 100644
index 5c7ec8efa1..0000000000
--- a/site/src/routes/tutorial/index.json.js
+++ /dev/null
@@ -1,63 +0,0 @@
-import * as fs from 'fs';
-import send from '@polka/send';
-import { extract_frontmatter } from '@sveltejs/site-kit/utils/markdown';
-
-let json;
-
-function get_sections() {
- const slugs = new Set();
-
- const sections = fs.readdirSync(`content/tutorial`)
- .filter(dir => /^\d+/.test(dir))
- .map(dir => {
- let meta;
-
- try {
- meta = JSON.parse(fs.readFileSync(`content/tutorial/${dir}/meta.json`, 'utf-8'));
- } catch (err) {
- throw new Error(`Error reading metadata for ${dir}`);
- }
-
- return {
- title: meta.title,
- chapters: fs.readdirSync(`content/tutorial/${dir}`)
- .filter(dir => /^\d+/.test(dir))
- .map(tutorial => {
- try {
- const md = fs.readFileSync(`content/tutorial/${dir}/${tutorial}/text.md`, 'utf-8');
- const { metadata } = extract_frontmatter(md);
-
- const slug = tutorial.replace(/^\d+-/, '');
-
- if (slugs.has(slug)) throw new Error(`Duplicate slug: ${slug}`);
- slugs.add(slug);
-
- return {
- slug,
- title: metadata.title,
- section_dir: dir,
- chapter_dir: tutorial,
- };
- } catch (err) {
- throw new Error(`Error building tutorial ${dir}/${tutorial}: ${err.message}`);
- }
- })
- };
- });
-
- return sections;
-}
-
-export function get(req, res) {
- try {
- if (!json || process.env.NODE_ENV !== 'production') {
- json = get_sections();
- }
-
- send(res, 200, json);
- } catch (err) {
- send(res, 500, {
- message: err.message
- });
- }
-}
diff --git a/site/src/routes/tutorial/index.svelte b/site/src/routes/tutorial/index.svelte
deleted file mode 100644
index 738a1b33e8..0000000000
--- a/site/src/routes/tutorial/index.svelte
+++ /dev/null
@@ -1,5 +0,0 @@
-
\ No newline at end of file
diff --git a/site/src/routes/tutorial/random-number.js b/site/src/routes/tutorial/random-number.js
deleted file mode 100644
index 818a38fe6a..0000000000
--- a/site/src/routes/tutorial/random-number.js
+++ /dev/null
@@ -1,20 +0,0 @@
-export function get(req, res) {
- let { min = '0', max = '100' } = req.query;
- min = +min;
- max = +max;
-
- res.setHeader('Access-Control-Allow-Origin', '*');
-
- // simulate a long delay
- setTimeout(() => {
- // fail sometimes
- if (Math.random() < 0.333) {
- res.statusCode = 400;
- res.end(`Failed to generate random number. Please try again`);
- return;
- }
-
- const num = min + Math.round(Math.random() * (max - min));
- res.end(String(num));
- }, 1000);
-}
\ No newline at end of file
diff --git a/site/src/server.js b/site/src/server.js
deleted file mode 100644
index 6990d94265..0000000000
--- a/site/src/server.js
+++ /dev/null
@@ -1,39 +0,0 @@
-import polka from 'polka';
-import send from '@polka/send';
-import sirv from 'sirv';
-import * as sapper from '@sapper/server';
-import { sanitize_user, authenticate } from './utils/auth';
-
-const { PORT = 3000 } = process.env;
-
-const app = polka({
- onError: (err, req, res) => {
- const error = err.message || err;
- const code = err.code || err.status || 500;
- res.headersSent || send(res, code, { error }, {
- 'content-type': 'text/plain'
- });
- }
-});
-
-if (process.env.PGHOST) {
- app.use(authenticate());
-}
-
-app.use(
- sirv('static', {
- dev: process.env.NODE_ENV === 'development',
- setHeaders(res) {
- res.setHeader('Access-Control-Allow-Origin', '*');
- res.hasHeader('Cache-Control') || res.setHeader('Cache-Control', 'max-age=600'); // 10min default
- }
- }),
-
- sapper.middleware({
- session: req => ({
- user: sanitize_user(req.user)
- })
- })
-);
-
-app.listen(PORT);
diff --git a/site/src/service-worker.js b/site/src/service-worker.js
deleted file mode 100644
index f7a76df99a..0000000000
--- a/site/src/service-worker.js
+++ /dev/null
@@ -1,87 +0,0 @@
-import { timestamp, files, shell } from '@sapper/service-worker';
-
-const ASSETS = `cache${timestamp}`;
-
-// `shell` is an array of all the files generated by Rollup,
-// `files` is an array of everything in the `static` directory
-const to_cache = shell.concat(files.filter(file => {
- const basename = file.split('/').pop();
- if (basename[0] === '.') return false; // .DS_Store and friends
- if (basename.endsWith('.mp3')) return false; // TODO others?
- return true;
-}));
-const cached = new Set(to_cache);
-
-self.addEventListener('install', event => {
- event.waitUntil(
- caches
- .open(ASSETS)
- .then(cache => cache.addAll(to_cache))
- .then(() => {
- self.skipWaiting();
- })
- );
-});
-
-self.addEventListener('activate', event => {
- event.waitUntil(
- caches.keys().then(async keys => {
- // delete old caches
- for (const key of keys) {
- if (key !== ASSETS) await caches.delete(key);
- }
-
- self.clients.claim();
- })
- );
-});
-
-self.addEventListener('fetch', event => {
- if (event.request.method !== 'GET' || event.request.headers.has('range')) return;
-
- const url = new URL(event.request.url);
-
- // don't try to handle e.g. data: URIs
- if (!url.protocol.startsWith('http')) return;
-
- // ignore dev server requests
- if (url.hostname === self.location.hostname && url.port !== self.location.port) return;
-
- // always serve static files and Rollup-generated assets from cache
- if (url.host === self.location.host && cached.has(url.pathname)) {
- event.respondWith(caches.match(event.request));
- return;
- }
-
- // for pages, you might want to serve a shell `index.html` file,
- // which Sapper has generated for you. It's not right for every
- // app, but if it's right for yours then uncomment this section
- /*
- if (url.origin === self.origin && routes.find(route => route.pattern.test(url.pathname))) {
- event.respondWith(caches.match('/index.html'));
- return;
- }
- */
-
- if (event.request.cache === 'only-if-cached') return;
-
- // for everything else, try the network first, falling back to
- // cache if the user is offline. (If the pages never change, you
- // might prefer a cache-first approach to a network-first one.)
- event.respondWith(
- caches
- .open(`offline${timestamp}`)
- .then(async cache => {
- try {
- const response = await fetch(event.request);
- cache.put(event.request, response.clone());
- return response;
- } catch (err) {
- const response = await cache.match(event.request);
- if (response) return response;
-
- throw err;
- }
- })
- );
-});
diff --git a/site/src/template.html b/site/src/template.html
deleted file mode 100644
index 28ea1910a5..0000000000
--- a/site/src/template.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
- %sapper.base%
-
-
-
-
-
-
-
-
-
-
-
-
-
- %sapper.styles%
-
-
- %sapper.head%
-
-
-
- %sapper.html%
-
-
- %sapper.scripts%
-
-
diff --git a/site/src/utils/auth.js b/site/src/utils/auth.js
deleted file mode 100644
index 1f7ccaf867..0000000000
--- a/site/src/utils/auth.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import * as cookie from 'cookie';
-import flru from 'flru';
-import { find, query } from './db';
-
-export const sanitize_user = obj => obj && ({
- uid: obj.uid,
- username: obj.username,
- name: obj.name,
- avatar: obj.avatar
-});
-
-const session_cache = flru(1000);
-
-export const create_user = async (gh_user, access_token) => {
- return await find(`
- insert into users(uid, name, username, avatar, github_token)
- values ($1, $2, $3, $4, $5) on conflict (uid) do update
- set (name, username, avatar, github_token, updated_at) = ($2, $3, $4, $5, now())
- returning id, uid, username, name, avatar
- `, [gh_user.id, gh_user.name, gh_user.login, gh_user.avatar_url, access_token]);
-};
-
-export const create_session = async user => {
- const session = await find(`
- insert into sessions(user_id)
- values ($1)
- returning uid
- `, [user.id]);
-
- session_cache.set(session.uid, user);
-
- return session;
-};
-
-export const delete_session = async sid => {
- await query(`delete from sessions where uid = $1`, [sid]);
- session_cache.set(sid, null);
-};
-
-const get_user = async sid => {
- if (!sid) return null;
-
- if (!session_cache.has(sid)) {
- session_cache.set(sid, await find(`
- select users.id, users.uid, users.username, users.name, users.avatar
- from sessions
- left join users on sessions.user_id = users.id
- where sessions.uid = $1 and expiry > now()
- `, [sid]));
- }
-
- return session_cache.get(sid);
-};
-
-export const authenticate = () => {
- // this is a convenient time to clear out expired sessions
- query(`delete from sessions where expiry < now()`);
-
- return async (req, res, next) => {
- req.cookies = cookie.parse(req.headers.cookie || '');
- req.user = await get_user(req.cookies.sid);
-
- next();
- };
-};
\ No newline at end of file
diff --git a/site/src/utils/compat.js b/site/src/utils/compat.js
deleted file mode 100644
index 0b0f1e954b..0000000000
--- a/site/src/utils/compat.js
+++ /dev/null
@@ -1 +0,0 @@
-export const isMac = typeof navigator !== 'undefined' && navigator.platform === 'MacIntel';
diff --git a/site/src/utils/db.js b/site/src/utils/db.js
deleted file mode 100644
index 069450b0f3..0000000000
--- a/site/src/utils/db.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Pool } from 'pg';
-
-// Uses `PG*` ENV vars
-export const DB = process.env.PGHOST ? new Pool() : null;
-
-export function query(text, values=[]) {
- return DB.query(text, values).then(r => r.rows);
-}
-
-export function find(text, values=[]) {
- return query(text, values).then(arr => arr[0]);
-}
diff --git a/site/src/utils/events.js b/site/src/utils/events.js
deleted file mode 100644
index 5575812a95..0000000000
--- a/site/src/utils/events.js
+++ /dev/null
@@ -1,19 +0,0 @@
-export function keyEvent(code) {
- return function (node, callback) {
- node.addEventListener('keydown', handleKeydown);
-
- function handleKeydown(event) {
- if (event.keyCode === code) {
- callback.call(this, event);
- }
- }
-
- return {
- destroy() {
- node.removeEventListener('keydown', handleKeydown);
- }
- };
- };
-}
-
-export const enter = keyEvent(13);
diff --git a/site/src/utils/examples.js b/site/src/utils/examples.js
deleted file mode 100644
index fc61d79ad3..0000000000
--- a/site/src/utils/examples.js
+++ /dev/null
@@ -1,16 +0,0 @@
-export function process_example(files) {
- return files
- .map(file => {
- const [name, type] = file.name.split('.');
- return { name, type, source: file.source };
- })
- .sort((a, b) => {
- if (a.name === 'App' && a.type === 'svelte') return -1;
- if (b.name === 'App' && b.type === 'svelte') return 1;
-
- if (a.type === b.type) return a.name < b.name ? -1 : 1;
-
- if (a.type === 'svelte') return -1;
- if (b.type === 'svelte') return 1;
- });
-}
\ No newline at end of file
diff --git a/site/src/utils/highlight.js b/site/src/utils/highlight.js
deleted file mode 100644
index 124af2e6be..0000000000
--- a/site/src/utils/highlight.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import { langs } from '@sveltejs/site-kit/utils/markdown.js';
-import PrismJS from 'prismjs';
-import 'prismjs/components/prism-bash';
-import 'prismjs/components/prism-diff';
-import 'prism-svelte';
-
-export function highlight(source, lang) {
- const plang = langs[lang] || '';
- const highlighted = plang ? PrismJS.highlight(
- source,
- PrismJS.languages[plang],
- lang,
- ) : source.replace(/[&<>]/g, c => ({ '&': '&', '<': '<', '>': '>' })[c]);
-
- return `${highlighted} `;
-}
diff --git a/site/src/utils/slug.js b/site/src/utils/slug.js
deleted file mode 100644
index 05ec5512ca..0000000000
--- a/site/src/utils/slug.js
+++ /dev/null
@@ -1,78 +0,0 @@
-import slugify from '@sindresorhus/slugify';
-import {SLUG_SEPARATOR} from '../../config';
-
-/* url-safe processor */
-
-export const urlsafeSlugProcessor = string =>
- slugify(string, {
- customReplacements: [ // runs before any other transformations
- ['$', 'DOLLAR'], // `$destroy` & co
- ['-', 'DASH'], // conflicts with `separator`
- ],
- separator: SLUG_SEPARATOR,
- decamelize: false,
- lowercase: false
- })
- .replace(/DOLLAR/g, '$')
- .replace(/DASH/g, '-');
-
-/* unicode-preserver processor */
-
-const alphaNumRegex = /[a-zA-Z0-9]/;
-const unicodeRegex = /\p{Letter}/u;
-const isNonAlphaNumUnicode =
- string => !alphaNumRegex.test(string) && unicodeRegex.test(string);
-
-export const unicodeSafeProcessor = string =>
- string.split('')
- .reduce((accum, char, index, array) => {
- const type = isNonAlphaNumUnicode(char) ? 'pass' : 'process';
-
- if (index === 0) {
- accum.current = {type, string: char};
- } else if (type === accum.current.type) {
- accum.current.string += char;
- } else {
- accum.chunks.push(accum.current);
- accum.current = {type, string: char};
- }
-
- if (index === array.length - 1) {
- accum.chunks.push(accum.current);
- }
-
- return accum;
- }, {chunks: [], current: {type: '', string: ''}})
- .chunks
- .reduce((accum, chunk) => {
- const processed = chunk.type === 'process'
- ? urlsafeSlugProcessor(chunk.string)
- : chunk.string;
-
- processed.length > 0 && accum.push(processed);
-
- return accum;
- }, [])
- .join(SLUG_SEPARATOR);
-
-/* processor */
-
-export const makeSlugProcessor = (preserveUnicode = false) => preserveUnicode
- ? unicodeSafeProcessor
- : urlsafeSlugProcessor;
-
-/* session processor */
-
-export const makeSessionSlugProcessor = (preserveUnicode = false) => {
- const processor = makeSlugProcessor(preserveUnicode);
- const seen = new Set();
-
- return string => {
- const slug = processor(string);
-
- if (seen.has(slug)) throw new Error(`Duplicate slug ${slug}`);
- seen.add(slug);
-
- return slug;
- };
-};
diff --git a/site/static/examples/thumbnails/7guis-circles.jpg b/site/static/examples/thumbnails/7guis-circles.jpg
deleted file mode 100644
index e2d58b9f36..0000000000
Binary files a/site/static/examples/thumbnails/7guis-circles.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/7guis-counter.jpg b/site/static/examples/thumbnails/7guis-counter.jpg
deleted file mode 100644
index b0b525fc42..0000000000
Binary files a/site/static/examples/thumbnails/7guis-counter.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/7guis-crud.jpg b/site/static/examples/thumbnails/7guis-crud.jpg
deleted file mode 100644
index ccebfb8a6b..0000000000
Binary files a/site/static/examples/thumbnails/7guis-crud.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/7guis-flight-booker.jpg b/site/static/examples/thumbnails/7guis-flight-booker.jpg
deleted file mode 100644
index c0aecc9fe1..0000000000
Binary files a/site/static/examples/thumbnails/7guis-flight-booker.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/7guis-temperature.jpg b/site/static/examples/thumbnails/7guis-temperature.jpg
deleted file mode 100644
index b58e9e09b9..0000000000
Binary files a/site/static/examples/thumbnails/7guis-temperature.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/7guis-timer.jpg b/site/static/examples/thumbnails/7guis-timer.jpg
deleted file mode 100644
index 6fd89dd75a..0000000000
Binary files a/site/static/examples/thumbnails/7guis-timer.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/actions.jpg b/site/static/examples/thumbnails/actions.jpg
deleted file mode 100644
index 33986769df..0000000000
Binary files a/site/static/examples/thumbnails/actions.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/adding-parameters-to-actions.jpg b/site/static/examples/thumbnails/adding-parameters-to-actions.jpg
deleted file mode 100644
index 1963b7f41e..0000000000
Binary files a/site/static/examples/thumbnails/adding-parameters-to-actions.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/adding-parameters-to-transitions.jpg b/site/static/examples/thumbnails/adding-parameters-to-transitions.jpg
deleted file mode 100644
index db4f939d2a..0000000000
Binary files a/site/static/examples/thumbnails/adding-parameters-to-transitions.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/animate.jpg b/site/static/examples/thumbnails/animate.jpg
deleted file mode 100644
index 48cc6eb45d..0000000000
Binary files a/site/static/examples/thumbnails/animate.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/area-chart.jpg b/site/static/examples/thumbnails/area-chart.jpg
deleted file mode 100644
index 4f6a2c8e64..0000000000
Binary files a/site/static/examples/thumbnails/area-chart.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/auto-subscriptions.jpg b/site/static/examples/thumbnails/auto-subscriptions.jpg
deleted file mode 100644
index 9f14c15036..0000000000
Binary files a/site/static/examples/thumbnails/auto-subscriptions.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/await-blocks.jpg b/site/static/examples/thumbnails/await-blocks.jpg
deleted file mode 100644
index 3d3dbe60f5..0000000000
Binary files a/site/static/examples/thumbnails/await-blocks.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/bar-chart.jpg b/site/static/examples/thumbnails/bar-chart.jpg
deleted file mode 100644
index ce303b926c..0000000000
Binary files a/site/static/examples/thumbnails/bar-chart.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/bind-this.jpg b/site/static/examples/thumbnails/bind-this.jpg
deleted file mode 100644
index 61c1957f69..0000000000
Binary files a/site/static/examples/thumbnails/bind-this.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/checkbox-inputs.jpg b/site/static/examples/thumbnails/checkbox-inputs.jpg
deleted file mode 100644
index 2831b458d7..0000000000
Binary files a/site/static/examples/thumbnails/checkbox-inputs.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/class-shorthand.jpg b/site/static/examples/thumbnails/class-shorthand.jpg
deleted file mode 100644
index 3c3937e4e0..0000000000
Binary files a/site/static/examples/thumbnails/class-shorthand.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/classes.jpg b/site/static/examples/thumbnails/classes.jpg
deleted file mode 100644
index b2081309e1..0000000000
Binary files a/site/static/examples/thumbnails/classes.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/clock.jpg b/site/static/examples/thumbnails/clock.jpg
deleted file mode 100644
index 9cab05c8cc..0000000000
Binary files a/site/static/examples/thumbnails/clock.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/component-bindings.jpg b/site/static/examples/thumbnails/component-bindings.jpg
deleted file mode 100644
index a28af2440f..0000000000
Binary files a/site/static/examples/thumbnails/component-bindings.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/component-events.jpg b/site/static/examples/thumbnails/component-events.jpg
deleted file mode 100644
index 3199aff9c9..0000000000
Binary files a/site/static/examples/thumbnails/component-events.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/conditional-slots.jpg b/site/static/examples/thumbnails/conditional-slots.jpg
deleted file mode 100644
index 39bdbf3a3e..0000000000
Binary files a/site/static/examples/thumbnails/conditional-slots.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/context-api.jpg b/site/static/examples/thumbnails/context-api.jpg
deleted file mode 100644
index 5c283cd63e..0000000000
Binary files a/site/static/examples/thumbnails/context-api.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/custom-css-transitions.jpg b/site/static/examples/thumbnails/custom-css-transitions.jpg
deleted file mode 100644
index fb406bff92..0000000000
Binary files a/site/static/examples/thumbnails/custom-css-transitions.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/custom-js-transitions.jpg b/site/static/examples/thumbnails/custom-js-transitions.jpg
deleted file mode 100644
index 4f43705d99..0000000000
Binary files a/site/static/examples/thumbnails/custom-js-transitions.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/custom-stores.jpg b/site/static/examples/thumbnails/custom-stores.jpg
deleted file mode 100644
index 9f14c15036..0000000000
Binary files a/site/static/examples/thumbnails/custom-stores.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/debug.jpg b/site/static/examples/thumbnails/debug.jpg
deleted file mode 100644
index e65fa074e2..0000000000
Binary files a/site/static/examples/thumbnails/debug.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/declaring-props.jpg b/site/static/examples/thumbnails/declaring-props.jpg
deleted file mode 100644
index 94759bc743..0000000000
Binary files a/site/static/examples/thumbnails/declaring-props.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/default-values.jpg b/site/static/examples/thumbnails/default-values.jpg
deleted file mode 100644
index 94033260b2..0000000000
Binary files a/site/static/examples/thumbnails/default-values.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/deferred-transitions.jpg b/site/static/examples/thumbnails/deferred-transitions.jpg
deleted file mode 100644
index 3a7fe90f2f..0000000000
Binary files a/site/static/examples/thumbnails/deferred-transitions.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/derived-stores.jpg b/site/static/examples/thumbnails/derived-stores.jpg
deleted file mode 100644
index a2aade2920..0000000000
Binary files a/site/static/examples/thumbnails/derived-stores.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/dimensions.jpg b/site/static/examples/thumbnails/dimensions.jpg
deleted file mode 100644
index 065a62207c..0000000000
Binary files a/site/static/examples/thumbnails/dimensions.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/dom-event-forwarding.jpg b/site/static/examples/thumbnails/dom-event-forwarding.jpg
deleted file mode 100644
index 4c23217bba..0000000000
Binary files a/site/static/examples/thumbnails/dom-event-forwarding.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/dom-events.jpg b/site/static/examples/thumbnails/dom-events.jpg
deleted file mode 100644
index 365d26e705..0000000000
Binary files a/site/static/examples/thumbnails/dom-events.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/dynamic-attributes.jpg b/site/static/examples/thumbnails/dynamic-attributes.jpg
deleted file mode 100644
index a0d5898ce2..0000000000
Binary files a/site/static/examples/thumbnails/dynamic-attributes.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/each-block-bindings.jpg b/site/static/examples/thumbnails/each-block-bindings.jpg
deleted file mode 100644
index 931f1dcf42..0000000000
Binary files a/site/static/examples/thumbnails/each-block-bindings.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/each-blocks.jpg b/site/static/examples/thumbnails/each-blocks.jpg
deleted file mode 100644
index efc9dcb88f..0000000000
Binary files a/site/static/examples/thumbnails/each-blocks.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/easing.jpg b/site/static/examples/thumbnails/easing.jpg
deleted file mode 100644
index 11c4871c2a..0000000000
Binary files a/site/static/examples/thumbnails/easing.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/else-blocks.jpg b/site/static/examples/thumbnails/else-blocks.jpg
deleted file mode 100644
index 69426d5ec3..0000000000
Binary files a/site/static/examples/thumbnails/else-blocks.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/else-if-blocks.jpg b/site/static/examples/thumbnails/else-if-blocks.jpg
deleted file mode 100644
index 15996af39f..0000000000
Binary files a/site/static/examples/thumbnails/else-if-blocks.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/event-forwarding.jpg b/site/static/examples/thumbnails/event-forwarding.jpg
deleted file mode 100644
index 3199aff9c9..0000000000
Binary files a/site/static/examples/thumbnails/event-forwarding.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/event-modifiers.jpg b/site/static/examples/thumbnails/event-modifiers.jpg
deleted file mode 100644
index 752c5b1a0a..0000000000
Binary files a/site/static/examples/thumbnails/event-modifiers.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/file-inputs.jpg b/site/static/examples/thumbnails/file-inputs.jpg
deleted file mode 100644
index d302633f6b..0000000000
Binary files a/site/static/examples/thumbnails/file-inputs.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/group-inputs.jpg b/site/static/examples/thumbnails/group-inputs.jpg
deleted file mode 100644
index c70f2afcdc..0000000000
Binary files a/site/static/examples/thumbnails/group-inputs.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/hacker-news.jpg b/site/static/examples/thumbnails/hacker-news.jpg
deleted file mode 100644
index 1792586cef..0000000000
Binary files a/site/static/examples/thumbnails/hacker-news.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/hello-world.jpg b/site/static/examples/thumbnails/hello-world.jpg
deleted file mode 100644
index 3b8d871ade..0000000000
Binary files a/site/static/examples/thumbnails/hello-world.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/html-tags.jpg b/site/static/examples/thumbnails/html-tags.jpg
deleted file mode 100644
index f208c04e4f..0000000000
Binary files a/site/static/examples/thumbnails/html-tags.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/if-blocks.jpg b/site/static/examples/thumbnails/if-blocks.jpg
deleted file mode 100644
index 69426d5ec3..0000000000
Binary files a/site/static/examples/thumbnails/if-blocks.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/immutable-data.jpg b/site/static/examples/thumbnails/immutable-data.jpg
deleted file mode 100644
index e339b8d459..0000000000
Binary files a/site/static/examples/thumbnails/immutable-data.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/in-and-out.jpg b/site/static/examples/thumbnails/in-and-out.jpg
deleted file mode 100644
index 397ca3b51b..0000000000
Binary files a/site/static/examples/thumbnails/in-and-out.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/inline-handlers.jpg b/site/static/examples/thumbnails/inline-handlers.jpg
deleted file mode 100644
index 365d26e705..0000000000
Binary files a/site/static/examples/thumbnails/inline-handlers.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/keyed-each-blocks.jpg b/site/static/examples/thumbnails/keyed-each-blocks.jpg
deleted file mode 100644
index 8f3d85b288..0000000000
Binary files a/site/static/examples/thumbnails/keyed-each-blocks.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/media-elements.jpg b/site/static/examples/thumbnails/media-elements.jpg
deleted file mode 100644
index 579dcc707f..0000000000
Binary files a/site/static/examples/thumbnails/media-elements.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/modal.jpg b/site/static/examples/thumbnails/modal.jpg
deleted file mode 100644
index d6ec829865..0000000000
Binary files a/site/static/examples/thumbnails/modal.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/module-exports.jpg b/site/static/examples/thumbnails/module-exports.jpg
deleted file mode 100644
index 26c3e6a32f..0000000000
Binary files a/site/static/examples/thumbnails/module-exports.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/multiple-select-bindings.jpg b/site/static/examples/thumbnails/multiple-select-bindings.jpg
deleted file mode 100644
index ada9aaa433..0000000000
Binary files a/site/static/examples/thumbnails/multiple-select-bindings.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/named-slots.jpg b/site/static/examples/thumbnails/named-slots.jpg
deleted file mode 100644
index 54915f686f..0000000000
Binary files a/site/static/examples/thumbnails/named-slots.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/nested-components.jpg b/site/static/examples/thumbnails/nested-components.jpg
deleted file mode 100644
index 2352c21b6c..0000000000
Binary files a/site/static/examples/thumbnails/nested-components.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/numeric-inputs.jpg b/site/static/examples/thumbnails/numeric-inputs.jpg
deleted file mode 100644
index 0bcbbbbfd2..0000000000
Binary files a/site/static/examples/thumbnails/numeric-inputs.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/ondestroy.jpg b/site/static/examples/thumbnails/ondestroy.jpg
deleted file mode 100644
index c34d437017..0000000000
Binary files a/site/static/examples/thumbnails/ondestroy.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/onmount.jpg b/site/static/examples/thumbnails/onmount.jpg
deleted file mode 100644
index e42c874b90..0000000000
Binary files a/site/static/examples/thumbnails/onmount.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/reactive-assignments.jpg b/site/static/examples/thumbnails/reactive-assignments.jpg
deleted file mode 100644
index 3a57e27711..0000000000
Binary files a/site/static/examples/thumbnails/reactive-assignments.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/reactive-declarations.jpg b/site/static/examples/thumbnails/reactive-declarations.jpg
deleted file mode 100644
index 4f094d80ff..0000000000
Binary files a/site/static/examples/thumbnails/reactive-declarations.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/reactive-statements.jpg b/site/static/examples/thumbnails/reactive-statements.jpg
deleted file mode 100644
index 3a57e27711..0000000000
Binary files a/site/static/examples/thumbnails/reactive-statements.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/readable-stores.jpg b/site/static/examples/thumbnails/readable-stores.jpg
deleted file mode 100644
index 18b3ecc97f..0000000000
Binary files a/site/static/examples/thumbnails/readable-stores.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/scatterplot.jpg b/site/static/examples/thumbnails/scatterplot.jpg
deleted file mode 100644
index 065aabcc8b..0000000000
Binary files a/site/static/examples/thumbnails/scatterplot.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/select-bindings.jpg b/site/static/examples/thumbnails/select-bindings.jpg
deleted file mode 100644
index f1f2f1bf9c..0000000000
Binary files a/site/static/examples/thumbnails/select-bindings.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/sharing-code.jpg b/site/static/examples/thumbnails/sharing-code.jpg
deleted file mode 100644
index f3d5ec1045..0000000000
Binary files a/site/static/examples/thumbnails/sharing-code.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/slot-fallbacks.jpg b/site/static/examples/thumbnails/slot-fallbacks.jpg
deleted file mode 100644
index 44c083e49d..0000000000
Binary files a/site/static/examples/thumbnails/slot-fallbacks.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/slot-props.jpg b/site/static/examples/thumbnails/slot-props.jpg
deleted file mode 100644
index 424a0f2b1e..0000000000
Binary files a/site/static/examples/thumbnails/slot-props.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/slots.jpg b/site/static/examples/thumbnails/slots.jpg
deleted file mode 100644
index 845f3cb938..0000000000
Binary files a/site/static/examples/thumbnails/slots.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/spread-props.jpg b/site/static/examples/thumbnails/spread-props.jpg
deleted file mode 100644
index 0d0e2a9228..0000000000
Binary files a/site/static/examples/thumbnails/spread-props.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/spring.jpg b/site/static/examples/thumbnails/spring.jpg
deleted file mode 100644
index ca972a512d..0000000000
Binary files a/site/static/examples/thumbnails/spring.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/styling.jpg b/site/static/examples/thumbnails/styling.jpg
deleted file mode 100644
index 431c4bfe7b..0000000000
Binary files a/site/static/examples/thumbnails/styling.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/svelte-body.jpg b/site/static/examples/thumbnails/svelte-body.jpg
deleted file mode 100644
index 2494b1c95a..0000000000
Binary files a/site/static/examples/thumbnails/svelte-body.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/svelte-component.jpg b/site/static/examples/thumbnails/svelte-component.jpg
deleted file mode 100644
index b0b8922416..0000000000
Binary files a/site/static/examples/thumbnails/svelte-component.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/svelte-head.jpg b/site/static/examples/thumbnails/svelte-head.jpg
deleted file mode 100644
index fbf9c2a5e6..0000000000
Binary files a/site/static/examples/thumbnails/svelte-head.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/svelte-self.jpg b/site/static/examples/thumbnails/svelte-self.jpg
deleted file mode 100644
index d28a3ac940..0000000000
Binary files a/site/static/examples/thumbnails/svelte-self.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/svelte-window-bindings.jpg b/site/static/examples/thumbnails/svelte-window-bindings.jpg
deleted file mode 100644
index 4afdf49f7b..0000000000
Binary files a/site/static/examples/thumbnails/svelte-window-bindings.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/svelte-window.jpg b/site/static/examples/thumbnails/svelte-window.jpg
deleted file mode 100644
index ff2d91423d..0000000000
Binary files a/site/static/examples/thumbnails/svelte-window.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/svg-transitions.jpg b/site/static/examples/thumbnails/svg-transitions.jpg
deleted file mode 100644
index ff2874f622..0000000000
Binary files a/site/static/examples/thumbnails/svg-transitions.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/text-inputs.jpg b/site/static/examples/thumbnails/text-inputs.jpg
deleted file mode 100644
index e27418de53..0000000000
Binary files a/site/static/examples/thumbnails/text-inputs.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/textarea-inputs.jpg b/site/static/examples/thumbnails/textarea-inputs.jpg
deleted file mode 100644
index 6245fd8d88..0000000000
Binary files a/site/static/examples/thumbnails/textarea-inputs.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/tick.jpg b/site/static/examples/thumbnails/tick.jpg
deleted file mode 100644
index 660f5ba94e..0000000000
Binary files a/site/static/examples/thumbnails/tick.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/transition-events.jpg b/site/static/examples/thumbnails/transition-events.jpg
deleted file mode 100644
index 40e7b05a19..0000000000
Binary files a/site/static/examples/thumbnails/transition-events.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/transition.jpg b/site/static/examples/thumbnails/transition.jpg
deleted file mode 100644
index d99be156f8..0000000000
Binary files a/site/static/examples/thumbnails/transition.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/tweened.jpg b/site/static/examples/thumbnails/tweened.jpg
deleted file mode 100644
index 89433e9f86..0000000000
Binary files a/site/static/examples/thumbnails/tweened.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/update.jpg b/site/static/examples/thumbnails/update.jpg
deleted file mode 100644
index 95c4d22d6a..0000000000
Binary files a/site/static/examples/thumbnails/update.jpg and /dev/null differ
diff --git a/site/static/examples/thumbnails/writable-stores.jpg b/site/static/examples/thumbnails/writable-stores.jpg
deleted file mode 100644
index 9f14c15036..0000000000
Binary files a/site/static/examples/thumbnails/writable-stores.jpg and /dev/null differ
diff --git a/site/static/favicon.ico b/site/static/favicon.ico
deleted file mode 100644
index d75d248ef0..0000000000
Binary files a/site/static/favicon.ico and /dev/null differ
diff --git a/site/static/favicon.png b/site/static/favicon.png
deleted file mode 100644
index 21bc302b68..0000000000
Binary files a/site/static/favicon.png and /dev/null differ
diff --git a/site/static/fonts/fira-mono/fira-mono-latin-400.woff2 b/site/static/fonts/fira-mono/fira-mono-latin-400.woff2
deleted file mode 100644
index e81b9f3c56..0000000000
Binary files a/site/static/fonts/fira-mono/fira-mono-latin-400.woff2 and /dev/null differ
diff --git a/site/static/fonts/overpass/overpass-latin-100.woff2 b/site/static/fonts/overpass/overpass-latin-100.woff2
deleted file mode 100644
index a828f98880..0000000000
Binary files a/site/static/fonts/overpass/overpass-latin-100.woff2 and /dev/null differ
diff --git a/site/static/fonts/overpass/overpass-latin-300.woff2 b/site/static/fonts/overpass/overpass-latin-300.woff2
deleted file mode 100644
index 15e204c35e..0000000000
Binary files a/site/static/fonts/overpass/overpass-latin-300.woff2 and /dev/null differ
diff --git a/site/static/fonts/overpass/overpass-latin-400.woff2 b/site/static/fonts/overpass/overpass-latin-400.woff2
deleted file mode 100644
index 8f469bb22e..0000000000
Binary files a/site/static/fonts/overpass/overpass-latin-400.woff2 and /dev/null differ
diff --git a/site/static/fonts/overpass/overpass-latin-600.woff2 b/site/static/fonts/overpass/overpass-latin-600.woff2
deleted file mode 100644
index 1956aca6e0..0000000000
Binary files a/site/static/fonts/overpass/overpass-latin-600.woff2 and /dev/null differ
diff --git a/site/static/fonts/overpass/overpass-latin-700.woff2 b/site/static/fonts/overpass/overpass-latin-700.woff2
deleted file mode 100644
index 14a7f9cce5..0000000000
Binary files a/site/static/fonts/overpass/overpass-latin-700.woff2 and /dev/null differ
diff --git a/site/static/fonts/roboto/roboto-latin-400.woff2 b/site/static/fonts/roboto/roboto-latin-400.woff2
deleted file mode 100644
index 7e854e669b..0000000000
Binary files a/site/static/fonts/roboto/roboto-latin-400.woff2 and /dev/null differ
diff --git a/site/static/fonts/roboto/roboto-latin-400italic.woff2 b/site/static/fonts/roboto/roboto-latin-400italic.woff2
deleted file mode 100644
index 3791c883e8..0000000000
Binary files a/site/static/fonts/roboto/roboto-latin-400italic.woff2 and /dev/null differ
diff --git a/site/static/fonts/roboto/roboto-latin-500.woff2 b/site/static/fonts/roboto/roboto-latin-500.woff2
deleted file mode 100644
index 8dceabcf6b..0000000000
Binary files a/site/static/fonts/roboto/roboto-latin-500.woff2 and /dev/null differ
diff --git a/site/static/fonts/roboto/roboto-latin-500italic.woff2 b/site/static/fonts/roboto/roboto-latin-500italic.woff2
deleted file mode 100644
index 1b9589945e..0000000000
Binary files a/site/static/fonts/roboto/roboto-latin-500italic.woff2 and /dev/null differ
diff --git a/site/static/global.css b/site/static/global.css
deleted file mode 100644
index 329a811545..0000000000
--- a/site/static/global.css
+++ /dev/null
@@ -1,44 +0,0 @@
-/* headers anchors */
-
-.offset-anchor {
- position: relative;
- display: block;
- top: calc(-1 * (var(--nav-h) + var(--top-offset)) + 11rem);
- width: 0;
- height: 0;
-}
-
-.anchor {
- position: absolute;
- display: block;
- background: url(/icons/link.svg) 0 50% no-repeat;
- background-size: 1em 1em;
- width: 1.4em;
- height: 1em;
- top: calc(((var(--h3) - 24px) / 2) + 0.6em);
- left: -1.4em;
- opacity: 0;
- transition: opacity 0.2s;
- border: none !important; /* TODO get rid of linkify */
-}
-
-h2:hover .anchor,
-h3:hover .anchor,
-h4:hover .anchor,
-h5:hover .anchor,
-h6:hover .anchor {
- opacity: 1;
-}
-
-/* visually hidden, but accessible to assistive tech */
-.visually-hidden {
- border: 0;
- clip: rect(0 0 0 0);
- height: auto;
- margin: 0;
- overflow: hidden;
- padding: 0;
- position: absolute;
- width: 1px;
- white-space: nowrap;
-}
diff --git a/site/static/icons/arrow-right.svg b/site/static/icons/arrow-right.svg
deleted file mode 100644
index 57bb51ed28..0000000000
--- a/site/static/icons/arrow-right.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/icons/check.svg b/site/static/icons/check.svg
deleted file mode 100644
index c3e46a42b6..0000000000
--- a/site/static/icons/check.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/icons/chevron.svg b/site/static/icons/chevron.svg
deleted file mode 100644
index 9d582fa803..0000000000
--- a/site/static/icons/chevron.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/icons/collapse.svg b/site/static/icons/collapse.svg
deleted file mode 100644
index 795939aec8..0000000000
--- a/site/static/icons/collapse.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/icons/download.svg b/site/static/icons/download.svg
deleted file mode 100644
index b286a882fe..0000000000
--- a/site/static/icons/download.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/icons/dropdown.svg b/site/static/icons/dropdown.svg
deleted file mode 100644
index 69435856b4..0000000000
--- a/site/static/icons/dropdown.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/icons/edit.svg b/site/static/icons/edit.svg
deleted file mode 100644
index 760321cd2f..0000000000
--- a/site/static/icons/edit.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/icons/expand.svg b/site/static/icons/expand.svg
deleted file mode 100644
index a026808da3..0000000000
--- a/site/static/icons/expand.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/icons/flip.svg b/site/static/icons/flip.svg
deleted file mode 100644
index 3a18d5ffa1..0000000000
--- a/site/static/icons/flip.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/icons/fork.svg b/site/static/icons/fork.svg
deleted file mode 100644
index 3e21885495..0000000000
--- a/site/static/icons/fork.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/icons/link.svg b/site/static/icons/link.svg
deleted file mode 100644
index 3345bdd0ba..0000000000
--- a/site/static/icons/link.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/icons/loading.svg b/site/static/icons/loading.svg
deleted file mode 100644
index e54abff1dd..0000000000
--- a/site/static/icons/loading.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/site/static/icons/save.svg b/site/static/icons/save.svg
deleted file mode 100644
index a8a5fa1618..0000000000
--- a/site/static/icons/save.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/images/svelte-android-chrome-192.png b/site/static/images/svelte-android-chrome-192.png
deleted file mode 100644
index e3ccf28087..0000000000
Binary files a/site/static/images/svelte-android-chrome-192.png and /dev/null differ
diff --git a/site/static/images/svelte-android-chrome-512.png b/site/static/images/svelte-android-chrome-512.png
deleted file mode 100644
index e673c91c7b..0000000000
Binary files a/site/static/images/svelte-android-chrome-512.png and /dev/null differ
diff --git a/site/static/images/svelte-apple-touch-icon.png b/site/static/images/svelte-apple-touch-icon.png
deleted file mode 100644
index 5600445b1c..0000000000
Binary files a/site/static/images/svelte-apple-touch-icon.png and /dev/null differ
diff --git a/site/static/images/svelte-mstile-150.png b/site/static/images/svelte-mstile-150.png
deleted file mode 100644
index 7694b20455..0000000000
Binary files a/site/static/images/svelte-mstile-150.png and /dev/null differ
diff --git a/site/static/images/twitter-card.png b/site/static/images/twitter-card.png
deleted file mode 100644
index 7a66e94003..0000000000
Binary files a/site/static/images/twitter-card.png and /dev/null differ
diff --git a/site/static/manifest.json b/site/static/manifest.json
deleted file mode 100644
index 45a9d5b907..0000000000
--- a/site/static/manifest.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "background_color": "#ffffff",
- "theme_color": "#ff3e00",
- "name": "Svelte",
- "short_name": "Svelte",
- "display": "minimal-ui",
- "start_url": "/",
- "icons": [
- {
- "src": "images/svelte-android-chrome-192.png",
- "sizes": "192x192",
- "type": "image/png"
- },
- {
- "src": "images/svelte-android-chrome-512.png",
- "sizes": "512x512",
- "type": "image/png"
- }
- ]
-}
diff --git a/site/static/media/rethinking-best-practices.jpg b/site/static/media/rethinking-best-practices.jpg
deleted file mode 100644
index fdbae403de..0000000000
Binary files a/site/static/media/rethinking-best-practices.jpg and /dev/null differ
diff --git a/site/static/media/svelte-ts.png b/site/static/media/svelte-ts.png
deleted file mode 100644
index ed562822c3..0000000000
Binary files a/site/static/media/svelte-ts.png and /dev/null differ
diff --git a/site/static/prism.css b/site/static/prism.css
deleted file mode 100644
index 0bedd0f02b..0000000000
--- a/site/static/prism.css
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
------------------------------------------------
- syntax-highlighting [prism]
------------------------------------------------
-*/
-
-/* colors --------------------------------- */
-pre[class*='language-'] {
- --background: var(--back-light);
- --base: #545454;
- --comment: #696969;
- --keyword: #007f8a;
- --function: #bb5525;
- --string: #856e3d;
- --number: #008000;
- --tags: var(--function);
- --important: var(--string);
-}
-
-/* type-base ------------------------------ */
-code[class*='language-'],
-pre[class*='language-'] {
- background: none;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
- word-break: normal;
- word-wrap: normal;
- font: 300 var(--code-fs)/1.7 var(--font-mono);
- color: var(--base);
- tab-size: 2;
- -moz-tab-size: 2;
- -webkit-hyphens: none;
- hyphens: none;
-}
-
-/* code-blocks ---------------------------- */
-pre[class*='language-'] {
- overflow: auto;
- padding: 1.5rem 2rem;
- margin: .8rem 0 2.4rem;
- /* max-width: var(--code-w); */
- border-radius: var(--border-r);
- box-shadow: 1px 1px 1px rgba(68, 68, 68, .12) inset;
-}
-
-:not(pre) > code[class*='language-'],
-pre[class*='language-'] {
- background: var(--background);
-}
-
-/* tokens --------------------------------- */
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata { color: var(--comment) }
-
-.token.punctuation { color: var(--base) }
-
-.token.property,
-.token.tag,
-.token.constant,
-.token.symbol,
-.token.deleted { color: var(--tags) }
-
-.token.boolean,
-.token.number { color: var(--number) }
-
-.token.selector,
-.token.attr-name,
-.token.string,
-.token.char,
-.token.builtin,
-.token.inserted { color: var(--string) }
-
-.token.operator,
-.token.entity,
-.token.url,
-.language-css .token.string,
-.style .token.string,
-.token.variable { color: var(--base) }
-
-.token.atrule,
-.token.attr-value,
-.token.function,
-.token.class-name { color: var(--function) }
-
-.token.keyword { color: var(--keyword) }
-
-.token.regex,
-.token.important { color: var(--important) }
-
-.token.important,
-.token.bold { font-weight: bold }
-.token.italic { font-style: italic }
-.token.entity { cursor: help }
\ No newline at end of file
diff --git a/site/static/svelte-logo-horizontal.svg b/site/static/svelte-logo-horizontal.svg
deleted file mode 100644
index 1d602a9051..0000000000
--- a/site/static/svelte-logo-horizontal.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/site/static/svelte-logo-mask.svg b/site/static/svelte-logo-mask.svg
deleted file mode 100644
index 8572d3da6c..0000000000
--- a/site/static/svelte-logo-mask.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/svelte-logo-outline.svg b/site/static/svelte-logo-outline.svg
deleted file mode 100644
index d93d71c593..0000000000
--- a/site/static/svelte-logo-outline.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/svelte-logo-vertical.svg b/site/static/svelte-logo-vertical.svg
deleted file mode 100644
index 7e2888234d..0000000000
--- a/site/static/svelte-logo-vertical.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/svelte-logo.svg b/site/static/svelte-logo.svg
deleted file mode 100644
index d8b477bee1..0000000000
--- a/site/static/svelte-logo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/svelte-logotype.svg b/site/static/svelte-logotype.svg
deleted file mode 100644
index 1e0aec15ef..0000000000
--- a/site/static/svelte-logotype.svg
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/site/static/tutorial/dark-theme.css b/site/static/tutorial/dark-theme.css
deleted file mode 100644
index e6bfb771f1..0000000000
--- a/site/static/tutorial/dark-theme.css
+++ /dev/null
@@ -1,5 +0,0 @@
-body {
- background-color: #333;
- color: whitesmoke;
- transition: all 0.5s;
-}
\ No newline at end of file
diff --git a/site/static/tutorial/icons/email.svg b/site/static/tutorial/icons/email.svg
deleted file mode 100644
index 70d92ca430..0000000000
--- a/site/static/tutorial/icons/email.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/tutorial/icons/folder-open.svg b/site/static/tutorial/icons/folder-open.svg
deleted file mode 100644
index b2a58e7432..0000000000
--- a/site/static/tutorial/icons/folder-open.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/tutorial/icons/folder.svg b/site/static/tutorial/icons/folder.svg
deleted file mode 100644
index 2e1246a7f9..0000000000
--- a/site/static/tutorial/icons/folder.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/tutorial/icons/gif.svg b/site/static/tutorial/icons/gif.svg
deleted file mode 100644
index 4b28abcecd..0000000000
--- a/site/static/tutorial/icons/gif.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/tutorial/icons/map-marker.svg b/site/static/tutorial/icons/map-marker.svg
deleted file mode 100644
index 40a702db9d..0000000000
--- a/site/static/tutorial/icons/map-marker.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/tutorial/icons/md.svg b/site/static/tutorial/icons/md.svg
deleted file mode 100644
index 582204d3b7..0000000000
--- a/site/static/tutorial/icons/md.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/tutorial/icons/xlsx.svg b/site/static/tutorial/icons/xlsx.svg
deleted file mode 100644
index 1a51093a97..0000000000
--- a/site/static/tutorial/icons/xlsx.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/site/static/tutorial/image.gif b/site/static/tutorial/image.gif
deleted file mode 100644
index 3ce9c237d5..0000000000
Binary files a/site/static/tutorial/image.gif and /dev/null differ
diff --git a/site/static/tutorial/kitten.png b/site/static/tutorial/kitten.png
deleted file mode 100644
index f1a0ecca19..0000000000
Binary files a/site/static/tutorial/kitten.png and /dev/null differ
diff --git a/site/test/utils/slug.js b/site/test/utils/slug.js
deleted file mode 100644
index 17262c5e83..0000000000
--- a/site/test/utils/slug.js
+++ /dev/null
@@ -1,423 +0,0 @@
-import {strict as assert} from 'assert';
-import {urlsafeSlugProcessor, unicodeSafeProcessor} from '../../src/utils/slug';
-import {SLUG_SEPARATOR as _} from '../../config';
-
-describe('slug', () => {
- describe('urlsafeSlugProcessor', () => {
- describe('ascii', () => {
- it('space separated words', () => {
- assert.equal(
- urlsafeSlugProcessor('Text expressions'),
- `Text${_}expressions`
- );
- });
- it('numbered text', () => {
- assert.equal(
- urlsafeSlugProcessor('1. export creates'),
- `1${_}export${_}creates`
- );
- });
- it('punctuated text', () => {
- assert.equal(
- urlsafeSlugProcessor('svelte.VERSION'),
- `svelte${_}VERSION`
- );
- });
- it('text starting with the dollar sign', () => {
- assert.equal(
- urlsafeSlugProcessor('$destroy method'),
- `$destroy${_}method`
- );
- });
- it('numbered text containing the dollar sign', () => {
- assert.equal(
- urlsafeSlugProcessor('1. export $destroy'),
- `1${_}export${_}$destroy`
- );
- });
- it('text containing the equal char', () => {
- assert.equal(
- urlsafeSlugProcessor('script context=module'),
- `script${_}context${_}module`
- );
- });
- it('text containing the colon char', () => {
- assert.equal(
- urlsafeSlugProcessor('svelte:body'),
- `svelte${_}body`
- );
- });
- it('text containing the slash char', () => {
- assert.equal(
- urlsafeSlugProcessor('svelte/motion'),
- `svelte${_}motion`
- );
- });
- it('text containing the comma char', () => {
- assert.equal(
- urlsafeSlugProcessor('svelte, motion'),
- `svelte${_}motion`
- );
- });
- });
- describe('unicode', () => {
- it('should translate symbols to English', () => {
- assert.equal(
- urlsafeSlugProcessor('Ich ♥ Deutsch'),
- `Ich${_}love${_}Deutsch`
- );
- });
- it('should remove emoji', () => {
- assert.equal(
- urlsafeSlugProcessor('Ich 😍 Deutsch'),
- `Ich${_}Deutsch`
- );
- });
- });
- describe('cyricllic', () => {
- it('space separated words', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие и перехват событий'),
- `Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('numbered text', () => {
- assert.equal(
- urlsafeSlugProcessor('1 Всплытие и перехват событий'),
- `1${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('punctuated text', () => {
- assert.equal(
- urlsafeSlugProcessor('.Всплытие.и.перехват событий'),
- `Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text starting with the dollar sign', () => {
- assert.equal(
- urlsafeSlugProcessor('$Всплытие $ перехват событий'),
- `$Vsplytie${_}$${_}perehvat${_}sobytij`
- );
- });
- it('text containing the dollar sign', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие$перехват'),
- `Vsplytie$perehvat`
- );
- });
- it('text containing the equal char', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие = перехват=событий'),
- `Vsplytie${_}perehvat${_}sobytij`
- );
- });
- it('text containing the colon char', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие : перехват:событий'),
- `Vsplytie${_}perehvat${_}sobytij`
- );
- });
- it('text containing the slash char', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие / перехват/событий'),
- `Vsplytie${_}perehvat${_}sobytij`
- );
- });
- it('text containing the comma char', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие, перехват'),
- `Vsplytie${_}perehvat`
- );
- });
- });
- describe('ascii + cyricllic', () => {
- it('space separated words', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие и export перехват событий'),
- `Vsplytie${_}i${_}export${_}perehvat${_}sobytij`
- );
- });
- it('ascii word concatenated to a cyricllic word', () => {
- assert.equal(
- urlsafeSlugProcessor('exportВсплытие'),
- 'exportVsplytie'
- );
- });
- it('cyricllic word concatenated to an ascii word', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытиеexport'),
- `Vsplytieexport`
- );
- });
- it('numbered text', () => {
- assert.equal(
- urlsafeSlugProcessor('1 export Всплытие и перехват событий'),
- `1${_}export${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('punctuated text', () => {
- assert.equal(
- urlsafeSlugProcessor('.Всплытие.export.и.перехват событий'),
- `Vsplytie${_}export${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text starting with the dollar sign, followed by ascii char', () => {
- assert.equal(
- urlsafeSlugProcessor('$exportВсплытие перехват событий'),
- `$exportVsplytie${_}perehvat${_}sobytij`
- );
- });
- it('text starting with the dollar sign, followed by unicode char', () => {
- assert.equal(
- urlsafeSlugProcessor('$Всплытие export перехват событий'),
- `$Vsplytie${_}export${_}perehvat${_}sobytij`
- );
- });
- it('text containing the dollar sign, followed by ascii char', () => {
- assert.equal(
- urlsafeSlugProcessor('export $destroy a component prop Всплытие и перехват событий'),
- `export${_}$destroy${_}a${_}component${_}prop${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text containing the dollar sign, followed by unicode char', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие export $Всплытие a component prop Всплытие и перехват событий'),
- `Vsplytie${_}export${_}$Vsplytie${_}a${_}component${_}prop${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text containing the equal char', () => {
- assert.equal(
- urlsafeSlugProcessor('script context=module Всплытие=и перехват событий'),
- `script${_}context${_}module${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text containing the colon char', () => {
- assert.equal(
- urlsafeSlugProcessor('svelte:body Всплытие и:перехват событий'),
- `svelte${_}body${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text containing the slash char', () => {
- assert.equal(
- urlsafeSlugProcessor('svelte/motion Всплытие и / перехват/событий'),
- `svelte${_}motion${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text containing the comma char', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие, export'),
- `Vsplytie${_}export`
- );
- });
- });
- });
-
- describe('unicodeSafeProcessor (preserve unicode)', () => {
- describe('ascii', () => {
- it('space separated words', () => {
- assert.equal(
- unicodeSafeProcessor('Text expressions'),
- `Text${_}expressions`
- );
- });
- it('numbered text', () => {
- assert.equal(
- unicodeSafeProcessor('1. export creates'),
- `1${_}export${_}creates`
- );
- });
- it('punctuated text', () => {
- assert.equal(
- unicodeSafeProcessor('svelte.VERSION'),
- `svelte${_}VERSION`
- );
- });
- it('text starting with the dollar sign', () => {
- assert.equal(
- unicodeSafeProcessor('$destroy method'),
- `$destroy${_}method`
- );
- });
- it('numbered text containing the dollar sign', () => {
- assert.equal(
- unicodeSafeProcessor('1. export $destroy'),
- `1${_}export${_}$destroy`
- );
- });
- it('text containing the equal char', () => {
- assert.equal(
- unicodeSafeProcessor('script context=module'),
- `script${_}context${_}module`
- );
- });
- it('text containing the colon char', () => {
- assert.equal(
- unicodeSafeProcessor('svelte:body'),
- `svelte${_}body`
- );
- });
- it('text containing the slash char', () => {
- assert.equal(
- unicodeSafeProcessor('svelte/motion'),
- `svelte${_}motion`
- );
- });
- it('text containing the comma char', () => {
- assert.equal(
- unicodeSafeProcessor('svelte, motion'),
- `svelte${_}motion`
- );
- });
- });
- describe('unicode', () => {
- it('should preserve symbols', () => {
- assert.equal(
- unicodeSafeProcessor('Ich ♥ Deutsch'),
- `Ich${_}love${_}Deutsch`
- );
- });
- it('should remove emoji', () => {
- assert.equal(
- unicodeSafeProcessor('Ich 😍 Deutsch'),
- `Ich${_}Deutsch`
- );
- });
- });
- describe('cyricllic', () => {
- it('space separated words', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие и перехват событий'),
- `Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('numbered text', () => {
- assert.equal(
- unicodeSafeProcessor('1 Всплытие и перехват событий'),
- `1${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('punctuated text', () => {
- assert.equal(
- unicodeSafeProcessor('.Всплытие.и.перехват событий'),
- `Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('text starting with the dollar sign', () => {
- assert.equal(
- unicodeSafeProcessor('$Всплытие $ перехват событий'),
- `$${_}Всплытие${_}$${_}перехват${_}событий`
- );
- });
- it('text containing the dollar sign', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие$перехват'),
- `Всплытие${_}$${_}перехват`
- );
- });
- it('text containing the equal char', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие = перехват=событий'),
- `Всплытие${_}перехват${_}событий`
- );
- });
- it('text containing the colon char', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие : перехват:событий'),
- `Всплытие${_}перехват${_}событий`
- );
- });
- it('text containing the slash char', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие / перехват/событий'),
- `Всплытие${_}перехват${_}событий`
- );
- });
- it('text containing the comma char', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие, перехват'),
- `Всплытие${_}перехват`
- );
- });
- });
- describe('ascii + cyricllic', () => {
- it('space separated words', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие и export перехват событий'),
- `Всплытие${_}и${_}export${_}перехват${_}событий`
- );
- });
- it('ascii word concatenated to a cyricllic word', () => {
- assert.equal(
- unicodeSafeProcessor('exportВсплытие'),
- `export${_}Всплытие`
- );
- });
- it('cyricllic word concatenated to an ascii word', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытиеexport'),
- `Всплытие${_}export`
- );
- });
- it('numbered text', () => {
- assert.equal(
- unicodeSafeProcessor('1 export Всплытие и перехват событий'),
- `1${_}export${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('punctuated text', () => {
- assert.equal(
- unicodeSafeProcessor('.Всплытие.export.и.перехват событий'),
- `Всплытие${_}export${_}и${_}перехват${_}событий`
- );
- });
- it('text starting with the dollar sign, followed by ascii char', () => {
- assert.equal(
- unicodeSafeProcessor('$exportВсплытие перехват событий'),
- `$export${_}Всплытие${_}перехват${_}событий`
- );
- });
- it('text starting with the dollar sign, followed by unicode char', () => {
- assert.equal(
- unicodeSafeProcessor('$Всплытие export перехват событий'),
- `$${_}Всплытие${_}export${_}перехват${_}событий`
- );
- });
- it('text containing the dollar sign, followed by ascii char', () => {
- assert.equal(
- unicodeSafeProcessor('export $destroy a component prop Всплытие и перехват событий'),
- `export${_}$destroy${_}a${_}component${_}prop${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('text containing the dollar sign, followed by unicode char', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие export $Всплытие a component prop Всплытие и перехват событий'),
- `Всплытие${_}export${_}$${_}Всплытие${_}a${_}component${_}prop${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('text containing the equal char', () => {
- assert.equal(
- unicodeSafeProcessor('script context=module Всплытие=и перехват событий'),
- `script${_}context${_}module${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('text containing the colon char', () => {
- assert.equal(
- unicodeSafeProcessor('svelte:body Всплытие и:перехват событий'),
- `svelte${_}body${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('text containing the slash char', () => {
- assert.equal(
- unicodeSafeProcessor('svelte/motion Всплытие и / перехват/событий'),
- `svelte${_}motion${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('text containing the comma char', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие, export'),
- `Всплытие${_}export`
- );
- });
- });
- });
-});
diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts
index 70c25460b5..0347a28743 100644
--- a/src/compiler/compile/Component.ts
+++ b/src/compiler/compile/Component.ts
@@ -19,19 +19,24 @@ import error from '../utils/error';
import get_code_frame from '../utils/get_code_frame';
import flatten_reference from './utils/flatten_reference';
import is_used_as_reference from './utils/is_used_as_reference';
-import is_reference from 'is-reference';
+import is_reference, { NodeWithPropertyDefinition } from 'is-reference';
import TemplateScope from './nodes/shared/TemplateScope';
import fuzzymatch from '../utils/fuzzymatch';
import get_object from './utils/get_object';
import Slot from './nodes/Slot';
-import { Node, ImportDeclaration, Identifier, Program, ExpressionStatement, AssignmentExpression, Literal } from 'estree';
+import { Node, ImportDeclaration, ExportNamedDeclaration, Identifier, ExpressionStatement, AssignmentExpression, Literal, Property, RestElement, ExportDefaultDeclaration, ExportAllDeclaration, FunctionDeclaration, FunctionExpression } from 'estree';
import add_to_set from './utils/add_to_set';
import check_graph_for_cycles from './utils/check_graph_for_cycles';
-import { print, x, b } from 'code-red';
+import { print, b } from 'code-red';
import { is_reserved_keyword } from './utils/reserved_keywords';
import { apply_preprocessor_sourcemap } from '../utils/mapped_code';
import Element from './nodes/Element';
import { DecodedSourceMap, RawSourceMap } from '@ampproject/remapping/dist/types/types';
+import { clone } from '../utils/clone';
+import compiler_warnings from './compiler_warnings';
+import compiler_errors from './compiler_errors';
+import { extract_ignores_above_position, extract_svelte_ignore_from_comments } from '../utils/extract_svelte_ignore';
+import check_enable_sourcemap from './utils/check_enable_sourcemap';
interface ComponentOptions {
namespace?: string;
@@ -66,6 +71,8 @@ export default class Component {
var_lookup: Map = new Map();
imports: ImportDeclaration[] = [];
+ exports_from: ExportNamedDeclaration[] = [];
+ instance_exports_from: ExportNamedDeclaration[] = [];
hoistable_nodes: Set = new Set();
node_for_declaration: Map = new Map();
@@ -116,12 +123,12 @@ export default class Component {
// the instance JS gets mutated, so we park
// a copy here for later. TODO this feels gross
- this.original_ast = {
+ this.original_ast = clone({
html: ast.html,
css: ast.css,
- instance: ast.instance && JSON.parse(JSON.stringify(ast.instance)),
+ instance: ast.instance,
module: ast.module
- };
+ });
this.file =
compile_options.filename &&
@@ -159,10 +166,7 @@ export default class Component {
const svelteOptions = ast.html.children.find(
child => child.name === 'svelte:options'
) || { start: 0, end: 0 };
- this.warn(svelteOptions, {
- code: 'custom-element-no-tag',
- message: 'No custom element \'tag\' option was specified. To automatically register a custom element, specify a name with a hyphen in it, e.g. . To hide this warning, use '
- });
+ this.warn(svelteOptions, compiler_warnings.custom_element_no_tag);
}
this.tag = this.component_options.tag || compile_options.tag;
} else {
@@ -170,21 +174,29 @@ export default class Component {
}
this.walk_module_js();
+
+ this.push_ignores(this.ast.instance ? extract_ignores_above_position(this.ast.instance.start, this.ast.html.children) : []);
this.walk_instance_js_pre_template();
+ this.pop_ignores();
this.fragment = new Fragment(this, ast.html);
this.name = this.get_unique_name(name);
+ this.push_ignores(this.ast.instance ? extract_ignores_above_position(this.ast.instance.start, this.ast.html.children) : []);
this.walk_instance_js_post_template();
+ this.pop_ignores();
this.elements.forEach(element => this.stylesheet.apply(element));
if (!compile_options.customElement) this.stylesheet.reify();
this.stylesheet.warn_on_unused_selectors(this);
}
- add_var(variable: Var) {
+ add_var(variable: Var, add_to_lookup = true) {
this.vars.push(variable);
- this.var_lookup.set(variable.name, variable);
+
+ if (add_to_lookup) {
+ this.var_lookup.set(variable.name, variable);
+ }
}
add_reference(name: string) {
@@ -215,6 +227,10 @@ export default class Component {
variable.subscribable = true;
}
} else {
+ if (this.compile_options.varsReport === 'full') {
+ this.add_var({ name, referenced: true }, false);
+ }
+
this.used_names.add(name);
}
}
@@ -259,6 +275,14 @@ export default class Component {
} else {
let name = node.name.slice(1);
+ if (compile_options.hydratable) {
+ if (internal_exports.has(`${name}_hydration`)) {
+ name += '_hydration';
+ } else if (internal_exports.has(`${name}Hydration`)) {
+ name += 'Hydration';
+ }
+ }
+
if (compile_options.dev) {
if (internal_exports.has(`${name}_dev`)) {
name += '_dev';
@@ -312,26 +336,36 @@ export default class Component {
.map(variable => ({
name: variable.name,
as: variable.export_name
- }))
+ })),
+ this.exports_from
);
css = compile_options.customElement
? { code: null, map: null }
: result.css;
- js = print(program, {
- sourceMapSource: compile_options.filename
- });
+ const js_sourcemap_enabled = check_enable_sourcemap(compile_options.enableSourcemap, 'js');
+
+ if (!js_sourcemap_enabled) {
+ js = print(program);
+ js.map = null;
+ } else {
+ const sourcemap_source_filename = get_sourcemap_source_filename(compile_options);
- js.map.sources = [
- compile_options.filename ? get_relative_path(compile_options.outputFilename || '', compile_options.filename) : null
- ];
+ js = print(program, {
+ sourceMapSource: sourcemap_source_filename
+ });
+
+ js.map.sources = [
+ sourcemap_source_filename
+ ];
- js.map.sourcesContent = [
- this.source
- ];
+ js.map.sourcesContent = [
+ this.source
+ ];
- js.map = apply_preprocessor_sourcemap(this.file, js.map, compile_options.sourcemap as (string | RawSourceMap | DecodedSourceMap));
+ js.map = apply_preprocessor_sourcemap(sourcemap_source_filename, js.map, compile_options.sourcemap as (string | RawSourceMap | DecodedSourceMap));
+ }
}
return {
@@ -339,19 +373,7 @@ export default class Component {
css,
ast: this.original_ast,
warnings: this.warnings,
- vars: this.vars
- .filter(v => !v.global && !v.internal)
- .map(v => ({
- name: v.name,
- export_name: v.export_name || null,
- injected: v.injected || false,
- module: v.module || false,
- mutated: v.mutated || false,
- reassigned: v.reassigned || false,
- referenced: v.referenced || false,
- writable: v.writable || false,
- referenced_from_script: v.referenced_from_script || false
- })),
+ vars: this.get_vars_report(),
stats: this.stats.render()
};
}
@@ -401,6 +423,28 @@ export default class Component {
};
}
+ get_vars_report(): Var[] {
+ const { compile_options, vars } = this;
+
+ const vars_report = compile_options.varsReport === false
+ ? []
+ : compile_options.varsReport === 'full'
+ ? vars
+ : vars.filter(v => !v.global && !v.internal);
+
+ return vars_report.map(v => ({
+ name: v.name,
+ export_name: v.export_name || null,
+ injected: v.injected || false,
+ module: v.module || false,
+ mutated: v.mutated || false,
+ reassigned: v.reassigned || false,
+ referenced: v.referenced || false,
+ writable: v.writable || false,
+ referenced_from_script: v.referenced_from_script || false
+ }));
+ }
+
error(
pos: {
start: number;
@@ -411,14 +455,18 @@ export default class Component {
message: string;
}
) {
- error(e.message, {
- name: 'ValidationError',
- code: e.code,
- source: this.source,
- start: pos.start,
- end: pos.end,
- filename: this.compile_options.filename
- });
+ if (this.compile_options.errorMode === 'warn') {
+ this.warn(pos, e);
+ } else {
+ error(e.message, {
+ name: 'ValidationError',
+ code: e.code,
+ source: this.source,
+ start: pos.start,
+ end: pos.end,
+ filename: this.compile_options.filename
+ });
+ }
}
warn(
@@ -457,20 +505,27 @@ export default class Component {
this.imports.push(node);
}
- extract_exports(node) {
+ extract_exports(node, module_script = false) {
+ const ignores = extract_svelte_ignore_from_comments(node);
+ if (ignores.length) this.push_ignores(ignores);
+ const result = this._extract_exports(node, module_script);
+ if (ignores.length) this.pop_ignores();
+ return result;
+ }
+
+ private _extract_exports(node: ExportDefaultDeclaration | ExportNamedDeclaration | ExportAllDeclaration, module_script) {
if (node.type === 'ExportDefaultDeclaration') {
- this.error(node, {
- code: 'default-export',
- message: 'A component cannot have a default export'
- });
+ return this.error(node as any, compiler_errors.default_export);
}
if (node.type === 'ExportNamedDeclaration') {
if (node.source) {
- this.error(node, {
- code: 'not-implemented',
- message: 'A component currently cannot have an export ... from'
- });
+ if (module_script) {
+ this.exports_from.push(node);
+ } else {
+ this.instance_exports_from.push(node);
+ }
+ return null;
}
if (node.declaration) {
if (node.declaration.type === 'VariableDeclaration') {
@@ -479,10 +534,7 @@ export default class Component {
const variable = this.var_lookup.get(name);
variable.export_name = name;
if (variable.writable && !(variable.referenced || variable.referenced_from_script || variable.subscribable)) {
- this.warn(declarator, {
- code: 'unused-export-let',
- message: `${this.name.name} has unused export property '${name}'. If it is for external reference only, please consider using \`export const ${name}\``
- });
+ this.warn(declarator as any, compiler_warnings.unused_export_let(this.name.name, name));
}
});
});
@@ -502,10 +554,7 @@ export default class Component {
variable.export_name = specifier.exported.name;
if (variable.writable && !(variable.referenced || variable.referenced_from_script || variable.subscribable)) {
- this.warn(specifier, {
- code: 'unused-export-let',
- message: `${this.name.name} has unused export property '${specifier.exported.name}'. If it is for external reference only, please consider using \`export const ${specifier.exported.name}\``
- });
+ this.warn(specifier as any, compiler_warnings.unused_export_let(this.name.name, specifier.exported.name));
}
}
});
@@ -536,10 +585,7 @@ export default class Component {
walk(script.content, {
enter(node: Node) {
if (node.type === 'LabeledStatement' && node.label.name === '$') {
- component.warn(node as any, {
- code: 'module-script-reactive-declaration',
- message: '$: has no effect in a module script'
- });
+ component.warn(node as any, compiler_warnings.module_script_reactive_declaration);
}
}
});
@@ -549,10 +595,7 @@ export default class Component {
scope.declarations.forEach((node, name) => {
if (name[0] === '$') {
- this.error(node as any, {
- code: 'illegal-declaration',
- message: 'The $ prefix is reserved, and cannot be used for variable and import names'
- });
+ return this.error(node as any, compiler_errors.illegal_declaration);
}
const writable = node.type === 'VariableDeclaration' && (node.kind === 'var' || node.kind === 'let');
@@ -567,10 +610,7 @@ export default class Component {
globals.forEach((node, name) => {
if (name[0] === '$') {
- this.error(node as any, {
- code: 'illegal-subscription',
- message: 'Cannot reference store value inside ';
+import parser_errors from '../errors';
function get_context(parser: Parser, attributes: any[], start: number): string {
const context = attributes.find(attribute => attribute.name === 'context');
if (!context) return 'default';
if (context.value.length !== 1 || context.value[0].type !== 'Text') {
- parser.error({
- code: 'invalid-script',
- message: 'context attribute must be static'
- }, start);
+ parser.error(parser_errors.invalid_script_context_attribute, start);
}
const value = context.value[0].data;
if (value !== 'module') {
- parser.error({
- code: 'invalid-script',
- message: 'If the context attribute is supplied, its value must be "module"'
- }, context.start);
+ parser.error(parser_errors.invalid_script_context_value, context.start);
}
return value;
@@ -30,18 +23,13 @@ function get_context(parser: Parser, attributes: any[], start: number): string {
export default function read_script(parser: Parser, start: number, attributes: Node[]): Script {
const script_start = parser.index;
- const script_end = parser.template.indexOf(script_closing_tag, script_start);
-
- if (script_end === -1) {
- parser.error({
- code: 'unclosed-script',
- message: '
*
* ```
- *
+ *
* #### Why not make this part of `SvelteComponent(Dev)`?
* Because
* ```ts
* class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}
* const component: typeof SvelteComponent = ASubclassOfSvelteComponent;
* ```
- * will throw a type error, so we need to seperate the more strictly typed class.
+ * will throw a type error, so we need to separate the more strictly typed class.
*/
export class SvelteComponentTyped<
Props extends Record = any,
@@ -229,14 +242,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);
}
}
diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts
index 4b38843f6d..d425a14af0 100644
--- a/src/runtime/internal/dom.ts
+++ b/src/runtime/internal/dom.ts
@@ -1,13 +1,207 @@
import { has_prop, noop } 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;
+
+export function start_hydrating() {
+ is_hydrating = true;
+}
+export function end_hydrating() {
+ is_hydrating = false;
+}
+
+type NodeEx = Node & {
+ claim_order?: number,
+ hydrate_init? : true,
+ actual_end_child?: NodeEx,
+ childNodes: NodeListOf,
+};
+
+function upper_bound(low: number, high: number, key: (index: number) => number, value: number) {
+ // Return first index of value larger than input value in the range [low, high)
+ while (low < high) {
+ const mid = low + ((high - low) >> 1);
+ if (key(mid) <= value) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return low;
+}
+
+function init_hydrate(target: NodeEx) {
+ if (target.hydrate_init) return;
+ target.hydrate_init = true;
+
+ type NodeEx2 = NodeEx & {claim_order: number};
+
+ // We know that all children have claim_order values since the unclaimed have been detached if target is not
+ let children: ArrayLike = target.childNodes as NodeListOf;
+
+ // If target is , there may be children without claim_order
+ if (target.nodeName === 'HEAD') {
+ const myChildren = [];
+ for (let i = 0; i < children.length; i++) {
+ const node = children[i];
+ if (node.claim_order !== undefined) {
+ myChildren.push(node);
+ }
+ }
+ children = myChildren;
+ }
+
+ /*
+ * Reorder claimed children optimally.
+ * We can reorder claimed children optimally by finding the longest subsequence of
+ * nodes that are already claimed in order and only moving the rest. The longest
+ * subsequence subsequence of nodes that are claimed in order can be found by
+ * computing the longest increasing subsequence of .claim_order values.
+ *
+ * This algorithm is optimal in generating the least amount of reorder operations
+ * possible.
+ *
+ * Proof:
+ * We know that, given a set of reordering operations, the nodes that do not move
+ * always form an increasing subsequence, since they do not move among each other
+ * meaning that they must be already ordered among each other. Thus, the maximal
+ * set of nodes that do not move form a longest increasing subsequence.
+ */
+
+ // Compute longest increasing subsequence
+ // m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j
+ const m = new Int32Array(children.length + 1);
+ // Predecessor indices + 1
+ const p = new Int32Array(children.length);
+
+ m[0] = -1;
+ let longest = 0;
+ for (let i = 0; i < children.length; i++) {
+ const current = children[i].claim_order;
+ // Find the largest subsequence length such that it ends in a value less than our current value
+
+ // upper_bound returns first greater value, so we subtract one
+ // with fast path for when we are on the current longest subsequence
+ const seqLen = ((longest > 0 && children[m[longest]].claim_order <= current) ? longest + 1 : upper_bound(1, longest, idx => children[m[idx]].claim_order, current)) - 1;
+
+ p[i] = m[seqLen] + 1;
+
+ const newLen = seqLen + 1;
+
+ // We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.
+ m[newLen] = i;
+
+ longest = Math.max(newLen, longest);
+ }
+
+ // The longest increasing subsequence of nodes (initially reversed)
+ const lis: NodeEx2[] = [];
+ // The rest of the nodes, nodes that will be moved
+ const toMove: NodeEx2[] = [];
+ let last = children.length - 1;
+ for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {
+ lis.push(children[cur - 1]);
+ for (; last >= cur; last--) {
+ toMove.push(children[last]);
+ }
+ last--;
+ }
+ for (; last >= 0; last--) {
+ toMove.push(children[last]);
+ }
+ lis.reverse();
+
+ // We sort the nodes being moved to guarantee that their insertion order matches the claim order
+ toMove.sort((a, b) => a.claim_order - b.claim_order);
+
+ // Finally, we move the nodes
+ for (let i = 0, j = 0; i < toMove.length; i++) {
+ while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {
+ j++;
+ }
+ const anchor = j < lis.length ? lis[j] : null;
+ target.insertBefore(toMove[i], anchor);
+ }
+}
+
export function append(target: Node, node: Node) {
target.appendChild(node);
}
+export function append_styles(
+ target: Node,
+ style_sheet_id: string,
+ styles: string
+) {
+ const append_styles_to = get_root_for_style(target);
+
+ if (!append_styles_to.getElementById(style_sheet_id)) {
+ const style = element('style');
+ style.id = style_sheet_id;
+ style.textContent = styles;
+ append_stylesheet(append_styles_to, style);
+ }
+}
+
+export function get_root_for_style(node: Node): ShadowRoot | Document {
+ if (!node) return document;
+
+ const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;
+ if (root && (root as ShadowRoot).host) {
+ return root as ShadowRoot;
+ }
+ return node.ownerDocument;
+}
+
+export function append_empty_stylesheet(node: Node) {
+ const style_element = element('style') as HTMLStyleElement;
+ append_stylesheet(get_root_for_style(node), style_element);
+ return style_element;
+}
+
+function append_stylesheet(node: ShadowRoot | Document, style: HTMLStyleElement) {
+ append((node as Document).head || node, style);
+}
+
+export function append_hydration(target: NodeEx, node: NodeEx) {
+ if (is_hydrating) {
+ init_hydrate(target);
+
+ if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentElement !== target))) {
+ target.actual_end_child = target.firstChild;
+ }
+
+ // Skip nodes of undefined ordering
+ while ((target.actual_end_child !== null) && (target.actual_end_child.claim_order === undefined)) {
+ target.actual_end_child = target.actual_end_child.nextSibling;
+ }
+
+ if (node !== target.actual_end_child) {
+ // We only insert if the ordering of this node should be modified or the parent node is not target
+ if (node.claim_order !== undefined || node.parentNode !== target) {
+ target.insertBefore(node, target.actual_end_child);
+ }
+ } else {
+ target.actual_end_child = node.nextSibling;
+ }
+ } else if (node.parentNode !== target || node.nextSibling !== null) {
+ target.appendChild(node);
+ }
+}
+
export function insert(target: Node, node: Node, anchor?: Node) {
target.insertBefore(node, anchor || null);
}
+export function insert_hydration(target: NodeEx, node: NodeEx, anchor?: NodeEx) {
+ if (is_hydrating && !anchor) {
+ append_hydration(target, node);
+ } else if (node.parentNode !== target || node.nextSibling != anchor) {
+ target.insertBefore(node, anchor || null);
+ }
+}
+
export function detach(node: Node) {
node.parentNode.removeChild(node);
}
@@ -85,6 +279,13 @@ export function self(fn) {
};
}
+export function trusted(fn) {
+ return function(event) {
+ // @ts-ignore
+ if (event.isTrusted) fn.call(this, event);
+ };
+}
+
export function attr(node: Element, attribute: string, value?: string) {
if (value == null) node.removeAttribute(attribute);
else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);
@@ -116,7 +317,7 @@ export function set_svg_attributes(node: Element & ElementCSSInlineStyle, attrib
export function set_custom_element_data(node, prop, value) {
if (prop in node) {
- node[prop] = value;
+ node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;
} else {
attr(node, prop, value);
}
@@ -149,46 +350,166 @@ export function time_ranges_to_array(ranges) {
return array;
}
-export function children(element) {
+type ChildNodeEx = ChildNode & NodeEx;
+
+type ChildNodeArray = ChildNodeEx[] & {
+ claim_info?: {
+ /**
+ * The index of the last claimed element
+ */
+ last_index: number;
+ /**
+ * The total number of elements claimed
+ */
+ total_claimed: number;
+ }
+};
+
+export function children(element: Element) {
return Array.from(element.childNodes);
}
-export function claim_element(nodes, name, attributes, svg) {
- for (let i = 0; i < nodes.length; i += 1) {
- const node = nodes[i];
- if (node.nodeName === name) {
- let j = 0;
+function init_claim_info(nodes: ChildNodeArray) {
+ if (nodes.claim_info === undefined) {
+ nodes.claim_info = {last_index: 0, total_claimed: 0};
+ }
+}
+
+function claim_node(nodes: ChildNodeArray, predicate: (node: ChildNodeEx) => node is R, processNode: (node: ChildNodeEx) => ChildNodeEx | undefined, createNode: () => R, dontUpdateLastIndex: boolean = false) {
+ // Try to find nodes in an order such that we lengthen the longest increasing subsequence
+ init_claim_info(nodes);
+
+ const resultNode = (() => {
+ // We first try to find an element after the previous one
+ for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {
+ const node = nodes[i];
+
+ if (predicate(node)) {
+ const replacement = processNode(node);
+
+ if (replacement === undefined) {
+ nodes.splice(i, 1);
+ } else {
+ nodes[i] = replacement;
+ }
+ if (!dontUpdateLastIndex) {
+ nodes.claim_info.last_index = i;
+ }
+ return node;
+ }
+ }
+
+
+ // Otherwise, we try to find one before
+ // We iterate in reverse so that we don't go too far back
+ for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {
+ const node = nodes[i];
+
+ if (predicate(node)) {
+ const replacement = processNode(node);
+
+ if (replacement === undefined) {
+ nodes.splice(i, 1);
+ } else {
+ nodes[i] = replacement;
+ }
+ if (!dontUpdateLastIndex) {
+ nodes.claim_info.last_index = i;
+ } else if (replacement === undefined) {
+ // Since we spliced before the last_index, we decrease it
+ nodes.claim_info.last_index--;
+ }
+ return node;
+ }
+ }
+
+ // If we can't find any matching node, we create a new one
+ return createNode();
+ })();
+
+ resultNode.claim_order = nodes.claim_info.total_claimed;
+ nodes.claim_info.total_claimed += 1;
+ return resultNode;
+}
+
+function claim_element_base(nodes: ChildNodeArray, name: string, attributes: { [key: string]: boolean }, create_element: (name: string) => Element | SVGElement) {
+ return claim_node(
+ nodes,
+ (node: ChildNode): node is Element | SVGElement => node.nodeName === name,
+ (node: Element) => {
const remove = [];
- while (j < node.attributes.length) {
- const attribute = node.attributes[j++];
+ for (let j = 0; j < node.attributes.length; j++) {
+ const attribute = node.attributes[j];
if (!attributes[attribute.name]) {
remove.push(attribute.name);
}
}
- for (let k = 0; k < remove.length; k++) {
- node.removeAttribute(remove[k]);
+ remove.forEach(v => node.removeAttribute(v));
+ return undefined;
+ },
+ () => create_element(name)
+ );
+}
+
+export function claim_element(nodes: ChildNodeArray, name: string, attributes: { [key: string]: boolean }) {
+ return claim_element_base(nodes, name, attributes, element);
+}
+
+export function claim_svg_element(nodes: ChildNodeArray, name: string, attributes: { [key: string]: boolean }) {
+ return claim_element_base(nodes, name, attributes, svg_element);
+}
+
+export function claim_text(nodes: ChildNodeArray, data) {
+ return claim_node(
+ nodes,
+ (node: ChildNode): node is Text => node.nodeType === 3,
+ (node: Text) => {
+ const dataStr = '' + data;
+ if (node.data.startsWith(dataStr)) {
+ if (node.data.length !== dataStr.length) {
+ return node.splitText(dataStr.length);
+ }
+ } else {
+ node.data = dataStr;
}
- return nodes.splice(i, 1)[0];
- }
- }
+ },
+ () => text(data),
+ true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements
+ );
+}
- return svg ? svg_element(name) : element(name);
+export function claim_space(nodes) {
+ return claim_text(nodes, ' ');
}
-export function claim_text(nodes, data) {
- for (let i = 0; i < nodes.length; i += 1) {
+function find_comment(nodes, text, start) {
+ for (let i = start; i < nodes.length; i += 1) {
const node = nodes[i];
- if (node.nodeType === 3) {
- node.data = '' + data;
- return nodes.splice(i, 1)[0];
+ if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {
+ return i;
}
}
-
- return text(data);
+ return nodes.length;
}
-export function claim_space(nodes) {
- return claim_text(nodes, ' ');
+export function claim_html_tag(nodes) {
+ // find html opening tag
+ const start_index = find_comment(nodes, 'HTML_TAG_START', 0);
+ const end_index = find_comment(nodes, 'HTML_TAG_END', start_index);
+ if (start_index === end_index) {
+ return new HtmlTagHydration();
+ }
+
+ init_claim_info(nodes);
+ const html_tag_nodes = nodes.splice(start_index, end_index + 1);
+ detach(html_tag_nodes[0]);
+ detach(html_tag_nodes[html_tag_nodes.length - 1]);
+ const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);
+ for (const n of claimed_nodes) {
+ n.claim_order = nodes.claim_info.total_claimed;
+ nodes.claim_info.total_claimed += 1;
+ }
+ return new HtmlTagHydration(claimed_nodes);
}
export function set_data(text, data) {
@@ -209,7 +530,11 @@ export function set_input_type(input, type) {
}
export function set_style(node, key, value, important) {
- node.style.setProperty(key, value, important ? 'important' : '');
+ if (value === null) {
+ node.style.removeProperty(key);
+ } else {
+ node.style.setProperty(key, value, important ? 'important' : '');
+ }
}
export function select_option(select, value) {
@@ -221,6 +546,8 @@ export function select_option(select, value) {
return;
}
}
+
+ select.selectedIndex = -1; // no option should be selected
}
export function select_options(select, value) {
@@ -318,38 +645,45 @@ export function toggle_class(element, name, toggle) {
element.classList[toggle ? 'add' : 'remove'](name);
}
-export function custom_event(type: string, detail?: T) {
+export function custom_event(type: string, detail?: T, bubbles: boolean = false) {
const e: CustomEvent = document.createEvent('CustomEvent');
- e.initCustomEvent(type, false, false, detail);
+ e.initCustomEvent(type, bubbles, false, detail);
return e;
}
export function query_selector_all(selector: string, parent: HTMLElement = document.body) {
- return Array.from(parent.querySelectorAll(selector));
+ return Array.from(parent.querySelectorAll(selector)) as ChildNodeArray;
}
export class HtmlTag {
+ // parent for creating node
e: HTMLElement;
+ // html tag nodes
n: ChildNode[];
+ // target
t: HTMLElement;
+ // anchor
a: HTMLElement;
- constructor(anchor: HTMLElement = null) {
- this.a = anchor;
+ constructor() {
this.e = this.n = null;
}
+ c(html: string) {
+ this.h(html);
+ }
+
m(html: string, target: HTMLElement, anchor: HTMLElement = null) {
if (!this.e) {
this.e = element(target.nodeName as keyof HTMLElementTagNameMap);
this.t = target;
- this.h(html);
+ this.c(html);
}
this.i(anchor);
}
- h(html) {
+ h(html: string) {
this.e.innerHTML = html;
this.n = Array.from(this.e.childNodes);
}
@@ -371,6 +705,29 @@ export class HtmlTag {
}
}
+export class HtmlTagHydration extends HtmlTag {
+ // hydration claimed nodes
+ l: ChildNode[] | void;
+
+ constructor(claimed_nodes?: ChildNode[]) {
+ super();
+ this.e = this.n = null;
+ this.l = claimed_nodes;
+ }
+ c(html: string) {
+ if (this.l) {
+ this.n = this.l;
+ } else {
+ super.c(html);
+ }
+ }
+ i(anchor) {
+ for (let i = 0; i < this.n.length; i += 1) {
+ insert_hydration(this.t, this.n[i], anchor);
+ }
+ }
+}
+
export function attribute_to_object(attributes: NamedNodeMap) {
const result = {};
for (const attribute of attributes) {
diff --git a/src/runtime/internal/lifecycle.ts b/src/runtime/internal/lifecycle.ts
index 002bd78d24..bb3df3d295 100644
--- a/src/runtime/internal/lifecycle.ts
+++ b/src/runtime/internal/lifecycle.ts
@@ -54,6 +54,10 @@ export function getContext(key): T {
return get_current_component().$$.context.get(key);
}
+export function getAllContexts = Map>(): T {
+ return get_current_component().$$.context;
+}
+
export function hasContext(key): boolean {
return get_current_component().$$.context.has(key);
}
@@ -65,6 +69,7 @@ export function bubble(component, event) {
const callbacks = component.$$.callbacks[event.type];
if (callbacks) {
- callbacks.slice().forEach(fn => fn(event));
+ // @ts-ignore
+ callbacks.slice().forEach(fn => fn.call(this, event));
}
}
diff --git a/src/runtime/internal/scheduler.ts b/src/runtime/internal/scheduler.ts
index 568739e4f8..c0b8e57b08 100644
--- a/src/runtime/internal/scheduler.ts
+++ b/src/runtime/internal/scheduler.ts
@@ -1,5 +1,5 @@
import { run_all } from './utils';
-import { set_current_component } from './lifecycle';
+import { current_component, set_current_component } from './lifecycle';
export const dirty_components = [];
export const intros = { enabled: false };
@@ -31,23 +31,42 @@ export function add_flush_callback(fn) {
flush_callbacks.push(fn);
}
-let flushing = false;
+// flush() calls callbacks in this order:
+// 1. All beforeUpdate callbacks, in order: parents before children
+// 2. All bind:this callbacks, in reverse order: children before parents.
+// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT
+// for afterUpdates called during the initial onMount, which are called in
+// reverse order: children before parents.
+// Since callbacks might update component values, which could trigger another
+// call to flush(), the following steps guard against this:
+// 1. During beforeUpdate, any updated components will be added to the
+// dirty_components array and will cause a reentrant call to flush(). Because
+// the flush index is kept outside the function, the reentrant call will pick
+// up where the earlier call left off and go through all dirty components. The
+// current_component value is saved and restored so that the reentrant call will
+// not interfere with the "parent" flush() call.
+// 2. bind:this callbacks cannot trigger new flush() calls.
+// 3. During afterUpdate, any updated components will NOT have their afterUpdate
+// callback called a second time; the seen_callbacks set, outside the flush()
+// function, guarantees this behavior.
const seen_callbacks = new Set();
+let flushidx = 0; // Do *not* move this inside the flush() function
export function flush() {
- if (flushing) return;
- flushing = true;
+ const saved_component = current_component;
do {
// first, call beforeUpdate functions
// and update components
- for (let i = 0; i < dirty_components.length; i += 1) {
- const component = dirty_components[i];
+ while (flushidx < dirty_components.length) {
+ const component = dirty_components[flushidx];
+ flushidx++;
set_current_component(component);
update(component.$$);
}
set_current_component(null);
dirty_components.length = 0;
+ flushidx = 0;
while (binding_callbacks.length) binding_callbacks.pop()();
@@ -73,8 +92,8 @@ export function flush() {
}
update_scheduled = false;
- flushing = false;
seen_callbacks.clear();
+ set_current_component(saved_component);
}
function update($$) {
diff --git a/src/runtime/internal/ssr.ts b/src/runtime/internal/ssr.ts
index 2d843abb2f..aeaf6e8de8 100644
--- a/src/runtime/internal/ssr.ts
+++ b/src/runtime/internal/ssr.ts
@@ -6,15 +6,29 @@ export const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFF
// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
// https://infra.spec.whatwg.org/#noncharacter
-export function spread(args, classes_to_add) {
+export function spread(args, attrs_to_add) {
const attributes = Object.assign({}, ...args);
- if (classes_to_add) {
- if (attributes.class == null) {
- attributes.class = classes_to_add;
- } else {
- attributes.class += ' ' + classes_to_add;
+ if (attrs_to_add) {
+ const classes_to_add = attrs_to_add.classes;
+ const styles_to_add = attrs_to_add.styles;
+
+ if (classes_to_add) {
+ if (attributes.class == null) {
+ attributes.class = classes_to_add;
+ } else {
+ attributes.class += ' ' + classes_to_add;
+ }
+ }
+
+ if (styles_to_add) {
+ if (attributes.style == null) {
+ attributes.style = style_object_to_string(styles_to_add);
+ } else {
+ attributes.style = style_object_to_string(merge_ssr_styles(attributes.style, styles_to_add));
+ }
}
}
+
let str = '';
Object.keys(attributes).forEach(name => {
@@ -25,13 +39,35 @@ export function spread(args, classes_to_add) {
else if (boolean_attributes.has(name.toLowerCase())) {
if (value) str += ' ' + name;
} else if (value != null) {
- str += ` ${name}="${String(value).replace(/"/g, '"').replace(/'/g, ''')}"`;
+ str += ` ${name}="${value}"`;
}
});
return str;
}
+export function merge_ssr_styles(style_attribute, style_directive) {
+ const style_object = {};
+ for (const individual_style of style_attribute.split(';')) {
+ const colon_index = individual_style.indexOf(':');
+ const name = individual_style.slice(0, colon_index).trim();
+ const value = individual_style.slice(colon_index + 1).trim();
+ if (!name) continue;
+ style_object[name] = value;
+ }
+
+ for (const name in style_directive) {
+ const value = style_directive[name];
+ if (value) {
+ style_object[name] = value;
+ } else {
+ delete style_object[name];
+ }
+ }
+
+ return style_object;
+}
+
export const escaped = {
'"': '"',
"'": ''',
@@ -44,6 +80,18 @@ export function escape(html) {
return String(html).replace(/["'&<>]/g, match => escaped[match]);
}
+export function escape_attribute_value(value) {
+ return typeof value === 'string' ? escape(value) : value;
+}
+
+export function escape_object(obj) {
+ const result = {};
+ for (const key in obj) {
+ result[key] = escape_attribute_value(obj[key]);
+ }
+ return result;
+}
+
export function each(items, fn) {
let str = '';
for (let i = 0; i < items.length; i += 1) {
@@ -74,12 +122,12 @@ export function debug(file, line, column, values) {
let on_destroy;
export function create_ssr_component(fn) {
- function $$render(result, props, bindings, slots) {
+ function $$render(result, props, bindings, slots, context) {
const parent_component = current_component;
const $$ = {
on_destroy,
- context: new Map(parent_component ? parent_component.$$.context : []),
+ context: new Map(context || (parent_component ? parent_component.$$.context : [])),
// these will be immediately discarded
on_mount: [],
@@ -97,7 +145,7 @@ export function create_ssr_component(fn) {
}
return {
- render: (props = {}, options = {}) => {
+ render: (props = {}, { $$slots = {}, context = new Map() } = {}) => {
on_destroy = [];
const result: {
@@ -109,7 +157,7 @@ export function create_ssr_component(fn) {
}>;
} = { title: '', head: '', css: new Set() };
- const html = $$render(result, props, {}, options);
+ const html = $$render(result, props, {}, $$slots, context);
run_all(on_destroy);
@@ -129,9 +177,22 @@ export function create_ssr_component(fn) {
export function add_attribute(name, value, boolean) {
if (value == null || (boolean && !value)) return '';
- return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape(value)) : `"${value}"`}`}`;
+ return ` ${name}${value === true && boolean_attributes.has(name) ? '' : `=${typeof value === 'string' ? JSON.stringify(escape(value)) : `"${value}"`}`}`;
}
export function add_classes(classes) {
return classes ? ` class="${classes}"` : '';
}
+
+function style_object_to_string(style_object) {
+ return Object.keys(style_object)
+ .filter(key => style_object[key])
+ .map(key => `${key}: ${style_object[key]};`)
+ .join(' ');
+}
+
+export function add_styles(style_object) {
+ const styles = style_object_to_string(style_object);
+
+ return styles ? ` style="${styles}"` : '';
+}
diff --git a/src/runtime/internal/style_manager.ts b/src/runtime/internal/style_manager.ts
index 8060e65a5d..0993b3bf18 100644
--- a/src/runtime/internal/style_manager.ts
+++ b/src/runtime/internal/style_manager.ts
@@ -1,4 +1,4 @@
-import { element } from './dom';
+import { append_empty_stylesheet, get_root_for_style } from './dom';
import { raf } from './environment';
interface ExtendedDoc extends Document {
@@ -29,9 +29,9 @@ export function create_rule(node: Element & ElementCSSInlineStyle, a: number, b:
const rule = keyframes + `100% {${fn(b, 1 - b)}}\n}`;
const name = `__svelte_${hash(rule)}_${uid}`;
- const doc = node.ownerDocument as ExtendedDoc;
+ const doc = get_root_for_style(node) as ExtendedDoc;
active_docs.add(doc);
- const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = doc.head.appendChild(element('style') as HTMLStyleElement).sheet as CSSStyleSheet);
+ const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = append_empty_stylesheet(node).sheet as CSSStyleSheet);
const current_rules = doc.__svelte_rules || (doc.__svelte_rules = {});
if (!current_rules[name]) {
diff --git a/src/runtime/internal/transitions.ts b/src/runtime/internal/transitions.ts
index 2fc81cc21f..a0134668ef 100644
--- a/src/runtime/internal/transitions.ts
+++ b/src/runtime/internal/transitions.ts
@@ -5,8 +5,25 @@ import { create_rule, delete_rule } from './style_manager';
import { custom_event } from './dom';
import { add_render_callback } from './scheduler';
import { TransitionConfig } from '../transition';
-
-let promise: Promise|null;
+import { Fragment } from './Component';
+
+let promise: Promise | null;
+type INTRO = 1;
+type OUTRO = 0;
+interface Outro {
+ /**
+ * remaining outros
+ */
+ r: number;
+ /**
+ * callbacks
+ */
+ c: Function[];
+ /**
+ * parent outro
+ */
+ p: Outro;
+}
function wait() {
if (!promise) {
@@ -19,12 +36,12 @@ function wait() {
return promise;
}
-function dispatch(node: Element, direction: boolean, kind: 'start' | 'end') {
+function dispatch(node: Element, direction: INTRO | OUTRO | boolean, kind: 'start' | 'end') {
node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));
}
const outroing = new Set();
-let outros;
+let outros: Outro;
export function group_outros() {
outros = {
@@ -41,14 +58,14 @@ export function check_outros() {
outros = outros.p;
}
-export function transition_in(block, local?: 0 | 1) {
+export function transition_in(block: Fragment, local?: 0 | 1) {
if (block && block.i) {
outroing.delete(block);
block.i(local);
}
}
-export function transition_out(block, local: 0 | 1, detach?: 0 | 1, callback?) {
+export function transition_out(block: Fragment, local: 0 | 1, detach?: 0 | 1, callback?) {
if (block && block.o) {
if (outroing.has(block)) return;
outroing.add(block);
@@ -126,7 +143,8 @@ export function create_in_transition(node: Element & ElementCSSInlineStyle, fn:
return {
start() {
if (started) return;
-
+
+ started = true;
delete_rule(node);
if (is_function(config)) {
@@ -225,21 +243,39 @@ export function create_out_transition(node: Element & ElementCSSInlineStyle, fn:
};
}
+interface PendingProgram {
+ start: number;
+ b: INTRO | OUTRO;
+ group?: Outro;
+}
+interface Program {
+ a: number;
+ b: INTRO | OUTRO;
+ /**
+ * direction
+ */
+ d: 1 | -1;
+ duration: number;
+ start: number;
+ end: number;
+ group?: Outro;
+}
+
export function create_bidirectional_transition(node: Element & ElementCSSInlineStyle, fn: TransitionFn, params: any, intro: boolean) {
let config = fn(node, params);
let t = intro ? 0 : 1;
- let running_program = null;
- let pending_program = null;
+ let running_program: Program | null = null;
+ let pending_program: PendingProgram | null = null;
let animation_name = null;
function clear_animation() {
if (animation_name) delete_rule(node, animation_name);
}
- function init(program, duration) {
- const d = program.b - t;
+ function init(program: PendingProgram, duration: number): Program {
+ const d = (program.b - t) as Program['d'];
duration *= Math.abs(d);
return {
@@ -253,7 +289,7 @@ export function create_bidirectional_transition(node: Element & ElementCSSInline
};
}
- function go(b) {
+ function go(b: INTRO | OUTRO) {
const {
delay = 0,
duration = 300,
@@ -262,7 +298,7 @@ export function create_bidirectional_transition(node: Element & ElementCSSInline
css
} = config || null_transition;
- const program = {
+ const program: PendingProgram = {
start: now() + delay,
b
};
@@ -331,7 +367,7 @@ export function create_bidirectional_transition(node: Element & ElementCSSInline
}
return {
- run(b) {
+ run(b: INTRO | OUTRO) {
if (is_function(config)) {
wait().then(() => {
// @ts-ignore
diff --git a/src/runtime/internal/utils.ts b/src/runtime/internal/utils.ts
index 084019fb59..8868e38ee2 100644
--- a/src/runtime/internal/utils.ts
+++ b/src/runtime/internal/utils.ts
@@ -28,7 +28,7 @@ export function blank_object() {
return Object.create(null);
}
-export function run_all(fns) {
+export function run_all(fns: Function[]) {
fns.forEach(run);
}
@@ -40,6 +40,16 @@ export function safe_not_equal(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
+let src_url_equal_anchor;
+
+export function src_url_equal(element_src, url) {
+ if (!src_url_equal_anchor) {
+ src_url_equal_anchor = document.createElement('a');
+ }
+ src_url_equal_anchor.href = url;
+ return element_src === src_url_equal_anchor.href;
+}
+
export function not_equal(a, b) {
return a != a ? b == b : a !== b;
}
@@ -79,7 +89,7 @@ export function create_slot(definition, ctx, $$scope, fn) {
}
}
-export function get_slot_context(definition, ctx, $$scope, fn) {
+function get_slot_context(definition, ctx, $$scope, fn) {
return definition[1] && fn
? assign($$scope.ctx.slice(), definition[1](fn(ctx)))
: $$scope.ctx;
@@ -109,20 +119,28 @@ export function get_slot_changes(definition, $$scope, dirty, fn) {
return $$scope.dirty;
}
-export function update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {
- const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);
+export function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {
if (slot_changes) {
const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
slot.p(slot_context, slot_changes);
}
}
-export function update_slot_spread(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_spread_changes_fn, get_slot_context_fn) {
- const slot_changes = get_slot_spread_changes_fn(dirty) | get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);
- if (slot_changes) {
- const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
- slot.p(slot_context, slot_changes);
+export function update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {
+ const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);
+ update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);
+}
+
+export function get_all_dirty_from_scope($$scope) {
+ if ($$scope.ctx.length > 32) {
+ const dirty = [];
+ const length = $$scope.ctx.length / 32;
+ for (let i = 0; i < length; i++) {
+ dirty[i] = -1;
+ }
+ return dirty;
}
+ return -1;
}
export function exclude_internal_props(props) {
@@ -159,7 +177,7 @@ export function null_to_empty(value) {
return value == null ? '' : value;
}
-export function set_store_value(store, ret, value = ret) {
+export function set_store_value(store, ret, value) {
store.set(value);
return ret;
}
diff --git a/src/runtime/motion/spring.ts b/src/runtime/motion/spring.ts
index ff625ec41f..64d17a058b 100644
--- a/src/runtime/motion/spring.ts
+++ b/src/runtime/motion/spring.ts
@@ -58,7 +58,7 @@ interface SpringUpdateOpts {
type Updater = (target_value: T, value: T) => T;
-interface Spring extends Readable{
+export interface Spring extends Readable{
set: (new_value: T, opts?: SpringUpdateOpts) => Promise;
update: (fn: Updater, opts?: SpringUpdateOpts) => Promise;
precision: number;
diff --git a/src/runtime/motion/tweened.ts b/src/runtime/motion/tweened.ts
index 83434cdff6..f0ede9add7 100644
--- a/src/runtime/motion/tweened.ts
+++ b/src/runtime/motion/tweened.ts
@@ -63,7 +63,7 @@ interface Options {
type Updater = (target_value: T, value: T) => T;
-interface Tweened extends Readable {
+export interface Tweened extends Readable {
set(value: T, opts?: Options): Promise;
update(updater: Updater, opts?: Options): Promise;
diff --git a/src/runtime/ssr.ts b/src/runtime/ssr.ts
new file mode 100644
index 0000000000..cbac1f3ef8
--- /dev/null
+++ b/src/runtime/ssr.ts
@@ -0,0 +1,15 @@
+export {
+ onDestroy,
+ setContext,
+ getContext,
+ getAllContexts,
+ hasContext,
+ tick,
+ createEventDispatcher,
+ SvelteComponent,
+ SvelteComponentTyped
+} from './index';
+
+export function onMount() {}
+export function beforeUpdate() {}
+export function afterUpdate() {}
diff --git a/src/runtime/store/index.ts b/src/runtime/store/index.ts
index c8e2b4ff99..e947fa0740 100644
--- a/src/runtime/store/index.ts
+++ b/src/runtime/store/index.ts
@@ -1,19 +1,19 @@
import { run_all, subscribe, noop, safe_not_equal, is_function, get_store_value } from 'svelte/internal';
/** Callback to inform of a value updates. */
-type Subscriber = (value: T) => void;
+export type Subscriber = (value: T) => void;
/** Unsubscribes from value updates. */
-type Unsubscriber = () => void;
+export type Unsubscriber = () => void;
/** Callback to update a value. */
-type Updater = (value: T) => T;
+export type Updater = (value: T) => T;
/** Cleanup logic callback. */
type Invalidator = (value?: T) => void;
/** Start and stop notification callbacks. */
-type StartStopNotifier = (set: Subscriber) => Unsubscriber | void;
+export type StartStopNotifier = (set: Subscriber) => Unsubscriber | void;
/** Readable interface for subscribing. */
export interface Readable {
@@ -22,7 +22,7 @@ export interface Readable {
* @param run subscription callback
* @param invalidate cleanup callback
*/
- subscribe(run: Subscriber, invalidate?: Invalidator): Unsubscriber;
+ subscribe(this: void, run: Subscriber, invalidate?: Invalidator): Unsubscriber;
}
/** Writable interface for both updating and subscribing. */
@@ -31,13 +31,13 @@ export interface Writable extends Readable {
* Set value and inform subscribers.
* @param value to set
*/
- set(value: T): void;
+ set(this: void, value: T): void;
/**
* Update value using callback and inform subscribers.
* @param updater callback
*/
- update(updater: Updater): void;
+ update(this: void, updater: Updater): void;
}
/** Pair of subscriber and invalidator. */
@@ -50,7 +50,7 @@ const subscriber_queue = [];
* @param value initial value
* @param {StartStopNotifier}start start and stop notifications for subscriptions
*/
-export function readable(value: T, start: StartStopNotifier): Readable {
+export function readable(value?: T, start?: StartStopNotifier): Readable {
return {
subscribe: writable(value, start).subscribe
};
@@ -61,19 +61,18 @@ export function readable(value: T, start: StartStopNotifier): Readable
* @param {*=}value initial value
* @param {StartStopNotifier=}start start and stop notifications for subscriptions
*/
-export function writable(value: T, start: StartStopNotifier = noop): Writable {
+export function writable(value?: T, start: StartStopNotifier = noop): Writable {
let stop: Unsubscriber;
- const subscribers: Array> = [];
+ const subscribers: Set> = new Set();
function set(new_value: T): void {
if (safe_not_equal(value, new_value)) {
value = new_value;
if (stop) { // store is ready
const run_queue = !subscriber_queue.length;
- for (let i = 0; i < subscribers.length; i += 1) {
- const s = subscribers[i];
- s[1]();
- subscriber_queue.push(s, value);
+ for (const subscriber of subscribers) {
+ subscriber[1]();
+ subscriber_queue.push(subscriber, value);
}
if (run_queue) {
for (let i = 0; i < subscriber_queue.length; i += 2) {
@@ -91,18 +90,15 @@ export function writable(value: T, start: StartStopNotifier = noop): Writa
function subscribe(run: Subscriber, invalidate: Invalidator = noop): Unsubscriber {
const subscriber: SubscribeInvalidateTuple = [run, invalidate];
- subscribers.push(subscriber);
- if (subscribers.length === 1) {
+ subscribers.add(subscriber);
+ if (subscribers.size === 1) {
stop = start(set) || noop;
}
run(value);
return () => {
- const index = subscribers.indexOf(subscriber);
- if (index !== -1) {
- subscribers.splice(index, 1);
- }
- if (subscribers.length === 0) {
+ subscribers.delete(subscriber);
+ if (subscribers.size === 0) {
stop();
stop = null;
}
@@ -113,7 +109,7 @@ export function writable(value: T, start: StartStopNotifier = noop): Writa
}
/** One or more `Readable`s. */
-type Stores = Readable | [Readable, ...Array>];
+type Stores = Readable | [Readable, ...Array>] | Array>;
/** One or more values from `Readable` stores. */
type StoresValues = T extends Readable ? U :
@@ -133,6 +129,20 @@ export function derived(
initial_value?: T
): Readable;
+/**
+ * Derived value store by synchronizing one or more readable stores and
+ * applying an aggregation function over its input values.
+ *
+ * @param stores - input stores
+ * @param fn - function callback that aggregates the values
+ * @param initial_value - initial value
+ */
+export function derived(
+ stores: S,
+ fn: (values: StoresValues) => T,
+ initial_value?: T
+): Readable;
+
/**
* Derived value store by synchronizing one or more readable stores and
* applying an aggregation function over its input values.
diff --git a/src/runtime/transition/index.ts b/src/runtime/transition/index.ts
index 650688b6e0..9315cd77d5 100644
--- a/src/runtime/transition/index.ts
+++ b/src/runtime/transition/index.ts
@@ -1,7 +1,7 @@
import { cubicOut, cubicInOut, linear } from 'svelte/easing';
import { assign, is_function } from 'svelte/internal';
-type EasingFunction = (t: number) => number;
+export type EasingFunction = (t: number) => number;
export interface TransitionConfig {
delay?: number;
@@ -11,7 +11,7 @@ export interface TransitionConfig {
tick?: (t: number, u: number) => void;
}
-interface BlurParams {
+export interface BlurParams {
delay?: number;
duration?: number;
easing?: EasingFunction;
@@ -40,7 +40,7 @@ export function blur(node: Element, {
};
}
-interface FadeParams {
+export interface FadeParams {
delay?: number;
duration?: number;
easing?: EasingFunction;
@@ -61,7 +61,7 @@ export function fade(node: Element, {
};
}
-interface FlyParams {
+export interface FlyParams {
delay?: number;
duration?: number;
easing?: EasingFunction;
@@ -94,7 +94,7 @@ export function fly(node: Element, {
};
}
-interface SlideParams {
+export interface SlideParams {
delay?: number;
duration?: number;
easing?: EasingFunction;
@@ -132,7 +132,7 @@ export function slide(node: Element, {
};
}
-interface ScaleParams {
+export interface ScaleParams {
delay?: number;
duration?: number;
easing?: EasingFunction;
@@ -165,7 +165,7 @@ export function scale(node: Element, {
};
}
-interface DrawParams {
+export interface DrawParams {
delay?: number;
speed?: number;
duration?: number | ((len: number) => number);
@@ -178,7 +178,11 @@ export function draw(node: SVGElement & { getTotalLength(): number }, {
duration,
easing = cubicInOut
}: DrawParams = {}): TransitionConfig {
- const len = node.getTotalLength();
+ let len = node.getTotalLength();
+ const style = getComputedStyle(node);
+ if (style.strokeLinecap !== 'butt') {
+ len += parseInt(style.strokeWidth);
+ }
if (duration === undefined) {
if (speed === undefined) {
@@ -198,7 +202,7 @@ export function draw(node: SVGElement & { getTotalLength(): number }, {
};
}
-interface CrossfadeParams {
+export interface CrossfadeParams {
delay?: number;
duration?: number | ((len: number) => number);
easing?: EasingFunction;
@@ -207,8 +211,21 @@ interface CrossfadeParams {
type ClientRectMap = Map;
export function crossfade({ fallback, ...defaults }: CrossfadeParams & {
- fallback: (node: Element, params: CrossfadeParams, intro: boolean) => TransitionConfig;
-}) {
+ fallback?: (node: Element, params: CrossfadeParams, intro: boolean) => TransitionConfig;
+}): [
+ (
+ node: Element,
+ params: CrossfadeParams & {
+ key: any;
+ }
+ ) => () => TransitionConfig,
+ (
+ node: Element,
+ params: CrossfadeParams & {
+ key: any;
+ }
+ ) => () => TransitionConfig
+] {
const to_receive: ClientRectMap = new Map();
const to_send: ClientRectMap = new Map();
diff --git a/test/css/samples/global-compound-selector/_config.js b/test/css/samples/global-compound-selector/_config.js
new file mode 100644
index 0000000000..0a95b541c8
--- /dev/null
+++ b/test/css/samples/global-compound-selector/_config.js
@@ -0,0 +1,27 @@
+export default {
+ warnings: [
+ {
+ code: 'css-unused-selector',
+ frame: `
+ 16: }
+ 17:
+ 18: .bar:global(.foo) {
+ ^
+ 19: color: blue;
+ 20: }
+ `,
+ message: 'Unused CSS selector ".bar:global(.foo)"',
+ pos: 210,
+ start: {
+ character: 210,
+ column: 1,
+ line: 18
+ },
+ end: {
+ character: 227,
+ column: 18,
+ line: 18
+ }
+ }
+ ]
+};
diff --git a/test/css/samples/global-compound-selector/expected.css b/test/css/samples/global-compound-selector/expected.css
new file mode 100644
index 0000000000..ff9bed9c34
--- /dev/null
+++ b/test/css/samples/global-compound-selector/expected.css
@@ -0,0 +1 @@
+div.svelte-xyz.svelte-xyz.bar{color:red}.foo.svelte-xyz.svelte-xyz.bar{color:red}.foo.svelte-xyz.bar span.svelte-xyz{color:red}
\ No newline at end of file
diff --git a/test/css/samples/global-compound-selector/expected.html b/test/css/samples/global-compound-selector/expected.html
new file mode 100644
index 0000000000..ca16db5456
--- /dev/null
+++ b/test/css/samples/global-compound-selector/expected.html
@@ -0,0 +1,3 @@
+text
+texttext
+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-with-child-combinator-2/_config.js b/test/css/samples/global-with-child-combinator-2/_config.js
new file mode 100644
index 0000000000..2286f4fe3c
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-2/_config.js
@@ -0,0 +1,27 @@
+export default {
+ warnings: [
+ {
+ code: 'css-unused-selector',
+ end: {
+ character: 111,
+ column: 21,
+ line: 8
+ },
+ frame: `
+ 6: color: red;
+ 7: }
+ 8: a:global(.foo) > div {
+ ^
+ 9: color: red;
+ 10: }
+ `,
+ message: 'Unused CSS selector "a:global(.foo) > div"',
+ pos: 91,
+ start: {
+ character: 91,
+ column: 1,
+ line: 8
+ }
+ }
+ ]
+};
diff --git a/test/css/samples/global-with-child-combinator-2/expected.css b/test/css/samples/global-with-child-combinator-2/expected.css
new file mode 100644
index 0000000000..3f406244a3
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-2/expected.css
@@ -0,0 +1 @@
+div>div.svelte-xyz.svelte-xyz{color:red}div.svelte-xyz.foo>div.svelte-xyz{color:red}
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator-2/expected.html b/test/css/samples/global-with-child-combinator-2/expected.html
new file mode 100644
index 0000000000..32ff99e34f
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-2/expected.html
@@ -0,0 +1,3 @@
+
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator-2/input.svelte b/test/css/samples/global-with-child-combinator-2/input.svelte
new file mode 100644
index 0000000000..caf7c5869a
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-2/input.svelte
@@ -0,0 +1,15 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/numeric-seperator/_config.js b/test/css/samples/global-with-child-combinator-3/_config.js
similarity index 51%
rename from test/runtime/samples/numeric-seperator/_config.js
rename to test/css/samples/global-with-child-combinator-3/_config.js
index 2b1b5168ee..c81f1a9f82 100644
--- a/test/runtime/samples/numeric-seperator/_config.js
+++ b/test/css/samples/global-with-child-combinator-3/_config.js
@@ -1,3 +1,3 @@
export default {
- html: '2048 2048'
+ warnings: []
};
diff --git a/test/css/samples/global-with-child-combinator-3/expected.css b/test/css/samples/global-with-child-combinator-3/expected.css
new file mode 100644
index 0000000000..11c60c7147
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-3/expected.css
@@ -0,0 +1 @@
+a>b>div.svelte-xyz{color:red}
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator-3/expected.html b/test/css/samples/global-with-child-combinator-3/expected.html
new file mode 100644
index 0000000000..32ff99e34f
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-3/expected.html
@@ -0,0 +1,3 @@
+
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator-3/input.svelte b/test/css/samples/global-with-child-combinator-3/input.svelte
new file mode 100644
index 0000000000..146f302633
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-3/input.svelte
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator/_config.js b/test/css/samples/global-with-child-combinator/_config.js
new file mode 100644
index 0000000000..c81f1a9f82
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator/_config.js
@@ -0,0 +1,3 @@
+export default {
+ warnings: []
+};
diff --git a/test/css/samples/global-with-child-combinator/expected.css b/test/css/samples/global-with-child-combinator/expected.css
new file mode 100644
index 0000000000..9d8989b63b
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator/expected.css
@@ -0,0 +1 @@
+div>div.svelte-xyz{color:red}
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator/expected.html b/test/css/samples/global-with-child-combinator/expected.html
new file mode 100644
index 0000000000..32ff99e34f
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator/expected.html
@@ -0,0 +1,3 @@
+
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator/input.svelte b/test/css/samples/global-with-child-combinator/input.svelte
new file mode 100644
index 0000000000..3b5ff160c3
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator/input.svelte
@@ -0,0 +1,9 @@
+
+
+
\ 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/css/samples/root/_config.js b/test/css/samples/root/_config.js
new file mode 100644
index 0000000000..ff8b4c5632
--- /dev/null
+++ b/test/css/samples/root/_config.js
@@ -0,0 +1 @@
+export default {};
diff --git a/test/css/samples/root/expected.css b/test/css/samples/root/expected.css
new file mode 100644
index 0000000000..ce35d8835f
--- /dev/null
+++ b/test/css/samples/root/expected.css
@@ -0,0 +1 @@
+:root{color:red}.foo:root{color:blue}:root.foo{color:green}
\ No newline at end of file
diff --git a/test/css/samples/root/expected.html b/test/css/samples/root/expected.html
new file mode 100644
index 0000000000..1d90ab5df7
--- /dev/null
+++ b/test/css/samples/root/expected.html
@@ -0,0 +1 @@
+Hello!
\ No newline at end of file
diff --git a/test/css/samples/root/input.svelte b/test/css/samples/root/input.svelte
new file mode 100644
index 0000000000..979c9d4f0a
--- /dev/null
+++ b/test/css/samples/root/input.svelte
@@ -0,0 +1,13 @@
+
+
+Hello!
diff --git a/test/custom-elements/index.ts b/test/custom-elements/index.ts
index 35df156879..42b27eebd3 100644
--- a/test/custom-elements/index.ts
+++ b/test/custom-elements/index.ts
@@ -4,7 +4,7 @@ import * as http from 'http';
import { rollup } from 'rollup';
import virtual from '@rollup/plugin-virtual';
import puppeteer from 'puppeteer';
-import { addLineNumbers, loadConfig, loadSvelte } from '../helpers';
+import { addLineNumbers, loadConfig, loadSvelte, retryAsync, executeBrowserTest } from '../helpers';
import { deepEqual } from 'assert';
const page = `
@@ -17,8 +17,8 @@ const page = `
const assert = fs.readFileSync(`${__dirname}/assert.js`, 'utf-8');
describe('custom-elements', function() {
+ // Note: Increase the timeout in preparation for restarting Chromium due to SIGSEGV.
this.timeout(10000);
-
let svelte;
let server;
let browser;
@@ -44,12 +44,16 @@ describe('custom-elements', function() {
});
}
+ async function launchPuppeteer() {
+ return await retryAsync(() => puppeteer.launch());
+ }
+
before(async () => {
svelte = loadSvelte();
console.log('[custom-element] Loaded Svelte');
server = await create_server();
console.log('[custom-element] Started server');
- browser = await puppeteer.launch();
+ browser = await launchPuppeteer();
console.log('[custom-element] Launched puppeteer browser');
});
@@ -108,26 +112,7 @@ describe('custom-elements', function() {
const result = await bundle.generate({ format: 'iife', name: 'test' });
code = result.output[0].code;
- const page = await browser.newPage();
-
- page.on('console', (type) => {
- console[type._type](type._text);
- });
-
- page.on('error', error => {
- console.log('>>> an error happened');
- console.error(error);
- });
-
- try {
- await page.goto('http://localhost:6789');
-
- const result = await page.evaluate(() => test(document.querySelector('main')));
- if (result) console.log(result);
- } catch (err) {
- console.log(addLineNumbers(code));
- throw err;
- } finally {
+ function assertWarnings() {
if (expected_warnings) {
deepEqual(warnings.map(w => ({
code: w.code,
@@ -138,6 +123,15 @@ describe('custom-elements', function() {
})), expected_warnings);
}
}
+
+ browser = await executeBrowserTest(
+ browser,
+ launchPuppeteer,
+ assertWarnings,
+ () => {
+ console.log(addLineNumbers(code));
+ assertWarnings();
+ });
});
});
});
diff --git a/test/custom-elements/samples/props/main.svelte b/test/custom-elements/samples/props/main.svelte
index 80b483bf6e..cf47b436b5 100644
--- a/test/custom-elements/samples/props/main.svelte
+++ b/test/custom-elements/samples/props/main.svelte
@@ -4,6 +4,7 @@
import './my-widget.svelte';
export let items = ['a', 'b', 'c'];
+ export let flagged = false;
-
+
diff --git a/test/custom-elements/samples/props/my-widget.svelte b/test/custom-elements/samples/props/my-widget.svelte
index cf512e0ff8..970acf84b2 100644
--- a/test/custom-elements/samples/props/my-widget.svelte
+++ b/test/custom-elements/samples/props/my-widget.svelte
@@ -2,7 +2,11 @@
{items.length} items
{items.join(', ')}
+{flag1 ? 'flagged (dynamic attribute)' : 'not flagged'}
+{flag2 ? 'flagged (static attribute)' : 'not flagged'}
diff --git a/test/custom-elements/samples/props/test.js b/test/custom-elements/samples/props/test.js
index fc8c01c623..41ca77d29d 100644
--- a/test/custom-elements/samples/props/test.js
+++ b/test/custom-elements/samples/props/test.js
@@ -11,13 +11,17 @@ export default function (target) {
const el = target.querySelector('custom-element');
const widget = el.shadowRoot.querySelector('my-widget');
- const [p1, p2] = widget.shadowRoot.querySelectorAll('p');
+ const [p1, p2, p3, p4] = widget.shadowRoot.querySelectorAll('p');
assert.equal(p1.textContent, '3 items');
assert.equal(p2.textContent, 'a, b, c');
+ assert.equal(p3.textContent, 'not flagged');
+ assert.equal(p4.textContent, 'flagged (static attribute)');
el.items = ['d', 'e', 'f', 'g', 'h'];
+ el.flagged = true;
assert.equal(p1.textContent, '5 items');
assert.equal(p2.textContent, 'd, e, f, g, h');
+ assert.equal(p3.textContent, 'flagged (dynamic attribute)');
}
diff --git a/test/helpers.ts b/test/helpers.ts
index 78f000c274..1ea0b19880 100644
--- a/test/helpers.ts
+++ b/test/helpers.ts
@@ -4,11 +4,11 @@ import glob from 'tiny-glob/sync';
import * as path from 'path';
import * as fs from 'fs';
import * as colors from 'kleur';
-export const assert = (assert$1 as unknown) as typeof assert$1 & { htmlEqual: (actual, expected, message?) => void };
+export const assert = (assert$1 as unknown) as typeof assert$1 & { htmlEqual: (actual, expected, message?) => void, htmlEqualWithComments: (actual, expected, message?) => void };
// for coverage purposes, we need to test source files,
// but for sanity purposes, we need to test dist files
-export function loadSvelte(test) {
+export function loadSvelte(test: boolean = false) {
process.env.TEST = test ? 'true' : '';
const resolved = require.resolve('../compiler.js');
@@ -55,7 +55,7 @@ export function cleanRequireCache() {
const virtualConsole = new jsdom.VirtualConsole();
virtualConsole.sendTo(console);
-const window = new jsdom.JSDOM(' ', {virtualConsole}).window;
+const window = new jsdom.JSDOM(' ', { virtualConsole }).window;
global.document = window.document;
global.navigator = window.navigator;
global.getComputedStyle = window.getComputedStyle;
@@ -118,6 +118,9 @@ function cleanChildren(node) {
node.removeChild(child);
child = previous;
}
+ } else if (child.nodeType === 8) {
+ // comment
+ // do nothing
} else {
cleanChildren(child);
}
@@ -137,11 +140,11 @@ function cleanChildren(node) {
}
}
-export function normalizeHtml(window, html) {
+export function normalizeHtml(window, html, preserveComments = false) {
try {
const node = window.document.createElement('div');
node.innerHTML = html
- .replace(//g, '')
+ .replace(/()/g, preserveComments ? '$1' : '')
.replace(/>[\s\r\n]+<')
.trim();
cleanChildren(node);
@@ -162,6 +165,14 @@ export function setupHtmlEqual() {
message
);
};
+ // eslint-disable-next-line no-import-assign
+ assert.htmlEqualWithComments = (actual, expected, message) => {
+ assert.deepEqual(
+ normalizeHtml(window, actual, true),
+ normalizeHtml(window, expected, true),
+ message
+ );
+ };
}
export function loadConfig(file) {
@@ -260,3 +271,58 @@ export function mkdirp(dir) {
// do nothing
}
}
+
+export function prettyPrintPuppeteerAssertionError(message) {
+ const match = /Error: Expected "(.+)" to equal "(.+)"/.exec(message);
+
+ if (match) {
+ assert.equal(match[1], match[2]);
+ }
+}
+
+export async function retryAsync(fn: () => Promise, maxAttempts: number = 3, interval: number = 1000): Promise {
+ let attempts = 0;
+ while (attempts <= maxAttempts) {
+ try {
+ return await fn();
+ } catch (err) {
+ if (++attempts >= maxAttempts) throw err;
+ await new Promise(resolve => setTimeout(resolve, interval));
+ }
+ }
+}
+
+// NOTE: Chromium may exit with SIGSEGV, so retry in that case
+export async function executeBrowserTest(browser, launchPuppeteer: () => Promise, additionalAssertion: () => void, onError: (err: Error) => void) {
+ let count = 0;
+ do {
+ count++;
+ try {
+ const page = await browser.newPage();
+
+ page.on('console', (type) => {
+ console[type._type](type._text);
+ });
+
+ page.on('error', error => {
+ console.log('>>> an error happened');
+ console.error(error);
+ });
+ await page.goto('http://localhost:6789');
+ const result = await page.evaluate(() => test(document.querySelector('main')));
+ if (result) console.log(result);
+ additionalAssertion();
+ await page.close();
+ break;
+ } catch (err) {
+ if (count === 5 || browser.isConnected()) {
+ onError(err);
+ throw err;
+ }
+ console.debug(err.stack || err);
+ console.log('RESTARTING Chromium...');
+ browser = await launchPuppeteer();
+ }
+ } while (count <= 5);
+ return browser;
+}
diff --git a/test/hydration/index.ts b/test/hydration/index.ts
index 2eefee3fac..f3e2c9ea0a 100644
--- a/test/hydration/index.ts
+++ b/test/hydration/index.ts
@@ -52,6 +52,7 @@ describe('hydration', () => {
const cwd = path.resolve(`${__dirname}/samples/${dir}`);
compileOptions = config.compileOptions || {};
+ compileOptions.accessors = 'accessors' in config ? config.accessors : true;
const window = env();
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
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 @@
+
+ 1
+ 2
+
diff --git a/test/hydration/samples/element-nested-sibling/_config.js b/test/hydration/samples/element-nested-sibling/_config.js
new file mode 100644
index 0000000000..8410fc189d
--- /dev/null
+++ b/test/hydration/samples/element-nested-sibling/_config.js
@@ -0,0 +1,19 @@
+export default {
+ snapshot(target) {
+ const p = target.querySelector('p');
+
+ return {
+ p,
+ span: p.querySelector('span'),
+ code: p.querySelector('code')
+ };
+ },
+
+ test(assert, target, snapshot) {
+ const p = target.querySelector('p');
+
+ assert.equal(p, snapshot.p);
+ assert.equal(p.querySelector('span'), snapshot.span);
+ assert.equal(p.querySelector('code'), snapshot.code);
+ }
+};
diff --git a/test/hydration/samples/element-nested-sibling/main.svelte b/test/hydration/samples/element-nested-sibling/main.svelte
new file mode 100644
index 0000000000..d6e02107e2
--- /dev/null
+++ b/test/hydration/samples/element-nested-sibling/main.svelte
@@ -0,0 +1,6 @@
+
+ 1
+ {#if true}
+ 2
+ {/if}
+
diff --git a/test/hydration/samples/event-handler/main.svelte b/test/hydration/samples/event-handler/main.svelte
index 3d1a05ed3e..ca2b21e4b1 100644
--- a/test/hydration/samples/event-handler/main.svelte
+++ b/test/hydration/samples/event-handler/main.svelte
@@ -1,9 +1,9 @@
click me
{#if clicked}
clicked!
-{/if}
\ No newline at end of file
+{/if}
diff --git a/test/hydration/samples/expression-sibling/_after.html b/test/hydration/samples/expression-sibling/_after.html
new file mode 100644
index 0000000000..9c0a0b5778
--- /dev/null
+++ b/test/hydration/samples/expression-sibling/_after.html
@@ -0,0 +1 @@
+1 2 3
diff --git a/test/hydration/samples/expression-sibling/_before.html b/test/hydration/samples/expression-sibling/_before.html
new file mode 100644
index 0000000000..9c0a0b5778
--- /dev/null
+++ b/test/hydration/samples/expression-sibling/_before.html
@@ -0,0 +1 @@
+1 2 3
diff --git a/test/hydration/samples/expression-sibling/_config.js b/test/hydration/samples/expression-sibling/_config.js
new file mode 100644
index 0000000000..c6d3ef3f2f
--- /dev/null
+++ b/test/hydration/samples/expression-sibling/_config.js
@@ -0,0 +1,19 @@
+export default {
+ snapshot(target) {
+ const p = target.querySelector('p');
+
+ return {
+ p,
+ text: p.childNodes[0],
+ span: p.querySelector('span')
+ };
+ },
+
+ test(assert, target, snapshot) {
+ const p = target.querySelector('p');
+
+ assert.equal(p, snapshot.p);
+ assert.equal(p.childNodes[0], snapshot.text);
+ assert.equal(p.querySelector('span'), snapshot.span);
+ }
+};
diff --git a/test/hydration/samples/expression-sibling/main.svelte b/test/hydration/samples/expression-sibling/main.svelte
new file mode 100644
index 0000000000..65aa541e9c
--- /dev/null
+++ b/test/hydration/samples/expression-sibling/main.svelte
@@ -0,0 +1 @@
+{1} 2 3
diff --git a/test/hydration/samples/head-meta-hydrate-duplicate/_after_head.html b/test/hydration/samples/head-meta-hydrate-duplicate/_after_head.html
index 10cf2c8b9a..be7a01ba4f 100644
--- a/test/hydration/samples/head-meta-hydrate-duplicate/_after_head.html
+++ b/test/hydration/samples/head-meta-hydrate-duplicate/_after_head.html
@@ -1,4 +1,4 @@
Some Title
-
\ No newline at end of file
+
diff --git a/test/js/samples/action-custom-event-handler/expected.js b/test/js/samples/action-custom-event-handler/expected.js
index 51656290d6..6433d5b04a 100644
--- a/test/js/samples/action-custom-event-handler/expected.js
+++ b/test/js/samples/action-custom-event-handler/expected.js
@@ -56,7 +56,7 @@ function instance($$self, $$props, $$invalidate) {
const foo_function = () => handleFoo(bar);
$$self.$$set = $$props => {
- if ("bar" in $$props) $$invalidate(0, bar = $$props.bar);
+ if ('bar' in $$props) $$invalidate(0, bar = $$props.bar);
};
return [bar, foo_function];
diff --git a/test/js/samples/action/expected.js b/test/js/samples/action/expected.js
index d52960bddd..689669c5bc 100644
--- a/test/js/samples/action/expected.js
+++ b/test/js/samples/action/expected.js
@@ -48,11 +48,11 @@ function link(node) {
history.pushState(null, null, event.target.href);
}
- node.addEventListener("click", onClick);
+ node.addEventListener('click', onClick);
return {
destroy() {
- node.removeEventListener("click", onClick);
+ node.removeEventListener('click', onClick);
}
};
}
diff --git a/test/js/samples/bind-open/expected.js b/test/js/samples/bind-open/expected.js
index 56ff302845..669cb41405 100644
--- a/test/js/samples/bind-open/expected.js
+++ b/test/js/samples/bind-open/expected.js
@@ -53,7 +53,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("open" in $$props) $$invalidate(0, open = $$props.open);
+ if ('open' in $$props) $$invalidate(0, open = $$props.open);
};
return [open, details_toggle_handler];
diff --git a/test/js/samples/bind-width-height/expected.js b/test/js/samples/bind-width-height/expected.js
index f23c20b683..8966e57c9c 100644
--- a/test/js/samples/bind-width-height/expected.js
+++ b/test/js/samples/bind-width-height/expected.js
@@ -47,8 +47,8 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("w" in $$props) $$invalidate(0, w = $$props.w);
- if ("h" in $$props) $$invalidate(1, h = $$props.h);
+ if ('w' in $$props) $$invalidate(0, w = $$props.w);
+ if ('h' in $$props) $$invalidate(1, h = $$props.h);
};
return [w, h, div_elementresize_handler];
diff --git a/test/js/samples/bindings-readonly-order/expected.js b/test/js/samples/bindings-readonly-order/expected.js
index 78a71dcd84..ea83573ee3 100644
--- a/test/js/samples/bindings-readonly-order/expected.js
+++ b/test/js/samples/bindings-readonly-order/expected.js
@@ -69,7 +69,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("files" in $$props) $$invalidate(0, files = $$props.files);
+ if ('files' in $$props) $$invalidate(0, files = $$props.files);
};
return [files, input0_change_handler, input1_change_handler];
diff --git a/test/js/samples/capture-inject-state/expected.js b/test/js/samples/capture-inject-state/expected.js
index 854e0b3265..58e1879553 100644
--- a/test/js/samples/capture-inject-state/expected.js
+++ b/test/js/samples/capture-inject-state/expected.js
@@ -95,7 +95,7 @@ const moduleContantProps = 4;
let moduleLet;
const moduleConst = 2;
let shadowedByModule;
-const priv = "priv";
+const priv = 'priv';
function instance($$self, $$props, $$invalidate) {
let computed;
@@ -106,22 +106,22 @@ function instance($$self, $$props, $$invalidate) {
$$self.$$.on_destroy.push(() => $$unsubscribe_prop());
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let { prop } = $$props;
- validate_store(prop, "prop");
+ validate_store(prop, 'prop');
$$subscribe_prop();
let { alias: realName } = $$props;
let local;
let shadowedByModule;
- const writable_props = ["prop", "alias"];
+ const writable_props = ['prop', 'alias'];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
$$self.$$set = $$props => {
- if ("prop" in $$props) $$subscribe_prop($$invalidate(0, prop = $$props.prop));
- if ("alias" in $$props) $$invalidate(1, realName = $$props.alias);
+ if ('prop' in $$props) $$subscribe_prop($$invalidate(0, prop = $$props.prop));
+ if ('alias' in $$props) $$invalidate(1, realName = $$props.alias);
};
$$self.$capture_state = () => ({
@@ -140,11 +140,11 @@ function instance($$self, $$props, $$invalidate) {
});
$$self.$inject_state = $$props => {
- if ("prop" in $$props) $$subscribe_prop($$invalidate(0, prop = $$props.prop));
- if ("realName" in $$props) $$invalidate(1, realName = $$props.realName);
- if ("local" in $$props) $$invalidate(3, local = $$props.local);
- if ("shadowedByModule" in $$props) $$invalidate(4, shadowedByModule = $$props.shadowedByModule);
- if ("computed" in $$props) computed = $$props.computed;
+ if ('prop' in $$props) $$subscribe_prop($$invalidate(0, prop = $$props.prop));
+ if ('realName' in $$props) $$invalidate(1, realName = $$props.realName);
+ if ('local' in $$props) $$invalidate(3, local = $$props.local);
+ if ('shadowedByModule' in $$props) $$invalidate(4, shadowedByModule = $$props.shadowedByModule);
+ if ('computed' in $$props) computed = $$props.computed;
};
if ($$props && "$$inject" in $$props) {
@@ -170,11 +170,11 @@ class Component extends SvelteComponentDev {
const { ctx } = this.$$;
const props = options.props || {};
- if (/*prop*/ ctx[0] === undefined && !("prop" in props)) {
+ if (/*prop*/ ctx[0] === undefined && !('prop' in props)) {
console.warn(" was created without expected prop 'prop'");
}
- if (/*realName*/ ctx[1] === undefined && !("alias" in props)) {
+ if (/*realName*/ ctx[1] === undefined && !('alias' in props)) {
console.warn(" was created without expected prop 'alias'");
}
}
diff --git a/test/js/samples/collapse-element-class-name/expected.js b/test/js/samples/collapse-element-class-name/expected.js
new file mode 100644
index 0000000000..a55affe76e
--- /dev/null
+++ b/test/js/samples/collapse-element-class-name/expected.js
@@ -0,0 +1,114 @@
+/* generated by Svelte vX.Y.Z */
+import {
+ SvelteComponent,
+ assign,
+ attr,
+ compute_rest_props,
+ create_component,
+ destroy_component,
+ detach,
+ element,
+ exclude_internal_props,
+ init,
+ insert,
+ mount_component,
+ safe_not_equal,
+ space,
+ transition_in,
+ transition_out
+} from "svelte/internal";
+
+import Component from "./Component.svelte";
+
+function create_fragment(ctx) {
+ let div;
+ let div_class_value;
+ let div_style_value;
+ let div_other_value;
+ let t;
+ let component;
+ let current;
+
+ component = new Component({
+ props: {
+ class: "\n\t\tbutton\n\t\tbutton--size--" + /*size*/ ctx[0] + "\n\t\tbutton--theme--" + /*theme*/ ctx[1] + "\n \t" + (/*$$restProps*/ ctx[2].class || ''),
+ style: "\n\t\tcolor: green;\n\t\tbackground: white;\n\t\tfont-size: " + /*size*/ ctx[0] + ";\n \ttransform: " + /*$$restProps*/ ctx[2].scale + " " + /*$$restProps*/ ctx[2].rotate + ";\n\t\t" + /*$$restProps*/ ctx[2].styles,
+ other: "\n\t\tbutton\n\t\tbutton--size--" + /*size*/ ctx[0] + "\n\t\tbutton--theme--" + /*theme*/ ctx[1] + "\n \t" + (/*$$restProps*/ ctx[2].class || '')
+ }
+ });
+
+ return {
+ c() {
+ div = element("div");
+ t = space();
+ create_component(component.$$.fragment);
+ attr(div, "class", div_class_value = "button button--size--" + /*size*/ ctx[0] + " button--theme--" + /*theme*/ ctx[1] + " " + (/*$$restProps*/ ctx[2].class || ''));
+ attr(div, "style", div_style_value = "color: green; background: white; font-size: " + /*size*/ ctx[0] + "; transform: " + /*$$restProps*/ ctx[2].scale + " " + /*$$restProps*/ ctx[2].rotate + "; " + /*$$restProps*/ ctx[2].styles);
+ attr(div, "other", div_other_value = "\n\t\tbutton\n\t\tbutton--size--" + /*size*/ ctx[0] + "\n\t\tbutton--theme--" + /*theme*/ ctx[1] + "\n \t" + (/*$$restProps*/ ctx[2].class || ''));
+ },
+ m(target, anchor) {
+ insert(target, div, anchor);
+ insert(target, t, anchor);
+ mount_component(component, target, anchor);
+ current = true;
+ },
+ p(ctx, [dirty]) {
+ if (!current || dirty & /*size, theme, $$restProps*/ 7 && div_class_value !== (div_class_value = "button button--size--" + /*size*/ ctx[0] + " button--theme--" + /*theme*/ ctx[1] + " " + (/*$$restProps*/ ctx[2].class || ''))) {
+ attr(div, "class", div_class_value);
+ }
+
+ if (!current || dirty & /*size, $$restProps*/ 5 && div_style_value !== (div_style_value = "color: green; background: white; font-size: " + /*size*/ ctx[0] + "; transform: " + /*$$restProps*/ ctx[2].scale + " " + /*$$restProps*/ ctx[2].rotate + "; " + /*$$restProps*/ ctx[2].styles)) {
+ attr(div, "style", div_style_value);
+ }
+
+ if (!current || dirty & /*size, theme, $$restProps*/ 7 && div_other_value !== (div_other_value = "\n\t\tbutton\n\t\tbutton--size--" + /*size*/ ctx[0] + "\n\t\tbutton--theme--" + /*theme*/ ctx[1] + "\n \t" + (/*$$restProps*/ ctx[2].class || ''))) {
+ attr(div, "other", div_other_value);
+ }
+
+ const component_changes = {};
+ if (dirty & /*size, theme, $$restProps*/ 7) component_changes.class = "\n\t\tbutton\n\t\tbutton--size--" + /*size*/ ctx[0] + "\n\t\tbutton--theme--" + /*theme*/ ctx[1] + "\n \t" + (/*$$restProps*/ ctx[2].class || '');
+ if (dirty & /*size, $$restProps*/ 5) component_changes.style = "\n\t\tcolor: green;\n\t\tbackground: white;\n\t\tfont-size: " + /*size*/ ctx[0] + ";\n \ttransform: " + /*$$restProps*/ ctx[2].scale + " " + /*$$restProps*/ ctx[2].rotate + ";\n\t\t" + /*$$restProps*/ ctx[2].styles;
+ if (dirty & /*size, theme, $$restProps*/ 7) component_changes.other = "\n\t\tbutton\n\t\tbutton--size--" + /*size*/ ctx[0] + "\n\t\tbutton--theme--" + /*theme*/ ctx[1] + "\n \t" + (/*$$restProps*/ ctx[2].class || '');
+ component.$set(component_changes);
+ },
+ i(local) {
+ if (current) return;
+ transition_in(component.$$.fragment, local);
+ current = true;
+ },
+ o(local) {
+ transition_out(component.$$.fragment, local);
+ current = false;
+ },
+ d(detaching) {
+ if (detaching) detach(div);
+ if (detaching) detach(t);
+ destroy_component(component, detaching);
+ }
+ };
+}
+
+function instance($$self, $$props, $$invalidate) {
+ const omit_props_names = ["size","theme"];
+ let $$restProps = compute_rest_props($$props, omit_props_names);
+ let { size } = $$props;
+ let { theme } = $$props;
+
+ $$self.$$set = $$new_props => {
+ $$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
+ $$invalidate(2, $$restProps = compute_rest_props($$props, omit_props_names));
+ if ('size' in $$new_props) $$invalidate(0, size = $$new_props.size);
+ if ('theme' in $$new_props) $$invalidate(1, theme = $$new_props.theme);
+ };
+
+ return [size, theme, $$restProps];
+}
+
+class Component_1 extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance, create_fragment, safe_not_equal, { size: 0, theme: 1 });
+ }
+}
+
+export default Component_1;
\ No newline at end of file
diff --git a/test/js/samples/collapse-element-class-name/input.svelte b/test/js/samples/collapse-element-class-name/input.svelte
new file mode 100644
index 0000000000..a4cb283778
--- /dev/null
+++ b/test/js/samples/collapse-element-class-name/input.svelte
@@ -0,0 +1,41 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js
index 67335ce246..63a32bbf38 100644
--- a/test/js/samples/collapses-text-around-comments/expected.js
+++ b/test/js/samples/collapses-text-around-comments/expected.js
@@ -2,6 +2,7 @@
import {
SvelteComponent,
append,
+ append_styles,
attr,
detach,
element,
@@ -13,11 +14,8 @@ import {
text
} from "svelte/internal";
-function add_css() {
- var style = element("style");
- style.id = "svelte-1a7i8ec-style";
- style.textContent = "p.svelte-1a7i8ec{color:red}";
- append(document.head, style);
+function add_css(target) {
+ append_styles(target, "svelte-1a7i8ec", "p.svelte-1a7i8ec{color:red}");
}
function create_fragment(ctx) {
@@ -49,7 +47,7 @@ function instance($$self, $$props, $$invalidate) {
let { foo = 42 } = $$props;
$$self.$$set = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
};
return [foo];
@@ -58,9 +56,8 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent {
constructor(options) {
super();
- if (!document.getElementById("svelte-1a7i8ec-style")) add_css();
- init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 });
+ init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 }, add_css);
}
}
-export default Component;
\ No newline at end of file
+export default Component;
diff --git a/test/js/samples/component-static-var/expected.js b/test/js/samples/component-static-var/expected.js
index 2cd5ed386f..9e481a25c3 100644
--- a/test/js/samples/component-static-var/expected.js
+++ b/test/js/samples/component-static-var/expected.js
@@ -16,8 +16,8 @@ import {
transition_out
} from "svelte/internal";
-import Foo from "./Foo.svelte";
-import Bar from "./Bar.svelte";
+import Foo from './Foo.svelte';
+import Bar from './Bar.svelte';
function create_fragment(ctx) {
let foo;
diff --git a/test/js/samples/component-store-access-invalidate/expected.js b/test/js/samples/component-store-access-invalidate/expected.js
index 4c7bfd7009..2742481aef 100644
--- a/test/js/samples/component-store-access-invalidate/expected.js
+++ b/test/js/samples/component-store-access-invalidate/expected.js
@@ -13,7 +13,7 @@ import {
text
} from "svelte/internal";
-import { writable } from "svelte/store";
+import { writable } from 'svelte/store';
function create_fragment(ctx) {
let h1;
diff --git a/test/js/samples/component-store-file-invalidate/expected.js b/test/js/samples/component-store-file-invalidate/expected.js
index d2fb3d0be4..86a467f368 100644
--- a/test/js/samples/component-store-file-invalidate/expected.js
+++ b/test/js/samples/component-store-file-invalidate/expected.js
@@ -7,7 +7,7 @@ import {
set_store_value
} from "svelte/internal";
-import { count } from "./store.js";
+import { count } from './store.js';
function instance($$self, $$props, $$invalidate) {
let $count;
diff --git a/test/js/samples/component-store-reassign-invalidate/expected.js b/test/js/samples/component-store-reassign-invalidate/expected.js
index 0cf555bf0d..9047316cef 100644
--- a/test/js/samples/component-store-reassign-invalidate/expected.js
+++ b/test/js/samples/component-store-reassign-invalidate/expected.js
@@ -15,7 +15,7 @@ import {
text
} from "svelte/internal";
-import { writable } from "svelte/store";
+import { writable } from 'svelte/store';
function create_fragment(ctx) {
let h1;
diff --git a/test/js/samples/computed-collapsed-if/expected.js b/test/js/samples/computed-collapsed-if/expected.js
index 3e70d6a7ae..8bcb5ed8b7 100644
--- a/test/js/samples/computed-collapsed-if/expected.js
+++ b/test/js/samples/computed-collapsed-if/expected.js
@@ -13,7 +13,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("x" in $$props) $$invalidate(0, x = $$props.x);
+ if ('x' in $$props) $$invalidate(0, x = $$props.x);
};
return [x, a, b];
diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js
index f477670059..d743432206 100644
--- a/test/js/samples/css-media-query/expected.js
+++ b/test/js/samples/css-media-query/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
- append,
+ append_styles,
attr,
detach,
element,
@@ -11,11 +11,8 @@ import {
safe_not_equal
} from "svelte/internal";
-function add_css() {
- var style = element("style");
- style.id = "svelte-1slhpfn-style";
- style.textContent = "@media(min-width: 1px){div.svelte-1slhpfn{color:red}}";
- append(document.head, style);
+function add_css(target) {
+ append_styles(target, "svelte-1slhpfn", "@media(min-width: 1px){div.svelte-1slhpfn{color:red}}");
}
function create_fragment(ctx) {
@@ -41,9 +38,8 @@ function create_fragment(ctx) {
class Component extends SvelteComponent {
constructor(options) {
super();
- if (!document.getElementById("svelte-1slhpfn-style")) add_css();
- init(this, options, null, create_fragment, safe_not_equal, {});
+ init(this, options, null, create_fragment, safe_not_equal, {}, add_css);
}
}
-export default Component;
\ No newline at end of file
+export default Component;
diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js
index 4d188201eb..5d65949488 100644
--- a/test/js/samples/css-shadow-dom-keyframes/expected.js
+++ b/test/js/samples/css-shadow-dom-keyframes/expected.js
@@ -46,7 +46,8 @@ class Component extends SvelteElement {
null,
create_fragment,
safe_not_equal,
- {}
+ {},
+ null
);
if (options) {
@@ -58,4 +59,4 @@ class Component extends SvelteElement {
}
customElements.define("custom-element", Component);
-export default Component;
\ No newline at end of file
+export default Component;
diff --git a/test/js/samples/custom-svelte-path/_config.js b/test/js/samples/custom-svelte-path/_config.js
new file mode 100644
index 0000000000..19a7366845
--- /dev/null
+++ b/test/js/samples/custom-svelte-path/_config.js
@@ -0,0 +1,5 @@
+export default {
+ options: {
+ sveltePath: 'a/b/svelte'
+ }
+};
diff --git a/test/js/samples/custom-svelte-path/expected.js b/test/js/samples/custom-svelte-path/expected.js
new file mode 100644
index 0000000000..3210f216d3
--- /dev/null
+++ b/test/js/samples/custom-svelte-path/expected.js
@@ -0,0 +1,64 @@
+/* generated by Svelte vX.Y.Z */
+import {
+ SvelteComponent,
+ append,
+ detach,
+ element,
+ init,
+ insert,
+ noop,
+ safe_not_equal,
+ set_data,
+ text
+} from "a/b/svelte/internal";
+
+import { onMount } from "a/b/svelte";
+
+function create_fragment(ctx) {
+ let h1;
+ let t0;
+ let t1;
+ let t2;
+
+ return {
+ c() {
+ h1 = element("h1");
+ t0 = text("Hello ");
+ t1 = text(/*name*/ ctx[0]);
+ t2 = text("!");
+ },
+ m(target, anchor) {
+ insert(target, h1, anchor);
+ append(h1, t0);
+ append(h1, t1);
+ append(h1, t2);
+ },
+ p(ctx, [dirty]) {
+ if (dirty & /*name*/ 1) set_data(t1, /*name*/ ctx[0]);
+ },
+ i: noop,
+ o: noop,
+ d(detaching) {
+ if (detaching) detach(h1);
+ }
+ };
+}
+
+function instance($$self, $$props, $$invalidate) {
+ let name = '';
+
+ onMount(() => {
+ $$invalidate(0, name = 'world');
+ });
+
+ return [name];
+}
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance, create_fragment, safe_not_equal, {});
+ }
+}
+
+export default Component;
\ No newline at end of file
diff --git a/test/js/samples/custom-svelte-path/input.svelte b/test/js/samples/custom-svelte-path/input.svelte
new file mode 100644
index 0000000000..03d31e7c7b
--- /dev/null
+++ b/test/js/samples/custom-svelte-path/input.svelte
@@ -0,0 +1,9 @@
+
+
+Hello {name}!
\ No newline at end of file
diff --git a/test/js/samples/data-attribute/expected.js b/test/js/samples/data-attribute/expected.js
index 8c30e6f6db..2b2f8870e4 100644
--- a/test/js/samples/data-attribute/expected.js
+++ b/test/js/samples/data-attribute/expected.js
@@ -48,7 +48,7 @@ function instance($$self, $$props, $$invalidate) {
let { bar } = $$props;
$$self.$$set = $$props => {
- if ("bar" in $$props) $$invalidate(0, bar = $$props.bar);
+ if ('bar' in $$props) $$invalidate(0, bar = $$props.bar);
};
return [bar];
diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js
index f427f1bf45..55303b41b7 100644
--- a/test/js/samples/debug-empty/expected.js
+++ b/test/js/samples/debug-empty/expected.js
@@ -70,22 +70,22 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let { name } = $$props;
- const writable_props = ["name"];
+ const writable_props = ['name'];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
$$self.$$set = $$props => {
- if ("name" in $$props) $$invalidate(0, name = $$props.name);
+ if ('name' in $$props) $$invalidate(0, name = $$props.name);
};
$$self.$capture_state = () => ({ name });
$$self.$inject_state = $$props => {
- if ("name" in $$props) $$invalidate(0, name = $$props.name);
+ if ('name' in $$props) $$invalidate(0, name = $$props.name);
};
if ($$props && "$$inject" in $$props) {
@@ -110,7 +110,7 @@ class Component extends SvelteComponentDev {
const { ctx } = this.$$;
const props = options.props || {};
- if (/*name*/ ctx[0] === undefined && !("name" in props)) {
+ if (/*name*/ ctx[0] === undefined && !('name' in props)) {
console.warn(" was created without expected prop 'name'");
}
}
diff --git a/test/js/samples/debug-foo-bar-baz-things/expected.js b/test/js/samples/debug-foo-bar-baz-things/expected.js
index 7439b3310b..3377d35018 100644
--- a/test/js/samples/debug-foo-bar-baz-things/expected.js
+++ b/test/js/samples/debug-foo-bar-baz-things/expected.js
@@ -171,31 +171,31 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let { things } = $$props;
let { foo } = $$props;
let { bar } = $$props;
let { baz } = $$props;
- const writable_props = ["things", "foo", "bar", "baz"];
+ const writable_props = ['things', 'foo', 'bar', 'baz'];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
$$self.$$set = $$props => {
- if ("things" in $$props) $$invalidate(0, things = $$props.things);
- if ("foo" in $$props) $$invalidate(1, foo = $$props.foo);
- if ("bar" in $$props) $$invalidate(2, bar = $$props.bar);
- if ("baz" in $$props) $$invalidate(3, baz = $$props.baz);
+ if ('things' in $$props) $$invalidate(0, things = $$props.things);
+ if ('foo' in $$props) $$invalidate(1, foo = $$props.foo);
+ if ('bar' in $$props) $$invalidate(2, bar = $$props.bar);
+ if ('baz' in $$props) $$invalidate(3, baz = $$props.baz);
};
$$self.$capture_state = () => ({ things, foo, bar, baz });
$$self.$inject_state = $$props => {
- if ("things" in $$props) $$invalidate(0, things = $$props.things);
- if ("foo" in $$props) $$invalidate(1, foo = $$props.foo);
- if ("bar" in $$props) $$invalidate(2, bar = $$props.bar);
- if ("baz" in $$props) $$invalidate(3, baz = $$props.baz);
+ if ('things' in $$props) $$invalidate(0, things = $$props.things);
+ if ('foo' in $$props) $$invalidate(1, foo = $$props.foo);
+ if ('bar' in $$props) $$invalidate(2, bar = $$props.bar);
+ if ('baz' in $$props) $$invalidate(3, baz = $$props.baz);
};
if ($$props && "$$inject" in $$props) {
@@ -220,19 +220,19 @@ class Component extends SvelteComponentDev {
const { ctx } = this.$$;
const props = options.props || {};
- if (/*things*/ ctx[0] === undefined && !("things" in props)) {
+ if (/*things*/ ctx[0] === undefined && !('things' in props)) {
console.warn(" was created without expected prop 'things'");
}
- if (/*foo*/ ctx[1] === undefined && !("foo" in props)) {
+ if (/*foo*/ ctx[1] === undefined && !('foo' in props)) {
console.warn(" was created without expected prop 'foo'");
}
- if (/*bar*/ ctx[2] === undefined && !("bar" in props)) {
+ if (/*bar*/ ctx[2] === undefined && !('bar' in props)) {
console.warn(" was created without expected prop 'bar'");
}
- if (/*baz*/ ctx[3] === undefined && !("baz" in props)) {
+ if (/*baz*/ ctx[3] === undefined && !('baz' in props)) {
console.warn(" was created without expected prop 'baz'");
}
}
diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js
index d869a5cf9e..518897c237 100644
--- a/test/js/samples/debug-foo/expected.js
+++ b/test/js/samples/debug-foo/expected.js
@@ -165,25 +165,25 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let { things } = $$props;
let { foo } = $$props;
- const writable_props = ["things", "foo"];
+ const writable_props = ['things', 'foo'];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
$$self.$$set = $$props => {
- if ("things" in $$props) $$invalidate(0, things = $$props.things);
- if ("foo" in $$props) $$invalidate(1, foo = $$props.foo);
+ if ('things' in $$props) $$invalidate(0, things = $$props.things);
+ if ('foo' in $$props) $$invalidate(1, foo = $$props.foo);
};
$$self.$capture_state = () => ({ things, foo });
$$self.$inject_state = $$props => {
- if ("things" in $$props) $$invalidate(0, things = $$props.things);
- if ("foo" in $$props) $$invalidate(1, foo = $$props.foo);
+ if ('things' in $$props) $$invalidate(0, things = $$props.things);
+ if ('foo' in $$props) $$invalidate(1, foo = $$props.foo);
};
if ($$props && "$$inject" in $$props) {
@@ -208,11 +208,11 @@ class Component extends SvelteComponentDev {
const { ctx } = this.$$;
const props = options.props || {};
- if (/*things*/ ctx[0] === undefined && !("things" in props)) {
+ if (/*things*/ ctx[0] === undefined && !('things' in props)) {
console.warn(" was created without expected prop 'things'");
}
- if (/*foo*/ ctx[1] === undefined && !("foo" in props)) {
+ if (/*foo*/ ctx[1] === undefined && !('foo' in props)) {
console.warn(" was created without expected prop 'foo'");
}
}
diff --git a/test/js/samples/debug-hoisted/expected.js b/test/js/samples/debug-hoisted/expected.js
index c6257ac90d..9fc4f7cf4f 100644
--- a/test/js/samples/debug-hoisted/expected.js
+++ b/test/js/samples/debug-hoisted/expected.js
@@ -50,20 +50,20 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let obj = { x: 5 };
let kobzol = 5;
const writable_props = [];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
$$self.$capture_state = () => ({ obj, kobzol });
$$self.$inject_state = $$props => {
- if ("obj" in $$props) $$invalidate(0, obj = $$props.obj);
- if ("kobzol" in $$props) $$invalidate(1, kobzol = $$props.kobzol);
+ if ('obj' in $$props) $$invalidate(0, obj = $$props.obj);
+ if ('kobzol' in $$props) $$invalidate(1, kobzol = $$props.kobzol);
};
if ($$props && "$$inject" in $$props) {
diff --git a/test/js/samples/debug-no-dependencies/expected.js b/test/js/samples/debug-no-dependencies/expected.js
index 4d8d05d3aa..8107b890a6 100644
--- a/test/js/samples/debug-no-dependencies/expected.js
+++ b/test/js/samples/debug-no-dependencies/expected.js
@@ -137,11 +137,11 @@ function create_fragment(ctx) {
function instance($$self, $$props) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
const writable_props = [];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
return [];
diff --git a/test/js/samples/deconflict-builtins/expected.js b/test/js/samples/deconflict-builtins/expected.js
index 6bc60194aa..8c9bb83b5b 100644
--- a/test/js/samples/deconflict-builtins/expected.js
+++ b/test/js/samples/deconflict-builtins/expected.js
@@ -105,7 +105,7 @@ function instance($$self, $$props, $$invalidate) {
let { createElement } = $$props;
$$self.$$set = $$props => {
- if ("createElement" in $$props) $$invalidate(0, createElement = $$props.createElement);
+ if ('createElement' in $$props) $$invalidate(0, createElement = $$props.createElement);
};
return [createElement];
diff --git a/test/js/samples/deconflict-globals/expected.js b/test/js/samples/deconflict-globals/expected.js
index 7168eba6a5..c048cc2ddd 100644
--- a/test/js/samples/deconflict-globals/expected.js
+++ b/test/js/samples/deconflict-globals/expected.js
@@ -1,17 +1,17 @@
/* generated by Svelte vX.Y.Z */
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
-import { onMount } from "svelte";
+import { onMount } from 'svelte';
function instance($$self, $$props, $$invalidate) {
- let { foo = "bar" } = $$props;
+ let { foo = 'bar' } = $$props;
onMount(() => {
alert(JSON.stringify(data()));
});
$$self.$$set = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
};
return [foo];
diff --git a/test/js/samples/dev-warning-missing-data-computed/expected.js b/test/js/samples/dev-warning-missing-data-computed/expected.js
index 8c7f8bb1cf..5e10ec55f8 100644
--- a/test/js/samples/dev-warning-missing-data-computed/expected.js
+++ b/test/js/samples/dev-warning-missing-data-computed/expected.js
@@ -66,24 +66,24 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let { foo } = $$props;
let bar;
- const writable_props = ["foo"];
+ const writable_props = ['foo'];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
$$self.$$set = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
};
$$self.$capture_state = () => ({ foo, bar });
$$self.$inject_state = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
- if ("bar" in $$props) $$invalidate(1, bar = $$props.bar);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('bar' in $$props) $$invalidate(1, bar = $$props.bar);
};
if ($$props && "$$inject" in $$props) {
@@ -114,7 +114,7 @@ class Component extends SvelteComponentDev {
const { ctx } = this.$$;
const props = options.props || {};
- if (/*foo*/ ctx[0] === undefined && !("foo" in props)) {
+ if (/*foo*/ ctx[0] === undefined && !('foo' in props)) {
console.warn(" was created without expected prop 'foo'");
}
}
diff --git a/test/js/samples/dynamic-import/expected.js b/test/js/samples/dynamic-import/expected.js
index d1085f431b..d25a825d3b 100644
--- a/test/js/samples/dynamic-import/expected.js
+++ b/test/js/samples/dynamic-import/expected.js
@@ -11,7 +11,7 @@ import {
transition_out
} from "svelte/internal";
-import LazyLoad from "./LazyLoad.svelte";
+import LazyLoad from './LazyLoad.svelte';
function create_fragment(ctx) {
let lazyload;
@@ -42,7 +42,7 @@ function create_fragment(ctx) {
};
}
-const func = () => import("./Foo.svelte");
+const func = () => import('./Foo.svelte');
class Component extends SvelteComponent {
constructor(options) {
diff --git a/test/js/samples/each-block-array-literal/expected.js b/test/js/samples/each-block-array-literal/expected.js
index fe51ac5bc3..bb5a04e952 100644
--- a/test/js/samples/each-block-array-literal/expected.js
+++ b/test/js/samples/each-block-array-literal/expected.js
@@ -107,11 +107,11 @@ function instance($$self, $$props, $$invalidate) {
let { e } = $$props;
$$self.$$set = $$props => {
- if ("a" in $$props) $$invalidate(0, a = $$props.a);
- if ("b" in $$props) $$invalidate(1, b = $$props.b);
- if ("c" in $$props) $$invalidate(2, c = $$props.c);
- if ("d" in $$props) $$invalidate(3, d = $$props.d);
- if ("e" in $$props) $$invalidate(4, e = $$props.e);
+ if ('a' in $$props) $$invalidate(0, a = $$props.a);
+ if ('b' in $$props) $$invalidate(1, b = $$props.b);
+ if ('c' in $$props) $$invalidate(2, c = $$props.c);
+ if ('d' in $$props) $$invalidate(3, d = $$props.d);
+ if ('e' in $$props) $$invalidate(4, e = $$props.e);
};
return [a, b, c, d, e];
diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js
index 63bc1d8607..19947edbbb 100644
--- a/test/js/samples/each-block-changed-check/expected.js
+++ b/test/js/samples/each-block-changed-check/expected.js
@@ -52,8 +52,9 @@ function create_each_block(ctx) {
t4 = text(t4_value);
t5 = text(" ago:");
t6 = space();
+ html_tag = new HtmlTag();
attr(span, "class", "meta");
- html_tag = new HtmlTag(null);
+ html_tag.a = null;
attr(div, "class", "comment");
},
m(target, anchor) {
@@ -153,10 +154,10 @@ function instance($$self, $$props, $$invalidate) {
let { foo } = $$props;
$$self.$$set = $$props => {
- if ("comments" in $$props) $$invalidate(0, comments = $$props.comments);
- if ("elapsed" in $$props) $$invalidate(1, elapsed = $$props.elapsed);
- if ("time" in $$props) $$invalidate(2, time = $$props.time);
- if ("foo" in $$props) $$invalidate(3, foo = $$props.foo);
+ if ('comments' in $$props) $$invalidate(0, comments = $$props.comments);
+ if ('elapsed' in $$props) $$invalidate(1, elapsed = $$props.elapsed);
+ if ('time' in $$props) $$invalidate(2, time = $$props.time);
+ if ('foo' in $$props) $$invalidate(3, foo = $$props.foo);
};
return [comments, elapsed, time, foo];
diff --git a/test/js/samples/each-block-keyed-animated/expected.js b/test/js/samples/each-block-keyed-animated/expected.js
index b48073f5a7..6f7c22a086 100644
--- a/test/js/samples/each-block-keyed-animated/expected.js
+++ b/test/js/samples/each-block-keyed-animated/expected.js
@@ -130,7 +130,7 @@ function instance($$self, $$props, $$invalidate) {
let { things } = $$props;
$$self.$$set = $$props => {
- if ("things" in $$props) $$invalidate(0, things = $$props.things);
+ if ('things' in $$props) $$invalidate(0, things = $$props.things);
};
return [things];
diff --git a/test/js/samples/each-block-keyed/expected.js b/test/js/samples/each-block-keyed/expected.js
index 7808ed677f..a275697d8e 100644
--- a/test/js/samples/each-block-keyed/expected.js
+++ b/test/js/samples/each-block-keyed/expected.js
@@ -99,7 +99,7 @@ function instance($$self, $$props, $$invalidate) {
let { things } = $$props;
$$self.$$set = $$props => {
- if ("things" in $$props) $$invalidate(0, things = $$props.things);
+ if ('things' in $$props) $$invalidate(0, things = $$props.things);
};
return [things];
diff --git a/test/js/samples/export-from-accessors/_config.js b/test/js/samples/export-from-accessors/_config.js
new file mode 100644
index 0000000000..7f9293a560
--- /dev/null
+++ b/test/js/samples/export-from-accessors/_config.js
@@ -0,0 +1,5 @@
+export default {
+ options: {
+ accessors: true
+ }
+};
diff --git a/test/js/samples/export-from-accessors/expected.js b/test/js/samples/export-from-accessors/expected.js
new file mode 100644
index 0000000000..20b0524ca7
--- /dev/null
+++ b/test/js/samples/export-from-accessors/expected.js
@@ -0,0 +1,34 @@
+/* generated by Svelte vX.Y.Z */
+import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
+
+import { f as f_1, g as g_1 } from './d';
+import { h as h_1 } from './e';
+import { i as j } from './f';
+export { d as e } from './c';
+export { c } from './b';
+export { a, b } from './a';
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, null, null, safe_not_equal, {});
+ }
+
+ get f() {
+ return f_1;
+ }
+
+ get g() {
+ return g_1;
+ }
+
+ get h() {
+ return h_1;
+ }
+
+ get j() {
+ return j;
+ }
+}
+
+export default Component;
\ No newline at end of file
diff --git a/test/js/samples/export-from-accessors/input.svelte b/test/js/samples/export-from-accessors/input.svelte
new file mode 100644
index 0000000000..66957806a2
--- /dev/null
+++ b/test/js/samples/export-from-accessors/input.svelte
@@ -0,0 +1,11 @@
+
+
+
diff --git a/test/js/samples/export-from-cjs/_config.js b/test/js/samples/export-from-cjs/_config.js
new file mode 100644
index 0000000000..2506f1d5fc
--- /dev/null
+++ b/test/js/samples/export-from-cjs/_config.js
@@ -0,0 +1,6 @@
+export default {
+ options: {
+ accessors: true,
+ format: 'cjs'
+ }
+};
diff --git a/test/js/samples/export-from-cjs/expected.js b/test/js/samples/export-from-cjs/expected.js
new file mode 100644
index 0000000000..d40f986635
--- /dev/null
+++ b/test/js/samples/export-from-cjs/expected.js
@@ -0,0 +1,36 @@
+/* generated by Svelte vX.Y.Z */
+"use strict";
+
+const { SvelteComponent, init, safe_not_equal } = require("svelte/internal");
+const { f: f_1, g: g_1 } = require("./d");
+const { h: h_1 } = require("./e");
+const { i: j } = require("./f");
+exports.e = require("./c").d;
+exports.c = require("./b").c;
+exports.a = require("./a").a;
+exports.b = require("./a").b;
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, null, null, safe_not_equal, {});
+ }
+
+ get f() {
+ return f_1;
+ }
+
+ get g() {
+ return g_1;
+ }
+
+ get h() {
+ return h_1;
+ }
+
+ get j() {
+ return j;
+ }
+}
+
+exports.default = Component;
\ No newline at end of file
diff --git a/test/js/samples/export-from-cjs/input.svelte b/test/js/samples/export-from-cjs/input.svelte
new file mode 100644
index 0000000000..66957806a2
--- /dev/null
+++ b/test/js/samples/export-from-cjs/input.svelte
@@ -0,0 +1,11 @@
+
+
+
diff --git a/test/js/samples/export-from/expected.js b/test/js/samples/export-from/expected.js
new file mode 100644
index 0000000000..04fb47605f
--- /dev/null
+++ b/test/js/samples/export-from/expected.js
@@ -0,0 +1,18 @@
+/* generated by Svelte vX.Y.Z */
+import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
+
+import './d';
+import './e';
+import './f';
+export { d as e } from './c';
+export { c } from './b';
+export { a, b } from './a';
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, null, null, safe_not_equal, {});
+ }
+}
+
+export default Component;
\ No newline at end of file
diff --git a/test/js/samples/export-from/input.svelte b/test/js/samples/export-from/input.svelte
new file mode 100644
index 0000000000..66957806a2
--- /dev/null
+++ b/test/js/samples/export-from/input.svelte
@@ -0,0 +1,11 @@
+
+
+
diff --git a/test/js/samples/hydrated-void-element/expected.js b/test/js/samples/hydrated-void-element/expected.js
index e53d16d925..e84b9ad58e 100644
--- a/test/js/samples/hydrated-void-element/expected.js
+++ b/test/js/samples/hydrated-void-element/expected.js
@@ -8,10 +8,11 @@ import {
detach,
element,
init,
- insert,
+ insert_hydration,
noop,
safe_not_equal,
- space
+ space,
+ src_url_equal
} from "svelte/internal";
function create_fragment(ctx) {
@@ -35,13 +36,13 @@ function create_fragment(ctx) {
this.h();
},
h() {
- if (img.src !== (img_src_value = "donuts.jpg")) attr(img, "src", img_src_value);
+ if (!src_url_equal(img.src, img_src_value = "donuts.jpg")) attr(img, "src", img_src_value);
attr(img, "alt", "donuts");
},
m(target, anchor) {
- insert(target, img, anchor);
- insert(target, t, anchor);
- insert(target, div, anchor);
+ insert_hydration(target, img, anchor);
+ insert_hydration(target, t, anchor);
+ insert_hydration(target, div, anchor);
},
p: noop,
i: noop,
@@ -61,4 +62,4 @@ class Component extends SvelteComponent {
}
}
-export default Component;
\ No newline at end of file
+export default Component;
diff --git a/test/js/samples/hydrated-void-svg-element/_config.js b/test/js/samples/hydrated-void-svg-element/_config.js
new file mode 100644
index 0000000000..af1bf11a52
--- /dev/null
+++ b/test/js/samples/hydrated-void-svg-element/_config.js
@@ -0,0 +1,5 @@
+export default {
+ options: {
+ hydratable: true
+ }
+};
diff --git a/test/js/samples/hydrated-void-svg-element/expected.js b/test/js/samples/hydrated-void-svg-element/expected.js
new file mode 100644
index 0000000000..e3b525bcdd
--- /dev/null
+++ b/test/js/samples/hydrated-void-svg-element/expected.js
@@ -0,0 +1,58 @@
+/* generated by Svelte vX.Y.Z */
+import {
+ SvelteComponent,
+ append_hydration,
+ children,
+ claim_svg_element,
+ claim_text,
+ detach,
+ init,
+ insert_hydration,
+ noop,
+ safe_not_equal,
+ svg_element,
+ text
+} from "svelte/internal";
+
+function create_fragment(ctx) {
+ let svg;
+ let title;
+ let t;
+
+ return {
+ c() {
+ svg = svg_element("svg");
+ title = svg_element("title");
+ t = text("a title");
+ },
+ l(nodes) {
+ svg = claim_svg_element(nodes, "svg", {});
+ var svg_nodes = children(svg);
+ title = claim_svg_element(svg_nodes, "title", {});
+ var title_nodes = children(title);
+ t = claim_text(title_nodes, "a title");
+ title_nodes.forEach(detach);
+ svg_nodes.forEach(detach);
+ },
+ m(target, anchor) {
+ insert_hydration(target, svg, anchor);
+ append_hydration(svg, title);
+ append_hydration(title, t);
+ },
+ p: noop,
+ i: noop,
+ o: noop,
+ d(detaching) {
+ if (detaching) detach(svg);
+ }
+ };
+}
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, null, create_fragment, safe_not_equal, {});
+ }
+}
+
+export default Component;
diff --git a/test/js/samples/hydrated-void-svg-element/input.svelte b/test/js/samples/hydrated-void-svg-element/input.svelte
new file mode 100644
index 0000000000..7ec3f98b64
--- /dev/null
+++ b/test/js/samples/hydrated-void-svg-element/input.svelte
@@ -0,0 +1,3 @@
+
+ a title
+
\ No newline at end of file
diff --git a/test/js/samples/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js
index c67b33fa85..25f197eb1a 100644
--- a/test/js/samples/if-block-no-update/expected.js
+++ b/test/js/samples/if-block-no-update/expected.js
@@ -89,7 +89,7 @@ function instance($$self, $$props, $$invalidate) {
let { foo } = $$props;
$$self.$$set = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
};
return [foo];
diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js
index 4cdd73cddb..6debe92c24 100644
--- a/test/js/samples/if-block-simple/expected.js
+++ b/test/js/samples/if-block-simple/expected.js
@@ -67,7 +67,7 @@ function instance($$self, $$props, $$invalidate) {
let { foo } = $$props;
$$self.$$set = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
};
return [foo];
diff --git a/test/js/samples/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js
index 0a9d0a1e8e..4e4dba16d5 100644
--- a/test/js/samples/inline-style-optimized-multiple/expected.js
+++ b/test/js/samples/inline-style-optimized-multiple/expected.js
@@ -45,9 +45,9 @@ function instance($$self, $$props, $$invalidate) {
let { y } = $$props;
$$self.$$set = $$props => {
- if ("color" in $$props) $$invalidate(0, color = $$props.color);
- if ("x" in $$props) $$invalidate(1, x = $$props.x);
- if ("y" in $$props) $$invalidate(2, y = $$props.y);
+ if ('color' in $$props) $$invalidate(0, color = $$props.color);
+ if ('x' in $$props) $$invalidate(1, x = $$props.x);
+ if ('y' in $$props) $$invalidate(2, y = $$props.y);
};
return [color, x, y];
diff --git a/test/js/samples/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js
index 0debb03585..a861e9dc7e 100644
--- a/test/js/samples/inline-style-optimized-url/expected.js
+++ b/test/js/samples/inline-style-optimized-url/expected.js
@@ -38,7 +38,7 @@ function instance($$self, $$props, $$invalidate) {
let { data } = $$props;
$$self.$$set = $$props => {
- if ("data" in $$props) $$invalidate(0, data = $$props.data);
+ if ('data' in $$props) $$invalidate(0, data = $$props.data);
};
return [data];
diff --git a/test/js/samples/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js
index b7db0f1cf3..ea4f39ab47 100644
--- a/test/js/samples/inline-style-optimized/expected.js
+++ b/test/js/samples/inline-style-optimized/expected.js
@@ -38,7 +38,7 @@ function instance($$self, $$props, $$invalidate) {
let { color } = $$props;
$$self.$$set = $$props => {
- if ("color" in $$props) $$invalidate(0, color = $$props.color);
+ if ('color' in $$props) $$invalidate(0, color = $$props.color);
};
return [color];
diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js
index 0688f14b9b..2900fb6ce7 100644
--- a/test/js/samples/inline-style-unoptimized/expected.js
+++ b/test/js/samples/inline-style-unoptimized/expected.js
@@ -55,9 +55,9 @@ function instance($$self, $$props, $$invalidate) {
let { value } = $$props;
$$self.$$set = $$props => {
- if ("style" in $$props) $$invalidate(0, style = $$props.style);
- if ("key" in $$props) $$invalidate(1, key = $$props.key);
- if ("value" in $$props) $$invalidate(2, value = $$props.value);
+ if ('style' in $$props) $$invalidate(0, style = $$props.style);
+ if ('key' in $$props) $$invalidate(1, key = $$props.key);
+ if ('value' in $$props) $$invalidate(2, value = $$props.value);
};
return [style, key, value];
diff --git a/test/js/samples/inline-style-without-updates/expected.js b/test/js/samples/inline-style-without-updates/expected.js
index 375896f259..ebfffe902c 100644
--- a/test/js/samples/inline-style-without-updates/expected.js
+++ b/test/js/samples/inline-style-without-updates/expected.js
@@ -30,7 +30,7 @@ function create_fragment(ctx) {
};
}
-let color = "red";
+let color = 'red';
class Component extends SvelteComponent {
constructor(options) {
diff --git a/test/js/samples/input-files/expected.js b/test/js/samples/input-files/expected.js
index 8adc7443f5..42ddddbcb3 100644
--- a/test/js/samples/input-files/expected.js
+++ b/test/js/samples/input-files/expected.js
@@ -50,7 +50,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("files" in $$props) $$invalidate(0, files = $$props.files);
+ if ('files' in $$props) $$invalidate(0, files = $$props.files);
};
return [files, input_change_handler];
diff --git a/test/js/samples/input-no-initial-value/expected.js b/test/js/samples/input-no-initial-value/expected.js
index 3354aa3111..a91a95bde2 100644
--- a/test/js/samples/input-no-initial-value/expected.js
+++ b/test/js/samples/input-no-initial-value/expected.js
@@ -69,7 +69,7 @@ function instance($$self, $$props, $$invalidate) {
function handleSubmit(event) {
event.preventDefault();
- console.log("value", test);
+ console.log('value', test);
}
function input_input_handler() {
diff --git a/test/js/samples/input-range/expected.js b/test/js/samples/input-range/expected.js
index a855ca3653..7ced4b176b 100644
--- a/test/js/samples/input-range/expected.js
+++ b/test/js/samples/input-range/expected.js
@@ -61,7 +61,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("value" in $$props) $$invalidate(0, value = $$props.value);
+ if ('value' in $$props) $$invalidate(0, value = $$props.value);
};
return [value, input_change_input_handler];
diff --git a/test/js/samples/input-value/expected.js b/test/js/samples/input-value/expected.js
index 781a2ae603..2f951c9ae1 100644
--- a/test/js/samples/input-value/expected.js
+++ b/test/js/samples/input-value/expected.js
@@ -2,12 +2,14 @@
import {
SvelteComponent,
append,
+ attr,
detach,
element,
init,
insert,
listen,
noop,
+ run_all,
safe_not_equal,
set_data,
space,
@@ -15,56 +17,394 @@ import {
} from "svelte/internal";
function create_fragment(ctx) {
- let input;
+ let input0;
let t0;
- let h1;
+ let input1;
let t1;
+ let input2;
let t2;
+ let input3;
+ let t3;
+ let input4;
+ let t4;
+ let input5;
+ let t5;
+ let input6;
+ let t6;
+ let input7;
+ let t7;
+ let input8;
+ let t8;
+ let input9;
+ let t9;
+ let input10;
+ let t10;
+ let input11;
+ let t11;
+ let input12;
+ let t12;
+ let input13;
+ let t13;
+ let input14;
+ let t14;
+ let input15;
+ let t15;
+ let input16;
+ let t16;
+ let input17;
+ let t17;
+ let input18;
+ let t18;
+ let input19;
+ let t19;
+ let input20;
+ let t20;
+ let input21;
+ let t21;
+ let input22;
+ let t22;
+ let h1;
+ let t23;
+ let t24;
let mounted;
let dispose;
return {
c() {
- input = element("input");
+ input0 = element("input");
t0 = space();
+ input1 = element("input");
+ t1 = space();
+ input2 = element("input");
+ t2 = space();
+ input3 = element("input");
+ t3 = space();
+ input4 = element("input");
+ t4 = space();
+ input5 = element("input");
+ t5 = space();
+ input6 = element("input");
+ t6 = space();
+ input7 = element("input");
+ t7 = space();
+ input8 = element("input");
+ t8 = space();
+ input9 = element("input");
+ t9 = space();
+ input10 = element("input");
+ t10 = space();
+ input11 = element("input");
+ t11 = space();
+ input12 = element("input");
+ t12 = space();
+ input13 = element("input");
+ t13 = space();
+ input14 = element("input");
+ t14 = space();
+ input15 = element("input");
+ t15 = space();
+ input16 = element("input");
+ t16 = space();
+ input17 = element("input");
+ t17 = space();
+ input18 = element("input");
+ t18 = space();
+ input19 = element("input");
+ t19 = space();
+ input20 = element("input");
+ t20 = space();
+ input21 = element("input");
+ t21 = space();
+ input22 = element("input");
+ t22 = space();
h1 = element("h1");
- t1 = text(/*name*/ ctx[0]);
- t2 = text("!");
- input.value = /*name*/ ctx[0];
+ t23 = text(/*name*/ ctx[0]);
+ t24 = text("!");
+ input0.value = /*name*/ ctx[0];
+ attr(input1, "type", "email");
+ input1.value = /*name*/ ctx[0];
+ attr(input2, "type", "month");
+ input2.value = /*name*/ ctx[0];
+ attr(input3, "type", "number");
+ input3.value = /*name*/ ctx[0];
+ attr(input4, "type", "password");
+ input4.value = /*name*/ ctx[0];
+ attr(input5, "type", "search");
+ input5.value = /*name*/ ctx[0];
+ attr(input6, "type", "tel");
+ input6.value = /*name*/ ctx[0];
+ attr(input7, "type", "text");
+ input7.value = /*name*/ ctx[0];
+ attr(input8, "type", "url");
+ input8.value = /*name*/ ctx[0];
+ attr(input9, "type", "week");
+ input9.value = /*name*/ ctx[0];
+ attr(input10, "type", "button");
+ input10.value = /*name*/ ctx[0];
+ attr(input11, "type", "checkbox");
+ input11.value = /*name*/ ctx[0];
+ attr(input12, "type", "color");
+ input12.value = /*name*/ ctx[0];
+ attr(input13, "type", "date");
+ input13.value = /*name*/ ctx[0];
+ attr(input14, "type", "datetime-local");
+ input14.value = /*name*/ ctx[0];
+ attr(input15, "type", "file");
+ input15.value = /*name*/ ctx[0];
+ attr(input16, "type", "hidden");
+ input16.value = /*name*/ ctx[0];
+ attr(input17, "type", "image");
+ input17.value = /*name*/ ctx[0];
+ attr(input17, "alt", /*name*/ ctx[0]);
+ attr(input18, "type", "radio");
+ input18.value = /*name*/ ctx[0];
+ attr(input19, "type", "range");
+ input19.value = /*name*/ ctx[0];
+ attr(input20, "type", "reset");
+ input20.value = /*name*/ ctx[0];
+ attr(input21, "type", "submit");
+ input21.value = /*name*/ ctx[0];
+ attr(input22, "type", "time");
+ input22.value = /*name*/ ctx[0];
},
m(target, anchor) {
- insert(target, input, anchor);
+ insert(target, input0, anchor);
insert(target, t0, anchor);
+ insert(target, input1, anchor);
+ insert(target, t1, anchor);
+ insert(target, input2, anchor);
+ insert(target, t2, anchor);
+ insert(target, input3, anchor);
+ insert(target, t3, anchor);
+ insert(target, input4, anchor);
+ insert(target, t4, anchor);
+ insert(target, input5, anchor);
+ insert(target, t5, anchor);
+ insert(target, input6, anchor);
+ insert(target, t6, anchor);
+ insert(target, input7, anchor);
+ insert(target, t7, anchor);
+ insert(target, input8, anchor);
+ insert(target, t8, anchor);
+ insert(target, input9, anchor);
+ insert(target, t9, anchor);
+ insert(target, input10, anchor);
+ insert(target, t10, anchor);
+ insert(target, input11, anchor);
+ insert(target, t11, anchor);
+ insert(target, input12, anchor);
+ insert(target, t12, anchor);
+ insert(target, input13, anchor);
+ insert(target, t13, anchor);
+ insert(target, input14, anchor);
+ insert(target, t14, anchor);
+ insert(target, input15, anchor);
+ insert(target, t15, anchor);
+ insert(target, input16, anchor);
+ insert(target, t16, anchor);
+ insert(target, input17, anchor);
+ insert(target, t17, anchor);
+ insert(target, input18, anchor);
+ insert(target, t18, anchor);
+ insert(target, input19, anchor);
+ insert(target, t19, anchor);
+ insert(target, input20, anchor);
+ insert(target, t20, anchor);
+ insert(target, input21, anchor);
+ insert(target, t21, anchor);
+ insert(target, input22, anchor);
+ insert(target, t22, anchor);
insert(target, h1, anchor);
- append(h1, t1);
- append(h1, t2);
+ append(h1, t23);
+ append(h1, t24);
if (!mounted) {
- dispose = listen(input, "input", /*onInput*/ ctx[1]);
+ dispose = [
+ listen(input0, "input", /*onInput*/ ctx[1]),
+ listen(input1, "input", /*onInput*/ ctx[1]),
+ listen(input2, "input", /*onInput*/ ctx[1]),
+ listen(input3, "input", /*onInput*/ ctx[1]),
+ listen(input4, "input", /*onInput*/ ctx[1]),
+ listen(input5, "input", /*onInput*/ ctx[1]),
+ listen(input6, "input", /*onInput*/ ctx[1]),
+ listen(input7, "input", /*onInput*/ ctx[1]),
+ listen(input8, "input", /*onInput*/ ctx[1]),
+ listen(input9, "input", /*onInput*/ ctx[1]),
+ listen(input10, "input", /*onInput*/ ctx[1]),
+ listen(input11, "input", /*onInput*/ ctx[1]),
+ listen(input12, "input", /*onInput*/ ctx[1]),
+ listen(input13, "input", /*onInput*/ ctx[1]),
+ listen(input14, "input", /*onInput*/ ctx[1]),
+ listen(input15, "input", /*onInput*/ ctx[1]),
+ listen(input16, "input", /*onInput*/ ctx[1]),
+ listen(input17, "input", /*onInput*/ ctx[1]),
+ listen(input18, "input", /*onInput*/ ctx[1]),
+ listen(input19, "input", /*onInput*/ ctx[1]),
+ listen(input20, "input", /*onInput*/ ctx[1]),
+ listen(input21, "input", /*onInput*/ ctx[1]),
+ listen(input22, "input", /*onInput*/ ctx[1])
+ ];
+
mounted = true;
}
},
p(ctx, [dirty]) {
- if (dirty & /*name*/ 1 && input.value !== /*name*/ ctx[0]) {
- input.value = /*name*/ ctx[0];
+ if (dirty & /*name*/ 1 && input0.value !== /*name*/ ctx[0]) {
+ input0.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1 && input1.value !== /*name*/ ctx[0]) {
+ input1.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1 && input2.value !== /*name*/ ctx[0]) {
+ input2.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1 && input3.value !== /*name*/ ctx[0]) {
+ input3.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1 && input4.value !== /*name*/ ctx[0]) {
+ input4.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1 && input5.value !== /*name*/ ctx[0]) {
+ input5.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1 && input6.value !== /*name*/ ctx[0]) {
+ input6.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1 && input7.value !== /*name*/ ctx[0]) {
+ input7.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1 && input8.value !== /*name*/ ctx[0]) {
+ input8.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1 && input9.value !== /*name*/ ctx[0]) {
+ input9.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1) {
+ input10.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1) {
+ input11.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1) {
+ input12.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1) {
+ input13.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1) {
+ input14.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1) {
+ input15.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1) {
+ input16.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1) {
+ input17.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1) {
+ attr(input17, "alt", /*name*/ ctx[0]);
+ }
+
+ if (dirty & /*name*/ 1) {
+ input18.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1) {
+ input19.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1) {
+ input20.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1) {
+ input21.value = /*name*/ ctx[0];
+ }
+
+ if (dirty & /*name*/ 1 && input22.value !== /*name*/ ctx[0]) {
+ input22.value = /*name*/ ctx[0];
}
- if (dirty & /*name*/ 1) set_data(t1, /*name*/ ctx[0]);
+ if (dirty & /*name*/ 1) set_data(t23, /*name*/ ctx[0]);
},
i: noop,
o: noop,
d(detaching) {
- if (detaching) detach(input);
+ if (detaching) detach(input0);
if (detaching) detach(t0);
+ if (detaching) detach(input1);
+ if (detaching) detach(t1);
+ if (detaching) detach(input2);
+ if (detaching) detach(t2);
+ if (detaching) detach(input3);
+ if (detaching) detach(t3);
+ if (detaching) detach(input4);
+ if (detaching) detach(t4);
+ if (detaching) detach(input5);
+ if (detaching) detach(t5);
+ if (detaching) detach(input6);
+ if (detaching) detach(t6);
+ if (detaching) detach(input7);
+ if (detaching) detach(t7);
+ if (detaching) detach(input8);
+ if (detaching) detach(t8);
+ if (detaching) detach(input9);
+ if (detaching) detach(t9);
+ if (detaching) detach(input10);
+ if (detaching) detach(t10);
+ if (detaching) detach(input11);
+ if (detaching) detach(t11);
+ if (detaching) detach(input12);
+ if (detaching) detach(t12);
+ if (detaching) detach(input13);
+ if (detaching) detach(t13);
+ if (detaching) detach(input14);
+ if (detaching) detach(t14);
+ if (detaching) detach(input15);
+ if (detaching) detach(t15);
+ if (detaching) detach(input16);
+ if (detaching) detach(t16);
+ if (detaching) detach(input17);
+ if (detaching) detach(t17);
+ if (detaching) detach(input18);
+ if (detaching) detach(t18);
+ if (detaching) detach(input19);
+ if (detaching) detach(t19);
+ if (detaching) detach(input20);
+ if (detaching) detach(t20);
+ if (detaching) detach(input21);
+ if (detaching) detach(t21);
+ if (detaching) detach(input22);
+ if (detaching) detach(t22);
if (detaching) detach(h1);
mounted = false;
- dispose();
+ run_all(dispose);
}
};
}
function instance($$self, $$props, $$invalidate) {
- let name = "change me";
+ let name = 'change me';
function onInput(event) {
$$invalidate(0, name = event.target.value);
@@ -80,4 +420,4 @@ class Component extends SvelteComponent {
}
}
-export default Component;
\ No newline at end of file
+export default Component;
diff --git a/test/js/samples/input-value/input.svelte b/test/js/samples/input-value/input.svelte
index 476458a195..ee1d9e3de7 100644
--- a/test/js/samples/input-value/input.svelte
+++ b/test/js/samples/input-value/input.svelte
@@ -1,11 +1,33 @@
+
+
+
+
+
+
+
+
+
-{name}!
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+{name}!
diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js
index 6c5b215623..007177bda5 100644
--- a/test/js/samples/input-without-blowback-guard/expected.js
+++ b/test/js/samples/input-without-blowback-guard/expected.js
@@ -54,7 +54,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
};
return [foo, input_change_handler];
diff --git a/test/js/samples/loop-protect/expected.js b/test/js/samples/loop-protect/expected.js
index 1042b20823..04033d0d95 100644
--- a/test/js/samples/loop-protect/expected.js
+++ b/test/js/samples/loop-protect/expected.js
@@ -54,7 +54,7 @@ function create_fragment(ctx) {
}
function foo() {
- const guard = "foo";
+ const guard = 'foo';
{
const guard_1 = loop_guard(100);
@@ -68,7 +68,7 @@ function foo() {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let node;
{
@@ -110,11 +110,11 @@ function instance($$self, $$props, $$invalidate) {
const writable_props = [];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console_1.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1.warn(` was created with unknown prop '${key}'`);
});
function div_binding($$value) {
- binding_callbacks[$$value ? "unshift" : "push"](() => {
+ binding_callbacks[$$value ? 'unshift' : 'push'](() => {
node = $$value;
$$invalidate(0, node);
});
@@ -123,7 +123,7 @@ function instance($$self, $$props, $$invalidate) {
$$self.$capture_state = () => ({ node, foo });
$$self.$inject_state = $$props => {
- if ("node" in $$props) $$invalidate(0, node = $$props.node);
+ if ('node' in $$props) $$invalidate(0, node = $$props.node);
};
if ($$props && "$$inject" in $$props) {
diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js
index 867d4a7dad..5005eb47d1 100644
--- a/test/js/samples/media-bindings/expected.js
+++ b/test/js/samples/media-bindings/expected.js
@@ -174,17 +174,17 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("buffered" in $$props) $$invalidate(0, buffered = $$props.buffered);
- if ("seekable" in $$props) $$invalidate(1, seekable = $$props.seekable);
- if ("played" in $$props) $$invalidate(2, played = $$props.played);
- if ("currentTime" in $$props) $$invalidate(3, currentTime = $$props.currentTime);
- if ("duration" in $$props) $$invalidate(4, duration = $$props.duration);
- if ("paused" in $$props) $$invalidate(5, paused = $$props.paused);
- if ("volume" in $$props) $$invalidate(6, volume = $$props.volume);
- if ("muted" in $$props) $$invalidate(7, muted = $$props.muted);
- if ("playbackRate" in $$props) $$invalidate(8, playbackRate = $$props.playbackRate);
- if ("seeking" in $$props) $$invalidate(9, seeking = $$props.seeking);
- if ("ended" in $$props) $$invalidate(10, ended = $$props.ended);
+ if ('buffered' in $$props) $$invalidate(0, buffered = $$props.buffered);
+ if ('seekable' in $$props) $$invalidate(1, seekable = $$props.seekable);
+ if ('played' in $$props) $$invalidate(2, played = $$props.played);
+ if ('currentTime' in $$props) $$invalidate(3, currentTime = $$props.currentTime);
+ if ('duration' in $$props) $$invalidate(4, duration = $$props.duration);
+ if ('paused' in $$props) $$invalidate(5, paused = $$props.paused);
+ if ('volume' in $$props) $$invalidate(6, volume = $$props.volume);
+ if ('muted' in $$props) $$invalidate(7, muted = $$props.muted);
+ if ('playbackRate' in $$props) $$invalidate(8, playbackRate = $$props.playbackRate);
+ if ('seeking' in $$props) $$invalidate(9, seeking = $$props.seeking);
+ if ('ended' in $$props) $$invalidate(10, ended = $$props.ended);
};
return [
diff --git a/test/js/samples/non-imported-component/expected.js b/test/js/samples/non-imported-component/expected.js
index 5a6b8e8bb7..e3f2760ce0 100644
--- a/test/js/samples/non-imported-component/expected.js
+++ b/test/js/samples/non-imported-component/expected.js
@@ -14,7 +14,7 @@ import {
transition_out
} from "svelte/internal";
-import Imported from "Imported.svelte";
+import Imported from 'Imported.svelte';
function create_fragment(ctx) {
let imported;
diff --git a/test/js/samples/non-mutable-reference/expected.js b/test/js/samples/non-mutable-reference/expected.js
index 93f2145a2e..adc67b9bc4 100644
--- a/test/js/samples/non-mutable-reference/expected.js
+++ b/test/js/samples/non-mutable-reference/expected.js
@@ -29,7 +29,7 @@ function create_fragment(ctx) {
};
}
-let name = "world";
+let name = 'world';
class Component extends SvelteComponent {
constructor(options) {
diff --git a/test/js/samples/optional-chaining/expected.js b/test/js/samples/optional-chaining/expected.js
index 8aa94796c1..57369ddb72 100644
--- a/test/js/samples/optional-chaining/expected.js
+++ b/test/js/samples/optional-chaining/expected.js
@@ -23,9 +23,9 @@ function create_fragment(ctx) {
let t1_value = /*b*/ ctx[1]?.optional + "";
let t1;
let t2;
- let t3_value = /*c*/ ctx[2]["computed"] + "";
+ let t3_value = /*c*/ ctx[2]['computed'] + "";
let t3;
- let t4_value = /*d*/ ctx[3]?.["computed_optional"] + "";
+ let t4_value = /*d*/ ctx[3]?.['computed_optional'] + "";
let t4;
let t5;
let t6_value = /*e*/ ctx[4]() + "";
@@ -48,8 +48,8 @@ function create_fragment(ctx) {
props: {
a: /*a*/ ctx[0].normal,
b: /*b*/ ctx[1]?.optional,
- c: /*c*/ ctx[2]["computed"],
- d: /*d*/ ctx[3]?.["computed_optional"],
+ c: /*c*/ ctx[2]['computed'],
+ d: /*d*/ ctx[3]?.['computed_optional'],
e: /*e*/ ctx[4](),
f: /*f*/ ctx[5]?.()
}
@@ -71,8 +71,8 @@ function create_fragment(ctx) {
create_component(component.$$.fragment);
attr(div, "a", div_a_value = /*a*/ ctx[0].normal);
attr(div, "b", div_b_value = /*b*/ ctx[1]?.optional);
- attr(div, "c", div_c_value = /*c*/ ctx[2]["computed"]);
- attr(div, "d", div_d_value = /*d*/ ctx[3]?.["computed_optional"]);
+ attr(div, "c", div_c_value = /*c*/ ctx[2]['computed']);
+ attr(div, "d", div_d_value = /*d*/ ctx[3]?.['computed_optional']);
attr(div, "e", div_e_value = /*e*/ ctx[4]());
attr(div, "f", div_f_value = /*f*/ ctx[5]?.());
},
@@ -94,8 +94,8 @@ function create_fragment(ctx) {
p(ctx, [dirty]) {
if ((!current || dirty & /*a*/ 1) && t0_value !== (t0_value = /*a*/ ctx[0].normal + "")) set_data(t0, t0_value);
if ((!current || dirty & /*b*/ 2) && t1_value !== (t1_value = /*b*/ ctx[1]?.optional + "")) set_data(t1, t1_value);
- if ((!current || dirty & /*c*/ 4) && t3_value !== (t3_value = /*c*/ ctx[2]["computed"] + "")) set_data(t3, t3_value);
- if ((!current || dirty & /*d*/ 8) && t4_value !== (t4_value = /*d*/ ctx[3]?.["computed_optional"] + "")) set_data(t4, t4_value);
+ if ((!current || dirty & /*c*/ 4) && t3_value !== (t3_value = /*c*/ ctx[2]['computed'] + "")) set_data(t3, t3_value);
+ if ((!current || dirty & /*d*/ 8) && t4_value !== (t4_value = /*d*/ ctx[3]?.['computed_optional'] + "")) set_data(t4, t4_value);
if ((!current || dirty & /*e*/ 16) && t6_value !== (t6_value = /*e*/ ctx[4]() + "")) set_data(t6, t6_value);
if ((!current || dirty & /*f*/ 32) && t7_value !== (t7_value = /*f*/ ctx[5]?.() + "")) set_data(t7, t7_value);
@@ -107,11 +107,11 @@ function create_fragment(ctx) {
attr(div, "b", div_b_value);
}
- if (!current || dirty & /*c*/ 4 && div_c_value !== (div_c_value = /*c*/ ctx[2]["computed"])) {
+ if (!current || dirty & /*c*/ 4 && div_c_value !== (div_c_value = /*c*/ ctx[2]['computed'])) {
attr(div, "c", div_c_value);
}
- if (!current || dirty & /*d*/ 8 && div_d_value !== (div_d_value = /*d*/ ctx[3]?.["computed_optional"])) {
+ if (!current || dirty & /*d*/ 8 && div_d_value !== (div_d_value = /*d*/ ctx[3]?.['computed_optional'])) {
attr(div, "d", div_d_value);
}
@@ -126,8 +126,8 @@ function create_fragment(ctx) {
const component_changes = {};
if (dirty & /*a*/ 1) component_changes.a = /*a*/ ctx[0].normal;
if (dirty & /*b*/ 2) component_changes.b = /*b*/ ctx[1]?.optional;
- if (dirty & /*c*/ 4) component_changes.c = /*c*/ ctx[2]["computed"];
- if (dirty & /*d*/ 8) component_changes.d = /*d*/ ctx[3]?.["computed_optional"];
+ if (dirty & /*c*/ 4) component_changes.c = /*c*/ ctx[2]['computed'];
+ if (dirty & /*d*/ 8) component_changes.d = /*d*/ ctx[3]?.['computed_optional'];
if (dirty & /*e*/ 16) component_changes.e = /*e*/ ctx[4]();
if (dirty & /*f*/ 32) component_changes.f = /*f*/ ctx[5]?.();
component.$set(component_changes);
@@ -168,12 +168,12 @@ function instance($$self, $$props, $$invalidate) {
let Component;
$$self.$$set = $$props => {
- if ("a" in $$props) $$invalidate(0, a = $$props.a);
- if ("b" in $$props) $$invalidate(1, b = $$props.b);
- if ("c" in $$props) $$invalidate(2, c = $$props.c);
- if ("d" in $$props) $$invalidate(3, d = $$props.d);
- if ("e" in $$props) $$invalidate(4, e = $$props.e);
- if ("f" in $$props) $$invalidate(5, f = $$props.f);
+ if ('a' in $$props) $$invalidate(0, a = $$props.a);
+ if ('b' in $$props) $$invalidate(1, b = $$props.b);
+ if ('c' in $$props) $$invalidate(2, c = $$props.c);
+ if ('d' in $$props) $$invalidate(3, d = $$props.d);
+ if ('e' in $$props) $$invalidate(4, e = $$props.e);
+ if ('f' in $$props) $$invalidate(5, f = $$props.f);
};
return [a, b, c, d, e, f, Component];
diff --git a/test/js/samples/reactive-class-optimized/expected.js b/test/js/samples/reactive-class-optimized/expected.js
index b7c2c3a60b..1d0606ad60 100644
--- a/test/js/samples/reactive-class-optimized/expected.js
+++ b/test/js/samples/reactive-class-optimized/expected.js
@@ -13,7 +13,7 @@ import {
toggle_class
} from "svelte/internal";
-import { reactiveStoreVal, unreactiveExport } from "./store";
+import { reactiveStoreVal, unreactiveExport } from './store';
function create_fragment(ctx) {
let div0;
@@ -159,4 +159,4 @@ class Component extends SvelteComponent {
}
}
-export default Component;
+export default Component;
\ No newline at end of file
diff --git a/test/js/samples/reactive-values-non-topologically-ordered/expected.js b/test/js/samples/reactive-values-non-topologically-ordered/expected.js
index dbfd794dc7..82af20ee90 100644
--- a/test/js/samples/reactive-values-non-topologically-ordered/expected.js
+++ b/test/js/samples/reactive-values-non-topologically-ordered/expected.js
@@ -7,7 +7,7 @@ function instance($$self, $$props, $$invalidate) {
let b;
$$self.$$set = $$props => {
- if ("x" in $$props) $$invalidate(0, x = $$props.x);
+ if ('x' in $$props) $$invalidate(0, x = $$props.x);
};
$$self.$$.update = () => {
diff --git a/test/js/samples/reactive-values-non-writable-dependencies/expected.js b/test/js/samples/reactive-values-non-writable-dependencies/expected.js
index 5196a770d9..ca01bda65b 100644
--- a/test/js/samples/reactive-values-non-writable-dependencies/expected.js
+++ b/test/js/samples/reactive-values-non-writable-dependencies/expected.js
@@ -6,13 +6,13 @@ function instance($$self, $$props, $$invalidate) {
let { b = 2 } = $$props;
$$self.$$set = $$props => {
- if ("a" in $$props) $$invalidate(0, a = $$props.a);
- if ("b" in $$props) $$invalidate(1, b = $$props.b);
+ if ('a' in $$props) $$invalidate(0, a = $$props.a);
+ if ('b' in $$props) $$invalidate(1, b = $$props.b);
};
$$self.$$.update = () => {
if ($$self.$$.dirty & /*a, b*/ 3) {
- $: console.log("max", Math.max(a, b));
+ $: console.log('max', Math.max(a, b));
}
};
diff --git a/test/js/samples/select-dynamic-value/expected.js b/test/js/samples/select-dynamic-value/expected.js
index 8777cd2600..cd1ab1d812 100644
--- a/test/js/samples/select-dynamic-value/expected.js
+++ b/test/js/samples/select-dynamic-value/expected.js
@@ -51,7 +51,7 @@ function instance($$self, $$props, $$invalidate) {
let { current } = $$props;
$$self.$$set = $$props => {
- if ("current" in $$props) $$invalidate(0, current = $$props.current);
+ if ('current' in $$props) $$invalidate(0, current = $$props.current);
};
return [current];
diff --git a/test/js/samples/src-attribute-check-in-foreign/_config.js b/test/js/samples/src-attribute-check-in-foreign/_config.js
new file mode 100644
index 0000000000..af1bf11a52
--- /dev/null
+++ b/test/js/samples/src-attribute-check-in-foreign/_config.js
@@ -0,0 +1,5 @@
+export default {
+ options: {
+ hydratable: true
+ }
+};
diff --git a/test/js/samples/src-attribute-check-in-foreign/expected.js b/test/js/samples/src-attribute-check-in-foreign/expected.js
new file mode 100644
index 0000000000..2eb4c0713c
--- /dev/null
+++ b/test/js/samples/src-attribute-check-in-foreign/expected.js
@@ -0,0 +1,70 @@
+/* generated by Svelte vX.Y.Z */
+import {
+ SvelteComponent,
+ append_hydration,
+ attr,
+ children,
+ claim_element,
+ detach,
+ init,
+ insert_hydration,
+ noop,
+ safe_not_equal
+} from "svelte/internal";
+
+function create_fragment(ctx) {
+ let svg;
+ let img;
+
+ return {
+ c() {
+ svg = document.createElementNS("https://svelte.dev/docs#template-syntax-svelte-options", "svg");
+ img = document.createElementNS("https://svelte.dev/docs#template-syntax-svelte-options", "img");
+ this.h();
+ },
+ l(nodes) {
+ svg = claim_element(nodes, "svg", {});
+ var svg_nodes = children(svg);
+ img = claim_element(svg_nodes, "img", { alt: true, src: true });
+ svg_nodes.forEach(detach);
+ this.h();
+ },
+ h() {
+ attr(img, "alt", "potato");
+ attr(img, "src", /*url*/ ctx[0]);
+ },
+ m(target, anchor) {
+ insert_hydration(target, svg, anchor);
+ append_hydration(svg, img);
+ },
+ p(ctx, [dirty]) {
+ if (dirty & /*url*/ 1) {
+ attr(img, "src", /*url*/ ctx[0]);
+ }
+ },
+ i: noop,
+ o: noop,
+ d(detaching) {
+ if (detaching) detach(svg);
+ }
+ };
+}
+
+function instance($$self, $$props, $$invalidate) {
+ let { url } = $$props;
+
+ $$self.$$set = $$props => {
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
+ };
+
+ return [url];
+}
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance, create_fragment, safe_not_equal, { url: 0 });
+ }
+}
+
+export default Component;
diff --git a/test/js/samples/src-attribute-check-in-foreign/input.svelte b/test/js/samples/src-attribute-check-in-foreign/input.svelte
new file mode 100644
index 0000000000..6d04f0fa55
--- /dev/null
+++ b/test/js/samples/src-attribute-check-in-foreign/input.svelte
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
diff --git a/test/js/samples/src-attribute-check-in-svg/_config.js b/test/js/samples/src-attribute-check-in-svg/_config.js
new file mode 100644
index 0000000000..af1bf11a52
--- /dev/null
+++ b/test/js/samples/src-attribute-check-in-svg/_config.js
@@ -0,0 +1,5 @@
+export default {
+ options: {
+ hydratable: true
+ }
+};
diff --git a/test/js/samples/src-attribute-check-in-svg/expected.js b/test/js/samples/src-attribute-check-in-svg/expected.js
new file mode 100644
index 0000000000..551a23e50e
--- /dev/null
+++ b/test/js/samples/src-attribute-check-in-svg/expected.js
@@ -0,0 +1,71 @@
+/* generated by Svelte vX.Y.Z */
+import {
+ SvelteComponent,
+ append_hydration,
+ attr,
+ children,
+ claim_svg_element,
+ detach,
+ init,
+ insert_hydration,
+ noop,
+ safe_not_equal,
+ svg_element
+} from "svelte/internal";
+
+function create_fragment(ctx) {
+ let svg;
+ let img;
+
+ return {
+ c() {
+ svg = svg_element("svg");
+ img = svg_element("img");
+ this.h();
+ },
+ l(nodes) {
+ svg = claim_svg_element(nodes, "svg", {});
+ var svg_nodes = children(svg);
+ img = claim_svg_element(svg_nodes, "img", { alt: true, src: true });
+ svg_nodes.forEach(detach);
+ this.h();
+ },
+ h() {
+ attr(img, "alt", "potato");
+ attr(img, "src", /*url*/ ctx[0]);
+ },
+ m(target, anchor) {
+ insert_hydration(target, svg, anchor);
+ append_hydration(svg, img);
+ },
+ p(ctx, [dirty]) {
+ if (dirty & /*url*/ 1) {
+ attr(img, "src", /*url*/ ctx[0]);
+ }
+ },
+ i: noop,
+ o: noop,
+ d(detaching) {
+ if (detaching) detach(svg);
+ }
+ };
+}
+
+function instance($$self, $$props, $$invalidate) {
+ let { url } = $$props;
+
+ $$self.$$set = $$props => {
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
+ };
+
+ return [url];
+}
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance, create_fragment, safe_not_equal, { url: 0 });
+ }
+}
+
+export default Component;
diff --git a/test/js/samples/src-attribute-check-in-svg/input.svelte b/test/js/samples/src-attribute-check-in-svg/input.svelte
new file mode 100644
index 0000000000..05dbc37608
--- /dev/null
+++ b/test/js/samples/src-attribute-check-in-svg/input.svelte
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/test/js/samples/src-attribute-check/expected.js b/test/js/samples/src-attribute-check/expected.js
index 93638edfb4..10ff49bb81 100644
--- a/test/js/samples/src-attribute-check/expected.js
+++ b/test/js/samples/src-attribute-check/expected.js
@@ -7,10 +7,11 @@ import {
detach,
element,
init,
- insert,
+ insert_hydration,
noop,
safe_not_equal,
- space
+ space,
+ src_url_equal
} from "svelte/internal";
function create_fragment(ctx) {
@@ -35,21 +36,21 @@ function create_fragment(ctx) {
},
h() {
attr(img0, "alt", "potato");
- if (img0.src !== (img0_src_value = /*url*/ ctx[0])) attr(img0, "src", img0_src_value);
+ if (!src_url_equal(img0.src, img0_src_value = /*url*/ ctx[0])) attr(img0, "src", img0_src_value);
attr(img1, "alt", "potato");
- if (img1.src !== (img1_src_value = "" + (/*slug*/ ctx[1] + ".jpg"))) attr(img1, "src", img1_src_value);
+ if (!src_url_equal(img1.src, img1_src_value = "" + (/*slug*/ ctx[1] + ".jpg"))) attr(img1, "src", img1_src_value);
},
m(target, anchor) {
- insert(target, img0, anchor);
- insert(target, t, anchor);
- insert(target, img1, anchor);
+ insert_hydration(target, img0, anchor);
+ insert_hydration(target, t, anchor);
+ insert_hydration(target, img1, anchor);
},
p(ctx, [dirty]) {
- if (dirty & /*url*/ 1 && img0.src !== (img0_src_value = /*url*/ ctx[0])) {
+ if (dirty & /*url*/ 1 && !src_url_equal(img0.src, img0_src_value = /*url*/ ctx[0])) {
attr(img0, "src", img0_src_value);
}
- if (dirty & /*slug*/ 2 && img1.src !== (img1_src_value = "" + (/*slug*/ ctx[1] + ".jpg"))) {
+ if (dirty & /*slug*/ 2 && !src_url_equal(img1.src, img1_src_value = "" + (/*slug*/ ctx[1] + ".jpg"))) {
attr(img1, "src", img1_src_value);
}
},
@@ -68,8 +69,8 @@ function instance($$self, $$props, $$invalidate) {
let { slug } = $$props;
$$self.$$set = $$props => {
- if ("url" in $$props) $$invalidate(0, url = $$props.url);
- if ("slug" in $$props) $$invalidate(1, slug = $$props.slug);
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
+ if ('slug' in $$props) $$invalidate(1, slug = $$props.slug);
};
return [url, slug];
@@ -82,4 +83,4 @@ class Component extends SvelteComponent {
}
}
-export default Component;
\ No newline at end of file
+export default Component;
diff --git a/test/js/samples/ssr-no-oncreate-etc/expected.js b/test/js/samples/ssr-no-oncreate-etc/expected.js
index b91deb3e97..09ae6fd4a6 100644
--- a/test/js/samples/ssr-no-oncreate-etc/expected.js
+++ b/test/js/samples/ssr-no-oncreate-etc/expected.js
@@ -1,14 +1,14 @@
/* generated by Svelte vX.Y.Z */
import { create_ssr_component } from "svelte/internal";
-import { onDestroy, onMount } from "svelte";
+import { onDestroy, onMount } from 'svelte';
function preload(input) {
return output;
}
function foo() {
- console.log("foo");
+ console.log('foo');
}
function swipe(node, callback) {
@@ -17,11 +17,11 @@ function swipe(node, callback) {
const Component = create_ssr_component(($$result, $$props, $$bindings, slots) => {
onMount(() => {
- console.log("onMount");
+ console.log('onMount');
});
onDestroy(() => {
- console.log("onDestroy");
+ console.log('onDestroy');
});
return ``;
diff --git a/test/js/samples/ssr-preserve-comments/expected.js b/test/js/samples/ssr-preserve-comments/expected.js
index de9fa7582e..4f3326cec5 100644
--- a/test/js/samples/ssr-preserve-comments/expected.js
+++ b/test/js/samples/ssr-preserve-comments/expected.js
@@ -3,8 +3,8 @@ import { create_ssr_component } from "svelte/internal";
const Component = create_ssr_component(($$result, $$props, $$bindings, slots) => {
return `content
-
+
more content
`;
});
-export default Component;
\ No newline at end of file
+export default Component;
diff --git a/test/js/samples/title/expected.js b/test/js/samples/title/expected.js
index b10f569759..6385f36acc 100644
--- a/test/js/samples/title/expected.js
+++ b/test/js/samples/title/expected.js
@@ -23,7 +23,7 @@ function instance($$self, $$props, $$invalidate) {
let { custom } = $$props;
$$self.$$set = $$props => {
- if ("custom" in $$props) $$invalidate(0, custom = $$props.custom);
+ if ('custom' in $$props) $$invalidate(0, custom = $$props.custom);
};
return [custom];
diff --git a/test/js/samples/transition-local/expected.js b/test/js/samples/transition-local/expected.js
index ea3d9db3d7..1824ccb066 100644
--- a/test/js/samples/transition-local/expected.js
+++ b/test/js/samples/transition-local/expected.js
@@ -125,8 +125,8 @@ function instance($$self, $$props, $$invalidate) {
let { y } = $$props;
$$self.$$set = $$props => {
- if ("x" in $$props) $$invalidate(0, x = $$props.x);
- if ("y" in $$props) $$invalidate(1, y = $$props.y);
+ if ('x' in $$props) $$invalidate(0, x = $$props.x);
+ if ('y' in $$props) $$invalidate(1, y = $$props.y);
};
return [x, y];
diff --git a/test/js/samples/transition-repeated-outro/expected.js b/test/js/samples/transition-repeated-outro/expected.js
index 12483ab91a..a2cbedffea 100644
--- a/test/js/samples/transition-repeated-outro/expected.js
+++ b/test/js/samples/transition-repeated-outro/expected.js
@@ -14,7 +14,7 @@ import {
transition_out
} from "svelte/internal";
-import { fade } from "svelte/transition";
+import { fade } from 'svelte/transition';
function create_if_block(ctx) {
let div;
@@ -103,7 +103,7 @@ function instance($$self, $$props, $$invalidate) {
let { num = 1 } = $$props;
$$self.$$set = $$props => {
- if ("num" in $$props) $$invalidate(0, num = $$props.num);
+ if ('num' in $$props) $$invalidate(0, num = $$props.num);
};
return [num];
diff --git a/test/js/samples/unchanged-expression/expected.js b/test/js/samples/unchanged-expression/expected.js
index 673d5b6abc..48ae8131ff 100644
--- a/test/js/samples/unchanged-expression/expected.js
+++ b/test/js/samples/unchanged-expression/expected.js
@@ -69,14 +69,14 @@ function create_fragment(ctx) {
};
}
-let world1 = "world";
-let world2 = "world";
+let world1 = 'world';
+let world2 = 'world';
function instance($$self, $$props, $$invalidate) {
- const world3 = "world";
+ const world3 = 'world';
function foo() {
- $$invalidate(0, world3 = "svelte");
+ $$invalidate(0, world3 = 'svelte');
}
return [world3];
diff --git a/test/js/samples/unreferenced-state-not-invalidated/expected.js b/test/js/samples/unreferenced-state-not-invalidated/expected.js
index 53044c7ed6..8c238a8397 100644
--- a/test/js/samples/unreferenced-state-not-invalidated/expected.js
+++ b/test/js/samples/unreferenced-state-not-invalidated/expected.js
@@ -12,7 +12,7 @@ import {
text
} from "svelte/internal";
-import { onMount } from "svelte";
+import { onMount } from 'svelte';
function create_fragment(ctx) {
let p;
diff --git a/test/js/samples/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js
index d07411518e..8a45cb54c8 100644
--- a/test/js/samples/use-elements-as-anchors/expected.js
+++ b/test/js/samples/use-elements-as-anchors/expected.js
@@ -244,11 +244,11 @@ function instance($$self, $$props, $$invalidate) {
let { e } = $$props;
$$self.$$set = $$props => {
- if ("a" in $$props) $$invalidate(0, a = $$props.a);
- if ("b" in $$props) $$invalidate(1, b = $$props.b);
- if ("c" in $$props) $$invalidate(2, c = $$props.c);
- if ("d" in $$props) $$invalidate(3, d = $$props.d);
- if ("e" in $$props) $$invalidate(4, e = $$props.e);
+ if ('a' in $$props) $$invalidate(0, a = $$props.a);
+ if ('b' in $$props) $$invalidate(1, b = $$props.b);
+ if ('c' in $$props) $$invalidate(2, c = $$props.c);
+ if ('d' in $$props) $$invalidate(3, d = $$props.d);
+ if ('e' in $$props) $$invalidate(4, e = $$props.e);
};
return [a, b, c, d, e];
diff --git a/test/js/samples/video-bindings/expected.js b/test/js/samples/video-bindings/expected.js
index 8afa670bbb..020bab574c 100644
--- a/test/js/samples/video-bindings/expected.js
+++ b/test/js/samples/video-bindings/expected.js
@@ -94,10 +94,10 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("currentTime" in $$props) $$invalidate(0, currentTime = $$props.currentTime);
- if ("videoHeight" in $$props) $$invalidate(1, videoHeight = $$props.videoHeight);
- if ("videoWidth" in $$props) $$invalidate(2, videoWidth = $$props.videoWidth);
- if ("offsetWidth" in $$props) $$invalidate(3, offsetWidth = $$props.offsetWidth);
+ if ('currentTime' in $$props) $$invalidate(0, currentTime = $$props.currentTime);
+ if ('videoHeight' in $$props) $$invalidate(1, videoHeight = $$props.videoHeight);
+ if ('videoWidth' in $$props) $$invalidate(2, videoWidth = $$props.videoWidth);
+ if ('offsetWidth' in $$props) $$invalidate(3, offsetWidth = $$props.offsetWidth);
};
return [
diff --git a/test/js/samples/window-binding-scroll/expected.js b/test/js/samples/window-binding-scroll/expected.js
index 09a4d3737d..ae155d42bf 100644
--- a/test/js/samples/window-binding-scroll/expected.js
+++ b/test/js/samples/window-binding-scroll/expected.js
@@ -79,7 +79,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("y" in $$props) $$invalidate(0, y = $$props.y);
+ if ('y' in $$props) $$invalidate(0, y = $$props.y);
};
return [y, onwindowscroll];
diff --git a/test/parser/samples/attribute-class-directive/input.svelte b/test/parser/samples/attribute-class-directive/input.svelte
new file mode 100644
index 0000000000..629df2e29f
--- /dev/null
+++ b/test/parser/samples/attribute-class-directive/input.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/parser/samples/attribute-class-directive/output.json b/test/parser/samples/attribute-class-directive/output.json
new file mode 100644
index 0000000000..abb2e0c0be
--- /dev/null
+++ b/test/parser/samples/attribute-class-directive/output.json
@@ -0,0 +1,41 @@
+{
+ "html": {
+ "start": 0,
+ "end": 29,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 29,
+ "type": "Element",
+ "name": "div",
+ "attributes": [
+ {
+ "start": 5,
+ "end": 22,
+ "type": "Class",
+ "name": "foo",
+ "modifiers": [],
+ "expression": {
+ "type": "Identifier",
+ "start": 16,
+ "end": 21,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 16
+ },
+ "end": {
+ "line": 1,
+ "column": 21
+ }
+ },
+ "name": "isFoo"
+ }
+ }
+ ],
+ "children": []
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/parser/samples/attribute-curly-bracket/input.svelte b/test/parser/samples/attribute-curly-bracket/input.svelte
new file mode 100644
index 0000000000..4e40713771
--- /dev/null
+++ b/test/parser/samples/attribute-curly-bracket/input.svelte
@@ -0,0 +1 @@
+
diff --git a/test/parser/samples/attribute-curly-bracket/output.json b/test/parser/samples/attribute-curly-bracket/output.json
new file mode 100644
index 0000000000..7fa04859f3
--- /dev/null
+++ b/test/parser/samples/attribute-curly-bracket/output.json
@@ -0,0 +1,55 @@
+{
+ "html": {
+ "start": 0,
+ "end": 18,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 18,
+ "type": "Element",
+ "name": "input",
+ "attributes": [
+ {
+ "start": 7,
+ "end": 15,
+ "type": "Attribute",
+ "name": "foo",
+ "value": [
+ {
+ "start": 11,
+ "end": 12,
+ "type": "Text",
+ "raw": "a",
+ "data": "a"
+ },
+ {
+ "start": 12,
+ "end": 15,
+ "type": "MustacheTag",
+ "expression": {
+ "type": "Literal",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": 1,
+ "raw": "1"
+ }
+ }
+ ]
+ }
+ ],
+ "children": []
+ }
+ ]
+ }
+}
diff --git a/test/parser/samples/attribute-dynamic/output.json b/test/parser/samples/attribute-dynamic/output.json
index 28b9da1dea..4926b645ab 100644
--- a/test/parser/samples/attribute-dynamic/output.json
+++ b/test/parser/samples/attribute-dynamic/output.json
@@ -18,7 +18,7 @@
"value": [
{
"start": 12,
- "end": 20,
+ "end": 19,
"type": "Text",
"raw": "color: ",
"data": "color: "
@@ -80,4 +80,4 @@
}
]
}
-}
\ No newline at end of file
+}
diff --git a/test/parser/samples/attribute-empty-error/error.json b/test/parser/samples/attribute-empty-error/error.json
new file mode 100644
index 0000000000..8c004d34ed
--- /dev/null
+++ b/test/parser/samples/attribute-empty-error/error.json
@@ -0,0 +1,10 @@
+{
+ "code": "missing-attribute-value",
+ "message": "Expected value for the attribute",
+ "pos": 12,
+ "start": {
+ "character": 12,
+ "column": 12,
+ "line": 1
+ }
+}
\ No newline at end of file
diff --git a/test/parser/samples/attribute-empty-error/input.svelte b/test/parser/samples/attribute-empty-error/input.svelte
new file mode 100644
index 0000000000..ee1b8935f1
--- /dev/null
+++ b/test/parser/samples/attribute-empty-error/input.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/parser/samples/attribute-empty/input.svelte b/test/parser/samples/attribute-empty/input.svelte
new file mode 100644
index 0000000000..d500678c37
--- /dev/null
+++ b/test/parser/samples/attribute-empty/input.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/parser/samples/attribute-empty/output.json b/test/parser/samples/attribute-empty/output.json
new file mode 100644
index 0000000000..22420b9fda
--- /dev/null
+++ b/test/parser/samples/attribute-empty/output.json
@@ -0,0 +1,108 @@
+{
+ "html": {
+ "start": 0,
+ "end": 38,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 38,
+ "type": "Element",
+ "name": "div",
+ "attributes": [
+ {
+ "start": 5,
+ "end": 9,
+ "type": "Attribute",
+ "name": "a",
+ "value": [
+ {
+ "start": 8,
+ "end": 8,
+ "type": "Text",
+ "raw": "",
+ "data": ""
+ }
+ ]
+ },
+ {
+ "start": 10,
+ "end": 16,
+ "type": "Attribute",
+ "name": "b",
+ "value": [
+ {
+ "start": 12,
+ "end": 16,
+ "type": "MustacheTag",
+ "expression": {
+ "type": "Literal",
+ "start": 13,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": "",
+ "raw": "''"
+ }
+ }
+ ]
+ },
+ {
+ "start": 17,
+ "end": 21,
+ "type": "Attribute",
+ "name": "c",
+ "value": [
+ {
+ "start": 20,
+ "end": 20,
+ "type": "Text",
+ "raw": "",
+ "data": ""
+ }
+ ]
+ },
+ {
+ "start": 22,
+ "end": 30,
+ "type": "Attribute",
+ "name": "d",
+ "value": [
+ {
+ "start": 25,
+ "end": 29,
+ "type": "MustacheTag",
+ "expression": {
+ "type": "Literal",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": "",
+ "raw": "''"
+ }
+ }
+ ]
+ }
+ ],
+ "children": []
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/parser/samples/attribute-style-directive-shorthand/input.svelte b/test/parser/samples/attribute-style-directive-shorthand/input.svelte
new file mode 100644
index 0000000000..3e2c66f218
--- /dev/null
+++ b/test/parser/samples/attribute-style-directive-shorthand/input.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/parser/samples/attribute-style-directive-shorthand/output.json b/test/parser/samples/attribute-style-directive-shorthand/output.json
new file mode 100644
index 0000000000..d4e81b6e4b
--- /dev/null
+++ b/test/parser/samples/attribute-style-directive-shorthand/output.json
@@ -0,0 +1,31 @@
+{
+ "html": {
+ "start": 0,
+ "end": 23,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 23,
+ "type": "Element",
+ "name": "div",
+ "attributes": [
+ {
+ "start": 5,
+ "end": 16,
+ "type": "Style",
+ "name": "color",
+ "modifiers": [],
+ "expression": {
+ "start": 11,
+ "end": 16,
+ "name": "color",
+ "type": "Identifier"
+ }
+ }
+ ],
+ "children": []
+ }
+ ]
+ }
+}
diff --git a/test/parser/samples/attribute-style-directive-string/input.svelte b/test/parser/samples/attribute-style-directive-string/input.svelte
new file mode 100644
index 0000000000..b2eb6bfef8
--- /dev/null
+++ b/test/parser/samples/attribute-style-directive-string/input.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/parser/samples/attribute-style-directive-string/output.json b/test/parser/samples/attribute-style-directive-string/output.json
new file mode 100644
index 0000000000..4cf2bd30c2
--- /dev/null
+++ b/test/parser/samples/attribute-style-directive-string/output.json
@@ -0,0 +1,39 @@
+{
+ "html": {
+ "start": 0,
+ "end": 29,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 29,
+ "type": "Element",
+ "name": "div",
+ "attributes": [
+ {
+ "start": 5,
+ "end": 22,
+ "type": "Style",
+ "name": "color",
+ "modifiers": [],
+ "expression": {
+ "type": "TemplateLiteral",
+ "expressions": [],
+ "quasis": [
+ {
+ "type": "TemplateElement",
+ "value": {
+ "raw": "red",
+ "cooked": null
+ },
+ "tail": true
+ }
+ ]
+ }
+ }
+ ],
+ "children": []
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/parser/samples/attribute-style-directive/input.svelte b/test/parser/samples/attribute-style-directive/input.svelte
new file mode 100644
index 0000000000..536d162326
--- /dev/null
+++ b/test/parser/samples/attribute-style-directive/input.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/parser/samples/attribute-style-directive/output.json b/test/parser/samples/attribute-style-directive/output.json
new file mode 100644
index 0000000000..36906045ce
--- /dev/null
+++ b/test/parser/samples/attribute-style-directive/output.json
@@ -0,0 +1,41 @@
+{
+ "html": {
+ "start": 0,
+ "end": 33,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 33,
+ "type": "Element",
+ "name": "div",
+ "attributes": [
+ {
+ "start": 5,
+ "end": 26,
+ "type": "Style",
+ "name": "color",
+ "modifiers": [],
+ "expression": {
+ "type": "Identifier",
+ "start": 18,
+ "end": 25,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 18
+ },
+ "end": {
+ "line": 1,
+ "column": 25
+ }
+ },
+ "name": "myColor"
+ }
+ }
+ ],
+ "children": []
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/parser/samples/attribute-style/input.svelte b/test/parser/samples/attribute-style/input.svelte
new file mode 100644
index 0000000000..12872605ad
--- /dev/null
+++ b/test/parser/samples/attribute-style/input.svelte
@@ -0,0 +1 @@
+red
\ No newline at end of file
diff --git a/test/parser/samples/attribute-style/output.json b/test/parser/samples/attribute-style/output.json
new file mode 100644
index 0000000000..95c0c8a7a4
--- /dev/null
+++ b/test/parser/samples/attribute-style/output.json
@@ -0,0 +1,41 @@
+{
+ "html": {
+ "start": 0,
+ "end": 34,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 34,
+ "type": "Element",
+ "name": "div",
+ "attributes": [
+ {
+ "start": 5,
+ "end": 24,
+ "type": "Attribute",
+ "name": "style",
+ "value": [
+ {
+ "start": 12,
+ "end": 23,
+ "type": "Text",
+ "raw": "color: red;",
+ "data": "color: red;"
+ }
+ ]
+ }
+ ],
+ "children": [
+ {
+ "start": 25,
+ "end": 28,
+ "type": "Text",
+ "raw": "red",
+ "data": "red"
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/parser/samples/comment-with-ignores/input.svelte b/test/parser/samples/comment-with-ignores/input.svelte
new file mode 100644
index 0000000000..c4fcec5e50
--- /dev/null
+++ b/test/parser/samples/comment-with-ignores/input.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/parser/samples/comment-with-ignores/output.json b/test/parser/samples/comment-with-ignores/output.json
new file mode 100644
index 0000000000..2705ec6658
--- /dev/null
+++ b/test/parser/samples/comment-with-ignores/output.json
@@ -0,0 +1,16 @@
+{
+ "html": {
+ "start": 0,
+ "end": 30,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 30,
+ "type": "Comment",
+ "data": " svelte-ignore foo bar ",
+ "ignores": ["foo", "bar"]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/parser/samples/comment/output.json b/test/parser/samples/comment/output.json
index 2a57c4fa5d..097fe994cf 100644
--- a/test/parser/samples/comment/output.json
+++ b/test/parser/samples/comment/output.json
@@ -8,7 +8,8 @@
"start": 0,
"end": 18,
"type": "Comment",
- "data": " a comment "
+ "data": " a comment ",
+ "ignores": []
}
]
}
diff --git a/test/parser/samples/element-with-attribute-empty-string/input.svelte b/test/parser/samples/element-with-attribute-empty-string/input.svelte
new file mode 100644
index 0000000000..685c0995d5
--- /dev/null
+++ b/test/parser/samples/element-with-attribute-empty-string/input.svelte
@@ -0,0 +1,2 @@
+
+
diff --git a/test/parser/samples/element-with-attribute-empty-string/output.json b/test/parser/samples/element-with-attribute-empty-string/output.json
new file mode 100644
index 0000000000..8e8768eb62
--- /dev/null
+++ b/test/parser/samples/element-with-attribute-empty-string/output.json
@@ -0,0 +1,64 @@
+{
+ "html": {
+ "start": 0,
+ "end": 43,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 21,
+ "type": "Element",
+ "name": "span",
+ "attributes": [
+ {
+ "start": 6,
+ "end": 13,
+ "type": "Attribute",
+ "name": "attr",
+ "value": [
+ {
+ "start": 12,
+ "end": 12,
+ "type": "Text",
+ "raw": "",
+ "data": ""
+ }
+ ]
+ }
+ ],
+ "children": []
+ },
+ {
+ "start": 21,
+ "end": 22,
+ "type": "Text",
+ "raw": "\n",
+ "data": "\n"
+ },
+ {
+ "start": 22,
+ "end": 43,
+ "type": "Element",
+ "name": "span",
+ "attributes": [
+ {
+ "start": 28,
+ "end": 35,
+ "type": "Attribute",
+ "name": "attr",
+ "value": [
+ {
+ "start": 34,
+ "end": 34,
+ "type": "Text",
+ "raw": "",
+ "data": ""
+ }
+ ]
+ }
+ ],
+ "children": []
+ }
+ ]
+ }
+}
diff --git a/test/parser/samples/element-with-attribute/input.svelte b/test/parser/samples/element-with-attribute/input.svelte
new file mode 100644
index 0000000000..f564fd0541
--- /dev/null
+++ b/test/parser/samples/element-with-attribute/input.svelte
@@ -0,0 +1,2 @@
+
+
diff --git a/test/parser/samples/element-with-attribute/output.json b/test/parser/samples/element-with-attribute/output.json
new file mode 100644
index 0000000000..a80344101e
--- /dev/null
+++ b/test/parser/samples/element-with-attribute/output.json
@@ -0,0 +1,64 @@
+{
+ "html": {
+ "start": 0,
+ "end": 49,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 24,
+ "type": "Element",
+ "name": "span",
+ "attributes": [
+ {
+ "start": 6,
+ "end": 16,
+ "type": "Attribute",
+ "name": "attr",
+ "value": [
+ {
+ "start": 12,
+ "end": 15,
+ "type": "Text",
+ "raw": "foo",
+ "data": "foo"
+ }
+ ]
+ }
+ ],
+ "children": []
+ },
+ {
+ "start": 24,
+ "end": 25,
+ "type": "Text",
+ "raw": "\n",
+ "data": "\n"
+ },
+ {
+ "start": 25,
+ "end": 49,
+ "type": "Element",
+ "name": "span",
+ "attributes": [
+ {
+ "start": 31,
+ "end": 41,
+ "type": "Attribute",
+ "name": "attr",
+ "value": [
+ {
+ "start": 37,
+ "end": 40,
+ "type": "Text",
+ "raw": "bar",
+ "data": "bar"
+ }
+ ]
+ }
+ ],
+ "children": []
+ }
+ ]
+ }
+}
diff --git a/test/parser/samples/error-comment-unclosed/error.json b/test/parser/samples/error-comment-unclosed/error.json
index 8e355fb821..95fa28c35a 100644
--- a/test/parser/samples/error-comment-unclosed/error.json
+++ b/test/parser/samples/error-comment-unclosed/error.json
@@ -1,5 +1,5 @@
{
- "code": "unexpected-eof",
+ "code": "unclosed-comment",
"message": "comment was left open, expected -->",
"start": {
"line": 1,
diff --git a/test/parser/samples/error-empty-attribute-shorthand/error.json b/test/parser/samples/error-empty-attribute-shorthand/error.json
new file mode 100644
index 0000000000..f465b3468a
--- /dev/null
+++ b/test/parser/samples/error-empty-attribute-shorthand/error.json
@@ -0,0 +1,10 @@
+{
+ "code": "empty-attribute-shorthand",
+ "message": "Attribute shorthand cannot be empty",
+ "start": {
+ "line": 1,
+ "column": 6,
+ "character": 6
+ },
+ "pos": 6
+}
\ No newline at end of file
diff --git a/test/parser/samples/error-empty-attribute-shorthand/input.svelte b/test/parser/samples/error-empty-attribute-shorthand/input.svelte
new file mode 100644
index 0000000000..2e137c8c6d
--- /dev/null
+++ b/test/parser/samples/error-empty-attribute-shorthand/input.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/parser/samples/error-empty-classname-binding/error.json b/test/parser/samples/error-empty-classname-binding/error.json
index edc09ff8e1..6ece5ff373 100644
--- a/test/parser/samples/error-empty-classname-binding/error.json
+++ b/test/parser/samples/error-empty-classname-binding/error.json
@@ -1,6 +1,6 @@
{
- "code": "invalid-class-directive",
- "message": "Class binding name cannot be empty",
+ "code": "empty-directive-name",
+ "message": "Class name cannot be empty",
"start": {
"line": 1,
"column": 10,
diff --git a/test/parser/samples/error-empty-directive-name/error.json b/test/parser/samples/error-empty-directive-name/error.json
new file mode 100644
index 0000000000..4fed0d8606
--- /dev/null
+++ b/test/parser/samples/error-empty-directive-name/error.json
@@ -0,0 +1,10 @@
+{
+ "code": "empty-directive-name",
+ "message": "Action name cannot be empty",
+ "start": {
+ "line": 1,
+ "column": 8,
+ "character": 8
+ },
+ "pos": 8
+}
diff --git a/test/parser/samples/error-empty-directive-name/input.svelte b/test/parser/samples/error-empty-directive-name/input.svelte
new file mode 100644
index 0000000000..b07875f398
--- /dev/null
+++ b/test/parser/samples/error-empty-directive-name/input.svelte
@@ -0,0 +1 @@
+Hello
diff --git a/test/parser/samples/error-script-unclosed-eof/error.json b/test/parser/samples/error-script-unclosed-eof/error.json
new file mode 100644
index 0000000000..277acd4196
--- /dev/null
+++ b/test/parser/samples/error-script-unclosed-eof/error.json
@@ -0,0 +1,10 @@
+{
+ "code": "unclosed-script",
+ "message": "
+
+Hello {name}!
\ No newline at end of file
diff --git a/test/parser/samples/whitespace-after-script-tag/output.json b/test/parser/samples/whitespace-after-script-tag/output.json
new file mode 100644
index 0000000000..903c392685
--- /dev/null
+++ b/test/parser/samples/whitespace-after-script-tag/output.json
@@ -0,0 +1,150 @@
+{
+ "html": {
+ "start": 51,
+ "end": 73,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 49,
+ "end": 51,
+ "type": "Text",
+ "raw": "\n\n",
+ "data": "\n\n"
+ },
+ {
+ "start": 51,
+ "end": 73,
+ "type": "Element",
+ "name": "h1",
+ "attributes": [],
+ "children": [
+ {
+ "start": 55,
+ "end": 61,
+ "type": "Text",
+ "raw": "Hello ",
+ "data": "Hello "
+ },
+ {
+ "start": 61,
+ "end": 67,
+ "type": "MustacheTag",
+ "expression": {
+ "type": "Identifier",
+ "start": 62,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 11
+ },
+ "end": {
+ "line": 10,
+ "column": 15
+ }
+ },
+ "name": "name"
+ }
+ },
+ {
+ "start": 67,
+ "end": 68,
+ "type": "Text",
+ "raw": "!",
+ "data": "!"
+ }
+ ]
+ }
+ ]
+ },
+ "instance": {
+ "type": "Script",
+ "start": 0,
+ "end": 49,
+ "context": "default",
+ "content": {
+ "type": "Program",
+ "start": 8,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 10,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 1
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 14,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "name": "name"
+ },
+ "init": {
+ "type": "Literal",
+ "start": 21,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "world",
+ "raw": "'world'"
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "sourceType": "module"
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/parser/samples/whitespace-after-style-tag/input.svelte b/test/parser/samples/whitespace-after-style-tag/input.svelte
new file mode 100644
index 0000000000..ae4277b697
--- /dev/null
+++ b/test/parser/samples/whitespace-after-style-tag/input.svelte
@@ -0,0 +1,12 @@
+foo
+
+
\ No newline at end of file
diff --git a/test/parser/samples/whitespace-after-style-tag/output.json b/test/parser/samples/whitespace-after-style-tag/output.json
new file mode 100644
index 0000000000..5eee81f034
--- /dev/null
+++ b/test/parser/samples/whitespace-after-style-tag/output.json
@@ -0,0 +1,97 @@
+{
+ "html": {
+ "start": 0,
+ "end": 14,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 14,
+ "type": "Element",
+ "name": "div",
+ "attributes": [],
+ "children": [
+ {
+ "start": 5,
+ "end": 8,
+ "type": "Text",
+ "raw": "foo",
+ "data": "foo"
+ }
+ ]
+ },
+ {
+ "start": 14,
+ "end": 16,
+ "type": "Text",
+ "raw": "\n\n",
+ "data": "\n\n"
+ }
+ ]
+ },
+ "css": {
+ "type": "Style",
+ "start": 16,
+ "end": 66,
+ "attributes": [],
+ "children": [
+ {
+ "type": "Rule",
+ "prelude": {
+ "type": "SelectorList",
+ "children": [
+ {
+ "type": "Selector",
+ "children": [
+ {
+ "type": "TypeSelector",
+ "name": "div",
+ "start": 25,
+ "end": 28
+ }
+ ],
+ "start": 25,
+ "end": 28
+ }
+ ],
+ "start": 25,
+ "end": 28
+ },
+ "block": {
+ "type": "Block",
+ "children": [
+ {
+ "type": "Declaration",
+ "important": false,
+ "property": "color",
+ "value": {
+ "type": "Value",
+ "children": [
+ {
+ "type": "Identifier",
+ "name": "red",
+ "start": 40,
+ "end": 43
+ }
+ ],
+ "start": 40,
+ "end": 43
+ },
+ "start": 33,
+ "end": 43
+ }
+ ],
+ "start": 29,
+ "end": 47
+ },
+ "start": 25,
+ "end": 47
+ }
+ ],
+ "content": {
+ "start": 23,
+ "end": 48,
+ "styles": "\n\tdiv {\n\t\tcolor: red;\n\t}\n"
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/preprocess/samples/empty-sourcemap/_config.js b/test/preprocess/samples/empty-sourcemap/_config.js
new file mode 100644
index 0000000000..941661ce01
--- /dev/null
+++ b/test/preprocess/samples/empty-sourcemap/_config.js
@@ -0,0 +1,7 @@
+export default {
+ preprocess: {
+ style: ({ content }) => {
+ return { code: content, map: { mappings: '' } };
+ }
+ }
+};
diff --git a/test/preprocess/samples/empty-sourcemap/input.svelte b/test/preprocess/samples/empty-sourcemap/input.svelte
new file mode 100644
index 0000000000..d2380c00cb
--- /dev/null
+++ b/test/preprocess/samples/empty-sourcemap/input.svelte
@@ -0,0 +1,7 @@
+bar
+
+
\ No newline at end of file
diff --git a/test/preprocess/samples/empty-sourcemap/output.svelte b/test/preprocess/samples/empty-sourcemap/output.svelte
new file mode 100644
index 0000000000..d2380c00cb
--- /dev/null
+++ b/test/preprocess/samples/empty-sourcemap/output.svelte
@@ -0,0 +1,7 @@
+bar
+
+
\ No newline at end of file
diff --git a/test/runtime-puppeteer/assert.js b/test/runtime-puppeteer/assert.js
new file mode 100644
index 0000000000..4ee8d9dda0
--- /dev/null
+++ b/test/runtime-puppeteer/assert.js
@@ -0,0 +1,54 @@
+export function deepEqual(a, b, message) {
+ if (!is_equal(a, b)) {
+ throw new Error(message || `Expected ${JSON.stringify(a)} to equal ${JSON.stringify(b)}`);
+ }
+}
+
+function is_equal(a, b) {
+ if (a && typeof a === 'object') {
+ const is_array = Array.isArray(a);
+ if (Array.isArray(b) !== is_array) return false;
+
+ if (is_array) {
+ if (a.length !== b.length) return false;
+ return a.every((value, i) => is_equal(value, b[i]));
+ }
+
+ const a_keys = Object.keys(a).sort();
+ const b_keys = Object.keys(b).sort();
+ if (a_keys.join(',') !== b_keys.join(',')) return false;
+
+ return a_keys.every(key => is_equal(a[key], b[key]));
+ }
+
+ return a === b;
+}
+
+export function equal(a, b, message) {
+ if (a != b) throw new Error(message || `Expected ${a} to equal ${b}`);
+}
+
+export function ok(condition, message) {
+ if (!condition) throw new Error(message || `Expected ${condition} to be truthy`);
+}
+
+export function htmlEqual(actual, expected, message) {
+ return deepEqual(
+ normalizeHtml(window, actual),
+ normalizeHtml(window, expected),
+ message
+ );
+}
+
+function normalizeHtml(window, html) {
+ try {
+ const node = window.document.createElement('div');
+ node.innerHTML = html
+ .replace(//g, '')
+ .replace(/>[\s\r\n]+<')
+ .trim();
+ return node.innerHTML.replace(/<\/?noscript\/?>/g, '');
+ } catch (err) {
+ throw new Error(`Failed to normalize HTML:\n${html}`);
+ }
+}
diff --git a/test/runtime-puppeteer/index.ts b/test/runtime-puppeteer/index.ts
new file mode 100644
index 0000000000..8e6f813de4
--- /dev/null
+++ b/test/runtime-puppeteer/index.ts
@@ -0,0 +1,248 @@
+import * as path from 'path';
+import * as fs from 'fs';
+import * as http from 'http';
+import { rollup } from 'rollup';
+import virtual from '@rollup/plugin-virtual';
+import puppeteer from 'puppeteer';
+
+import {
+ loadConfig,
+ loadSvelte,
+ mkdirp,
+ prettyPrintPuppeteerAssertionError,
+ retryAsync,
+ executeBrowserTest
+} from '../helpers';
+import { deepEqual } from 'assert';
+
+const page = `
+
+
+
+
+`;
+
+let svelte;
+let server;
+let code;
+let browser;
+
+const internal = path.resolve('internal/index.mjs');
+const index = path.resolve('index.mjs');
+
+function create_server() {
+ return new Promise((fulfil, reject) => {
+ const server = http.createServer((req, res) => {
+ if (req.url === '/') {
+ res.end(page);
+ }
+
+ if (req.url === '/bundle.js') {
+ res.end(code);
+ }
+ });
+
+ server.on('error', reject);
+
+ server.listen('6789', () => {
+ fulfil(server);
+ });
+ });
+}
+
+async function launchPuppeteer() {
+ return await retryAsync(() => puppeteer.launch());
+}
+
+const assert = fs.readFileSync(`${__dirname}/assert.js`, 'utf-8');
+
+describe('runtime (puppeteer)', function() {
+ // Note: Increase the timeout in preparation for restarting Chromium due to SIGSEGV.
+ this.timeout(10000);
+ before(async () => {
+ svelte = loadSvelte(false);
+ console.log('[runtime-puppeteer] Loaded Svelte');
+ server = await create_server();
+ console.log('[runtime-puppeteer] Started server');
+ browser = await launchPuppeteer();
+ console.log('[runtime-puppeteer] Launched puppeteer browser');
+ });
+
+ after(async () => {
+ if (server) server.close();
+ if (browser) await browser.close();
+ });
+
+ const failed = new Set();
+
+ function runTest(dir, hydrate) {
+ if (dir[0] === '.') return;
+
+ const config = loadConfig(`${__dirname}/samples/${dir}/_config.js`);
+ const solo = config.solo || /\.solo/.test(dir);
+ const skip = config.skip || /\.skip/.test(dir);
+
+ if (hydrate && config.skip_if_hydrate) return;
+
+ if (solo && process.env.CI) {
+ throw new Error('Forgot to remove `solo: true` from test');
+ }
+
+ (skip ? it.skip : solo ? it.only : it)(`${dir} ${hydrate ? '(with hydration)' : ''}`, async () => {
+ if (failed.has(dir)) {
+ // this makes debugging easier, by only printing compiled output once
+ throw new Error('skipping test, already failed');
+ }
+
+ const warnings = [];
+
+ const bundle = await rollup({
+ input: 'main',
+ plugins: [
+ {
+ name: 'testing-runtime-puppeteer',
+ resolveId(importee) {
+ if (importee === 'svelte/internal' || importee === './internal') {
+ return internal;
+ }
+
+ if (importee === 'svelte') {
+ return index;
+ }
+
+ if (importee === 'main') {
+ return 'main';
+ }
+ },
+ load(id) {
+ if (id === 'main') {
+ return `
+ import SvelteComponent from ${JSON.stringify(path.join(__dirname, 'samples', dir, 'main.svelte'))};
+ import config from ${JSON.stringify(path.join(__dirname, 'samples', dir, '_config.js'))};
+ import * as assert from 'assert';
+
+ export default async function (target) {
+ let unhandled_rejection = false;
+ function unhandled_rejection_handler(event) {
+ unhandled_rejection = event.reason;
+ }
+ window.addEventListener('unhandledrejection', unhandled_rejection_handler);
+
+ try {
+ if (config.before_test) config.before_test();
+
+ const options = Object.assign({}, {
+ target,
+ hydrate: ${String(!!hydrate)},
+ props: config.props,
+ intro: config.intro
+ }, config.options || {});
+
+ const component = new SvelteComponent(options);
+
+ if (config.html) {
+ assert.htmlEqual(target.innerHTML, config.html);
+ }
+
+ if (config.test) {
+ await config.test({
+ assert,
+ component,
+ target,
+ window,
+ });
+
+ component.$destroy();
+
+ if (unhandled_rejection) {
+ throw unhandled_rejection;
+ }
+ } else {
+ component.$destroy();
+ assert.htmlEqual(target.innerHTML, '');
+
+ if (unhandled_rejection) {
+ throw unhandled_rejection;
+ }
+ }
+
+ if (config.after_test) config.after_test();
+ } catch (error) {
+ if (config.error) {
+ assert.equal(err.message, config.error);
+ } else {
+ throw error;
+ }
+ } finally {
+ window.removeEventListener('unhandledrejection', unhandled_rejection_handler);
+ }
+ }
+ `;
+ }
+ return null;
+ },
+ transform(code, id) {
+ if (id.endsWith('.svelte')) {
+ const compiled = svelte.compile(code.replace(/\r/g, ''), {
+ ...config.compileOptions,
+ hydratable: hydrate,
+ immutable: config.immutable,
+ accessors: 'accessors' in config ? config.accessors : true
+ });
+
+ const out_dir = `${__dirname}/samples/${dir}/_output/${hydrate ? 'hydratable' : 'normal'}`;
+ const out = `${out_dir}/${path.basename(id).replace(/\.svelte$/, '.js')}`;
+
+ if (fs.existsSync(out)) {
+ fs.unlinkSync(out);
+ }
+
+ mkdirp(out_dir);
+ fs.writeFileSync(out, compiled.js.code, 'utf8');
+
+ compiled.warnings.forEach(w => warnings.push(w));
+
+ return compiled.js;
+ }
+ }
+ },
+ virtual({ assert })
+ ]
+ });
+
+ const result = await bundle.generate({ format: 'iife', name: 'test' });
+ code = result.output[0].code;
+
+ function assertWarnings() {
+ if (config.warnings) {
+ deepEqual(warnings.map(w => ({
+ code: w.code,
+ message: w.message,
+ pos: w.pos,
+ start: w.start,
+ end: w.end
+ })), config.warnings);
+ } else if (warnings.length) {
+ failed.add(dir);
+ /* eslint-disable no-unsafe-finally */
+ throw new Error('Received unexpected warnings');
+ }
+ }
+
+ browser = await executeBrowserTest(
+ browser,
+ launchPuppeteer,
+ assertWarnings,
+ (err) => {
+ failed.add(dir);
+ prettyPrintPuppeteerAssertionError(err.message);
+ assertWarnings();
+ });
+ });
+ }
+
+ fs.readdirSync(`${__dirname}/samples`).forEach(dir => {
+ runTest(dir, false);
+ runTest(dir, true);
+ });
+});
diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/Slider.svelte b/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/Slider.svelte
new file mode 100644
index 0000000000..4863966f85
--- /dev/null
+++ b/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/Slider.svelte
@@ -0,0 +1,17 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/_config.js b/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/_config.js
new file mode 100644
index 0000000000..96965c223b
--- /dev/null
+++ b/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/_config.js
@@ -0,0 +1,41 @@
+export default {
+ props: {
+ railColor1: 'black',
+ trackColor1: 'red',
+ railColor2: 'green',
+ trackColor2: 'blue'
+ },
+ html: `
+
+
+ `,
+ test({ component, assert, target }) {
+ component.railColor1 = 'yellow';
+ component.trackColor2 = 'orange';
+
+ assert.htmlEqual(target.innerHTML, `
+
+
+ `);
+ }
+};
diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/main.svelte b/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/main.svelte
new file mode 100644
index 0000000000..94e68e38a2
--- /dev/null
+++ b/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/main.svelte
@@ -0,0 +1,23 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties/Slider.svelte b/test/runtime-puppeteer/samples/component-css-custom-properties/Slider.svelte
new file mode 100644
index 0000000000..4863966f85
--- /dev/null
+++ b/test/runtime-puppeteer/samples/component-css-custom-properties/Slider.svelte
@@ -0,0 +1,17 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties/_config.js b/test/runtime-puppeteer/samples/component-css-custom-properties/_config.js
new file mode 100644
index 0000000000..9c3b7cbdea
--- /dev/null
+++ b/test/runtime-puppeteer/samples/component-css-custom-properties/_config.js
@@ -0,0 +1,27 @@
+export default {
+ html: `
+
+
+ `,
+ test({ target, window, assert }) {
+ const railColor1 = target.querySelector('#slider-1 p');
+ const trackColor1 = target.querySelector('#slider-1 span');
+ const railColor2 = target.querySelector('#slider-2 p');
+ const trackColor2 = target.querySelector('#slider-2 span');
+
+ assert.htmlEqual(window.getComputedStyle(railColor1).color, 'rgb(0, 0, 0)');
+ assert.htmlEqual(window.getComputedStyle(trackColor1).color, 'rgb(255, 0, 0)');
+ assert.htmlEqual(window.getComputedStyle(railColor2).color, 'rgb(0, 255, 0)');
+ assert.htmlEqual(window.getComputedStyle(trackColor2).color, 'rgb(0, 0, 255)');
+ }
+};
diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties/main.svelte b/test/runtime-puppeteer/samples/component-css-custom-properties/main.svelte
new file mode 100644
index 0000000000..0d92b7ae87
--- /dev/null
+++ b/test/runtime-puppeteer/samples/component-css-custom-properties/main.svelte
@@ -0,0 +1,15 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime/index.ts b/test/runtime/index.ts
index 153ac9dbb8..4fc3880208 100644
--- a/test/runtime/index.ts
+++ b/test/runtime/index.ts
@@ -25,12 +25,13 @@ let compile = null;
const sveltePath = process.cwd().split('\\').join('/');
let unhandled_rejection = false;
-process.on('unhandledRejection', err => {
+function unhandledRejection_handler(err) {
unhandled_rejection = err;
-});
+}
describe('runtime', () => {
before(() => {
+ process.on('unhandledRejection', unhandledRejection_handler);
svelte = loadSvelte(false);
svelte$ = loadSvelte(true);
@@ -46,22 +47,25 @@ describe('runtime', () => {
return setupHtmlEqual();
});
+ after(() => process.removeListener('unhandledRejection', unhandledRejection_handler));
const failed = new Set();
- function runTest(dir, hydrate) {
+ function runTest(dir, hydrate, from_ssr_html) {
if (dir[0] === '.') return;
const config = loadConfig(`${__dirname}/samples/${dir}/_config.js`);
const solo = config.solo || /\.solo/.test(dir);
if (hydrate && config.skip_if_hydrate) return;
+ if (hydrate && from_ssr_html && config.skip_if_hydrate_from_ssr) return;
if (solo && process.env.CI) {
throw new Error('Forgot to remove `solo: true` from test');
}
- (config.skip ? it.skip : solo ? it.only : it)(`${dir} ${hydrate ? '(with hydration)' : ''}`, () => {
+ const testName = `${dir} ${hydrate ? `(with hydration${from_ssr_html ? ' from ssr rendered html' : ''})` : ''}`;
+ (config.skip ? it.skip : solo ? it.only : it)(testName, (done) => {
if (failed.has(dir)) {
// this makes debugging easier, by only printing compiled output once
throw new Error('skipping test, already failed');
@@ -92,7 +96,7 @@ describe('runtime', () => {
glob('**/*.svelte', { cwd }).forEach(file => {
if (file[0] === '_') return;
- const dir = `${cwd}/_output/${hydrate ? 'hydratable' : 'normal'}`;
+ const dir = `${cwd}/_output/${hydrate ? 'hydratable' : 'normal'}`;
const out = `${dir}/${file.replace(/\.svelte$/, '.js')}`;
if (fs.existsSync(out)) {
@@ -116,7 +120,7 @@ describe('runtime', () => {
}
});
- return Promise.resolve()
+ Promise.resolve()
.then(() => {
// hack to support transition tests
clear_loops();
@@ -146,13 +150,25 @@ describe('runtime', () => {
throw err;
}
- if (config.before_test) config.before_test();
-
// Put things we need on window for testing
window.SvelteComponent = SvelteComponent;
const target = window.document.querySelector('main');
+ if (hydrate && from_ssr_html) {
+ // ssr into target
+ compileOptions.generate = 'ssr';
+ cleanRequireCache();
+ const SsrSvelteComponent = require(`./samples/${dir}/main.svelte`).default;
+ const { html } = SsrSvelteComponent.render(config.props);
+ target.innerHTML = html;
+ delete compileOptions.generate;
+ } else {
+ target.innerHTML = '';
+ }
+
+ if (config.before_test) config.before_test();
+
const warnings = [];
const warn = console.warn;
console.warn = warning => {
@@ -229,6 +245,7 @@ describe('runtime', () => {
.catch(err => {
// print a clickable link to open the directory
err.stack += `\n\ncmd-click: ${path.relative(process.cwd(), cwd)}/main.svelte`;
+ done();
throw err;
})
.then(() => {
@@ -239,13 +256,15 @@ describe('runtime', () => {
flush();
if (config.after_test) config.after_test();
+ done();
});
});
}
fs.readdirSync(`${__dirname}/samples`).forEach(dir => {
runTest(dir, false);
- runTest(dir, true);
+ runTest(dir, true, false);
+ runTest(dir, true, true);
});
async function create_component(src = '
') {
diff --git a/test/runtime/samples/$$slot/_config.js b/test/runtime/samples/$$slot/_config.js
index 13b2137cdb..46e435ae97 100644
--- a/test/runtime/samples/$$slot/_config.js
+++ b/test/runtime/samples/$$slot/_config.js
@@ -11,7 +11,7 @@ export default {
hello world
`,
- async test({ assert, target, component }) {
+ async test({ assert, component }) {
assert.equal(component.getA(), '');
assert.equal(component.getB(), 'foo');
}
diff --git a/test/runtime/samples/action-body/_config.js b/test/runtime/samples/action-body/_config.js
new file mode 100644
index 0000000000..c882499e0e
--- /dev/null
+++ b/test/runtime/samples/action-body/_config.js
@@ -0,0 +1,18 @@
+export default {
+ html: '
',
+
+ async test({ assert, target, window }) {
+ const enter = new window.MouseEvent('mouseenter');
+ const leave = new window.MouseEvent('mouseleave');
+
+ await window.document.body.dispatchEvent(enter);
+ assert.htmlEqual(target.innerHTML, `
+
+ `);
+
+ await window.document.body.dispatchEvent(leave);
+ assert.htmlEqual(target.innerHTML, '
');
+ }
+};
diff --git a/test/runtime/samples/action-body/main.svelte b/test/runtime/samples/action-body/main.svelte
new file mode 100644
index 0000000000..dd57116577
--- /dev/null
+++ b/test/runtime/samples/action-body/main.svelte
@@ -0,0 +1,32 @@
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/action-custom-event-handler-node-context/_config.js b/test/runtime/samples/action-custom-event-handler-node-context/_config.js
index ea94abe9b3..9a5d0d5f82 100644
--- a/test/runtime/samples/action-custom-event-handler-node-context/_config.js
+++ b/test/runtime/samples/action-custom-event-handler-node-context/_config.js
@@ -3,7 +3,7 @@ export default {
html: '10 ',
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.MouseEvent('click');
const button = target.querySelector('button');
diff --git a/test/runtime/samples/action-custom-event-handler-this/_config.js b/test/runtime/samples/action-custom-event-handler-this/_config.js
index ec3fa373eb..29c2059d9f 100644
--- a/test/runtime/samples/action-custom-event-handler-this/_config.js
+++ b/test/runtime/samples/action-custom-event-handler-this/_config.js
@@ -1,7 +1,7 @@
export default {
html: ' ',
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
const input = target.querySelector('input');
const event = new window.KeyboardEvent('keydown', {
key: 'Enter'
diff --git a/test/runtime/samples/action-custom-event-handler-with-context/_config.js b/test/runtime/samples/action-custom-event-handler-with-context/_config.js
index 104ec27503..41ea15151a 100644
--- a/test/runtime/samples/action-custom-event-handler-with-context/_config.js
+++ b/test/runtime/samples/action-custom-event-handler-with-context/_config.js
@@ -1,7 +1,7 @@
export default {
html: '??? ',
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.MouseEvent('click', {
clientX: 42,
clientY: 42
diff --git a/test/runtime/samples/action-function/_config.js b/test/runtime/samples/action-function/_config.js
index 07b4087dcc..6aa972f1a8 100644
--- a/test/runtime/samples/action-function/_config.js
+++ b/test/runtime/samples/action-function/_config.js
@@ -3,7 +3,7 @@ export default {
action
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const eventEnter = new window.MouseEvent('mouseenter');
const eventLeave = new window.MouseEvent('mouseleave');
diff --git a/test/runtime/samples/action-object-deep/_config.js b/test/runtime/samples/action-object-deep/_config.js
index 7fdc11af2b..ce4981c568 100644
--- a/test/runtime/samples/action-object-deep/_config.js
+++ b/test/runtime/samples/action-object-deep/_config.js
@@ -2,7 +2,7 @@ export default {
html: `
action
`,
- async test({ assert, target, window }) {
+ async test({ assert, target }) {
assert.equal(target.querySelector('button').foo, 'bar1337');
}
};
diff --git a/test/runtime/samples/action-object/_config.js b/test/runtime/samples/action-object/_config.js
index 7fdc11af2b..ce4981c568 100644
--- a/test/runtime/samples/action-object/_config.js
+++ b/test/runtime/samples/action-object/_config.js
@@ -2,7 +2,7 @@ export default {
html: `
action
`,
- async test({ assert, target, window }) {
+ async test({ assert, target }) {
assert.equal(target.querySelector('button').foo, 'bar1337');
}
};
diff --git a/test/runtime/samples/action-receives-element-mounted/_config.js b/test/runtime/samples/action-receives-element-mounted/_config.js
index 0806d0fa90..c6f3fcd89f 100644
--- a/test/runtime/samples/action-receives-element-mounted/_config.js
+++ b/test/runtime/samples/action-receives-element-mounted/_config.js
@@ -2,7 +2,7 @@ const result = {};
export default {
props: { result },
- async test({ assert, component, target, window }) {
+ async test({ assert }) {
assert.notEqual(result.parentElement, null);
}
};
diff --git a/test/runtime/samples/action-ternary-template/_config.js b/test/runtime/samples/action-ternary-template/_config.js
index ecb18dceec..8e5e8e2236 100644
--- a/test/runtime/samples/action-ternary-template/_config.js
+++ b/test/runtime/samples/action-ternary-template/_config.js
@@ -8,7 +8,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const header = target.querySelector('h1');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/action-this/_config.js b/test/runtime/samples/action-this/_config.js
index 933ce993b9..85cb917d96 100644
--- a/test/runtime/samples/action-this/_config.js
+++ b/test/runtime/samples/action-this/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/animation-js-delay/_config.js b/test/runtime/samples/animation-js-delay/_config.js
index 2cee51121f..d7eba13bd4 100644
--- a/test/runtime/samples/animation-js-delay/_config.js
+++ b/test/runtime/samples/animation-js-delay/_config.js
@@ -17,7 +17,7 @@ export default {
e
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, window, raf }) {
let divs = window.document.querySelectorAll('div');
divs.forEach(div => {
div.getBoundingClientRect = function() {
diff --git a/test/runtime/samples/animation-js-easing/_config.js b/test/runtime/samples/animation-js-easing/_config.js
index e466309f57..9cbb77275a 100644
--- a/test/runtime/samples/animation-js-easing/_config.js
+++ b/test/runtime/samples/animation-js-easing/_config.js
@@ -17,7 +17,7 @@ export default {
e
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, raf }) {
let divs = document.querySelectorAll('div');
divs.forEach(div => {
div.getBoundingClientRect = function() {
diff --git a/test/runtime/samples/animation-js/_config.js b/test/runtime/samples/animation-js/_config.js
index 5c5e874b3e..64373d08a3 100644
--- a/test/runtime/samples/animation-js/_config.js
+++ b/test/runtime/samples/animation-js/_config.js
@@ -17,7 +17,7 @@ export default {
e
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, raf }) {
let divs = document.querySelectorAll('div');
divs.forEach(div => {
div.getBoundingClientRect = function() {
diff --git a/test/runtime/samples/apply-directives-in-order-2/_config.js b/test/runtime/samples/apply-directives-in-order-2/_config.js
index caff97a5b9..6072a18b27 100644
--- a/test/runtime/samples/apply-directives-in-order-2/_config.js
+++ b/test/runtime/samples/apply-directives-in-order-2/_config.js
@@ -4,7 +4,7 @@ export default {
value
},
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const inputs = target.querySelectorAll('input');
const event = new window.Event('input');
diff --git a/test/runtime/samples/apply-directives-in-order/_config.js b/test/runtime/samples/apply-directives-in-order/_config.js
index 7c8f87ef85..2e057118b4 100644
--- a/test/runtime/samples/apply-directives-in-order/_config.js
+++ b/test/runtime/samples/apply-directives-in-order/_config.js
@@ -9,11 +9,11 @@ export default {
`,
ssrHtml: `
-
+
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
const event = new window.Event('input');
diff --git a/test/runtime/samples/attribute-boolean-false/_config.js b/test/runtime/samples/attribute-boolean-false/_config.js
index 935b709fab..e4aaabecaf 100644
--- a/test/runtime/samples/attribute-boolean-false/_config.js
+++ b/test/runtime/samples/attribute-boolean-false/_config.js
@@ -1,6 +1,6 @@
export default {
html: '',
- test({ assert, component, target }) {
+ test({ assert, target }) {
const textarea = target.querySelector('textarea');
assert.ok(textarea.readOnly === false);
}
diff --git a/test/runtime/samples/attribute-boolean-indeterminate/_config.js b/test/runtime/samples/attribute-boolean-indeterminate/_config.js
index d16cb5f96b..d6e97ffc0e 100644
--- a/test/runtime/samples/attribute-boolean-indeterminate/_config.js
+++ b/test/runtime/samples/attribute-boolean-indeterminate/_config.js
@@ -7,9 +7,11 @@ export default {
indeterminate: true
},
- html: `
-
- `,
+ html: " ",
+
+ // somehow ssr will render indeterminate=""
+ // the hydrated html will still contain that attribute
+ ssrHtml: " ",
test({ assert, component, target }) {
const input = target.querySelector('input');
diff --git a/test/runtime/samples/attribute-boolean-true/_config.js b/test/runtime/samples/attribute-boolean-true/_config.js
index ccc0814296..89b2fc7c21 100644
--- a/test/runtime/samples/attribute-boolean-true/_config.js
+++ b/test/runtime/samples/attribute-boolean-true/_config.js
@@ -1,7 +1,8 @@
export default {
- html: '',
- test({ assert, component, target }) {
+ html: '',
+ test({ assert, target }) {
const textarea = target.querySelector('textarea');
+ assert.equal(textarea.dataset.attr, 'true');
assert.ok(textarea.readOnly);
}
};
diff --git a/test/runtime/samples/attribute-boolean-true/main.svelte b/test/runtime/samples/attribute-boolean-true/main.svelte
index 04d5cab8f9..6474644749 100644
--- a/test/runtime/samples/attribute-boolean-true/main.svelte
+++ b/test/runtime/samples/attribute-boolean-true/main.svelte
@@ -1 +1 @@
-
\ No newline at end of file
+
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..9f8ee61c7a 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,14 +1,17 @@
-// 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: {
hydrate: false // Hydration test will fail as case sensitivity is only handled for svg elements.
},
+ skip_if_hydrate_from_ssr: true,
compileOptions: {
namespace: 'foreign'
},
@@ -16,5 +19,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
+
+
+
diff --git a/test/runtime/samples/attribute-casing-foreign-namespace/_config.js b/test/runtime/samples/attribute-casing-foreign-namespace/_config.js
index d7eca6aba9..f74f622524 100644
--- a/test/runtime/samples/attribute-casing-foreign-namespace/_config.js
+++ b/test/runtime/samples/attribute-casing-foreign-namespace/_config.js
@@ -9,6 +9,7 @@ export default {
options: {
hydrate: false // Hydration test will fail as case sensitivity is only handled for svg elements.
},
+ skip_if_hydrate_from_ssr: true,
test({ assert, target }) {
const attr = sel => target.querySelector(sel).attributes[0].name;
diff --git a/test/runtime/samples/attribute-dynamic-type/_config.js b/test/runtime/samples/attribute-dynamic-type/_config.js
index 19aa33d65e..fa00cb6bc3 100644
--- a/test/runtime/samples/attribute-dynamic-type/_config.js
+++ b/test/runtime/samples/attribute-dynamic-type/_config.js
@@ -1,12 +1,11 @@
export default {
- skip_if_ssr: true,
-
props: {
inputType: 'text',
inputValue: 42
},
html: ' ',
+ ssrHtml: ' ',
test({ assert, component, target }) {
const input = target.querySelector('input');
diff --git a/test/runtime/samples/attribute-namespaced/_config.js b/test/runtime/samples/attribute-namespaced/_config.js
index 275a198219..f3a7f28a93 100644
--- a/test/runtime/samples/attribute-namespaced/_config.js
+++ b/test/runtime/samples/attribute-namespaced/_config.js
@@ -7,7 +7,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const use = target.querySelector( 'use' );
assert.equal( use.getAttributeNS( 'http://www.w3.org/1999/xlink', 'href' ), '#bar' );
}
diff --git a/test/runtime/samples/attribute-prefer-expression/_config.js b/test/runtime/samples/attribute-prefer-expression/_config.js
index 2388ff35df..22bed8a6bc 100644
--- a/test/runtime/samples/attribute-prefer-expression/_config.js
+++ b/test/runtime/samples/attribute-prefer-expression/_config.js
@@ -1,5 +1,4 @@
export default {
- skip_if_ssr: true,
props: {
foo: false
diff --git a/test/runtime/samples/attribute-static-boolean/_config.js b/test/runtime/samples/attribute-static-boolean/_config.js
index 3dba036319..2d31b26747 100644
--- a/test/runtime/samples/attribute-static-boolean/_config.js
+++ b/test/runtime/samples/attribute-static-boolean/_config.js
@@ -1,6 +1,6 @@
export default {
html: '',
- test({ assert, component, target }) {
+ test({ assert, target }) {
const textarea = target.querySelector( 'textarea' );
assert.ok( textarea.readOnly );
}
diff --git a/test/runtime/samples/autofocus/_config.js b/test/runtime/samples/autofocus/_config.js
index faf9cf9f48..b0131f8bfe 100644
--- a/test/runtime/samples/autofocus/_config.js
+++ b/test/runtime/samples/autofocus/_config.js
@@ -2,7 +2,23 @@ export default {
html: '',
test({ assert, component, target, window }) {
- component.visible = true;
- assert.equal(target.querySelector('input'), window.document.activeElement);
+ component.active = 'default';
+ assert.equal(target.querySelector('input[title="default"]'), window.document.activeElement);
+
+ component.active = 'dynamic-false';
+ assert.notEqual(target.querySelector('input[title="dynamic-false"]'), window.document.activeElement);
+
+ // when dynamically set autofocus to true, don't autofocus
+ component.autofocusFalse = true;
+ assert.notEqual(target.querySelector('input[title="dynamic-false"]'), window.document.activeElement);
+
+ component.active = 'dynamic-true';
+ assert.equal(target.querySelector('input[title="dynamic-true"]'), window.document.activeElement);
+
+ component.active = 'spread';
+ assert.equal(target.querySelector('input[title="spread"]'), window.document.activeElement);
+
+ component.active = 'spread-override';
+ assert.notEqual(target.querySelector('input[title="spread-override"]'), window.document.activeElement);
}
};
diff --git a/test/runtime/samples/autofocus/main.svelte b/test/runtime/samples/autofocus/main.svelte
index 561596e9cf..ecdb1beb5e 100644
--- a/test/runtime/samples/autofocus/main.svelte
+++ b/test/runtime/samples/autofocus/main.svelte
@@ -1,8 +1,18 @@
-{#if visible}
-
+{#if active === 'default'}
+
+{:else if active === 'dynamic-false'}
+
+{:else if active === 'dynamic-true'}
+
+{:else if active === 'spread'}
+
+{:else if active === 'spread-override'}
+
{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/await-catch-no-expression/_config.js b/test/runtime/samples/await-catch-no-expression/_config.js
new file mode 100644
index 0000000000..5274e60e2d
--- /dev/null
+++ b/test/runtime/samples/await-catch-no-expression/_config.js
@@ -0,0 +1,47 @@
+let fulfil;
+
+let thePromise = new Promise(f => {
+ fulfil = f;
+});
+
+export default {
+ props: {
+ thePromise
+ },
+
+ html: `
+
+ the promise is pending
+ `,
+
+ async test({ assert, component, target }) {
+ fulfil(42);
+
+ await thePromise;
+
+ assert.htmlEqual(target.innerHTML, ' ');
+
+ let reject;
+
+ thePromise = new Promise((f, r) => {
+ reject = r;
+ });
+
+ component.thePromise = thePromise;
+
+ assert.htmlEqual(target.innerHTML, `
+
+ the promise is pending
+ `);
+
+ reject(new Error());
+
+ await thePromise.catch(() => {});
+
+ assert.htmlEqual(target.innerHTML, `
+ oh no! Something broke!
+
+ oh no! Something broke!
+ `);
+ }
+};
diff --git a/test/runtime/samples/await-catch-no-expression/main.svelte b/test/runtime/samples/await-catch-no-expression/main.svelte
new file mode 100644
index 0000000000..0da0d12092
--- /dev/null
+++ b/test/runtime/samples/await-catch-no-expression/main.svelte
@@ -0,0 +1,15 @@
+
+
+{#await thePromise catch}
+ oh no! Something broke!
+{/await}
+
+
+
+{#await thePromise}
+ the promise is pending
+{:catch}
+ oh no! Something broke!
+{/await}
diff --git a/test/runtime/samples/await-conservative-update/_config.js b/test/runtime/samples/await-conservative-update/_config.js
index 20a9448ebd..c548a400af 100644
--- a/test/runtime/samples/await-conservative-update/_config.js
+++ b/test/runtime/samples/await-conservative-update/_config.js
@@ -5,7 +5,7 @@ export default {
loading...
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
return sleep(50).then(() => {
assert.htmlEqual(target.innerHTML, `
the answer is 42
diff --git a/test/runtime/samples/await-in-each/_config.js b/test/runtime/samples/await-in-each/_config.js
index a648bbe38a..617194a95c 100644
--- a/test/runtime/samples/await-in-each/_config.js
+++ b/test/runtime/samples/await-in-each/_config.js
@@ -18,7 +18,7 @@ export default {
a title: loading...
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
fulfil(42);
return thePromise
diff --git a/test/runtime/samples/await-then-catch-order/_config.js b/test/runtime/samples/await-then-catch-order/_config.js
index f972520904..29fc074162 100644
--- a/test/runtime/samples/await-then-catch-order/_config.js
+++ b/test/runtime/samples/await-then-catch-order/_config.js
@@ -13,7 +13,7 @@ export default {
loading...
true!
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
fulfil(42);
return thePromise
diff --git a/test/runtime/samples/await-then-catch-static/_config.js b/test/runtime/samples/await-then-catch-static/_config.js
index 35fc865d44..6918986950 100644
--- a/test/runtime/samples/await-then-catch-static/_config.js
+++ b/test/runtime/samples/await-then-catch-static/_config.js
@@ -22,7 +22,7 @@ export default {
loaded
`);
- promise = new Promise((f, r) => {
+ promise = new Promise((f, _) => {
fulfil = f;
});
diff --git a/test/runtime/samples/await-then-destruct-array/_config.js b/test/runtime/samples/await-then-destruct-array/_config.js
index 55c48481e0..58a66a698d 100644
--- a/test/runtime/samples/await-then-destruct-array/_config.js
+++ b/test/runtime/samples/await-then-destruct-array/_config.js
@@ -1,6 +1,6 @@
export default {
props: {
- thePromise: new Promise(resolve => {})
+ thePromise: new Promise(_ => {})
},
html: `
diff --git a/test/runtime/samples/await-then-destruct-default/_config.js b/test/runtime/samples/await-then-destruct-default/_config.js
index d0e5a49f28..151f2c91f7 100644
--- a/test/runtime/samples/await-then-destruct-default/_config.js
+++ b/test/runtime/samples/await-then-destruct-default/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target }) {
+ async test({ assert, target }) {
await Promise.resolve();
assert.htmlEqual(
diff --git a/test/runtime/samples/await-then-destruct-object/_config.js b/test/runtime/samples/await-then-destruct-object/_config.js
index 7d08ad3711..47e8422cc4 100644
--- a/test/runtime/samples/await-then-destruct-object/_config.js
+++ b/test/runtime/samples/await-then-destruct-object/_config.js
@@ -1,6 +1,6 @@
export default {
props: {
- thePromise: new Promise(resolve => {})
+ thePromise: new Promise(_ => {})
},
html: `
diff --git a/test/runtime/samples/await-then-destruct-rest/_config.js b/test/runtime/samples/await-then-destruct-rest/_config.js
index 528568e569..0a7445b535 100644
--- a/test/runtime/samples/await-then-destruct-rest/_config.js
+++ b/test/runtime/samples/await-then-destruct-rest/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target }) {
+ async test({ assert, target }) {
await Promise.resolve();
assert.htmlEqual(
diff --git a/test/runtime/samples/await-then-if/_config.js b/test/runtime/samples/await-then-if/_config.js
index f9e81dd2cc..f29f5df0e5 100644
--- a/test/runtime/samples/await-then-if/_config.js
+++ b/test/runtime/samples/await-then-if/_config.js
@@ -13,11 +13,11 @@ export default {
loading...
`,
- async test({ assert, component, target }) {
+ async test({ assert, target }) {
fulfil([]);
await thePromise;
-
+
assert.htmlEqual(target.innerHTML, `
promise array is empty
`);
diff --git a/test/runtime/samples/await-then-no-expression/_config.js b/test/runtime/samples/await-then-no-expression/_config.js
new file mode 100644
index 0000000000..f684da52ed
--- /dev/null
+++ b/test/runtime/samples/await-then-no-expression/_config.js
@@ -0,0 +1,55 @@
+let fulfil;
+
+let thePromise = new Promise(f => {
+ fulfil = f;
+});
+
+export default {
+ props: {
+ thePromise
+ },
+
+ html: `
+
+
+ the promise is pending
+ `,
+
+ async test({ assert, component, target }) {
+ fulfil();
+
+ await thePromise;
+
+ assert.htmlEqual(target.innerHTML, `
+ the promise is resolved
+
+ the promise is resolved
+
+ the promise is resolved
+ `);
+
+ let reject;
+
+ thePromise = new Promise((f, r) => {
+ reject = r;
+ });
+
+ component.thePromise = thePromise;
+
+ assert.htmlEqual(target.innerHTML, `
+
+
+ the promise is pending
+ `);
+
+ reject(new Error('something broke'));
+
+ await thePromise.catch(() => {});
+
+ assert.htmlEqual(target.innerHTML, `
+ oh no! something broke
+
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/await-then-no-expression/main.svelte b/test/runtime/samples/await-then-no-expression/main.svelte
new file mode 100644
index 0000000000..fedc7cd2b7
--- /dev/null
+++ b/test/runtime/samples/await-then-no-expression/main.svelte
@@ -0,0 +1,23 @@
+
+
+{#await thePromise then}
+ the promise is resolved
+{:catch theError}
+ oh no! {theError.message}
+{/await}
+
+
+
+{#await thePromise then}
+ the promise is resolved
+{/await}
+
+
+
+{#await thePromise}
+ the promise is pending
+{:then}
+ the promise is resolved
+{/await}
\ No newline at end of file
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: `
+ error: undefined
+ `,
+
+ async test({ assert, component, target }) {
+ await (component.thePromise = Promise.resolve('abc'));
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+
+ error: undefined
+ After Resolve: undefined
+
+ `
+ );
+
+ component.error = 'external error occurred';
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+
+ error: ${component.error}
+ After Resolve: ${component.error}
+
+ `
+ );
+
+ try {
+ await (component.thePromise = Promise.reject('failure'));
+ } catch (error) {
+ // ignore
+ }
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+
+ error: ${component.error}
+ Rejected: failure
+
+ `
+ );
+ }
+};
diff --git a/test/runtime/samples/await-with-update-catch-scope/main.svelte b/test/runtime/samples/await-with-update-catch-scope/main.svelte
new file mode 100644
index 0000000000..4d4eb53f0b
--- /dev/null
+++ b/test/runtime/samples/await-with-update-catch-scope/main.svelte
@@ -0,0 +1,13 @@
+
+
+
+ error: {error}
+ {#await thePromise then _}
+ After Resolve: {error}
+ {:catch error}
+ Rejected: {error}
+ {/await}
+
diff --git a/test/runtime/samples/binding-circular/_config.js b/test/runtime/samples/binding-circular/_config.js
index 505ed22beb..3e58ab2f98 100644
--- a/test/runtime/samples/binding-circular/_config.js
+++ b/test/runtime/samples/binding-circular/_config.js
@@ -3,11 +3,5 @@ export default {
wheeee
- `,
-
- ssrHtml: `
-
- wheeee
-
`
};
diff --git a/test/runtime/samples/binding-indirect-spread/_config.js b/test/runtime/samples/binding-indirect-spread/_config.js
index 1f24fcdbcb..b0701bdc7c 100644
--- a/test/runtime/samples/binding-indirect-spread/_config.js
+++ b/test/runtime/samples/binding-indirect-spread/_config.js
@@ -1,5 +1,13 @@
export default {
- skip_if_ssr: true,
+ ssrHtml: `
+
+
+
+
+
+
+
+ `,
async test({ assert, component, target, window }) {
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/binding-input-checkbox-group-outside-each/_config.js b/test/runtime/samples/binding-input-checkbox-group-outside-each/_config.js
index ab89bc8daa..0948797865 100644
--- a/test/runtime/samples/binding-input-checkbox-group-outside-each/_config.js
+++ b/test/runtime/samples/binding-input-checkbox-group-outside-each/_config.js
@@ -25,6 +25,21 @@ export default {
Beta
`,
+ ssrHtml: `
+
+ Alpha
+
+
+
+ Beta
+
+
+
+ Gamma
+
+
+ Beta
`,
+
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false);
diff --git a/test/runtime/samples/binding-input-checkbox-group/_config.js b/test/runtime/samples/binding-input-checkbox-group/_config.js
index ab89bc8daa..0948797865 100644
--- a/test/runtime/samples/binding-input-checkbox-group/_config.js
+++ b/test/runtime/samples/binding-input-checkbox-group/_config.js
@@ -25,6 +25,21 @@ export default {
Beta
`,
+ ssrHtml: `
+
+ Alpha
+
+
+
+ Beta
+
+
+
+ Gamma
+
+
+ Beta
`,
+
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false);
diff --git a/test/runtime/samples/binding-input-group-duplicate-value/_config.js b/test/runtime/samples/binding-input-group-duplicate-value/_config.js
index b5f3ae0115..db7dd84dee 100644
--- a/test/runtime/samples/binding-input-group-duplicate-value/_config.js
+++ b/test/runtime/samples/binding-input-group-duplicate-value/_config.js
@@ -17,7 +17,7 @@ export default {
d
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const inputs = target.querySelectorAll('input');
const p = target.querySelector('p');
diff --git a/test/runtime/samples/binding-input-group-each-1/_config.js b/test/runtime/samples/binding-input-group-each-1/_config.js
index 92010296dc..9bdf784f73 100644
--- a/test/runtime/samples/binding-input-group-each-1/_config.js
+++ b/test/runtime/samples/binding-input-group-each-1/_config.js
@@ -64,6 +64,54 @@ export default {
`,
+ ssrHtml: `
+
+
+
+ `,
+
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false);
diff --git a/test/runtime/samples/binding-input-group-each-2/_config.js b/test/runtime/samples/binding-input-group-each-2/_config.js
index 78d692d979..880b183f88 100644
--- a/test/runtime/samples/binding-input-group-each-2/_config.js
+++ b/test/runtime/samples/binding-input-group-each-2/_config.js
@@ -12,6 +12,19 @@ export default {
1, 2, 3
`,
+ ssrHtml: `
+
+ 1
+
+
+ 2
+
+
+ 3
+
+
+
1, 2, 3
`,
+
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, true);
diff --git a/test/runtime/samples/binding-input-group-each-3/_config.js b/test/runtime/samples/binding-input-group-each-3/_config.js
index 92010296dc..f4018295d7 100644
--- a/test/runtime/samples/binding-input-group-each-3/_config.js
+++ b/test/runtime/samples/binding-input-group-each-3/_config.js
@@ -63,7 +63,53 @@ export default {
Gamma
`,
+ ssrHtml: `
+
+
+
+ `,
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false);
diff --git a/test/runtime/samples/binding-input-group-each-4/_config.js b/test/runtime/samples/binding-input-group-each-4/_config.js
index f1168858b0..da5edf18bc 100644
--- a/test/runtime/samples/binding-input-group-each-4/_config.js
+++ b/test/runtime/samples/binding-input-group-each-4/_config.js
@@ -17,7 +17,24 @@ export default {
3
3
`,
-
+ ssrHtml: `
+ 1
+ 2
+ 3
+ 1
+ 1
+ 2
+ 3
+ 2
+ 1
+ 2
+ 3
+
+ 1
+ 2
+ 3
+ 3
+ `,
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, true);
diff --git a/test/runtime/samples/binding-input-group-each-5/_config.js b/test/runtime/samples/binding-input-group-each-5/_config.js
index 579225c627..cdfe9308df 100644
--- a/test/runtime/samples/binding-input-group-each-5/_config.js
+++ b/test/runtime/samples/binding-input-group-each-5/_config.js
@@ -17,7 +17,24 @@ export default {
3
1
`,
-
+ ssrHtml: `
+ 1
+ 2
+ 3
+ 1
+ 1
+ 2
+ 3
+ 1, 2, 3
+ 1
+ 2
+ 3
+ 2
+ 1
+ 2
+ 3
+ 1
+ `,
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, true);
diff --git a/test/runtime/samples/binding-input-group-each-6/_config.js b/test/runtime/samples/binding-input-group-each-6/_config.js
index 9eb251bf5d..7fd1232a27 100644
--- a/test/runtime/samples/binding-input-group-each-6/_config.js
+++ b/test/runtime/samples/binding-input-group-each-6/_config.js
@@ -13,8 +13,7 @@ export default {
z
`,
-
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false);
assert.equal(inputs[1].checked, false);
diff --git a/test/runtime/samples/binding-input-group-each-7/_config.js b/test/runtime/samples/binding-input-group-each-7/_config.js
index 3063141983..7535001f67 100644
--- a/test/runtime/samples/binding-input-group-each-7/_config.js
+++ b/test/runtime/samples/binding-input-group-each-7/_config.js
@@ -20,7 +20,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const inputs = target.querySelectorAll('input');
const checked = new Set();
const checkInbox = async (i) => {
diff --git a/test/runtime/samples/binding-input-member-expression-update/_config.js b/test/runtime/samples/binding-input-member-expression-update/_config.js
new file mode 100644
index 0000000000..c0dfc3bbe8
--- /dev/null
+++ b/test/runtime/samples/binding-input-member-expression-update/_config.js
@@ -0,0 +1,18 @@
+// binding member expression shouldn't invalidate the property name
+export default {
+ async test({ assert, component, target, window }) {
+ const input = target.querySelector('input');
+ assert.deepEqual(component.logs.length, 1);
+ assert.equal(input.value, 'abc');
+
+ input.value = 'hij';
+ await input.dispatchEvent(new window.Event('input'));
+
+ assert.deepEqual(component.values.a, 'hij');
+ assert.deepEqual(component.logs.length, 1);
+
+ component.paths = ['b'];
+ assert.deepEqual(component.logs.length, 2);
+ assert.equal(input.value, 'def');
+ }
+};
diff --git a/test/runtime/samples/binding-input-member-expression-update/main.svelte b/test/runtime/samples/binding-input-member-expression-update/main.svelte
new file mode 100644
index 0000000000..dc72b229ba
--- /dev/null
+++ b/test/runtime/samples/binding-input-member-expression-update/main.svelte
@@ -0,0 +1,9 @@
+
+
+
diff --git a/test/runtime/samples/binding-input-radio-group/_config.js b/test/runtime/samples/binding-input-radio-group/_config.js
index e289d48597..9684f60fa6 100644
--- a/test/runtime/samples/binding-input-radio-group/_config.js
+++ b/test/runtime/samples/binding-input-radio-group/_config.js
@@ -25,6 +25,21 @@ export default {
Beta
`,
+ ssrHtml: `
+
+ Alpha
+
+
+
+ Beta
+
+
+
+ Gamma
+
+
+ Beta
`,
+
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false);
diff --git a/test/runtime/samples/binding-input-text-undefined/_config.js b/test/runtime/samples/binding-input-text-undefined/_config.js
index fa59b1f796..82cada3b15 100644
--- a/test/runtime/samples/binding-input-text-undefined/_config.js
+++ b/test/runtime/samples/binding-input-text-undefined/_config.js
@@ -7,7 +7,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const input = target.querySelector('input');
assert.equal(input.value, '');
diff --git a/test/runtime/samples/binding-select-implicit-option-value/_config.js b/test/runtime/samples/binding-select-implicit-option-value/_config.js
index cce1172f6a..1266602a47 100644
--- a/test/runtime/samples/binding-select-implicit-option-value/_config.js
+++ b/test/runtime/samples/binding-select-implicit-option-value/_config.js
@@ -14,16 +14,6 @@ export default {
foo: 2
`,
- ssrHtml: `
-
- 1
- 2
- 3
-
-
- foo: 2
- `,
-
async test({ assert, component, target, window }) {
const select = target.querySelector('select');
const options = [...target.querySelectorAll('option')];
diff --git a/test/runtime/samples/binding-select-in-each-block/_config.js b/test/runtime/samples/binding-select-in-each-block/_config.js
index 89f40f8d48..80ea375b78 100644
--- a/test/runtime/samples/binding-select-in-each-block/_config.js
+++ b/test/runtime/samples/binding-select-in-each-block/_config.js
@@ -1,17 +1,4 @@
export default {
-
- ssrHtml: `
-
- Hullo
- World
-
-
-
- Hullo
- World
-
- `,
-
html: `
Hullo
diff --git a/test/runtime/samples/binding-select-initial-value-undefined/_config.js b/test/runtime/samples/binding-select-initial-value-undefined/_config.js
index 821a8a3c64..27bac7ef77 100644
--- a/test/runtime/samples/binding-select-initial-value-undefined/_config.js
+++ b/test/runtime/samples/binding-select-initial-value-undefined/_config.js
@@ -14,6 +14,7 @@ export default {
`,
test({ assert, component, target }) {
+ assert.equal(component.selected, 'a');
const select = target.querySelector('select');
const options = [...target.querySelectorAll('option')];
diff --git a/test/runtime/samples/binding-select-initial-value/_config.js b/test/runtime/samples/binding-select-initial-value/_config.js
index d34a987fa5..5dbd761b61 100644
--- a/test/runtime/samples/binding-select-initial-value/_config.js
+++ b/test/runtime/samples/binding-select-initial-value/_config.js
@@ -11,23 +11,11 @@ export default {
selected: b
`,
- ssrHtml: `
- selected: b
-
-
- a
- b
- c
-
-
- selected: b
- `,
-
props: {
selected: 'b'
},
- test({ assert, component, target }) {
+ test({ assert, target }) {
const select = target.querySelector('select');
const options = [...target.querySelectorAll('option')];
diff --git a/test/runtime/samples/binding-select-late-2/_config.js b/test/runtime/samples/binding-select-late-2/_config.js
index 42c45d1366..f4b0088fb9 100644
--- a/test/runtime/samples/binding-select-late-2/_config.js
+++ b/test/runtime/samples/binding-select-late-2/_config.js
@@ -9,11 +9,6 @@ export default {
selected: two
`,
- ssrHtml: `
-
- selected: two
- `,
-
test({ assert, component, target }) {
component.items = [ 'one', 'two', 'three' ];
diff --git a/test/runtime/samples/binding-select-multiple/_config.js b/test/runtime/samples/binding-select-multiple/_config.js
index b7d6c3589f..70a5620d05 100644
--- a/test/runtime/samples/binding-select-multiple/_config.js
+++ b/test/runtime/samples/binding-select-multiple/_config.js
@@ -4,16 +4,6 @@ export default {
selected: [ 'two', 'three' ]
},
- ssrHtml: `
-
- one
- two
- three
-
-
- selected: two, three
- `,
-
html: `
one
diff --git a/test/runtime/samples/binding-select-unmatched/_config.js b/test/runtime/samples/binding-select-unmatched/_config.js
new file mode 100644
index 0000000000..99e7d23927
--- /dev/null
+++ b/test/runtime/samples/binding-select-unmatched/_config.js
@@ -0,0 +1,60 @@
+export default {
+ html: `
+ selected: null
+
+
+ a
+ b
+ c
+
+
+ selected: null
+ `,
+
+ async test({ assert, component, target }) {
+ const select = target.querySelector('select');
+ const options = [...target.querySelectorAll('option')];
+
+ assert.equal(component.selected, null);
+
+ // no option should be selected since none of the options matches the bound value
+ assert.equal(select.value, '');
+ assert.equal(select.selectedIndex, -1);
+ assert.ok(!options[0].selected);
+
+ component.selected = 'a'; // first option should now be selected
+ assert.equal(select.value, 'a');
+ assert.ok(options[0].selected);
+
+ assert.htmlEqual(target.innerHTML, `
+ selected: a
+
+
+ a
+ b
+ c
+
+
+ selected: a
+ `);
+
+ component.selected = 'd'; // doesn't match an option
+
+ // now no option should be selected again
+ assert.equal(select.value, '');
+ assert.equal(select.selectedIndex, -1);
+ assert.ok(!options[0].selected);
+
+ assert.htmlEqual(target.innerHTML, `
+ selected: d
+
+
+ a
+ b
+ c
+
+
+ selected: d
+ `);
+ }
+};
diff --git a/test/runtime/samples/binding-select-unmatched/main.svelte b/test/runtime/samples/binding-select-unmatched/main.svelte
new file mode 100644
index 0000000000..20e13f4765
--- /dev/null
+++ b/test/runtime/samples/binding-select-unmatched/main.svelte
@@ -0,0 +1,14 @@
+
+
+selected: {selected}
+
+
+ a
+ b
+ c
+
+
+selected: {selected}
\ No newline at end of file
diff --git a/test/runtime/samples/binding-select/_config.js b/test/runtime/samples/binding-select/_config.js
index 310315176b..6cdef2651a 100644
--- a/test/runtime/samples/binding-select/_config.js
+++ b/test/runtime/samples/binding-select/_config.js
@@ -11,18 +11,6 @@ export default {
selected: one
`,
- ssrHtml: `
- selected: one
-
-
- one
- two
- three
-
-
- selected: one
- `,
-
props: {
selected: 'one'
},
diff --git a/test/runtime/samples/binding-this-each-block-property-2/_config.js b/test/runtime/samples/binding-this-each-block-property-2/_config.js
index b67d27050e..49131d6635 100644
--- a/test/runtime/samples/binding-this-each-block-property-2/_config.js
+++ b/test/runtime/samples/binding-this-each-block-property-2/_config.js
@@ -7,7 +7,7 @@ export default {
props: {
callback
},
- after_test() {
+ before_test() {
calls = [];
},
async test({ assert, component, target }) {
diff --git a/test/runtime/samples/binding-this-each-key/_config.js b/test/runtime/samples/binding-this-each-key/_config.js
new file mode 100644
index 0000000000..332e14fda8
--- /dev/null
+++ b/test/runtime/samples/binding-this-each-key/_config.js
@@ -0,0 +1,10 @@
+export default {
+ html: 'content
content
content
',
+
+ test({ assert, target, component }) {
+ const divs = target.querySelectorAll('div');
+ assert.equal(component.refs[0], divs[0]);
+ assert.equal(component.refs[1], divs[1]);
+ assert.equal(component.refs[2], divs[2]);
+ }
+};
diff --git a/test/runtime/samples/binding-this-each-key/main.svelte b/test/runtime/samples/binding-this-each-key/main.svelte
new file mode 100644
index 0000000000..cff2ffa226
--- /dev/null
+++ b/test/runtime/samples/binding-this-each-key/main.svelte
@@ -0,0 +1,15 @@
+
+
+{#each list as { id }, index (id)}
+
+ content
+
+{/each}
diff --git a/test/runtime/samples/binding-this-member-expression-update/_config.js b/test/runtime/samples/binding-this-member-expression-update/_config.js
new file mode 100644
index 0000000000..782d44311c
--- /dev/null
+++ b/test/runtime/samples/binding-this-member-expression-update/_config.js
@@ -0,0 +1,8 @@
+// binding member expression shouldn't invalidate the property name
+export default {
+ test({ assert, component, target }) {
+ const div = target.querySelector('div');
+ assert.equal(div, component.container.a);
+ assert.deepEqual(component.logs.length, 1);
+ }
+};
diff --git a/test/runtime/samples/binding-this-member-expression-update/main.svelte b/test/runtime/samples/binding-this-member-expression-update/main.svelte
new file mode 100644
index 0000000000..327d63d494
--- /dev/null
+++ b/test/runtime/samples/binding-this-member-expression-update/main.svelte
@@ -0,0 +1,9 @@
+
+
+
diff --git a/test/runtime/samples/bindings-global-dependency/_config.js b/test/runtime/samples/bindings-global-dependency/_config.js
index 1180424e81..907aa52e6e 100644
--- a/test/runtime/samples/bindings-global-dependency/_config.js
+++ b/test/runtime/samples/bindings-global-dependency/_config.js
@@ -1,3 +1,4 @@
export default {
- html: ' '
+ html: ' ',
+ ssrHtml: ' '
};
diff --git a/test/runtime/samples/bitmask-overflow-if-2/_config.js b/test/runtime/samples/bitmask-overflow-if-2/_config.js
new file mode 100644
index 0000000000..bdcf45abba
--- /dev/null
+++ b/test/runtime/samples/bitmask-overflow-if-2/_config.js
@@ -0,0 +1,23 @@
+// `bitmask-overflow-if` tests the case where the if condition is made of first 32 variables
+// this tests the case where the if condition is made of the next 32 variables
+export default {
+ html: `
+ 012345678910111213141516171819202122232425262728293031323334353637383940
+ expected: true
+ if: true
+ `,
+
+ async test({ assert, component, target }) {
+ component._40 = '-';
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+ 0123456789101112131415161718192021222324252627282930313233343536373839-
+ expected: false
+ if: false
+
+ `
+ );
+ }
+};
diff --git a/test/runtime/samples/bitmask-overflow-if-2/main.svelte b/test/runtime/samples/bitmask-overflow-if-2/main.svelte
new file mode 100644
index 0000000000..f2a461b5b4
--- /dev/null
+++ b/test/runtime/samples/bitmask-overflow-if-2/main.svelte
@@ -0,0 +1,56 @@
+
+
+
+{_0}{_1}{_2}{_3}{_4}{_5}{_6}{_7}{_8}{_9}{_10}{_11}{_12}{_13}{_14}{_15}{_16}{_17}{_18}{_19}{_20}{_21}{_22}{_23}{_24}{_25}{_26}{_27}{_28}{_29}{_30}{_31}{_32}{_33}{_34}{_35}{_36}{_37}{_38}{_39}{_40}
+
+expected: {_a.indexOf(_40) > -1 && _40 === '40' && _39 === '39'}
+{#if _a.indexOf(_40) > -1 && _40 === '40' && _39 === '39'}
+if: true
+{:else}
+if: false
+
+{/if}
diff --git a/test/runtime/samples/bitmask-overflow-if/_config.js b/test/runtime/samples/bitmask-overflow-if/_config.js
index 49f48925c5..39ddc997fc 100644
--- a/test/runtime/samples/bitmask-overflow-if/_config.js
+++ b/test/runtime/samples/bitmask-overflow-if/_config.js
@@ -6,7 +6,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
await button.dispatchEvent(new window.MouseEvent('click'));
diff --git a/test/runtime/samples/bitmask-overflow-slot-6/_config.js b/test/runtime/samples/bitmask-overflow-slot-6/_config.js
index 7cf7538b69..3bcf4b98e4 100644
--- a/test/runtime/samples/bitmask-overflow-slot-6/_config.js
+++ b/test/runtime/samples/bitmask-overflow-slot-6/_config.js
@@ -7,11 +7,11 @@ export default {
Toggle outside
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelectorAll('button')[1];
const div = target.querySelector('div');
await div.dispatchEvent(new window.MouseEvent('click'));
-
+
assert.htmlEqual(target.innerHTML, `
Toggle inside 1
@@ -19,7 +19,7 @@ export default {
Toggle outside
`);
-
+
await button.dispatchEvent(new window.MouseEvent('click'));
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/class-shortcut-with-class/_config.js b/test/runtime/samples/class-shortcut-with-class/_config.js
index 6d647e8f9d..5f2f28555e 100644
--- a/test/runtime/samples/class-shortcut-with-class/_config.js
+++ b/test/runtime/samples/class-shortcut-with-class/_config.js
@@ -7,7 +7,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.foo = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/class-shortcut/_config.js b/test/runtime/samples/class-shortcut/_config.js
index aba7e0e031..ac5be276b0 100644
--- a/test/runtime/samples/class-shortcut/_config.js
+++ b/test/runtime/samples/class-shortcut/_config.js
@@ -6,7 +6,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.foo = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js b/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js
index f704e9327f..0c357926e2 100644
--- a/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js
+++ b/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js
@@ -8,7 +8,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.myClass = 'one';
component.attributes = {
'aria-label': 'Test'
diff --git a/test/runtime/samples/class-with-dynamic-attribute/_config.js b/test/runtime/samples/class-with-dynamic-attribute/_config.js
index 2be6500674..8e05c72065 100644
--- a/test/runtime/samples/class-with-dynamic-attribute/_config.js
+++ b/test/runtime/samples/class-with-dynamic-attribute/_config.js
@@ -5,7 +5,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.myClass = 'one';
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/class-with-spread-and-bind/_config.js b/test/runtime/samples/class-with-spread-and-bind/_config.js
index 7b50502f34..d1f3503b6c 100644
--- a/test/runtime/samples/class-with-spread-and-bind/_config.js
+++ b/test/runtime/samples/class-with-spread-and-bind/_config.js
@@ -5,7 +5,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.primary = true;
assert.htmlEqual(
diff --git a/test/runtime/samples/class-with-spread/_config.js b/test/runtime/samples/class-with-spread/_config.js
index c7c85e38b0..d49b3f053e 100644
--- a/test/runtime/samples/class-with-spread/_config.js
+++ b/test/runtime/samples/class-with-spread/_config.js
@@ -8,7 +8,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.myClass = 'one';
component.attributes = {
'aria-label': 'Test'
diff --git a/test/runtime/samples/component-binding-accessors/Nested.svelte b/test/runtime/samples/component-binding-accessors/Nested.svelte
new file mode 100644
index 0000000000..a3ce2afd9f
--- /dev/null
+++ b/test/runtime/samples/component-binding-accessors/Nested.svelte
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-binding-accessors/_config.js b/test/runtime/samples/component-binding-accessors/_config.js
new file mode 100644
index 0000000000..4513b43a0b
--- /dev/null
+++ b/test/runtime/samples/component-binding-accessors/_config.js
@@ -0,0 +1,18 @@
+export default {
+ async test({ assert, target, window }) {
+ const [input1, input2] = target.querySelectorAll('input');
+ assert.equal(input1.value, 'something');
+ assert.equal(input2.value, 'something');
+
+ input1.value = 'abc';
+
+ await input1.dispatchEvent(new window.Event('input'));
+ assert.equal(input1.value, 'abc');
+ assert.equal(input2.value, 'abc');
+
+ await target.querySelector('button').dispatchEvent(new window.MouseEvent('click'));
+
+ assert.equal(input1.value, 'Reset');
+ assert.equal(input2.value, 'Reset');
+ }
+};
diff --git a/test/runtime/samples/component-binding-accessors/main.svelte b/test/runtime/samples/component-binding-accessors/main.svelte
new file mode 100644
index 0000000000..1d8576643d
--- /dev/null
+++ b/test/runtime/samples/component-binding-accessors/main.svelte
@@ -0,0 +1,12 @@
+
+
+
+
+
+
{
+ c.value = 'Reset';
+}}>Reset
\ No newline at end of file
diff --git a/test/runtime/samples/component-binding-blowback-b/_config.js b/test/runtime/samples/component-binding-blowback-b/_config.js
index 69af7917ca..2f6350c4fb 100644
--- a/test/runtime/samples/component-binding-blowback-b/_config.js
+++ b/test/runtime/samples/component-binding-blowback-b/_config.js
@@ -14,7 +14,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
input.value = 4;
diff --git a/test/runtime/samples/component-binding-computed/_config.js b/test/runtime/samples/component-binding-computed/_config.js
index b287014065..f43a6834a8 100644
--- a/test/runtime/samples/component-binding-computed/_config.js
+++ b/test/runtime/samples/component-binding-computed/_config.js
@@ -3,6 +3,10 @@ export default {
firstname
lastname
`,
+ ssrHtml: `
+
firstname
+
lastname
+ `,
async test({ assert, component, target, window }) {
const input = new window.Event('input');
diff --git a/test/runtime/samples/component-binding-onMount/Mount.svelte b/test/runtime/samples/component-binding-onMount/Mount.svelte
new file mode 100644
index 0000000000..ce3b0c48f8
--- /dev/null
+++ b/test/runtime/samples/component-binding-onMount/Mount.svelte
@@ -0,0 +1,15 @@
+
+
+
+
+ Bound? {bound}
+
diff --git a/test/runtime/samples/component-binding-onMount/_config.js b/test/runtime/samples/component-binding-onMount/_config.js
new file mode 100644
index 0000000000..4ae78b588a
--- /dev/null
+++ b/test/runtime/samples/component-binding-onMount/_config.js
@@ -0,0 +1,11 @@
+export default {
+ async test({ assert, target }) {
+ assert.htmlEqual(target.innerHTML, `
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/component-binding-onMount/main.svelte b/test/runtime/samples/component-binding-onMount/main.svelte
new file mode 100644
index 0000000000..971b13c1ce
--- /dev/null
+++ b/test/runtime/samples/component-binding-onMount/main.svelte
@@ -0,0 +1,13 @@
+
+
+
diff --git a/test/runtime/samples/component-binding-parent-supercedes-child-b/_config.js b/test/runtime/samples/component-binding-parent-supercedes-child-b/_config.js
index bf6312f5ad..4e31a4d79c 100644
--- a/test/runtime/samples/component-binding-parent-supercedes-child-b/_config.js
+++ b/test/runtime/samples/component-binding-parent-supercedes-child-b/_config.js
@@ -4,7 +4,7 @@ export default {
x in parent: yes
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
component.a = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/component-binding-parent-supercedes-child-c/_config.js b/test/runtime/samples/component-binding-parent-supercedes-child-c/_config.js
index bf6312f5ad..4e31a4d79c 100644
--- a/test/runtime/samples/component-binding-parent-supercedes-child-c/_config.js
+++ b/test/runtime/samples/component-binding-parent-supercedes-child-c/_config.js
@@ -4,7 +4,7 @@ export default {
x in parent: yes
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
component.a = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/component-binding-private-state/_config.js b/test/runtime/samples/component-binding-private-state/_config.js
index bd8a25d490..f4f2fd6f83 100644
--- a/test/runtime/samples/component-binding-private-state/_config.js
+++ b/test/runtime/samples/component-binding-private-state/_config.js
@@ -4,7 +4,7 @@ export default {
x in parent: undefined
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
component.a = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/component-binding-reactive-statement/_config.js b/test/runtime/samples/component-binding-reactive-statement/_config.js
index 49342d0645..8b8d091c73 100644
--- a/test/runtime/samples/component-binding-reactive-statement/_config.js
+++ b/test/runtime/samples/component-binding-reactive-statement/_config.js
@@ -4,7 +4,7 @@ export default {
button 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.MouseEvent('click');
const buttons = target.querySelectorAll('button');
diff --git a/test/runtime/samples/component-binding-store/_config.js b/test/runtime/samples/component-binding-store/_config.js
index d17b9e2d80..8bbdab17ee 100644
--- a/test/runtime/samples/component-binding-store/_config.js
+++ b/test/runtime/samples/component-binding-store/_config.js
@@ -4,6 +4,11 @@ export default {
`,
+ ssrHtml: `
+
+
+
+ `,
async test({ assert, component, target, window }) {
let count = 0;
diff --git a/test/runtime/samples/component-event-handler-contenteditable/_config.js b/test/runtime/samples/component-event-handler-contenteditable/_config.js
index 3a85734975..1628e22d01 100644
--- a/test/runtime/samples/component-event-handler-contenteditable/_config.js
+++ b/test/runtime/samples/component-event-handler-contenteditable/_config.js
@@ -3,7 +3,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const div = target.querySelector('div');
const text = window.document.createTextNode('a');
div.insertBefore(text, null);
diff --git a/test/runtime/samples/component-events-console/_config.js b/test/runtime/samples/component-events-console/_config.js
index 39ccbd719f..fc3b4daa85 100644
--- a/test/runtime/samples/component-events-console/_config.js
+++ b/test/runtime/samples/component-events-console/_config.js
@@ -1,7 +1,7 @@
export default {
html: '
click me ',
- test({ assert, component, target }) {
+ test({ assert, target }) {
const button = target.querySelector('button');
const messages = [];
diff --git a/test/runtime/samples/component-events-this/Inner.svelte b/test/runtime/samples/component-events-this/Inner.svelte
new file mode 100644
index 0000000000..377aa17c43
--- /dev/null
+++ b/test/runtime/samples/component-events-this/Inner.svelte
@@ -0,0 +1,7 @@
+
+
+
dispatch('bar')} />
\ No newline at end of file
diff --git a/test/runtime/samples/component-events-this/Widget.svelte b/test/runtime/samples/component-events-this/Widget.svelte
new file mode 100644
index 0000000000..30b95e94f1
--- /dev/null
+++ b/test/runtime/samples/component-events-this/Widget.svelte
@@ -0,0 +1,6 @@
+
+
+click me
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-events-this/_config.js b/test/runtime/samples/component-events-this/_config.js
new file mode 100644
index 0000000000..180ae7367d
--- /dev/null
+++ b/test/runtime/samples/component-events-this/_config.js
@@ -0,0 +1,11 @@
+export default {
+ test({ assert, component, target, window }) {
+ const [button1, button2] = target.querySelectorAll('button');
+
+ button1.dispatchEvent(new window.MouseEvent('click'));
+ button2.dispatchEvent(new window.MouseEvent('click'));
+
+ assert.strictEqual(component.logs[0], button1);
+ assert.ok(component.logs[1] instanceof component.Inner);
+ }
+};
diff --git a/test/runtime/samples/component-events-this/main.svelte b/test/runtime/samples/component-events-this/main.svelte
new file mode 100644
index 0000000000..328a524360
--- /dev/null
+++ b/test/runtime/samples/component-events-this/main.svelte
@@ -0,0 +1,16 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-namespaced/_config.js b/test/runtime/samples/component-namespaced/_config.js
index 35a5e46d47..7ec4a35c6d 100644
--- a/test/runtime/samples/component-namespaced/_config.js
+++ b/test/runtime/samples/component-namespaced/_config.js
@@ -1,5 +1,3 @@
-import * as path from 'path';
-
export default {
props: {
a: 1
@@ -9,10 +7,6 @@ export default {
foo 1
`,
- before_test() {
- delete require.cache[path.resolve(__dirname, 'components.js')];
- },
-
test({ assert, component, target }) {
component.a = 2;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/component-namespaced/components.js b/test/runtime/samples/component-namespaced/components.js
deleted file mode 100644
index 7dcfcf157c..0000000000
--- a/test/runtime/samples/component-namespaced/components.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import Foo from './Foo.svelte';
-
-export default { Foo };
diff --git a/test/runtime/samples/component-namespaced/components.svelte b/test/runtime/samples/component-namespaced/components.svelte
new file mode 100644
index 0000000000..5b9a6c5167
--- /dev/null
+++ b/test/runtime/samples/component-namespaced/components.svelte
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-namespaced/main.svelte b/test/runtime/samples/component-namespaced/main.svelte
index 541b68e47e..25862cf6f2 100644
--- a/test/runtime/samples/component-namespaced/main.svelte
+++ b/test/runtime/samples/component-namespaced/main.svelte
@@ -1,5 +1,5 @@
diff --git a/test/runtime/samples/component-nested-deep/_config.js b/test/runtime/samples/component-nested-deep/_config.js
index 0114e79223..3d5305529e 100644
--- a/test/runtime/samples/component-nested-deep/_config.js
+++ b/test/runtime/samples/component-nested-deep/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component }) {
+ test({ component }) {
component.l1.$destroy();
}
};
diff --git a/test/runtime/samples/component-nested-deeper/_config.js b/test/runtime/samples/component-nested-deeper/_config.js
index 86993b3e9a..828a3169ac 100644
--- a/test/runtime/samples/component-nested-deeper/_config.js
+++ b/test/runtime/samples/component-nested-deeper/_config.js
@@ -3,7 +3,7 @@ export default {
values: [1, 2, 3, 4]
},
- test({ assert, component }) {
+ test({ component }) {
component.values = [2, 3];
}
};
diff --git a/test/runtime/samples/component-slot-attribute-order/_config.js b/test/runtime/samples/component-slot-attribute-order/_config.js
index 54dc21c446..f4572317ca 100644
--- a/test/runtime/samples/component-slot-attribute-order/_config.js
+++ b/test/runtime/samples/component-slot-attribute-order/_config.js
@@ -4,7 +4,7 @@ export default {
Button
Button
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [btn, btn1, btn2] = target.querySelectorAll('button');
await btn.dispatchEvent(new window.MouseEvent('click'));
diff --git a/test/runtime/samples/component-slot-dynamic/_config.js b/test/runtime/samples/component-slot-dynamic/_config.js
index 9e43ff15fe..9a6ed1a057 100644
--- a/test/runtime/samples/component-slot-dynamic/_config.js
+++ b/test/runtime/samples/component-slot-dynamic/_config.js
@@ -3,7 +3,7 @@ export default {
override default slot
`,
- test({ assert, component }) {
+ test({ component }) {
component.nested.foo = 'b';
}
};
diff --git a/test/runtime/samples/component-slot-fallback-6/_config.js b/test/runtime/samples/component-slot-fallback-6/_config.js
index b32d96db2e..be47d31d03 100644
--- a/test/runtime/samples/component-slot-fallback-6/_config.js
+++ b/test/runtime/samples/component-slot-fallback-6/_config.js
@@ -4,6 +4,10 @@ export default {
{"value":""}
`,
+ ssrHtml: `
+
+ {"value":""}
+ `,
async test({ assert, target, window }) {
const input = target.querySelector('input');
diff --git a/test/runtime/samples/component-slot-let-destructured-2/_config.js b/test/runtime/samples/component-slot-let-destructured-2/_config.js
index 38b04b7b5e..e407dcf2f8 100644
--- a/test/runtime/samples/component-slot-let-destructured-2/_config.js
+++ b/test/runtime/samples/component-slot-let-destructured-2/_config.js
@@ -13,7 +13,7 @@ export default {
Increment
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [button1, button2, button3] = target.querySelectorAll('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/component-slot-nested-if/_config.js b/test/runtime/samples/component-slot-nested-if/_config.js
index 45c570fc22..e4af352970 100644
--- a/test/runtime/samples/component-slot-nested-if/_config.js
+++ b/test/runtime/samples/component-slot-nested-if/_config.js
@@ -2,7 +2,7 @@ export default {
html: `
`,
- async test({ assert, target, snapshot, component, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
input.value = 'a';
diff --git a/test/runtime/samples/component-slot-spread-props/_config.js b/test/runtime/samples/component-slot-spread-props/_config.js
index 042bdca6ec..7beda8d3d5 100644
--- a/test/runtime/samples/component-slot-spread-props/_config.js
+++ b/test/runtime/samples/component-slot-spread-props/_config.js
@@ -5,6 +5,12 @@ export default {
`,
+ ssrHtml: `
+
+ `,
async test({ assert, component, target }) {
component.value = 'foo';
diff --git a/test/runtime/samples/component-svelte-slot-let-destructured-2/_config.js b/test/runtime/samples/component-svelte-slot-let-destructured-2/_config.js
index 38b04b7b5e..e407dcf2f8 100644
--- a/test/runtime/samples/component-svelte-slot-let-destructured-2/_config.js
+++ b/test/runtime/samples/component-svelte-slot-let-destructured-2/_config.js
@@ -13,7 +13,7 @@ export default {
Increment
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [button1, button2, button3] = target.querySelectorAll('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/component-yield-placement/_config.js b/test/runtime/samples/component-yield-placement/_config.js
index eaa600b07d..089b3ce752 100644
--- a/test/runtime/samples/component-yield-placement/_config.js
+++ b/test/runtime/samples/component-yield-placement/_config.js
@@ -12,7 +12,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/constructor-pass-context/Component.svelte b/test/runtime/samples/constructor-pass-context/Component.svelte
new file mode 100644
index 0000000000..ae27a0d57a
--- /dev/null
+++ b/test/runtime/samples/constructor-pass-context/Component.svelte
@@ -0,0 +1,9 @@
+
+
+{value}
+ fn('hello world')} />
\ No newline at end of file
diff --git a/test/runtime/samples/constructor-pass-context/_config.js b/test/runtime/samples/constructor-pass-context/_config.js
new file mode 100644
index 0000000000..02b58f5451
--- /dev/null
+++ b/test/runtime/samples/constructor-pass-context/_config.js
@@ -0,0 +1,32 @@
+export default {
+ async test({ assert, target, window }) {
+ const Component = require('./Component.svelte').default;
+
+ const called = [];
+ const component = new Component({
+ target,
+ context: new Map([
+ ['key', 'svelte'],
+ ['fn', (value) => called.push(value)]
+ ])
+ });
+ assert.htmlEqual(target.innerHTML, 'svelte
');
+
+ const button = target.querySelector('button');
+ await button.dispatchEvent(new window.MouseEvent('click'));
+
+ assert.deepEqual(called, ['hello world']);
+
+ component.$destroy();
+ },
+ test_ssr({ assert }) {
+ const Component = require('./Component.svelte').default;
+
+ const called = [];
+ const { html } = Component.render(undefined, { context: new Map([
+ ['key', 'svelte'],
+ ['fn', (value) => called.push(value)]
+ ]) });
+ assert.htmlEqual(html, 'svelte
');
+ }
+};
diff --git a/test/runtime/samples/constructor-pass-context/main.svelte b/test/runtime/samples/constructor-pass-context/main.svelte
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/test/runtime/samples/constructor-prefer-passed-context/ChildComponent.svelte b/test/runtime/samples/constructor-prefer-passed-context/ChildComponent.svelte
new file mode 100644
index 0000000000..af77418a1f
--- /dev/null
+++ b/test/runtime/samples/constructor-prefer-passed-context/ChildComponent.svelte
@@ -0,0 +1,6 @@
+
+
+Value in child component: {value}
diff --git a/test/runtime/samples/constructor-prefer-passed-context/_config.js b/test/runtime/samples/constructor-prefer-passed-context/_config.js
new file mode 100644
index 0000000000..5d5cf9e44a
--- /dev/null
+++ b/test/runtime/samples/constructor-prefer-passed-context/_config.js
@@ -0,0 +1,6 @@
+export default {
+ skip_if_ssr: true,
+ html: `
+ Value in child component: undefined
+ `
+};
diff --git a/test/runtime/samples/constructor-prefer-passed-context/main.svelte b/test/runtime/samples/constructor-prefer-passed-context/main.svelte
new file mode 100644
index 0000000000..dd051a123a
--- /dev/null
+++ b/test/runtime/samples/constructor-prefer-passed-context/main.svelte
@@ -0,0 +1,15 @@
+
+
+
diff --git a/test/runtime/samples/context-api-d/Leaf.svelte b/test/runtime/samples/context-api-d/Leaf.svelte
new file mode 100644
index 0000000000..02b6b26e00
--- /dev/null
+++ b/test/runtime/samples/context-api-d/Leaf.svelte
@@ -0,0 +1,9 @@
+
+
+{#each [...context.keys()] as key}
+ {key}: {context.get(key)}
+{/each}
diff --git a/test/runtime/samples/context-api-d/Nested.svelte b/test/runtime/samples/context-api-d/Nested.svelte
new file mode 100644
index 0000000000..e8a7e083c3
--- /dev/null
+++ b/test/runtime/samples/context-api-d/Nested.svelte
@@ -0,0 +1,8 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/context-api-d/_config.js b/test/runtime/samples/context-api-d/_config.js
new file mode 100644
index 0000000000..a5b0769f8b
--- /dev/null
+++ b/test/runtime/samples/context-api-d/_config.js
@@ -0,0 +1,7 @@
+export default {
+ html: `
+ a: 1
+ b: 2
+ c: 3
+ `
+};
diff --git a/test/runtime/samples/context-api-d/main.svelte b/test/runtime/samples/context-api-d/main.svelte
new file mode 100644
index 0000000000..82d1021574
--- /dev/null
+++ b/test/runtime/samples/context-api-d/main.svelte
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/test/runtime/samples/css-comments/_config.js b/test/runtime/samples/css-comments/_config.js
index 7f11f792c7..baf571fcd1 100644
--- a/test/runtime/samples/css-comments/_config.js
+++ b/test/runtime/samples/css-comments/_config.js
@@ -1,6 +1,6 @@
// JSDOM makes this test pass when it should fail. weird
export default {
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
const p = target.querySelector( 'p' );
assert.equal( window.getComputedStyle( p ).color, 'red' );
}
diff --git a/test/runtime/samples/css-false/_config.js b/test/runtime/samples/css-false/_config.js
index 2ade2acf83..320efce35b 100644
--- a/test/runtime/samples/css-false/_config.js
+++ b/test/runtime/samples/css-false/_config.js
@@ -3,7 +3,7 @@ export default {
css: false
},
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
const [ control, test ] = target.querySelectorAll( 'p' );
assert.equal( window.getComputedStyle( control ).color, '' );
diff --git a/test/runtime/samples/css-space-in-attribute/_config.js b/test/runtime/samples/css-space-in-attribute/_config.js
index dc931217fc..c88f72cafa 100644
--- a/test/runtime/samples/css-space-in-attribute/_config.js
+++ b/test/runtime/samples/css-space-in-attribute/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
const [ control, test ] = target.querySelectorAll( 'p' );
assert.equal( window.getComputedStyle( control ).color, '' );
diff --git a/test/runtime/samples/css/_config.js b/test/runtime/samples/css/_config.js
index c4500e7441..6119af94de 100644
--- a/test/runtime/samples/css/_config.js
+++ b/test/runtime/samples/css/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
const [control, test] = target.querySelectorAll('p');
assert.equal(window.getComputedStyle(control).color, '');
diff --git a/test/runtime/samples/deconflict-builtins-2/_config.js b/test/runtime/samples/deconflict-builtins-2/_config.js
index e136b0410d..fba811b880 100644
--- a/test/runtime/samples/deconflict-builtins-2/_config.js
+++ b/test/runtime/samples/deconflict-builtins-2/_config.js
@@ -1,4 +1,4 @@
export default {
- html: 'hello world ',
+ html: 'hello world ',
preserveIdentifiers: true
};
diff --git a/test/runtime/samples/deconflict-builtins-2/main.svelte b/test/runtime/samples/deconflict-builtins-2/main.svelte
index 82f9213045..db10a81c74 100644
--- a/test/runtime/samples/deconflict-builtins-2/main.svelte
+++ b/test/runtime/samples/deconflict-builtins-2/main.svelte
@@ -1,5 +1,6 @@
-
-{foo}
\ No newline at end of file
+
+ {foo}
+
\ No newline at end of file
diff --git a/test/runtime/samples/destroy-twice/_config.js b/test/runtime/samples/destroy-twice/_config.js
index 1279b2315d..39f6cdcd57 100644
--- a/test/runtime/samples/destroy-twice/_config.js
+++ b/test/runtime/samples/destroy-twice/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component }) {
+ test({ component }) {
component.$destroy();
component.$destroy();
}
diff --git a/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/_config.js b/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/_config.js
new file mode 100644
index 0000000000..75025e4614
--- /dev/null
+++ b/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/_config.js
@@ -0,0 +1,6 @@
+export default {
+ html: `
+ hello undefined
+ hello bar2
+ `
+};
diff --git a/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/main.svelte b/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/main.svelte
new file mode 100644
index 0000000000..b71b25bd67
--- /dev/null
+++ b/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/main.svelte
@@ -0,0 +1,11 @@
+
+
+hello {bar}
+hello {bar2}
diff --git a/test/runtime/samples/destructured-props-1/A.svelte b/test/runtime/samples/destructured-props-1/A.svelte
new file mode 100644
index 0000000000..d1b392ef34
--- /dev/null
+++ b/test/runtime/samples/destructured-props-1/A.svelte
@@ -0,0 +1,24 @@
+
+
+
+a: {a},
+b: {typeof b},
+c: {c},
+d_one: {d_one},
+d_three: {$d_three},
+f: {f},
+g: {g},
+e: {typeof e},
+e_one: {e_one},
+A: {A},
+C: {C}
+
+{JSON.stringify(THING)}
\ No newline at end of file
diff --git a/test/runtime/samples/destructured-props-1/_config.js b/test/runtime/samples/destructured-props-1/_config.js
new file mode 100644
index 0000000000..29feaaabab
--- /dev/null
+++ b/test/runtime/samples/destructured-props-1/_config.js
@@ -0,0 +1,9 @@
+export default {
+ html: `
+ a: 1, b: undefined, c: 2, d_one: 3, d_three: 5, f: undefined, g: 9, e: undefined, e_one: 6, A: 1, C: 2
+ {"a":1,"b":{"c":2,"d":[3,4,{}]},"e":[6],"h":8}
+
+ a: a, b: undefined, c: 2, d_one: d_one, d_three: 5, f: f, g: g, e: undefined, e_one: 6, A: 1, C: 2
+ {"a":1,"b":{"c":2,"d":[3,4,{}]},"e":[6],"h":8}
+ `
+};
diff --git a/test/runtime/samples/destructured-props-1/main.svelte b/test/runtime/samples/destructured-props-1/main.svelte
new file mode 100644
index 0000000000..dbe7c88d33
--- /dev/null
+++ b/test/runtime/samples/destructured-props-1/main.svelte
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/test/runtime/samples/destructured-props-2/A.svelte b/test/runtime/samples/destructured-props-2/A.svelte
new file mode 100644
index 0000000000..51167edbc4
--- /dev/null
+++ b/test/runtime/samples/destructured-props-2/A.svelte
@@ -0,0 +1,21 @@
+
+
+
+ x: {x},
+ list_two_a: {list_two_a},
+ list_two_b: {list_two_b},
+ y: {$y},
+ m: {m},
+ n: {n},
+ o: {o},
+ p: {p},
+ q: {$q}
+
+{JSON.stringify(LIST)}
\ No newline at end of file
diff --git a/test/runtime/samples/destructured-props-2/_config.js b/test/runtime/samples/destructured-props-2/_config.js
new file mode 100644
index 0000000000..c647f31be1
--- /dev/null
+++ b/test/runtime/samples/destructured-props-2/_config.js
@@ -0,0 +1,19 @@
+export default {
+ html: `
+ x: 1, list_two_a: 2, list_two_b: 5, y: 4, m: 1, n: 2, o: 5, p: 3, q: 4
+ [1,{"a":2},[3,{}]]
+ x: 1, list_two_a: 2, list_two_b: 5, y: 4, m: m, n: n, o: o, p: p, q: q
+ [1,{"a":2},[3,{}]]
+ `,
+
+ async test({ component, assert, target }) {
+ await component.update();
+
+ assert.htmlEqual(target.innerHTML, `
+ x: 1, list_two_a: 2, list_two_b: 5, y: 4, m: 1, n: 2, o: 5, p: 3, q: 4
+ [1,{"a":2},[3,{}]]
+ x: 1, list_two_a: 2, list_two_b: 5, y: 4, m: MM, n: NN, o: OO, p: PP, q: QQ
+ [1,{"a":2},[3,{}]]
+ `);
+ }
+};
diff --git a/test/runtime/samples/destructured-props-2/main.svelte b/test/runtime/samples/destructured-props-2/main.svelte
new file mode 100644
index 0000000000..f0044bb567
--- /dev/null
+++ b/test/runtime/samples/destructured-props-2/main.svelte
@@ -0,0 +1,30 @@
+
+
+
+
+
diff --git a/test/runtime/samples/destructured-props-3/A.svelte b/test/runtime/samples/destructured-props-3/A.svelte
new file mode 100644
index 0000000000..6c5aca05b0
--- /dev/null
+++ b/test/runtime/samples/destructured-props-3/A.svelte
@@ -0,0 +1,10 @@
+
+
+i: {i}, j: {j}, k: {$k}, l: {l}, m: {m}, n: {$n}, a: {a}, b: {b}, c: {$c}, d: {d}, e: {e}, f: {$f}
\ No newline at end of file
diff --git a/test/runtime/samples/destructured-props-3/_config.js b/test/runtime/samples/destructured-props-3/_config.js
new file mode 100644
index 0000000000..6d2e516e0e
--- /dev/null
+++ b/test/runtime/samples/destructured-props-3/_config.js
@@ -0,0 +1,15 @@
+export default {
+ html: `
+ i: 9, j: 10, k: 11, l: 12, m: 13, n: 14, a: 9, b: 10, c: 11, d: 12, e: 13, f: 14
+
+ i: 9, j: 10, k: 11, l: 12, m: 13, n: 14, a: a, b: 10, c: c, d: d, e: 13, f: f
+ `,
+ async test({ component, target, assert }) {
+ await component.update();
+ assert.htmlEqual(target.innerHTML, `
+ i: 9, j: 10, k: 11, l: 12, m: 13, n: 14, a: 9, b: 10, c: 11, d: 12, e: 13, f: 14
+
+ i: 9, j: 10, k: 11, l: 12, m: 13, n: 14, a: aa, b: 10, c: cc, d: dd, e: 13, f: ff
+ `);
+ }
+};
diff --git a/test/runtime/samples/destructured-props-3/main.svelte b/test/runtime/samples/destructured-props-3/main.svelte
new file mode 100644
index 0000000000..8152d61aab
--- /dev/null
+++ b/test/runtime/samples/destructured-props-3/main.svelte
@@ -0,0 +1,29 @@
+
+
+
+
+
diff --git a/test/runtime/samples/dynamic-component-destroy-null/_config.js b/test/runtime/samples/dynamic-component-destroy-null/_config.js
index 00f7d47d0f..c9bc1a05c0 100644
--- a/test/runtime/samples/dynamic-component-destroy-null/_config.js
+++ b/test/runtime/samples/dynamic-component-destroy-null/_config.js
@@ -3,7 +3,7 @@ export default {
x: true
},
- test({ assert, component }) {
+ test({ component }) {
component.x = false;
}
};
diff --git a/test/runtime/samples/each-block-destructured-default-binding/_config.js b/test/runtime/samples/each-block-destructured-default-binding/_config.js
index 3697e37441..2ba27bff03 100644
--- a/test/runtime/samples/each-block-destructured-default-binding/_config.js
+++ b/test/runtime/samples/each-block-destructured-default-binding/_config.js
@@ -4,7 +4,7 @@ export default {
`,
ssrHtml: `
-
+
`,
diff --git a/test/runtime/samples/each-block-keyed-changed/_config.js b/test/runtime/samples/each-block-keyed-changed/_config.js
new file mode 100644
index 0000000000..afb3593b94
--- /dev/null
+++ b/test/runtime/samples/each-block-keyed-changed/_config.js
@@ -0,0 +1,13 @@
+export default {
+ props: {
+ titles: [{ name: 'a' }, { name: 'b' }, { name: 'c' }]
+ },
+
+ html: '',
+
+ test({ assert, component, target }) {
+ component.titles = [{ name: 'b' }, { name: 'c' }, { name: 'a' }];
+
+ assert.htmlEqual(target.innerHTML, '');
+ }
+};
diff --git a/test/runtime/samples/each-block-keyed-changed/main.svelte b/test/runtime/samples/each-block-keyed-changed/main.svelte
new file mode 100644
index 0000000000..1e1ef513a7
--- /dev/null
+++ b/test/runtime/samples/each-block-keyed-changed/main.svelte
@@ -0,0 +1,8 @@
+
+
+ {#each titles as title (title.name)}
+
{title.name}
+ {/each}
+
diff --git a/test/runtime/samples/each-block-keyed-component-action/_config.js b/test/runtime/samples/each-block-keyed-component-action/_config.js
index a1afc44c93..af621330d3 100644
--- a/test/runtime/samples/each-block-keyed-component-action/_config.js
+++ b/test/runtime/samples/each-block-keyed-component-action/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, raf }) {
+ test({ assert, component }) {
assert.equal(component.count, 0);
component.arr = ['2'];
diff --git a/test/runtime/samples/each-block-keyed-dyanmic-key/_config.js b/test/runtime/samples/each-block-keyed-dyanmic-key/_config.js
index 0aed1b0e07..949235ee48 100644
--- a/test/runtime/samples/each-block-keyed-dyanmic-key/_config.js
+++ b/test/runtime/samples/each-block-keyed-dyanmic-key/_config.js
@@ -9,6 +9,10 @@ export default {
}
},
+ before_test() {
+ count = 0;
+ },
+
html: `
foo
foo
diff --git a/test/runtime/samples/each-block-keyed-dynamic-2/_config.js b/test/runtime/samples/each-block-keyed-dynamic-2/_config.js
index e25083c751..0c28656f5f 100644
--- a/test/runtime/samples/each-block-keyed-dynamic-2/_config.js
+++ b/test/runtime/samples/each-block-keyed-dynamic-2/_config.js
@@ -5,7 +5,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/each-blocks-assignment-2/_config.js b/test/runtime/samples/each-blocks-assignment-2/_config.js
index f69b4fe9f6..93f06956d0 100644
--- a/test/runtime/samples/each-blocks-assignment-2/_config.js
+++ b/test/runtime/samples/each-blocks-assignment-2/_config.js
@@ -3,7 +3,7 @@ export default {
foo
Test
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const clickEvent = new window.MouseEvent('click');
diff --git a/test/runtime/samples/each-blocks-assignment/_config.js b/test/runtime/samples/each-blocks-assignment/_config.js
index b651e3e02b..5e22381e9e 100644
--- a/test/runtime/samples/each-blocks-assignment/_config.js
+++ b/test/runtime/samples/each-blocks-assignment/_config.js
@@ -8,7 +8,7 @@ export default {
3
Test
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
let [incrementBtn, ...buttons] = target.querySelectorAll('button');
const clickEvent = new window.MouseEvent('click');
@@ -92,6 +92,6 @@ export default {
8
Test
`
- );
+ );
}
};
diff --git a/test/runtime/samples/each-blocks-nested-b/_config.js b/test/runtime/samples/each-blocks-nested-b/_config.js
index 7b13d988b4..ab008b4249 100644
--- a/test/runtime/samples/each-blocks-nested-b/_config.js
+++ b/test/runtime/samples/each-blocks-nested-b/_config.js
@@ -29,7 +29,7 @@ export default {
]
},
html: 'animals: aardvark
animals: buffalo
animals: chinchilla
countries: albania
countries: brazil
countries: china
people: alice
people: bob
people: carol
people: dave
',
- test({ assert, component, target }) {
+ test() {
// TODO
}
};
diff --git a/test/runtime/samples/each-blocks-nested/_config.js b/test/runtime/samples/each-blocks-nested/_config.js
index 3318bc344d..04d9bd11c5 100644
--- a/test/runtime/samples/each-blocks-nested/_config.js
+++ b/test/runtime/samples/each-blocks-nested/_config.js
@@ -6,7 +6,6 @@ export default {
html: 'a, 1
a, 2
a, 3
b, 1
b, 2
b, 3
c, 1
c, 2
c, 3
',
- test({ assert, component, target }) {
- // TODO
- }
+ // TODO
+ test() {}
};
diff --git a/test/runtime/samples/element-source-location/_config.js b/test/runtime/samples/element-source-location/_config.js
index 101cc2cad1..be528d15eb 100644
--- a/test/runtime/samples/element-source-location/_config.js
+++ b/test/runtime/samples/element-source-location/_config.js
@@ -5,7 +5,7 @@ export default {
dev: true
},
- test({ assert, component, target }) {
+ test({ assert, target }) {
const h1 = target.querySelector('h1');
const p = target.querySelector('p');
diff --git a/test/runtime/samples/event-handler-console-log/_config.js b/test/runtime/samples/event-handler-console-log/_config.js
index 35e447c45b..289a84e44c 100644
--- a/test/runtime/samples/event-handler-console-log/_config.js
+++ b/test/runtime/samples/event-handler-console-log/_config.js
@@ -7,7 +7,7 @@ export default {
click me
`,
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
const button = target.querySelector('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/event-handler-destructured/_config.js b/test/runtime/samples/event-handler-destructured/_config.js
index b32fe76c0a..2c37a17c75 100644
--- a/test/runtime/samples/event-handler-destructured/_config.js
+++ b/test/runtime/samples/event-handler-destructured/_config.js
@@ -3,7 +3,7 @@ export default {
clicked: false
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/event-handler-dynamic-bound-var/_config.js b/test/runtime/samples/event-handler-dynamic-bound-var/_config.js
index c490db000a..fbbfee221d 100644
--- a/test/runtime/samples/event-handler-dynamic-bound-var/_config.js
+++ b/test/runtime/samples/event-handler-dynamic-bound-var/_config.js
@@ -3,7 +3,7 @@ export default {
Click Me
Hello World
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/event-handler-dynamic-expression/_config.js b/test/runtime/samples/event-handler-dynamic-expression/_config.js
index f479c9cef2..f2c876cdeb 100644
--- a/test/runtime/samples/event-handler-dynamic-expression/_config.js
+++ b/test/runtime/samples/event-handler-dynamic-expression/_config.js
@@ -1,7 +1,7 @@
export default {
html: 'bar ',
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [button] = target.querySelectorAll(
'button'
);
@@ -10,10 +10,10 @@ export default {
await button.dispatchEvent(event);
assert.htmlEqual(target.innerHTML, 'foo ');
-
+
await button.dispatchEvent(event);
assert.htmlEqual(target.innerHTML, 'bar ');
-
+
await button.dispatchEvent(event);
assert.htmlEqual(target.innerHTML, 'foo ');
}
diff --git a/test/runtime/samples/event-handler-dynamic-hash/_config.js b/test/runtime/samples/event-handler-dynamic-hash/_config.js
index 35f5fa103d..e98d0f6104 100644
--- a/test/runtime/samples/event-handler-dynamic-hash/_config.js
+++ b/test/runtime/samples/event-handler-dynamic-hash/_config.js
@@ -8,7 +8,7 @@ export default {
click
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [updateButton1, updateButton2, button] = target.querySelectorAll(
'button'
);
diff --git a/test/runtime/samples/event-handler-dynamic-invalid/_config.js b/test/runtime/samples/event-handler-dynamic-invalid/_config.js
index 0ed298c95a..beebd4459e 100644
--- a/test/runtime/samples/event-handler-dynamic-invalid/_config.js
+++ b/test/runtime/samples/event-handler-dynamic-invalid/_config.js
@@ -3,7 +3,7 @@ export default {
null
invalid `,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [buttonUndef, buttonNull, buttonInvalid] = target.querySelectorAll(
'button'
);
diff --git a/test/runtime/samples/event-handler-dynamic/_config.js b/test/runtime/samples/event-handler-dynamic/_config.js
index 35f5fa103d..e98d0f6104 100644
--- a/test/runtime/samples/event-handler-dynamic/_config.js
+++ b/test/runtime/samples/event-handler-dynamic/_config.js
@@ -8,7 +8,7 @@ export default {
click
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [updateButton1, updateButton2, button] = target.querySelectorAll(
'button'
);
diff --git a/test/runtime/samples/event-handler-each/_config.js b/test/runtime/samples/event-handler-each/_config.js
index 281f6d0d7c..9c0407860e 100644
--- a/test/runtime/samples/event-handler-each/_config.js
+++ b/test/runtime/samples/event-handler-each/_config.js
@@ -15,7 +15,7 @@ export default {
selected: foo
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/event-handler-modifier-trusted/_config.js b/test/runtime/samples/event-handler-modifier-trusted/_config.js
new file mode 100644
index 0000000000..ac269e674a
--- /dev/null
+++ b/test/runtime/samples/event-handler-modifier-trusted/_config.js
@@ -0,0 +1,9 @@
+export default {
+ async test({ assert, component, target, window }) {
+ const button = target.querySelector('button');
+ const event = new window.MouseEvent('click');
+
+ await button.dispatchEvent(event);
+ assert.equal(component.trusted, true);
+ }
+};
diff --git a/test/runtime/samples/event-handler-modifier-trusted/main.svelte b/test/runtime/samples/event-handler-modifier-trusted/main.svelte
new file mode 100644
index 0000000000..504326a498
--- /dev/null
+++ b/test/runtime/samples/event-handler-modifier-trusted/main.svelte
@@ -0,0 +1,5 @@
+
+
+ trusted = false}">Only trusted events: {trusted?'true':'false'}
diff --git a/test/runtime/samples/event-handler-sanitize/_config.js b/test/runtime/samples/event-handler-sanitize/_config.js
index 9f16b14093..ddc15724a3 100644
--- a/test/runtime/samples/event-handler-sanitize/_config.js
+++ b/test/runtime/samples/event-handler-sanitize/_config.js
@@ -3,7 +3,7 @@ export default {
toggle
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const div = target.querySelector('div');
const event = new window.MouseEvent('some-event');
diff --git a/test/runtime/samples/event-handler-this-methods/_config.js b/test/runtime/samples/event-handler-this-methods/_config.js
index 8be56cf1a6..d7907f752d 100644
--- a/test/runtime/samples/event-handler-this-methods/_config.js
+++ b/test/runtime/samples/event-handler-this-methods/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
// Click events don't focus elements in JSDOM – obviously they would
// in real browsers. More realistically, you'd use this for e.g.
// this.select(), but that's harder to test than this.focus()
diff --git a/test/runtime/samples/event-handler/_config.js b/test/runtime/samples/event-handler/_config.js
index 3a5ac7a18b..f142fc9daa 100644
--- a/test/runtime/samples/event-handler/_config.js
+++ b/test/runtime/samples/event-handler/_config.js
@@ -3,7 +3,7 @@ export default {
toggle
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/export-from/A.svelte b/test/runtime/samples/export-from/A.svelte
new file mode 100644
index 0000000000..7773727704
--- /dev/null
+++ b/test/runtime/samples/export-from/A.svelte
@@ -0,0 +1,23 @@
+
+
+
+
+a: {typeof a}
+b: {typeof b}
+c: {typeof c}
+d: {typeof d}
+e: {typeof e}
+f: {typeof f}
+g: {typeof g}
\ No newline at end of file
diff --git a/test/runtime/samples/export-from/B.svelte b/test/runtime/samples/export-from/B.svelte
new file mode 100644
index 0000000000..0cc1070cb5
--- /dev/null
+++ b/test/runtime/samples/export-from/B.svelte
@@ -0,0 +1,8 @@
+
diff --git a/test/runtime/samples/export-from/_config.js b/test/runtime/samples/export-from/_config.js
new file mode 100644
index 0000000000..9e65b7501d
--- /dev/null
+++ b/test/runtime/samples/export-from/_config.js
@@ -0,0 +1,28 @@
+export default {
+ html: `
+ a,b,undefined,c
+
+ a: undefined
+ b: number
+ c: undefined
+ d: undefined
+ e: number
+ f: undefined
+ g: undefined
+
+ {"d":"d","e":"e","g":"f"}
+ `,
+ ssrHtml: `
+ a,b,undefined,c
+
+ a: undefined
+ b: number
+ c: undefined
+ d: undefined
+ e: number
+ f: undefined
+ g: undefined
+
+ {}
+ `
+};
diff --git a/test/runtime/samples/export-from/main.svelte b/test/runtime/samples/export-from/main.svelte
new file mode 100644
index 0000000000..18cc066c1f
--- /dev/null
+++ b/test/runtime/samples/export-from/main.svelte
@@ -0,0 +1,21 @@
+
+
+{a},{b},{c},{d}
+
+
+
+{JSON.stringify(props)}
\ No newline at end of file
diff --git a/test/runtime/samples/globals-accessible-directly/_config.js b/test/runtime/samples/globals-accessible-directly/_config.js
index ad010356c8..30e176ae1b 100644
--- a/test/runtime/samples/globals-accessible-directly/_config.js
+++ b/test/runtime/samples/globals-accessible-directly/_config.js
@@ -1,7 +1,7 @@
export default {
html: '',
- test({ assert, component, target }) {
+ test({ assert, target }) {
assert.htmlEqual(target.innerHTML, 'NaN');
}
};
diff --git a/test/runtime/samples/head-if-else-block/_config.js b/test/runtime/samples/head-if-else-block/_config.js
index 7665bfe90b..64da6ff796 100644
--- a/test/runtime/samples/head-if-else-block/_config.js
+++ b/test/runtime/samples/head-if-else-block/_config.js
@@ -3,7 +3,7 @@ export default {
condition: false
},
- test({ assert, component, target, window }) {
+ test({ assert, component, window }) {
assert.equal(window.document.title, '');
assert.equal(Boolean(window.document.getElementById('meta')), true);
diff --git a/test/runtime/samples/head-title-dynamic-simple/_config.js b/test/runtime/samples/head-title-dynamic-simple/_config.js
index cc2301a2f9..7a086419ee 100644
--- a/test/runtime/samples/head-title-dynamic-simple/_config.js
+++ b/test/runtime/samples/head-title-dynamic-simple/_config.js
@@ -3,7 +3,7 @@ export default {
foo: 'A Title'
},
- test({ assert, component, target, window }) {
+ test({ assert, component, window }) {
assert.equal(window.document.title, 'A Title');
component.foo = 'Also A Title';
diff --git a/test/runtime/samples/head-title-dynamic/_config.js b/test/runtime/samples/head-title-dynamic/_config.js
index 95d5f8debf..2555e55b8c 100644
--- a/test/runtime/samples/head-title-dynamic/_config.js
+++ b/test/runtime/samples/head-title-dynamic/_config.js
@@ -3,7 +3,7 @@ export default {
adjective: 'custom'
},
- test({ assert, component, target, window }) {
+ test({ assert, component, window }) {
assert.equal(window.document.title, 'a custom title');
component.adjective = 'different';
diff --git a/test/runtime/samples/head-title-static/_config.js b/test/runtime/samples/head-title-static/_config.js
index ee9a0316b5..184d04c092 100644
--- a/test/runtime/samples/head-title-static/_config.js
+++ b/test/runtime/samples/head-title-static/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window }) {
+ test({ assert, window }) {
assert.equal(window.document.title, 'changed');
}
};
diff --git a/test/runtime/samples/if-block-conservative-update/_config.js b/test/runtime/samples/if-block-conservative-update/_config.js
index f84ccb6b43..f7ba01a8fd 100644
--- a/test/runtime/samples/if-block-conservative-update/_config.js
+++ b/test/runtime/samples/if-block-conservative-update/_config.js
@@ -11,6 +11,9 @@ export default {
html: 'potato
',
+ before_test() {
+ count = 0;
+ },
test({ assert, component, target }) {
assert.equal(count, 1);
diff --git a/test/runtime/samples/if-block-else-conservative-update/_config.js b/test/runtime/samples/if-block-else-conservative-update/_config.js
index da83385dd5..b3db0bca54 100644
--- a/test/runtime/samples/if-block-else-conservative-update/_config.js
+++ b/test/runtime/samples/if-block-else-conservative-update/_config.js
@@ -17,6 +17,11 @@ export default {
html: 'potato
',
+ before_test() {
+ count_a = 0;
+ count_b = 0;
+ },
+
test({ assert, component, target }) {
assert.equal(count_a, 1);
assert.equal(count_b, 0);
diff --git a/test/runtime/samples/if-block-else-update/_config.js b/test/runtime/samples/if-block-else-update/_config.js
new file mode 100644
index 0000000000..db35ca8488
--- /dev/null
+++ b/test/runtime/samples/if-block-else-update/_config.js
@@ -0,0 +1,46 @@
+export default {
+ async test({ assert, component, target, window }) {
+ const [btn1, btn2] = target.querySelectorAll('button');
+
+ const clickEvent = new window.MouseEvent('click');
+
+ await btn2.dispatchEvent(clickEvent);
+ assert.htmlEqual(target.innerHTML, `
+ Toggle foo
+ Toggle bar
+
+ foo: false, bar: true
+
+ bar!
+ `);
+
+ await btn1.dispatchEvent(clickEvent);
+ assert.htmlEqual(target.innerHTML, `
+ Toggle foo
+ Toggle bar
+
+ foo: true, bar: true
+
+ foo!
+ `);
+
+ await btn2.dispatchEvent(clickEvent);
+ assert.htmlEqual(target.innerHTML, `
+ Toggle foo
+ Toggle bar
+
+ foo: true, bar: false
+
+ foo!
+ `);
+
+ await btn1.dispatchEvent(clickEvent);
+ assert.htmlEqual(target.innerHTML, `
+ Toggle foo
+ Toggle bar
+
+ foo: false, bar: false
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/if-block-else-update/main.svelte b/test/runtime/samples/if-block-else-update/main.svelte
new file mode 100644
index 0000000000..258d0422ba
--- /dev/null
+++ b/test/runtime/samples/if-block-else-update/main.svelte
@@ -0,0 +1,21 @@
+
+
+ foo = !foo}>
+ Toggle foo
+
+ bar[0] = !bar[0]}>
+ Toggle bar
+
+
+
+{@html `foo: ${foo}, bar: ${bar.every(x => x)}`}
+
+
+{#if foo}
+ foo!
+{:else if bar.every(x => x)}
+ bar!
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/if-block-outro-computed-function/Foo.svelte b/test/runtime/samples/if-block-outro-computed-function/Foo.svelte
new file mode 100644
index 0000000000..1910281566
--- /dev/null
+++ b/test/runtime/samples/if-block-outro-computed-function/Foo.svelte
@@ -0,0 +1 @@
+foo
\ No newline at end of file
diff --git a/test/runtime/samples/if-block-outro-computed-function/_config.js b/test/runtime/samples/if-block-outro-computed-function/_config.js
new file mode 100644
index 0000000000..69fd95d008
--- /dev/null
+++ b/test/runtime/samples/if-block-outro-computed-function/_config.js
@@ -0,0 +1,12 @@
+export default {
+ props: {
+ foo: true
+ },
+
+ html: 'foo',
+
+ test({ assert, component, target }) {
+ component.foo = false;
+ assert.htmlEqual(target.innerHTML, 'bar');
+ }
+};
diff --git a/test/runtime/samples/if-block-outro-computed-function/main.svelte b/test/runtime/samples/if-block-outro-computed-function/main.svelte
new file mode 100644
index 0000000000..adf7cc3e0b
--- /dev/null
+++ b/test/runtime/samples/if-block-outro-computed-function/main.svelte
@@ -0,0 +1,13 @@
+
+
+{#if foo}
+
+{:else if bar()}
+ bar
+{:else}
+ else
+{/if}
diff --git a/test/runtime/samples/if-block-outro-nested-else/_config.js b/test/runtime/samples/if-block-outro-nested-else/_config.js
index 226116fe13..06b89ea723 100644
--- a/test/runtime/samples/if-block-outro-nested-else/_config.js
+++ b/test/runtime/samples/if-block-outro-nested-else/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target }) {
+ test({ component }) {
// Would cause "TypeError: Cannot read property 'o' of undefined"
component.foo = false;
}
diff --git a/test/runtime/samples/inline-style-directive-and-style-attr-merged/_config.js b/test/runtime/samples/inline-style-directive-and-style-attr-merged/_config.js
new file mode 100644
index 0000000000..f5780daf80
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-and-style-attr-merged/_config.js
@@ -0,0 +1,13 @@
+export default {
+ html: `
+
+ `,
+
+ test({ assert, target, window }) {
+ const p = target.querySelector('p');
+
+ const styles = window.getComputedStyle(p);
+ assert.equal(styles.color, 'red');
+ assert.equal(styles.height, '40px');
+ }
+};
diff --git a/test/runtime/samples/inline-style-directive-and-style-attr-merged/main.svelte b/test/runtime/samples/inline-style-directive-and-style-attr-merged/main.svelte
new file mode 100644
index 0000000000..6f3e86b9bf
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-and-style-attr-merged/main.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/test/runtime/samples/inline-style-directive-and-style-attr/_config.js b/test/runtime/samples/inline-style-directive-and-style-attr/_config.js
new file mode 100644
index 0000000000..f5780daf80
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-and-style-attr/_config.js
@@ -0,0 +1,13 @@
+export default {
+ html: `
+
+ `,
+
+ test({ assert, target, window }) {
+ const p = target.querySelector('p');
+
+ const styles = window.getComputedStyle(p);
+ assert.equal(styles.color, 'red');
+ assert.equal(styles.height, '40px');
+ }
+};
diff --git a/test/runtime/samples/inline-style-directive-and-style-attr/main.svelte b/test/runtime/samples/inline-style-directive-and-style-attr/main.svelte
new file mode 100644
index 0000000000..e2ba0fa591
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-and-style-attr/main.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/test/runtime/samples/inline-style-directive-css-vars/_config.js b/test/runtime/samples/inline-style-directive-css-vars/_config.js
new file mode 100644
index 0000000000..c8b239a42b
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-css-vars/_config.js
@@ -0,0 +1,9 @@
+export default {
+ html: '
',
+
+ test({ assert, component, target }) {
+ component.myColor = 'blue';
+
+ assert.htmlEqual(target.innerHTML, '
');
+ }
+};
diff --git a/test/runtime/samples/inline-style-directive-css-vars/main.svelte b/test/runtime/samples/inline-style-directive-css-vars/main.svelte
new file mode 100644
index 0000000000..689a2333f5
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-css-vars/main.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/test/runtime/samples/inline-style-directive-dynamic/_config.js b/test/runtime/samples/inline-style-directive-dynamic/_config.js
new file mode 100644
index 0000000000..a2214fd872
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-dynamic/_config.js
@@ -0,0 +1,10 @@
+export default {
+ html: `
+
+ `,
+
+ test({ assert, component, target }) {
+ component.myColor = 'blue';
+ assert.htmlEqual(target.innerHTML, '
');
+ }
+};
diff --git a/test/runtime/samples/inline-style-directive-dynamic/main.svelte b/test/runtime/samples/inline-style-directive-dynamic/main.svelte
new file mode 100644
index 0000000000..1d60aefa6f
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-dynamic/main.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/test/runtime/samples/inline-style-directive-multiple/_config.js b/test/runtime/samples/inline-style-directive-multiple/_config.js
new file mode 100644
index 0000000000..725d03c4fe
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-multiple/_config.js
@@ -0,0 +1,27 @@
+export default {
+ html: `
+
+ `,
+
+ test({ assert, component, target, window }) {
+ const p = target.querySelector('p');
+
+ let styles = window.getComputedStyle(p);
+ assert.equal(styles.color, 'red');
+
+ component.myColor = 'pink';
+ component.width = '100vh';
+ component.absolute = true;
+ component.bold = false;
+
+ styles = window.getComputedStyle(p);
+ assert.htmlEqual(
+ target.innerHTML,
+ '
'
+ );
+ assert.equal(styles.color, 'pink');
+ assert.equal(styles.width, '100vh');
+ assert.equal(styles.fontWeight, '100');
+ assert.equal(styles.position, 'absolute');
+ }
+};
diff --git a/test/runtime/samples/inline-style-directive-multiple/main.svelte b/test/runtime/samples/inline-style-directive-multiple/main.svelte
new file mode 100644
index 0000000000..06f03206d5
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-multiple/main.svelte
@@ -0,0 +1,13 @@
+
+
+
diff --git a/test/runtime/samples/inline-style-directive-shorthand/_config.js b/test/runtime/samples/inline-style-directive-shorthand/_config.js
new file mode 100644
index 0000000000..64043e5269
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-shorthand/_config.js
@@ -0,0 +1,18 @@
+export default {
+ html: `
+
+ `,
+
+ test({ assert, component, target, window }) {
+ const p = target.querySelector('p');
+
+ let styles = window.getComputedStyle(p);
+ assert.equal(styles.color, 'red');
+
+ component.color = 'blue';
+ assert.htmlEqual(target.innerHTML, '
');
+
+ styles = window.getComputedStyle(p);
+ assert.equal(styles.color, 'blue');
+ }
+};
diff --git a/test/runtime/samples/inline-style-directive-shorthand/main.svelte b/test/runtime/samples/inline-style-directive-shorthand/main.svelte
new file mode 100644
index 0000000000..65bbff910b
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-shorthand/main.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/test/runtime/samples/inline-style-directive-spread-and-attr-empty/_config.js b/test/runtime/samples/inline-style-directive-spread-and-attr-empty/_config.js
new file mode 100644
index 0000000000..f3dcbc8823
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-spread-and-attr-empty/_config.js
@@ -0,0 +1,5 @@
+export default {
+ html: `
+
+ `
+};
diff --git a/test/runtime/samples/inline-style-directive-spread-and-attr-empty/main.svelte b/test/runtime/samples/inline-style-directive-spread-and-attr-empty/main.svelte
new file mode 100644
index 0000000000..c2d5cb4d3f
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-spread-and-attr-empty/main.svelte
@@ -0,0 +1,11 @@
+
+
+
diff --git a/test/runtime/samples/inline-style-directive-spread-and-attr/_config.js b/test/runtime/samples/inline-style-directive-spread-and-attr/_config.js
new file mode 100644
index 0000000000..b3660bd5ca
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-spread-and-attr/_config.js
@@ -0,0 +1,43 @@
+export default {
+ html: `
+
+ `,
+
+ test({ assert, component, target, window }) {
+ const p = target.querySelector('p');
+
+ let styles = window.getComputedStyle(p);
+ assert.equal(styles.color, 'green');
+
+ component.color = null;
+ assert.htmlEqual(target.innerHTML, '
');
+ styles = window.getComputedStyle(p);
+ assert.equal(styles.color, '');
+
+ component.spread = { style: 'color: yellow; padding: 30px;' };
+
+ assert.htmlEqual(target.innerHTML, '
');
+ styles = window.getComputedStyle(p);
+ assert.equal(styles.color, '');
+ assert.equal(styles.padding, '30px');
+
+ component.spread = {};
+ component.style = 'color: blue; background-color: green;';
+ assert.htmlEqual(
+ target.innerHTML,
+ '
'
+ );
+ styles = window.getComputedStyle(p);
+ assert.equal(styles.color, '');
+ assert.equal(styles.backgroundColor, 'green');
+
+ component.color = 'purple';
+ assert.htmlEqual(
+ target.innerHTML,
+ '
'
+ );
+ styles = window.getComputedStyle(p);
+ assert.equal(styles.color, 'purple');
+ assert.equal(styles.backgroundColor, 'green');
+ }
+};
diff --git a/test/runtime/samples/inline-style-directive-spread-and-attr/main.svelte b/test/runtime/samples/inline-style-directive-spread-and-attr/main.svelte
new file mode 100644
index 0000000000..a9696df675
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-spread-and-attr/main.svelte
@@ -0,0 +1,11 @@
+
+
+
diff --git a/test/runtime/samples/inline-style-directive-spread-dynamic/_config.js b/test/runtime/samples/inline-style-directive-spread-dynamic/_config.js
new file mode 100644
index 0000000000..152e4036a0
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-spread-dynamic/_config.js
@@ -0,0 +1,39 @@
+export default {
+ html: `
+
+ `,
+
+ test({ assert, component, target, window }) {
+ const p = target.querySelector('p');
+
+ const styles = window.getComputedStyle(p);
+ assert.equal(styles.color, 'blue');
+ assert.equal(styles.width, '65px');
+ assert.equal(p.id, 'my-id');
+
+ component.color = 'red';
+
+ assert.htmlEqual(
+ target.innerHTML,
+ '
'
+ );
+
+ component.obj = { style: 'height: 72px;' };
+
+ assert.htmlEqual(
+ target.innerHTML,
+ '
'
+ );
+
+ component.obj = { style: 'border-radius: 2px; color: orange' };
+
+ assert.htmlEqual(
+ target.innerHTML,
+ '
'
+ );
+
+ component.obj = {};
+
+ assert.htmlEqual(target.innerHTML, '
');
+ }
+};
diff --git a/test/runtime/samples/inline-style-directive-spread-dynamic/main.svelte b/test/runtime/samples/inline-style-directive-spread-dynamic/main.svelte
new file mode 100644
index 0000000000..a514e4856f
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-spread-dynamic/main.svelte
@@ -0,0 +1,5 @@
+
+
diff --git a/test/runtime/samples/inline-style-directive-spread/_config.js b/test/runtime/samples/inline-style-directive-spread/_config.js
new file mode 100644
index 0000000000..adb8a26544
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-spread/_config.js
@@ -0,0 +1,14 @@
+export default {
+ html: `
+
+ `,
+
+ test({ assert, target, window }) {
+ const p = target.querySelector('p');
+
+ const styles = window.getComputedStyle(p);
+ assert.equal(styles.color, 'blue');
+ assert.equal(styles.width, '65px');
+ assert.equal(p.id, 'my-id');
+ }
+};
diff --git a/test/runtime/samples/inline-style-directive-spread/main.svelte b/test/runtime/samples/inline-style-directive-spread/main.svelte
new file mode 100644
index 0000000000..51291146c7
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-spread/main.svelte
@@ -0,0 +1 @@
+
diff --git a/test/runtime/samples/inline-style-directive-string-variable/_config.js b/test/runtime/samples/inline-style-directive-string-variable/_config.js
new file mode 100644
index 0000000000..411a42db8e
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-string-variable/_config.js
@@ -0,0 +1,23 @@
+export default {
+ html: `
+
+ `,
+
+ test({ assert, component, target, window }) {
+ const p = target.querySelector('p');
+
+ const styles = window.getComputedStyle(p);
+ assert.equal(styles.color, 'green');
+ assert.equal(styles.transform, 'translateX(45px)');
+ assert.equal(styles.border, '100px solid pink');
+
+ component.translate_x = '100%';
+ component.border_width = 20;
+ component.border_color = 'yellow';
+
+ assert.htmlEqual(
+ target.innerHTML,
+ '
'
+ );
+ }
+};
diff --git a/test/runtime/samples/inline-style-directive-string-variable/main.svelte b/test/runtime/samples/inline-style-directive-string-variable/main.svelte
new file mode 100644
index 0000000000..1f0b5019f4
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-string-variable/main.svelte
@@ -0,0 +1,7 @@
+
+
+
diff --git a/test/runtime/samples/inline-style-directive-string/_config.js b/test/runtime/samples/inline-style-directive-string/_config.js
new file mode 100644
index 0000000000..ec32e157e5
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-string/_config.js
@@ -0,0 +1,12 @@
+export default {
+ html: `
+
+ `,
+
+ test({ assert, target, window }) {
+ const p = target.querySelector('p');
+
+ const styles = window.getComputedStyle(p);
+ assert.equal(styles.color, 'red');
+ }
+};
diff --git a/test/runtime/samples/inline-style-directive-string/main.svelte b/test/runtime/samples/inline-style-directive-string/main.svelte
new file mode 100644
index 0000000000..4e7ce22b22
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive-string/main.svelte
@@ -0,0 +1 @@
+
diff --git a/test/runtime/samples/inline-style-directive/_config.js b/test/runtime/samples/inline-style-directive/_config.js
new file mode 100644
index 0000000000..ec32e157e5
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive/_config.js
@@ -0,0 +1,12 @@
+export default {
+ html: `
+
+ `,
+
+ test({ assert, target, window }) {
+ const p = target.querySelector('p');
+
+ const styles = window.getComputedStyle(p);
+ assert.equal(styles.color, 'red');
+ }
+};
diff --git a/test/runtime/samples/inline-style-directive/main.svelte b/test/runtime/samples/inline-style-directive/main.svelte
new file mode 100644
index 0000000000..1d60aefa6f
--- /dev/null
+++ b/test/runtime/samples/inline-style-directive/main.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/test/runtime/samples/inline-style/_config.js b/test/runtime/samples/inline-style/_config.js
new file mode 100644
index 0000000000..3e984d4c69
--- /dev/null
+++ b/test/runtime/samples/inline-style/_config.js
@@ -0,0 +1,12 @@
+export default {
+ html: `
+
+ `,
+
+ test({ assert, component, target, window }) {
+ const p = target.querySelector('div');
+
+ const styles = window.getComputedStyle(p);
+ assert.equal(styles.color, 'red');
+ }
+};
diff --git a/test/runtime/samples/inline-style/main.svelte b/test/runtime/samples/inline-style/main.svelte
new file mode 100644
index 0000000000..0f37a04c99
--- /dev/null
+++ b/test/runtime/samples/inline-style/main.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/runtime/samples/instrumentation-script-destructuring/_config.js b/test/runtime/samples/instrumentation-script-destructuring/_config.js
index 2b677a8b3a..b8ccf586ae 100644
--- a/test/runtime/samples/instrumentation-script-destructuring/_config.js
+++ b/test/runtime/samples/instrumentation-script-destructuring/_config.js
@@ -6,7 +6,7 @@ export default {
x: 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/instrumentation-script-loop-scope/_config.js b/test/runtime/samples/instrumentation-script-loop-scope/_config.js
index 069114c523..1b57ed1e72 100644
--- a/test/runtime/samples/instrumentation-script-loop-scope/_config.js
+++ b/test/runtime/samples/instrumentation-script-loop-scope/_config.js
@@ -4,7 +4,7 @@ export default {
x: 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/instrumentation-script-update/_config.js b/test/runtime/samples/instrumentation-script-update/_config.js
index 223904ad63..d662856a7b 100644
--- a/test/runtime/samples/instrumentation-script-update/_config.js
+++ b/test/runtime/samples/instrumentation-script-update/_config.js
@@ -4,7 +4,7 @@ export default {
x: 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/instrumentation-template-destructuring/_config.js b/test/runtime/samples/instrumentation-template-destructuring/_config.js
index 2b677a8b3a..b8ccf586ae 100644
--- a/test/runtime/samples/instrumentation-template-destructuring/_config.js
+++ b/test/runtime/samples/instrumentation-template-destructuring/_config.js
@@ -6,7 +6,7 @@ export default {
x: 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/instrumentation-template-loop-scope/_config.js b/test/runtime/samples/instrumentation-template-loop-scope/_config.js
index 069114c523..1b57ed1e72 100644
--- a/test/runtime/samples/instrumentation-template-loop-scope/_config.js
+++ b/test/runtime/samples/instrumentation-template-loop-scope/_config.js
@@ -4,7 +4,7 @@ export default {
x: 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/instrumentation-template-update/_config.js b/test/runtime/samples/instrumentation-template-update/_config.js
index 223904ad63..d662856a7b 100644
--- a/test/runtime/samples/instrumentation-template-update/_config.js
+++ b/test/runtime/samples/instrumentation-template-update/_config.js
@@ -4,7 +4,7 @@ export default {
x: 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/key-block-2/_config.js b/test/runtime/samples/key-block-2/_config.js
index 9bbf1f199f..9bb7f17140 100644
--- a/test/runtime/samples/key-block-2/_config.js
+++ b/test/runtime/samples/key-block-2/_config.js
@@ -1,7 +1,7 @@
// with reactive content beside `key`
export default {
html: '00
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const div = target.querySelector('div');
component.reactive = 2;
assert.htmlEqual(target.innerHTML, '02
');
diff --git a/test/runtime/samples/key-block-3/_config.js b/test/runtime/samples/key-block-3/_config.js
index 17b6146827..6a41869f9b 100644
--- a/test/runtime/samples/key-block-3/_config.js
+++ b/test/runtime/samples/key-block-3/_config.js
@@ -1,7 +1,7 @@
// key is not used in the template
export default {
html: '
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const div = target.querySelector('div');
component.value = 5;
diff --git a/test/runtime/samples/key-block-array-immutable/_config.js b/test/runtime/samples/key-block-array-immutable/_config.js
index b1ffd6cd15..02823ec98a 100644
--- a/test/runtime/samples/key-block-array-immutable/_config.js
+++ b/test/runtime/samples/key-block-array-immutable/_config.js
@@ -1,6 +1,6 @@
export default {
html: '1
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
let div = target.querySelector('div');
await component.append(2);
assert.htmlEqual(target.innerHTML, '1
');
diff --git a/test/runtime/samples/key-block-array/_config.js b/test/runtime/samples/key-block-array/_config.js
index 374175177d..6c22a03ed4 100644
--- a/test/runtime/samples/key-block-array/_config.js
+++ b/test/runtime/samples/key-block-array/_config.js
@@ -1,6 +1,6 @@
export default {
html: '1
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
let div = target.querySelector('div');
await component.append(2);
assert.htmlEqual(target.innerHTML, '1,2
');
diff --git a/test/runtime/samples/key-block-expression-2/_config.js b/test/runtime/samples/key-block-expression-2/_config.js
index bab23d2a84..602a8364ee 100644
--- a/test/runtime/samples/key-block-expression-2/_config.js
+++ b/test/runtime/samples/key-block-expression-2/_config.js
@@ -1,6 +1,6 @@
export default {
html: '3
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const div = target.querySelector('div');
await component.mutate();
diff --git a/test/runtime/samples/key-block-expression/_config.js b/test/runtime/samples/key-block-expression/_config.js
index c04d55bd29..85de9f8e88 100644
--- a/test/runtime/samples/key-block-expression/_config.js
+++ b/test/runtime/samples/key-block-expression/_config.js
@@ -1,6 +1,6 @@
export default {
html: '000
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
let div = target.querySelector('div');
component.value = 2;
assert.htmlEqual(target.innerHTML, '200
');
diff --git a/test/runtime/samples/key-block-post-hydrate/_config.js b/test/runtime/samples/key-block-post-hydrate/_config.js
new file mode 100644
index 0000000000..e989d678e9
--- /dev/null
+++ b/test/runtime/samples/key-block-post-hydrate/_config.js
@@ -0,0 +1,19 @@
+export default {
+ html: `
+
+
item 1 something
+
item 2 something
+
item 3 something
+
+ `,
+ test({ assert, component, target }) {
+ component.sortById = false;
+ assert.htmlEqual( target.innerHTML, `
+
+
item 3 something
+
item 2 something
+
item 1 something
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/key-block-post-hydrate/main.svelte b/test/runtime/samples/key-block-post-hydrate/main.svelte
new file mode 100644
index 0000000000..8ea316a0d7
--- /dev/null
+++ b/test/runtime/samples/key-block-post-hydrate/main.svelte
@@ -0,0 +1,23 @@
+
+
+
+ {#each items as item (item.id)}
+
+ {#if item.name}
+
+ {item.name}
+
+ {/if}
+ something
+
+ {/each}
+
diff --git a/test/runtime/samples/key-block-static-if/_config.js b/test/runtime/samples/key-block-static-if/_config.js
index 2926ad7c24..2dfca9d8b6 100644
--- a/test/runtime/samples/key-block-static-if/_config.js
+++ b/test/runtime/samples/key-block-static-if/_config.js
@@ -5,7 +5,7 @@ export default {
Click
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
await button.dispatchEvent(new window.Event('click'));
diff --git a/test/runtime/samples/key-block-static/_config.js b/test/runtime/samples/key-block-static/_config.js
index 8323336615..8c327bcefd 100644
--- a/test/runtime/samples/key-block-static/_config.js
+++ b/test/runtime/samples/key-block-static/_config.js
@@ -1,6 +1,6 @@
export default {
html: '00
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const div = target.querySelector('div');
component.anotherValue = 2;
assert.htmlEqual(target.innerHTML, '02
');
diff --git a/test/runtime/samples/key-block-transition/_config.js b/test/runtime/samples/key-block-transition/_config.js
index 53de6b333c..d4bef20311 100644
--- a/test/runtime/samples/key-block-transition/_config.js
+++ b/test/runtime/samples/key-block-transition/_config.js
@@ -1,8 +1,8 @@
export default {
html: '0
',
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
component.value = 2;
-
+
const [div1, div2] = target.querySelectorAll('div');
assert.htmlEqual(div1.outerHTML, '0
');
diff --git a/test/runtime/samples/key-block/_config.js b/test/runtime/samples/key-block/_config.js
index b25ca901f8..119c50e21d 100644
--- a/test/runtime/samples/key-block/_config.js
+++ b/test/runtime/samples/key-block/_config.js
@@ -1,6 +1,6 @@
export default {
html: '0
0
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
let [div1, div2] = target.querySelectorAll('div');
component.value = 5;
@@ -8,7 +8,7 @@ export default {
assert.notStrictEqual(div1, target.querySelectorAll('div')[0]);
assert.strictEqual(div2, target.querySelectorAll('div')[1]);
[div1, div2] = target.querySelectorAll('div');
-
+
component.reactive = 10;
assert.htmlEqual(target.innerHTML, '5
10
');
assert.strictEqual(div1, target.querySelectorAll('div')[0]);
diff --git a/test/runtime/samples/lifecycle-render-order-for-children/_config.js b/test/runtime/samples/lifecycle-render-order-for-children/_config.js
index d182d5a97e..32bc35d49c 100644
--- a/test/runtime/samples/lifecycle-render-order-for-children/_config.js
+++ b/test/runtime/samples/lifecycle-render-order-for-children/_config.js
@@ -2,8 +2,10 @@ import order from './order.js';
export default {
skip_if_ssr: true,
-
- test({ assert, component, target, compileOptions }) {
+ before_test() {
+ order.length = 0;
+ },
+ test({ assert, compileOptions }) {
if (compileOptions.hydratable) {
assert.deepEqual(order, [
'0: beforeUpdate',
@@ -43,7 +45,5 @@ export default {
'0: afterUpdate'
]);
}
-
- order.length = 0;
}
};
diff --git a/test/runtime/samples/lifecycle-render-order/_config.js b/test/runtime/samples/lifecycle-render-order/_config.js
index 5080973cef..2bbab7a838 100644
--- a/test/runtime/samples/lifecycle-render-order/_config.js
+++ b/test/runtime/samples/lifecycle-render-order/_config.js
@@ -3,6 +3,9 @@ import order from './order.js';
export default {
skip_if_ssr: true,
+ before_test() {
+ order.length = 0;
+ },
test({ assert }) {
assert.deepEqual(order, [
'beforeUpdate',
@@ -10,7 +13,5 @@ export default {
'onMount',
'afterUpdate'
]);
-
- order.length = 0;
}
};
diff --git a/test/runtime/samples/loop-protect-async-opt-out/_config.js b/test/runtime/samples/loop-protect-async-opt-out/_config.js
new file mode 100644
index 0000000000..b1855c83eb
--- /dev/null
+++ b/test/runtime/samples/loop-protect-async-opt-out/_config.js
@@ -0,0 +1,9 @@
+export default {
+ compileOptions: {
+ dev: true,
+ loopGuardTimeout: 1
+ },
+ async test({ component }) {
+ await component.run_async_function();
+ }
+};
diff --git a/test/runtime/samples/loop-protect-async-opt-out/main.svelte b/test/runtime/samples/loop-protect-async-opt-out/main.svelte
new file mode 100644
index 0000000000..bc711ac5a3
--- /dev/null
+++ b/test/runtime/samples/loop-protect-async-opt-out/main.svelte
@@ -0,0 +1,12 @@
+
diff --git a/test/runtime/samples/loop-protect-generator-opt-out/_config.js b/test/runtime/samples/loop-protect-generator-opt-out/_config.js
index 0fe83a36db..2680ecfdfb 100644
--- a/test/runtime/samples/loop-protect-generator-opt-out/_config.js
+++ b/test/runtime/samples/loop-protect-generator-opt-out/_config.js
@@ -2,5 +2,8 @@ export default {
compileOptions: {
dev: true,
loopGuardTimeout: 1
+ },
+ async test({ component }) {
+ await component.run_generator();
}
};
diff --git a/test/runtime/samples/loop-protect-generator-opt-out/main.svelte b/test/runtime/samples/loop-protect-generator-opt-out/main.svelte
index a7aa790681..514089435d 100644
--- a/test/runtime/samples/loop-protect-generator-opt-out/main.svelte
+++ b/test/runtime/samples/loop-protect-generator-opt-out/main.svelte
@@ -1,10 +1,12 @@
-
-{num} {2_048}
\ No newline at end of file
diff --git a/test/runtime/samples/ondestroy-deep/_config.js b/test/runtime/samples/ondestroy-deep/_config.js
index 3f82e8b601..397d8c5684 100644
--- a/test/runtime/samples/ondestroy-deep/_config.js
+++ b/test/runtime/samples/ondestroy-deep/_config.js
@@ -2,6 +2,9 @@ import { destroyed, reset } from './destroyed.js';
export default {
test({ assert, component }) {
+ // for hydration, ssr may have pushed to `destroyed`
+ reset();
+
component.visible = false;
assert.deepEqual(destroyed, ['A', 'B', 'C']);
diff --git a/test/runtime/samples/props-reactive-only-with-change/_config.js b/test/runtime/samples/props-reactive-only-with-change/_config.js
index dcf12868f9..8ed82fc8ec 100644
--- a/test/runtime/samples/props-reactive-only-with-change/_config.js
+++ b/test/runtime/samples/props-reactive-only-with-change/_config.js
@@ -11,7 +11,7 @@ export default {
callbacks = [];
},
- async test({ assert, component, target }) {
+ async test({ assert, component }) {
assert.equal(callbacks.length, 2);
assert.equal(JSON.stringify(callbacks), '["1","2"]');
diff --git a/test/runtime/samples/props-reactive-slot/_config.js b/test/runtime/samples/props-reactive-slot/_config.js
index 266f0fc8a8..6129866605 100644
--- a/test/runtime/samples/props-reactive-slot/_config.js
+++ b/test/runtime/samples/props-reactive-slot/_config.js
@@ -4,7 +4,7 @@ export default {
Change
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const btn = target.querySelector('button');
const clickEvent = new window.MouseEvent('click');
diff --git a/test/runtime/samples/raw-anchor-first-child/_config.js b/test/runtime/samples/raw-anchor-first-child/_config.js
index 02297675c5..f9e6b76626 100644
--- a/test/runtime/samples/raw-anchor-first-child/_config.js
+++ b/test/runtime/samples/raw-anchor-first-child/_config.js
@@ -8,5 +8,6 @@ export default {
assert.ok(!span.previousSibling);
component.raw = 'bar ';
+ assert.htmlEqual(target.innerHTML, 'bar
');
}
};
diff --git a/test/runtime/samples/raw-mustaches/_config.js b/test/runtime/samples/raw-mustaches/_config.js
index 9eda8289ce..a69b91d2d8 100644
--- a/test/runtime/samples/raw-mustaches/_config.js
+++ b/test/runtime/samples/raw-mustaches/_config.js
@@ -1,5 +1,4 @@
export default {
- skip_if_ssr: true,
props: {
raw: 'raw html!!!\\o/ '
diff --git a/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/_config.js b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/_config.js
index 08a3435a4b..bc34b3893c 100644
--- a/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/_config.js
+++ b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/_config.js
@@ -5,7 +5,7 @@ export default {
before_test() {
store.reset();
},
- async test({ assert, target, component }) {
+ async test({ assert, target }) {
store.set(42);
await Promise.resolve();
diff --git a/test/runtime/samples/reactive-function-called-reassigned/_config.js b/test/runtime/samples/reactive-function-called-reassigned/_config.js
index 7b2a8b72fe..3469c285af 100644
--- a/test/runtime/samples/reactive-function-called-reassigned/_config.js
+++ b/test/runtime/samples/reactive-function-called-reassigned/_config.js
@@ -9,7 +9,10 @@ export default {
props: {
callback
},
- async test({ assert, component, target, window }) {
+ before_test() {
+ called = 0;
+ },
+ async test({ assert, target, window }) {
assert.equal(called, 1);
const input = target.querySelector('input');
diff --git a/test/runtime/samples/reactive-values-exported/_config.js b/test/runtime/samples/reactive-values-exported/_config.js
index 56220d3993..9f782835f3 100644
--- a/test/runtime/samples/reactive-values-exported/_config.js
+++ b/test/runtime/samples/reactive-values-exported/_config.js
@@ -7,7 +7,7 @@ export default {
1 1 1
`,
- test({ assert, component, target }) {
+ test({ assert, component }) {
assert.equal(component.y, 1);
assert.equal(component.z, 1);
diff --git a/test/runtime/samples/reactive-values-fixed/_config.js b/test/runtime/samples/reactive-values-fixed/_config.js
index 58aee09c35..9f25b3e24e 100644
--- a/test/runtime/samples/reactive-values-fixed/_config.js
+++ b/test/runtime/samples/reactive-values-fixed/_config.js
@@ -3,7 +3,7 @@ export default {
4
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
assert.htmlEqual(target.innerHTML, `
4
`);
diff --git a/test/runtime/samples/reactive-values-second-order/_config.js b/test/runtime/samples/reactive-values-second-order/_config.js
index c1dee87e2c..c70fb0641c 100644
--- a/test/runtime/samples/reactive-values-second-order/_config.js
+++ b/test/runtime/samples/reactive-values-second-order/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target }) {
+ test({ assert, component }) {
assert.equal(component.qux, 2);
component.foo = 2;
diff --git a/test/runtime/samples/select-bind-in-array/_config.js b/test/runtime/samples/select-bind-in-array/_config.js
index d104743d44..79c5641324 100644
--- a/test/runtime/samples/select-bind-in-array/_config.js
+++ b/test/runtime/samples/select-bind-in-array/_config.js
@@ -7,7 +7,7 @@ export default {
items
},
- test({ assert, component, target }) {
+ test({ assert, component }) {
const items = component.items;
assert.equal( items[0].id, 'a' );
diff --git a/test/runtime/samples/select-no-whitespace/_config.js b/test/runtime/samples/select-no-whitespace/_config.js
index fbd4990317..b00b800033 100644
--- a/test/runtime/samples/select-no-whitespace/_config.js
+++ b/test/runtime/samples/select-no-whitespace/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target }) {
+ test({ assert, target }) {
const select = target.querySelector( 'select' );
assert.equal( select.childNodes.length, 3 );
}
diff --git a/test/runtime/samples/select-props/_config.js b/test/runtime/samples/select-props/_config.js
index 640fee0ef7..93915d5b82 100644
--- a/test/runtime/samples/select-props/_config.js
+++ b/test/runtime/samples/select-props/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window }) {
+ test({ assert, component, window }) {
const selects = document.querySelectorAll('select');
const event1 = new window.Event('change');
diff --git a/test/runtime/samples/set-after-destroy/_config.js b/test/runtime/samples/set-after-destroy/_config.js
index 063c133b87..3411f0cc79 100644
--- a/test/runtime/samples/set-after-destroy/_config.js
+++ b/test/runtime/samples/set-after-destroy/_config.js
@@ -3,7 +3,7 @@ export default {
x: 1
},
- test({ assert, component }) {
+ test({ component }) {
component.$destroy();
component.x = 2;
}
diff --git a/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js b/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js
index 1d572f52fa..9f50a3cf25 100644
--- a/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js
+++ b/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js
@@ -1,7 +1,7 @@
export default {
skip: true, // nice-to-have – tricky though, so skipping for now
- test({ assert, component }) {
+ test({ component }) {
component.foo = { x: 2 };
}
};
diff --git a/test/runtime/samples/spread-component-with-bind/_config.js b/test/runtime/samples/spread-component-with-bind/_config.js
index 96eb3c9475..5394fa80e0 100644
--- a/test/runtime/samples/spread-component-with-bind/_config.js
+++ b/test/runtime/samples/spread-component-with-bind/_config.js
@@ -9,7 +9,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
input.value = 'bar';
diff --git a/test/runtime/samples/spread-element-input-bind-group-with-value-attr/_config.js b/test/runtime/samples/spread-element-input-bind-group-with-value-attr/_config.js
index 4bbc9d278c..5176fb976c 100644
--- a/test/runtime/samples/spread-element-input-bind-group-with-value-attr/_config.js
+++ b/test/runtime/samples/spread-element-input-bind-group-with-value-attr/_config.js
@@ -7,7 +7,7 @@ export default {
html: ' ',
- async test({ assert, component, target, window }) {
+ async test({ assert, target }) {
const input = target.querySelector('input');
assert.equal(input.value, 'abc');
assert.equal(input.__value, 'abc');
diff --git a/test/runtime/samples/spread-element-input-select/_config.js b/test/runtime/samples/spread-element-input-select/_config.js
new file mode 100644
index 0000000000..7971a2a3fc
--- /dev/null
+++ b/test/runtime/samples/spread-element-input-select/_config.js
@@ -0,0 +1,25 @@
+export default {
+ async test({ assert, component, target }) {
+ const select = target.querySelector('select');
+ const [option1, option2] = select.childNodes;
+
+ let selections = Array.from(select.selectedOptions);
+ assert.equal(selections.length, 1);
+ assert.ok(!selections.includes(option1));
+ assert.ok(selections.includes(option2));
+
+ component.value = 'Hello';
+
+ selections = Array.from(select.selectedOptions);
+ assert.equal(selections.length, 1);
+ assert.ok(selections.includes(option1));
+ assert.ok(!selections.includes(option2));
+
+ component.spread = { value: 'World' };
+
+ selections = Array.from(select.selectedOptions);
+ assert.equal(selections.length, 1);
+ assert.ok(!selections.includes(option1));
+ assert.ok(selections.includes(option2));
+ }
+};
diff --git a/test/runtime/samples/spread-element-input-select/main.svelte b/test/runtime/samples/spread-element-input-select/main.svelte
new file mode 100644
index 0000000000..41554d794f
--- /dev/null
+++ b/test/runtime/samples/spread-element-input-select/main.svelte
@@ -0,0 +1,9 @@
+
+
+
+ Hello
+ World
+
diff --git a/test/runtime/samples/spread-element-input-value-undefined/_config.js b/test/runtime/samples/spread-element-input-value-undefined/_config.js
index 9a83dccd80..9f5c0b8e77 100644
--- a/test/runtime/samples/spread-element-input-value-undefined/_config.js
+++ b/test/runtime/samples/spread-element-input-value-undefined/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const input = target.querySelector('input');
component.value = undefined;
diff --git a/test/runtime/samples/spread-element-select-value-undefined/Select.svelte b/test/runtime/samples/spread-element-select-value-undefined/Select.svelte
new file mode 100644
index 0000000000..6f5dadf001
--- /dev/null
+++ b/test/runtime/samples/spread-element-select-value-undefined/Select.svelte
@@ -0,0 +1,12 @@
+
+
+
+ {#each options as option}
+ {option}
+ {/each}
+
+{label}
diff --git a/test/runtime/samples/spread-element-select-value-undefined/_config.js b/test/runtime/samples/spread-element-select-value-undefined/_config.js
new file mode 100644
index 0000000000..0c2c76a119
--- /dev/null
+++ b/test/runtime/samples/spread-element-select-value-undefined/_config.js
@@ -0,0 +1,11 @@
+export default {
+ async test({ assert, component, target }) {
+ const select = target.querySelector('select');
+
+ assert.equal(select.value, '1');
+
+ component.label = 'hoge';
+
+ assert.equal(select.value, '1');
+ }
+};
diff --git a/test/runtime/samples/spread-element-select-value-undefined/main.svelte b/test/runtime/samples/spread-element-select-value-undefined/main.svelte
new file mode 100644
index 0000000000..57a2e3cf3e
--- /dev/null
+++ b/test/runtime/samples/spread-element-select-value-undefined/main.svelte
@@ -0,0 +1,11 @@
+
+
+
diff --git a/test/runtime/samples/store-assignment-updates-destructure/_config.js b/test/runtime/samples/store-assignment-updates-destructure/_config.js
new file mode 100644
index 0000000000..7a1023614c
--- /dev/null
+++ b/test/runtime/samples/store-assignment-updates-destructure/_config.js
@@ -0,0 +1,11 @@
+export default {
+ html: `
+ $userName1: user1
+ $userName2: undefined
+ $userName3: undefined
+ $userName4: user4
+ $userName5: undefined
+ $userName6: user6
+ $userName7: undefined
+ `
+};
diff --git a/test/runtime/samples/store-assignment-updates-destructure/main.svelte b/test/runtime/samples/store-assignment-updates-destructure/main.svelte
new file mode 100644
index 0000000000..71e02fe16d
--- /dev/null
+++ b/test/runtime/samples/store-assignment-updates-destructure/main.svelte
@@ -0,0 +1,34 @@
+
+
+$userName1: {$userName1}
+$userName2: {$userName2}
+$userName3: {$userName3}
+$userName4: {$userName4}
+$userName5: {$userName5}
+$userName6: {$userName6}
+$userName7: {$userName7}
diff --git a/test/runtime/samples/store-assignment-updates-property/_config.js b/test/runtime/samples/store-assignment-updates-property/_config.js
index a1c41b9888..467e7782d6 100644
--- a/test/runtime/samples/store-assignment-updates-property/_config.js
+++ b/test/runtime/samples/store-assignment-updates-property/_config.js
@@ -6,7 +6,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [btn1, btn2] = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/App.svelte b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/App.svelte
new file mode 100644
index 0000000000..250305b62c
--- /dev/null
+++ b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/App.svelte
@@ -0,0 +1,8 @@
+
+{value}
+{$store}
diff --git a/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/_config.js b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/_config.js
new file mode 100644
index 0000000000..560eb44a9a
--- /dev/null
+++ b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/_config.js
@@ -0,0 +1,15 @@
+export default {
+ html: `
+ Hello World
+ Hello World
+ `,
+
+ async test({ assert, component, target }) {
+ await component.update_value('Hi Svelte');
+
+ assert.htmlEqual(target.innerHTML, `
+ Hi Svelte
+ Hi Svelte
+ `);
+ }
+};
diff --git a/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/main.svelte b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/main.svelte
new file mode 100644
index 0000000000..4e771617bb
--- /dev/null
+++ b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/main.svelte
@@ -0,0 +1,12 @@
+
+
+
diff --git a/test/runtime/samples/store-contextual/_config.js b/test/runtime/samples/store-contextual/_config.js
index 2a4f8fef8d..0b7aa6cf33 100644
--- a/test/runtime/samples/store-contextual/_config.js
+++ b/test/runtime/samples/store-contextual/_config.js
@@ -30,7 +30,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const inputs = target.querySelectorAll('input');
const change = new window.MouseEvent('change');
diff --git a/test/runtime/samples/store-invalidation-while-update-1/_config.js b/test/runtime/samples/store-invalidation-while-update-1/_config.js
index 6a931afeaf..bc78193ae7 100644
--- a/test/runtime/samples/store-invalidation-while-update-1/_config.js
+++ b/test/runtime/samples/store-invalidation-while-update-1/_config.js
@@ -5,8 +5,14 @@ export default {
simple
click me
`,
+ ssrHtml: `
+
+
+ simple
+ click me
+ `,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
const button = target.querySelector('button');
@@ -22,7 +28,7 @@ export default {
foo
click me
`);
-
+
await button.dispatchEvent(clickEvent);
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/store-invalidation-while-update-2/_config.js b/test/runtime/samples/store-invalidation-while-update-2/_config.js
index 6c2538e564..78104ef293 100644
--- a/test/runtime/samples/store-invalidation-while-update-2/_config.js
+++ b/test/runtime/samples/store-invalidation-while-update-2/_config.js
@@ -5,8 +5,14 @@ export default {
click me
`,
+ ssrHtml: `
+
+ simple
+
+ click me
+ `,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
const button = target.querySelector('button');
@@ -22,7 +28,7 @@ export default {
click me
`);
-
+
await button.dispatchEvent(clickEvent);
assert.htmlEqual(target.innerHTML, `
foo
diff --git a/test/runtime/samples/store-unreferenced/_config.js b/test/runtime/samples/store-unreferenced/_config.js
index e15f202492..ce416bca5d 100644
--- a/test/runtime/samples/store-unreferenced/_config.js
+++ b/test/runtime/samples/store-unreferenced/_config.js
@@ -3,11 +3,13 @@ import { count } from './store.js';
export default {
html: 'count: 0
',
+ before_test() {
+ count.set(0);
+ },
+
async test({ assert, component, target }) {
await component.increment();
assert.htmlEqual(target.innerHTML, 'count: 1
');
-
- count.set(0);
}
};
diff --git a/test/runtime/samples/svg-attributes/_config.js b/test/runtime/samples/svg-attributes/_config.js
index 668fb391c0..44f7d3a368 100644
--- a/test/runtime/samples/svg-attributes/_config.js
+++ b/test/runtime/samples/svg-attributes/_config.js
@@ -7,7 +7,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const circle = target.querySelector('circle');
assert.equal(circle.getAttribute('class'), 'red');
}
diff --git a/test/runtime/samples/svg-class/_config.js b/test/runtime/samples/svg-class/_config.js
index 36f5d06b1c..ce32d1fb93 100644
--- a/test/runtime/samples/svg-class/_config.js
+++ b/test/runtime/samples/svg-class/_config.js
@@ -3,7 +3,7 @@
export default {
html: " ",
- test({ assert, component, target }) {
+ test({ assert, target }) {
const svg = target.querySelector('svg');
assert.equal(svg.namespaceURI, 'http://www.w3.org/2000/svg');
diff --git a/test/runtime/samples/svg-each-block-namespace/_config.js b/test/runtime/samples/svg-each-block-namespace/_config.js
index 795510c879..c43734885f 100644
--- a/test/runtime/samples/svg-each-block-namespace/_config.js
+++ b/test/runtime/samples/svg-each-block-namespace/_config.js
@@ -5,7 +5,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const circles = target.querySelectorAll('circle');
assert.equal(circles[0].namespaceURI, 'http://www.w3.org/2000/svg');
assert.equal(circles[1].namespaceURI, 'http://www.w3.org/2000/svg');
diff --git a/test/runtime/samples/svg-no-whitespace/_config.js b/test/runtime/samples/svg-no-whitespace/_config.js
index 6d4cefba21..2f7a917f16 100644
--- a/test/runtime/samples/svg-no-whitespace/_config.js
+++ b/test/runtime/samples/svg-no-whitespace/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target }) {
+ test({ assert, target }) {
const svg = target.querySelector( 'svg' );
assert.equal( svg.childNodes.length, 2 );
diff --git a/test/runtime/samples/svg-xlink/_config.js b/test/runtime/samples/svg-xlink/_config.js
index 6e0ad4664c..d3018b3698 100644
--- a/test/runtime/samples/svg-xlink/_config.js
+++ b/test/runtime/samples/svg-xlink/_config.js
@@ -8,7 +8,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const use = target.querySelector('use');
const href = use.attributes[ 'xlink:href' ];
diff --git a/test/runtime/samples/target-dom-detached/App.svelte b/test/runtime/samples/target-dom-detached/App.svelte
new file mode 100644
index 0000000000..251e480307
--- /dev/null
+++ b/test/runtime/samples/target-dom-detached/App.svelte
@@ -0,0 +1,11 @@
+
+
+Hello {name}
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/target-dom-detached/_config.js b/test/runtime/samples/target-dom-detached/_config.js
new file mode 100644
index 0000000000..055d1868eb
--- /dev/null
+++ b/test/runtime/samples/target-dom-detached/_config.js
@@ -0,0 +1,16 @@
+export default {
+ skip_if_ssr: true,
+ compileOptions: {
+ cssHash: () => 'svelte-xyz'
+ },
+ async test({ assert, component, window }) {
+ assert.htmlEqual(
+ window.document.head.innerHTML,
+ ''
+ );
+ assert.htmlEqual(
+ component.div.innerHTML,
+ 'Hello World
'
+ );
+ }
+};
diff --git a/test/runtime/samples/target-dom-detached/main.svelte b/test/runtime/samples/target-dom-detached/main.svelte
new file mode 100644
index 0000000000..42e7dffee9
--- /dev/null
+++ b/test/runtime/samples/target-dom-detached/main.svelte
@@ -0,0 +1,18 @@
+
diff --git a/test/runtime/samples/target-dom/App.svelte b/test/runtime/samples/target-dom/App.svelte
new file mode 100644
index 0000000000..251e480307
--- /dev/null
+++ b/test/runtime/samples/target-dom/App.svelte
@@ -0,0 +1,11 @@
+
+
+Hello {name}
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/target-dom/_config.js b/test/runtime/samples/target-dom/_config.js
new file mode 100644
index 0000000000..055d1868eb
--- /dev/null
+++ b/test/runtime/samples/target-dom/_config.js
@@ -0,0 +1,16 @@
+export default {
+ skip_if_ssr: true,
+ compileOptions: {
+ cssHash: () => 'svelte-xyz'
+ },
+ async test({ assert, component, window }) {
+ assert.htmlEqual(
+ window.document.head.innerHTML,
+ ''
+ );
+ assert.htmlEqual(
+ component.div.innerHTML,
+ 'Hello World
'
+ );
+ }
+};
diff --git a/test/runtime/samples/target-dom/main.svelte b/test/runtime/samples/target-dom/main.svelte
new file mode 100644
index 0000000000..68d2990552
--- /dev/null
+++ b/test/runtime/samples/target-dom/main.svelte
@@ -0,0 +1,18 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/target-shadow-dom/App.svelte b/test/runtime/samples/target-shadow-dom/App.svelte
new file mode 100644
index 0000000000..251e480307
--- /dev/null
+++ b/test/runtime/samples/target-shadow-dom/App.svelte
@@ -0,0 +1,11 @@
+
+
+Hello {name}
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/target-shadow-dom/_config.js b/test/runtime/samples/target-shadow-dom/_config.js
new file mode 100644
index 0000000000..ff775d15fd
--- /dev/null
+++ b/test/runtime/samples/target-shadow-dom/_config.js
@@ -0,0 +1,13 @@
+export default {
+ skip_if_ssr: true,
+ compileOptions: {
+ cssHash: () => 'svelte-xyz'
+ },
+ async test({ assert, component, window }) {
+ assert.htmlEqual(window.document.head.innerHTML, '');
+ assert.htmlEqual(component.div.shadowRoot.innerHTML, `
+
+ Hello World
+ `);
+ }
+};
diff --git a/test/runtime/samples/target-shadow-dom/main.svelte b/test/runtime/samples/target-shadow-dom/main.svelte
new file mode 100644
index 0000000000..cb47ad01f0
--- /dev/null
+++ b/test/runtime/samples/target-shadow-dom/main.svelte
@@ -0,0 +1,19 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/template/_config.js b/test/runtime/samples/template/_config.js
index fd9bb3af67..f5117d3808 100644
--- a/test/runtime/samples/template/_config.js
+++ b/test/runtime/samples/template/_config.js
@@ -7,7 +7,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const template = target.querySelector('template');
assert.htmlEqual(template.innerHTML, `
diff --git a/test/runtime/samples/transition-abort/_config.js b/test/runtime/samples/transition-abort/_config.js
index 4f31c44a4d..c0f702cb76 100644
--- a/test/runtime/samples/transition-abort/_config.js
+++ b/test/runtime/samples/transition-abort/_config.js
@@ -7,7 +7,7 @@ export default {
a
`,
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
component.visible = false;
// abort halfway through the outro transition
diff --git a/test/runtime/samples/transition-css-deferred-removal/_config.js b/test/runtime/samples/transition-css-deferred-removal/_config.js
index 763f004835..9bf429cd9e 100644
--- a/test/runtime/samples/transition-css-deferred-removal/_config.js
+++ b/test/runtime/samples/transition-css-deferred-removal/_config.js
@@ -3,7 +3,7 @@ export default {
visible: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = false;
const outer = target.querySelector('.outer');
diff --git a/test/runtime/samples/transition-css-duration/_config.js b/test/runtime/samples/transition-css-duration/_config.js
index a448c3f164..b2a9fb3476 100644
--- a/test/runtime/samples/transition-css-duration/_config.js
+++ b/test/runtime/samples/transition-css-duration/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-css-iframe/_config.js b/test/runtime/samples/transition-css-iframe/_config.js
index 612ee8e5ba..a7d98dc474 100644
--- a/test/runtime/samples/transition-css-iframe/_config.js
+++ b/test/runtime/samples/transition-css-iframe/_config.js
@@ -1,7 +1,7 @@
export default {
skip_if_ssr: true,
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
const frame = target.querySelector('iframe');
await Promise.resolve();
diff --git a/test/runtime/samples/transition-css-in-out-in-with-param/_config.js b/test/runtime/samples/transition-css-in-out-in-with-param/_config.js
new file mode 100644
index 0000000000..7d0dfa9a07
--- /dev/null
+++ b/test/runtime/samples/transition-css-in-out-in-with-param/_config.js
@@ -0,0 +1,21 @@
+export default {
+ test({ assert, component, target, raf }) {
+ component.visible = true;
+ const div = target.querySelector('div');
+
+ // animation duration of `in` should be 10ms.
+ assert.equal(div.style.animation, '__svelte_1670736059_0 10ms linear 0ms 1 both');
+
+ // animation duration of `out` should be 5ms.
+ component.visible = false;
+ assert.equal(div.style.animation, '__svelte_1670736059_0 10ms linear 0ms 1 both, __svelte_1998461463_0 5ms linear 0ms 1 both');
+
+ // change param
+ raf.tick(1);
+ component.param = true;
+ component.visible = true;
+
+ // animation duration of `in` should be 20ms.
+ assert.equal(div.style.animation, '__svelte_722598827_0 20ms linear 0ms 1 both');
+ }
+};
diff --git a/test/runtime/samples/transition-css-in-out-in-with-param/main.svelte b/test/runtime/samples/transition-css-in-out-in-with-param/main.svelte
new file mode 100644
index 0000000000..616e2e0e8b
--- /dev/null
+++ b/test/runtime/samples/transition-css-in-out-in-with-param/main.svelte
@@ -0,0 +1,26 @@
+
+
+{#if visible}
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-css-in-out-in/_config.js b/test/runtime/samples/transition-css-in-out-in/_config.js
index cd7ae14ce8..5debe6abd6 100644
--- a/test/runtime/samples/transition-css-in-out-in/_config.js
+++ b/test/runtime/samples/transition-css-in-out-in/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
@@ -15,6 +15,6 @@ export default {
component.visible = true;
// reset original styles
- assert.equal(div.style.animation, '__svelte_3809512021_1 100ms linear 0ms 1 both');
+ assert.equal(div.style.animation, '__svelte_3809512021_0 100ms linear 0ms 1 both');
}
};
diff --git a/test/runtime/samples/transition-js-args-dynamic/_config.js b/test/runtime/samples/transition-js-args-dynamic/_config.js
index 513a17486a..50bf9eeefc 100644
--- a/test/runtime/samples/transition-js-args-dynamic/_config.js
+++ b/test/runtime/samples/transition-js-args-dynamic/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-args/_config.js b/test/runtime/samples/transition-js-args/_config.js
index 00682894cd..5fb9f1e93d 100644
--- a/test/runtime/samples/transition-js-args/_config.js
+++ b/test/runtime/samples/transition-js-args/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-context/_config.js b/test/runtime/samples/transition-js-context/_config.js
index e2e7135180..6bc20d3dd1 100644
--- a/test/runtime/samples/transition-js-context/_config.js
+++ b/test/runtime/samples/transition-js-context/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-delay-in-out/_config.js b/test/runtime/samples/transition-js-delay-in-out/_config.js
index bb00604dd9..5a17eead20 100644
--- a/test/runtime/samples/transition-js-delay-in-out/_config.js
+++ b/test/runtime/samples/transition-js-delay-in-out/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-delay/_config.js b/test/runtime/samples/transition-js-delay/_config.js
index 4567573661..aeb42b5d0f 100644
--- a/test/runtime/samples/transition-js-delay/_config.js
+++ b/test/runtime/samples/transition-js-delay/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-destroyed-before-end/_config.js b/test/runtime/samples/transition-js-destroyed-before-end/_config.js
index 59615bd7a5..8033c7c00c 100644
--- a/test/runtime/samples/transition-js-destroyed-before-end/_config.js
+++ b/test/runtime/samples/transition-js-destroyed-before-end/_config.js
@@ -3,7 +3,7 @@ export default {
visible: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = false;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-dynamic-component/_config.js b/test/runtime/samples/transition-js-dynamic-component/_config.js
index e8104a67e5..b59bd41af8 100644
--- a/test/runtime/samples/transition-js-dynamic-component/_config.js
+++ b/test/runtime/samples/transition-js-dynamic-component/_config.js
@@ -7,7 +7,7 @@ export default {
a
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/transition-js-each-block-intro-outro/_config.js b/test/runtime/samples/transition-js-each-block-intro-outro/_config.js
index 9b83a1a1d3..9a0326fbb0 100644
--- a/test/runtime/samples/transition-js-each-block-intro-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-intro-outro/_config.js
@@ -4,7 +4,7 @@ export default {
things: [ 'a', 'b', 'c' ]
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const divs = target.querySelectorAll('div');
assert.equal(divs[0].foo, 0);
diff --git a/test/runtime/samples/transition-js-each-block-intro/_config.js b/test/runtime/samples/transition-js-each-block-intro/_config.js
index 42d69665cf..14e17ae8a9 100644
--- a/test/runtime/samples/transition-js-each-block-intro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-intro/_config.js
@@ -5,7 +5,7 @@ export default {
intro: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
let divs = target.querySelectorAll('div');
assert.equal(divs[0].foo, 0);
assert.equal(divs[1].foo, 0);
diff --git a/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js b/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js
index 9927289ee5..5d1ae5d3e9 100644
--- a/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js
@@ -9,7 +9,7 @@ export default {
intro: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const divs = target.querySelectorAll('div');
divs[0].i = 0; // for debugging
divs[1].i = 1;
diff --git a/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js b/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js
index c37cb8101d..f6b1416789 100644
--- a/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js
@@ -9,7 +9,7 @@ export default {
intro: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
let divs = target.querySelectorAll('div');
assert.equal(divs[0].foo, 0);
assert.equal(divs[1].foo, 0);
diff --git a/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js b/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js
index 1c98ec3198..f3677ef89a 100644
--- a/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js
@@ -7,7 +7,7 @@ export default {
]
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const divs = target.querySelectorAll( 'div' );
component.things = [
diff --git a/test/runtime/samples/transition-js-each-block-outro/_config.js b/test/runtime/samples/transition-js-each-block-outro/_config.js
index e9a7644383..b36a3d93eb 100644
--- a/test/runtime/samples/transition-js-each-block-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-outro/_config.js
@@ -3,7 +3,7 @@ export default {
things: [ 'a', 'b', 'c' ]
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const divs = target.querySelectorAll( 'div' );
component.things = [ 'a' ];
diff --git a/test/runtime/samples/transition-js-each-else-block-intro-outro/_config.js b/test/runtime/samples/transition-js-each-else-block-intro-outro/_config.js
index d51fdecb2e..692713840d 100644
--- a/test/runtime/samples/transition-js-each-else-block-intro-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-else-block-intro-outro/_config.js
@@ -3,7 +3,7 @@ export default {
things: ['a', 'b', 'c']
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.things = [];
let div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-each-else-block-intro/_config.js b/test/runtime/samples/transition-js-each-else-block-intro/_config.js
index dccfbd1a03..77edb37ef2 100644
--- a/test/runtime/samples/transition-js-each-else-block-intro/_config.js
+++ b/test/runtime/samples/transition-js-each-else-block-intro/_config.js
@@ -3,7 +3,7 @@ export default {
things: ['a', 'b', 'c']
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.things = [];
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-each-else-block-outro/_config.js b/test/runtime/samples/transition-js-each-else-block-outro/_config.js
index 163cbbd08d..fb5d9cb823 100644
--- a/test/runtime/samples/transition-js-each-else-block-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-else-block-outro/_config.js
@@ -2,7 +2,7 @@ export default {
props: {
things: []
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const div = target.querySelector('div');
component.things = ['a', 'b', 'c'];
diff --git a/test/runtime/samples/transition-js-each-keyed-unchanged/_config.js b/test/runtime/samples/transition-js-each-keyed-unchanged/_config.js
index a36b1a4610..ddf83e4397 100644
--- a/test/runtime/samples/transition-js-each-keyed-unchanged/_config.js
+++ b/test/runtime/samples/transition-js-each-keyed-unchanged/_config.js
@@ -3,7 +3,7 @@ export default {
numbers: [1, 2, 3, 4, 5]
},
- test({ assert, component, target, raf }) {
+ test({ assert, component, target }) {
const divs1 = target.querySelectorAll('div');
assert.equal(divs1[0].foo, undefined);
diff --git a/test/runtime/samples/transition-js-each-unchanged/_config.js b/test/runtime/samples/transition-js-each-unchanged/_config.js
index 671aa2af74..2dfa1f65ac 100644
--- a/test/runtime/samples/transition-js-each-unchanged/_config.js
+++ b/test/runtime/samples/transition-js-each-unchanged/_config.js
@@ -3,7 +3,7 @@ export default {
numbers: [1, 2, 3, 4, 5]
},
- test({ assert, component, target, raf }) {
+ test({ assert, component, target }) {
const divs1 = target.querySelectorAll('div');
assert.equal(divs1[0].foo, undefined);
diff --git a/test/runtime/samples/transition-js-if-block-bidi/_config.js b/test/runtime/samples/transition-js-if-block-bidi/_config.js
index 1587a92ad6..68242ecbbf 100644
--- a/test/runtime/samples/transition-js-if-block-bidi/_config.js
+++ b/test/runtime/samples/transition-js-if-block-bidi/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
global.count = 0;
component.visible = true;
diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js
index fb885b0826..ed88103f2c 100644
--- a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js
+++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js
@@ -12,7 +12,7 @@ export default {
5
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
raf.tick(100);
component.threshold = 4;
diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js b/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js
index 712be980aa..b02ccffc81 100644
--- a/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js
+++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js
@@ -13,7 +13,7 @@ export default {
intro: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const divs = target.querySelectorAll('div');
assert.equal(divs[0].foo, 0);
diff --git a/test/runtime/samples/transition-js-if-block-intro-outro/_config.js b/test/runtime/samples/transition-js-if-block-intro-outro/_config.js
index 06f72653e4..89fbaac1e6 100644
--- a/test/runtime/samples/transition-js-if-block-intro-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-block-intro-outro/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
let div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js b/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js
index 4985d39850..c3f6334576 100644
--- a/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js
@@ -3,7 +3,7 @@ export default {
z: 'z'
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
assert.equal(target.querySelector('div'), component.no);
component.x = true;
diff --git a/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/_config.js b/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/_config.js
index 1c0c6e0543..9bd793c3ad 100644
--- a/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
const t = target.querySelector('#t');
await (component.condition = false);
diff --git a/test/runtime/samples/transition-js-if-else-block-outro/_config.js b/test/runtime/samples/transition-js-if-else-block-outro/_config.js
index 1dc5af8f6c..0d56cba09b 100644
--- a/test/runtime/samples/transition-js-if-else-block-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-else-block-outro/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
assert.equal(target.querySelector('div'), component.no);
component.x = true;
diff --git a/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js b/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js
index b11f33e7c1..9a61c2e45b 100644
--- a/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js
@@ -4,7 +4,7 @@ export default {
y: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
assert.equal(target.querySelector('div'), component.no);
component.x = true;
diff --git a/test/runtime/samples/transition-js-initial/_config.js b/test/runtime/samples/transition-js-initial/_config.js
index 3760a1cbfb..770b2a8cc9 100644
--- a/test/runtime/samples/transition-js-initial/_config.js
+++ b/test/runtime/samples/transition-js-initial/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js b/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js
index af8e957b19..b4d4dd2053 100644
--- a/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js
+++ b/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js
@@ -3,7 +3,7 @@ export default {
skip_if_hydrate: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, target, raf }) {
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js
index e209e0a80c..cada0124c6 100644
--- a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js
+++ b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, target, raf }) {
const div = target.querySelector('div');
assert.equal(div.foo, undefined);
diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js b/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js
index e209e0a80c..cada0124c6 100644
--- a/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js
+++ b/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, target, raf }) {
const div = target.querySelector('div');
assert.equal(div.foo, undefined);
diff --git a/test/runtime/samples/transition-js-local/_config.js b/test/runtime/samples/transition-js-local/_config.js
index 5f9cf9048a..f2d2c0384d 100644
--- a/test/runtime/samples/transition-js-local/_config.js
+++ b/test/runtime/samples/transition-js-local/_config.js
@@ -4,7 +4,7 @@ export default {
y: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
let div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-nested-await/_config.js b/test/runtime/samples/transition-js-nested-await/_config.js
index 78dbe5ae41..e0f26580cc 100644
--- a/test/runtime/samples/transition-js-nested-await/_config.js
+++ b/test/runtime/samples/transition-js-nested-await/_config.js
@@ -10,7 +10,7 @@ export default {
promise
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
fulfil();
diff --git a/test/runtime/samples/transition-js-nested-component/_config.js b/test/runtime/samples/transition-js-nested-component/_config.js
index f1ca81c52e..87d7aaa233 100644
--- a/test/runtime/samples/transition-js-nested-component/_config.js
+++ b/test/runtime/samples/transition-js-nested-component/_config.js
@@ -3,7 +3,7 @@ export default {
x: false
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js b/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js
index c2d782c0f2..1040d1af53 100644
--- a/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js
+++ b/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js
@@ -4,7 +4,7 @@ export default {
things: ['a', 'b']
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target }) {
component.x = false;
assert.htmlEqual(target.innerHTML, '');
}
diff --git a/test/runtime/samples/transition-js-nested-each-keyed/_config.js b/test/runtime/samples/transition-js-nested-each-keyed/_config.js
index 5ec416afd9..a74aba5610 100644
--- a/test/runtime/samples/transition-js-nested-each-keyed/_config.js
+++ b/test/runtime/samples/transition-js-nested-each-keyed/_config.js
@@ -4,7 +4,7 @@ export default {
things: ['a']
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-nested-if/_config.js b/test/runtime/samples/transition-js-nested-if/_config.js
index 7d48077aca..9e4c634967 100644
--- a/test/runtime/samples/transition-js-nested-if/_config.js
+++ b/test/runtime/samples/transition-js-nested-if/_config.js
@@ -4,7 +4,7 @@ export default {
y: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-nested-intro/_config.js b/test/runtime/samples/transition-js-nested-intro/_config.js
index 9c23290b1a..5d27f84839 100644
--- a/test/runtime/samples/transition-js-nested-intro/_config.js
+++ b/test/runtime/samples/transition-js-nested-intro/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-parameterised-with-state/_config.js b/test/runtime/samples/transition-js-parameterised-with-state/_config.js
index b143e8fdd6..07dd1ad906 100644
--- a/test/runtime/samples/transition-js-parameterised-with-state/_config.js
+++ b/test/runtime/samples/transition-js-parameterised-with-state/_config.js
@@ -3,7 +3,7 @@ export default {
duration: 200
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-parameterised/_config.js b/test/runtime/samples/transition-js-parameterised/_config.js
index 6655cd374d..222e9e713e 100644
--- a/test/runtime/samples/transition-js-parameterised/_config.js
+++ b/test/runtime/samples/transition-js-parameterised/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-slot-2/Nested.svelte b/test/runtime/samples/transition-js-slot-2/Nested.svelte
new file mode 100644
index 0000000000..4cd6a9b375
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-2/Nested.svelte
@@ -0,0 +1,18 @@
+
+
+{#if visible}
+
+
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-2/_config.js b/test/runtime/samples/transition-js-slot-2/_config.js
new file mode 100644
index 0000000000..1785941252
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-2/_config.js
@@ -0,0 +1,24 @@
+// cancelled the transition halfway
+export default {
+ html: `
+ Foo
+ `,
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const div = target.querySelector('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, 'Bar
');
+
+ 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}
+
diff --git a/test/runtime/samples/transition-js-slot-3/Nested.svelte b/test/runtime/samples/transition-js-slot-3/Nested.svelte
new file mode 100644
index 0000000000..8a5b9ec2df
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-3/Nested.svelte
@@ -0,0 +1,27 @@
+
+
+{#if visible}
+
+
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-3/_config.js b/test/runtime/samples/transition-js-slot-3/_config.js
new file mode 100644
index 0000000000..0dfe3281fc
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-3/_config.js
@@ -0,0 +1,23 @@
+export default {
+ html: `
+ Foo
+ `,
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const div = target.querySelector('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, 'Bar
');
+
+ 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-3/main.svelte b/test/runtime/samples/transition-js-slot-3/main.svelte
new file mode 100644
index 0000000000..f10ad356e1
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-3/main.svelte
@@ -0,0 +1,16 @@
+
+
+
+ {data}
+
diff --git a/test/runtime/samples/transition-js-slot-4-cancelled/Nested.svelte b/test/runtime/samples/transition-js-slot-4-cancelled/Nested.svelte
new file mode 100644
index 0000000000..04eea750fd
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-4-cancelled/Nested.svelte
@@ -0,0 +1,19 @@
+
+
+{#if visible}
+
+
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-4-cancelled/_config.js b/test/runtime/samples/transition-js-slot-4-cancelled/_config.js
new file mode 100644
index 0000000000..8be95f0150
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-4-cancelled/_config.js
@@ -0,0 +1,35 @@
+// updated props in the middle of transitions
+// and cancelled the transition halfway
+export default {
+ html: `
+ outside Foo Foo Foo
+ inside Foo Foo Foo
+ `,
+ props: {
+ props: 'Foo'
+ },
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const [, div] = target.querySelectorAll('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ component.props = 'Bar';
+ assert.htmlEqual(target.innerHTML, `
+ outside Bar Bar Bar
+ inside Foo Foo Foo
+ `);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, `
+ outside Bar Bar Bar
+ inside Bar Bar Bar
+ `);
+
+ raf.tick(100);
+ assert.equal(div.foo, 1);
+ }
+};
diff --git a/test/runtime/samples/transition-js-slot-4-cancelled/main.svelte b/test/runtime/samples/transition-js-slot-4-cancelled/main.svelte
new file mode 100644
index 0000000000..1003419244
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-4-cancelled/main.svelte
@@ -0,0 +1,22 @@
+
+
+outside {state} {props} {slotProps}
+
+ inside {state} {props} {slotProps}
+
diff --git a/test/runtime/samples/transition-js-slot-5-cancelled-overflow/Nested.svelte b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/Nested.svelte
new file mode 100644
index 0000000000..10050b6a10
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/Nested.svelte
@@ -0,0 +1,19 @@
+
+
+{#if visible}
+
+
+
+{/if}
diff --git a/test/runtime/samples/transition-js-slot-5-cancelled-overflow/_config.js b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/_config.js
new file mode 100644
index 0000000000..556f75eccd
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/_config.js
@@ -0,0 +1,40 @@
+// updated props in the middle of transitions
+// and cancelled the transition halfway
+// + spreaded props + overflow context
+
+export default {
+ html: `
+ outside Foo Foo Foo
+ inside Foo Foo Foo
+ 0
+ `,
+ props: {
+ props: 'Foo'
+ },
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const [, div] = target.querySelectorAll('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ component.props = 'Bar';
+ assert.htmlEqual(target.innerHTML, `
+ outside Bar Bar Bar
+ inside Foo Foo Foo
+ 0
+ `);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, `
+ outside Bar Bar Bar
+ inside Bar Bar Bar
+ 0
+ `);
+
+ raf.tick(100);
+ assert.equal(div.foo, 1);
+ }
+};
diff --git a/test/runtime/samples/transition-js-slot-5-cancelled-overflow/main.svelte b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/main.svelte
new file mode 100644
index 0000000000..9c46fd0521
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/main.svelte
@@ -0,0 +1,27 @@
+
+
+outside {state} {props} {slotProps}
+
+
+ inside {state} {props} {slotProps}
+
+
+{a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16+a17+a18+a19+a20+a21+a22+a23+a24+a25+a26+a27+a28+a29+a30+a31+a32+a33}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-6-spread-cancelled/Nested.svelte b/test/runtime/samples/transition-js-slot-6-spread-cancelled/Nested.svelte
new file mode 100644
index 0000000000..b1853993d3
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-6-spread-cancelled/Nested.svelte
@@ -0,0 +1,19 @@
+
+
+{#if visible}
+
+
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-6-spread-cancelled/Nested2.svelte b/test/runtime/samples/transition-js-slot-6-spread-cancelled/Nested2.svelte
new file mode 100644
index 0000000000..52f89858a0
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-6-spread-cancelled/Nested2.svelte
@@ -0,0 +1,19 @@
+
+
+{#if visible}
+
+
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-6-spread-cancelled/_config.js b/test/runtime/samples/transition-js-slot-6-spread-cancelled/_config.js
new file mode 100644
index 0000000000..960e02a8f6
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-6-spread-cancelled/_config.js
@@ -0,0 +1,40 @@
+// updated props in the middle of transitions
+// and cancelled the transition halfway
+// with spreaded props
+
+export default {
+ html: `
+ outside Foo Foo Foo
+ inside Foo Foo Foo
+ inside Foo Foo XXX
+ `,
+ props: {
+ props: 'Foo'
+ },
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const [, div] = target.querySelectorAll('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ component.props = 'Bar';
+ assert.htmlEqual(target.innerHTML, `
+ outside Bar Bar Bar
+ inside Foo Foo Foo
+ inside Foo Foo XXX
+ `);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, `
+ outside Bar Bar Bar
+ inside Bar Bar Bar
+ inside Bar Bar XXX
+ `);
+
+ raf.tick(100);
+ assert.equal(div.foo, 1);
+ }
+};
diff --git a/test/runtime/samples/transition-js-slot-6-spread-cancelled/main.svelte b/test/runtime/samples/transition-js-slot-6-spread-cancelled/main.svelte
new file mode 100644
index 0000000000..5dd8ce348e
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-6-spread-cancelled/main.svelte
@@ -0,0 +1,26 @@
+
+
+outside {state} {props} {slotProps.slotProps}
+
+ inside {state} {props} {slotProps}
+
+
+ inside {state} {props} {slotProps}
+
diff --git a/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/Nested.svelte b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/Nested.svelte
new file mode 100644
index 0000000000..b01200fd9f
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/Nested.svelte
@@ -0,0 +1,19 @@
+
+
+{#if visible}
+
+
+
+{/if}
diff --git a/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/_config.js b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/_config.js
new file mode 100644
index 0000000000..556f75eccd
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/_config.js
@@ -0,0 +1,40 @@
+// updated props in the middle of transitions
+// and cancelled the transition halfway
+// + spreaded props + overflow context
+
+export default {
+ html: `
+ outside Foo Foo Foo
+ inside Foo Foo Foo
+ 0
+ `,
+ props: {
+ props: 'Foo'
+ },
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const [, div] = target.querySelectorAll('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ component.props = 'Bar';
+ assert.htmlEqual(target.innerHTML, `
+ outside Bar Bar Bar
+ inside Foo Foo Foo
+ 0
+ `);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, `
+ outside Bar Bar Bar
+ inside Bar Bar Bar
+ 0
+ `);
+
+ raf.tick(100);
+ assert.equal(div.foo, 1);
+ }
+};
diff --git a/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/main.svelte b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/main.svelte
new file mode 100644
index 0000000000..000b29ee7f
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/main.svelte
@@ -0,0 +1,27 @@
+
+
+outside {state} {props} {slotProps.slotProps}
+
+
+ inside {state} {props} {slotProps}
+
+
+{a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16+a17+a18+a19+a20+a21+a22+a23+a24+a25+a26+a27+a28+a29+a30+a31+a32+a33}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-fallback/_config.js b/test/runtime/samples/transition-js-slot-fallback/_config.js
new file mode 100644
index 0000000000..0dfe3281fc
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-fallback/_config.js
@@ -0,0 +1,23 @@
+export default {
+ html: `
+ Foo
+ `,
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const div = target.querySelector('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, 'Bar
');
+
+ 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-fallback/main.svelte b/test/runtime/samples/transition-js-slot-fallback/main.svelte
new file mode 100644
index 0000000000..3392792043
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-fallback/main.svelte
@@ -0,0 +1,27 @@
+
+
+{#if visible}
+
+ {data}
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot/_config.js b/test/runtime/samples/transition-js-slot/_config.js
index e4d1c85a9f..3c1cbeec10 100644
--- a/test/runtime/samples/transition-js-slot/_config.js
+++ b/test/runtime/samples/transition-js-slot/_config.js
@@ -7,7 +7,7 @@ export default {
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const p = target.querySelector('p');
assert.equal(p.foo, 0);
diff --git a/test/runtime/samples/whitespace-each-block/_config.js b/test/runtime/samples/whitespace-each-block/_config.js
index 269e21781b..9f3f5735ed 100644
--- a/test/runtime/samples/whitespace-each-block/_config.js
+++ b/test/runtime/samples/whitespace-each-block/_config.js
@@ -3,7 +3,7 @@ export default {
characters: ['a', 'b', 'c']
},
- test({ assert, component, target }) {
+ test({ assert, target }) {
assert.equal(
target.textContent,
'a b c '
diff --git a/test/runtime/samples/whitespace-list/_config.js b/test/runtime/samples/whitespace-list/_config.js
index 1ba852726c..c3c9d31333 100644
--- a/test/runtime/samples/whitespace-list/_config.js
+++ b/test/runtime/samples/whitespace-list/_config.js
@@ -14,7 +14,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const ul = target.querySelector('ul');
assert.equal(ul.childNodes.length, 5);
diff --git a/test/runtime/samples/whitespace-normal/_config.js b/test/runtime/samples/whitespace-normal/_config.js
index 9b82576c06..90ca0b42c0 100644
--- a/test/runtime/samples/whitespace-normal/_config.js
+++ b/test/runtime/samples/whitespace-normal/_config.js
@@ -3,7 +3,7 @@ export default {
name: 'world'
},
- test({ assert, component, target }) {
+ test({ assert, target }) {
assert.equal(
target.textContent,
'Hello world! How are you?'
diff --git a/test/runtime/samples/window-bind-scroll-update/_config.js b/test/runtime/samples/window-bind-scroll-update/_config.js
index ac6f54ad55..60bdb4b7f6 100644
--- a/test/runtime/samples/window-bind-scroll-update/_config.js
+++ b/test/runtime/samples/window-bind-scroll-update/_config.js
@@ -24,7 +24,7 @@ export default {
clock = null;
},
- async test({ assert, component, target, window }) {
+ async test({ assert, component, window }) {
assert.equal(window.pageYOffset, 0);
// clear the previous 'scrolling' state
diff --git a/test/runtime/samples/window-binding-resize/_config.js b/test/runtime/samples/window-binding-resize/_config.js
index c396666014..c99e92a07b 100644
--- a/test/runtime/samples/window-binding-resize/_config.js
+++ b/test/runtime/samples/window-binding-resize/_config.js
@@ -16,7 +16,7 @@ export default {
skip_if_ssr: true, // there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.Event('resize');
Object.defineProperties(window, {
diff --git a/test/runtime/samples/window-binding-scroll-store/_config.js b/test/runtime/samples/window-binding-scroll-store/_config.js
index 0ce87efee0..47951506bf 100644
--- a/test/runtime/samples/window-binding-scroll-store/_config.js
+++ b/test/runtime/samples/window-binding-scroll-store/_config.js
@@ -8,7 +8,7 @@ export default {
}
});
},
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
assert.equal(window.pageYOffset, 0);
const event = new window.Event('scroll');
diff --git a/test/runtime/samples/window-event-custom/_config.js b/test/runtime/samples/window-event-custom/_config.js
index 15644bc8e8..2e3b577b86 100644
--- a/test/runtime/samples/window-event-custom/_config.js
+++ b/test/runtime/samples/window-event-custom/_config.js
@@ -1,7 +1,7 @@
export default {
html: 'escaped: false
',
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.KeyboardEvent('keydown', {
key: 'Escape'
});
diff --git a/test/runtime/samples/window-event/_config.js b/test/runtime/samples/window-event/_config.js
index 90c6562f95..9abde274e9 100644
--- a/test/runtime/samples/window-event/_config.js
+++ b/test/runtime/samples/window-event/_config.js
@@ -3,7 +3,7 @@ export default {
skip_if_ssr: true, // there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.Event('resize');
Object.defineProperties(window, {
diff --git a/test/server-side-rendering/index.ts b/test/server-side-rendering/index.ts
index f44bf17ab9..f4175c73a6 100644
--- a/test/server-side-rendering/index.ts
+++ b/test/server-side-rendering/index.ts
@@ -13,6 +13,7 @@ import {
shouldUpdateExpected,
mkdirp
} from '../helpers';
+import { set_current_component } from '../../internal';
function tryToReadFile(file) {
try {
@@ -51,21 +52,23 @@ describe('ssr', () => {
throw new Error('Forgot to remove `solo: true` from test');
}
- (solo ? it.only : it)(dir, () => {
- dir = path.resolve(`${__dirname}/samples`, dir);
+ (solo ? it.only : it)(dir, (done) => {
- cleanRequireCache();
+ try {
- const compileOptions = {
- sveltePath,
- ...config.compileOptions,
- generate: 'ssr',
- format: 'cjs'
- };
+ dir = path.resolve(`${__dirname}/samples`, dir);
- require('../../register')(compileOptions);
+ cleanRequireCache();
+
+ const compileOptions = {
+ sveltePath,
+ ...config.compileOptions,
+ generate: 'ssr',
+ format: 'cjs'
+ };
+
+ require('../../register')(compileOptions);
- try {
const Component = require(`${dir}/main.svelte`).default;
const expectedHtml = tryToReadFile(`${dir}/_expected.html`);
@@ -80,7 +83,9 @@ describe('ssr', () => {
if (css.code) fs.writeFileSync(`${dir}/_actual.css`, css.code);
try {
- assert.htmlEqual(html, expectedHtml);
+ (compileOptions.preserveComments
+ ? assert.htmlEqualWithComments
+ : assert.htmlEqual)(html, expectedHtml);
} catch (error) {
if (shouldUpdateExpected()) {
fs.writeFileSync(`${dir}/_expected.html`, html);
@@ -127,103 +132,113 @@ describe('ssr', () => {
showOutput(dir, { generate: 'ssr', format: 'cjs' });
err.stack += `\n\ncmd-click: ${path.relative(process.cwd(), dir)}/main.svelte`;
throw err;
+ } finally {
+ set_current_component(null);
+ done();
}
});
});
// duplicate client-side tests, as far as possible
- fs.readdirSync('test/runtime/samples').forEach(dir => {
- if (dir[0] === '.') return;
+ runRuntimeSamples('runtime');
+ runRuntimeSamples('runtime-puppeteer');
- const config = loadConfig(`./runtime/samples/${dir}/_config.js`);
- const solo = config.solo || /\.solo/.test(dir);
-
- if (solo && process.env.CI) {
- throw new Error('Forgot to remove `solo: true` from test');
- }
+ function runRuntimeSamples(suite) {
+ fs.readdirSync(`test/${suite}/samples`).forEach(dir => {
+ if (dir[0] === '.') return;
- if (config.skip_if_ssr) return;
+ const config = loadConfig(`./${suite}/samples/${dir}/_config.js`);
+ const solo = config.solo || /\.solo/.test(dir);
- (config.skip ? it.skip : solo ? it.only : it)(dir, () => {
- const cwd = path.resolve('test/runtime/samples', dir);
+ if (solo && process.env.CI) {
+ throw new Error('Forgot to remove `solo: true` from test');
+ }
- cleanRequireCache();
+ if (config.skip_if_ssr) return;
- delete global.window;
+ (config.skip ? it.skip : solo ? it.only : it)(dir, () => {
+ const cwd = path.resolve(`test/${suite}/samples`, dir);
- const compileOptions = {
- sveltePath,
- ...config.compileOptions,
- generate: 'ssr',
- format: 'cjs'
- };
+ cleanRequireCache();
- require('../../register')(compileOptions);
+ delete global.window;
- glob('**/*.svelte', { cwd }).forEach(file => {
- if (file[0] === '_') return;
+ const compileOptions = {
+ sveltePath,
+ ...config.compileOptions,
+ generate: 'ssr',
+ format: 'cjs'
+ };
- const dir = `${cwd}/_output/ssr`;
- const out = `${dir}/${file.replace(/\.svelte$/, '.js')}`;
+ require('../../register')(compileOptions);
- if (fs.existsSync(out)) {
- fs.unlinkSync(out);
- }
+ glob('**/*.svelte', { cwd }).forEach(file => {
+ if (file[0] === '_') return;
- mkdirp(dir);
+ const dir = `${cwd}/_output/ssr`;
+ const out = `${dir}/${file.replace(/\.svelte$/, '.js')}`;
- try {
- const { js } = compile(
- fs.readFileSync(`${cwd}/${file}`, 'utf-8'),
- {
- ...compileOptions,
- filename: file
- }
- );
+ if (fs.existsSync(out)) {
+ fs.unlinkSync(out);
+ }
- fs.writeFileSync(out, js.code);
- } catch (err) {
- // do nothing
- }
- });
+ mkdirp(dir);
- try {
- if (config.before_test) config.before_test();
+ try {
+ const { js } = compile(
+ fs.readFileSync(`${cwd}/${file}`, 'utf-8'),
+ {
+ ...compileOptions,
+ filename: file
+ }
+ );
- const Component = require(`../runtime/samples/${dir}/main.svelte`).default;
- const { html } = Component.render(config.props, {
- store: (config.store !== true) && config.store
+ fs.writeFileSync(out, js.code);
+ } catch (err) {
+ // do nothing
+ }
});
- if (config.ssrHtml) {
- assert.htmlEqual(html, config.ssrHtml);
- } else if (config.html) {
- assert.htmlEqual(html, config.html);
- }
+ try {
+ if (config.before_test) config.before_test();
- if (config.test_ssr) {
- config.test_ssr({ assert });
- }
+ const Component = require(`../${suite}/samples/${dir}/main.svelte`).default;
+ const { html } = Component.render(config.props, {
+ store: (config.store !== true) && config.store
+ });
- if (config.after_test) config.after_test();
+ if (config.ssrHtml) {
+ assert.htmlEqual(html, config.ssrHtml);
+ } else if (config.html) {
+ assert.htmlEqual(html, config.html);
+ }
- if (config.show) {
- showOutput(cwd, compileOptions);
- }
- } catch (err) {
- err.stack += `\n\ncmd-click: ${path.relative(process.cwd(), cwd)}/main.svelte`;
+ if (config.test_ssr) {
+ config.test_ssr({ assert });
+ }
- if (config.error) {
- if (typeof config.error === 'function') {
- config.error(assert, err);
+ if (config.after_test) config.after_test();
+
+ if (config.show) {
+ showOutput(cwd, compileOptions);
+ }
+ } catch (err) {
+ err.stack += `\n\ncmd-click: ${path.relative(process.cwd(), cwd)}/main.svelte`;
+
+ if (config.error) {
+ if (typeof config.error === 'function') {
+ config.error(assert, err);
+ } else {
+ assert.equal(err.message, config.error);
+ }
} else {
- assert.equal(err.message, config.error);
+ showOutput(cwd, compileOptions);
+ throw err;
}
- } else {
- showOutput(cwd, compileOptions);
- throw err;
+ } finally {
+ set_current_component(null);
}
- }
+ });
});
- });
+ }
});
diff --git a/test/server-side-rendering/samples/attribute-escape-quotes-spread-2/_expected.html b/test/server-side-rendering/samples/attribute-escape-quotes-spread-2/_expected.html
new file mode 100644
index 0000000000..b3970f88ba
--- /dev/null
+++ b/test/server-side-rendering/samples/attribute-escape-quotes-spread-2/_expected.html
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/attribute-escape-quotes-spread-2/main.svelte b/test/server-side-rendering/samples/attribute-escape-quotes-spread-2/main.svelte
new file mode 100644
index 0000000000..22f5526f3e
--- /dev/null
+++ b/test/server-side-rendering/samples/attribute-escape-quotes-spread-2/main.svelte
@@ -0,0 +1,10 @@
+
+
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/attribute-escaped-quotes-spread/_expected.html b/test/server-side-rendering/samples/attribute-escaped-quotes-spread/_expected.html
index bc31ce8bc3..b3970f88ba 100644
--- a/test/server-side-rendering/samples/attribute-escaped-quotes-spread/_expected.html
+++ b/test/server-side-rendering/samples/attribute-escaped-quotes-spread/_expected.html
@@ -1,4 +1,5 @@
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/attribute-escaped-quotes-spread/main.svelte b/test/server-side-rendering/samples/attribute-escaped-quotes-spread/main.svelte
index ff6c15981d..66047eb09a 100644
--- a/test/server-side-rendering/samples/attribute-escaped-quotes-spread/main.svelte
+++ b/test/server-side-rendering/samples/attribute-escaped-quotes-spread/main.svelte
@@ -2,7 +2,8 @@
export let props = {
foo: '">
diff --git a/test/server-side-rendering/samples/attribute-spread-with-null/_expected.html b/test/server-side-rendering/samples/attribute-spread-with-null/_expected.html
new file mode 100644
index 0000000000..281c6866c3
--- /dev/null
+++ b/test/server-side-rendering/samples/attribute-spread-with-null/_expected.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/attribute-spread-with-null/main.svelte b/test/server-side-rendering/samples/attribute-spread-with-null/main.svelte
new file mode 100644
index 0000000000..adfa9e6919
--- /dev/null
+++ b/test/server-side-rendering/samples/attribute-spread-with-null/main.svelte
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/bindings-empty-string/_expected.html b/test/server-side-rendering/samples/bindings-empty-string/_expected.html
new file mode 100644
index 0000000000..8344e198fa
--- /dev/null
+++ b/test/server-side-rendering/samples/bindings-empty-string/_expected.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/bindings-empty-string/main.svelte b/test/server-side-rendering/samples/bindings-empty-string/main.svelte
new file mode 100644
index 0000000000..7257d0f85e
--- /dev/null
+++ b/test/server-side-rendering/samples/bindings-empty-string/main.svelte
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/bindings-group/_expected.html b/test/server-side-rendering/samples/bindings-group/_expected.html
new file mode 100644
index 0000000000..06d4242b07
--- /dev/null
+++ b/test/server-side-rendering/samples/bindings-group/_expected.html
@@ -0,0 +1,5 @@
+Cheese
+
+
+
+
diff --git a/test/server-side-rendering/samples/bindings-group/main.svelte b/test/server-side-rendering/samples/bindings-group/main.svelte
new file mode 100644
index 0000000000..a88d3fb200
--- /dev/null
+++ b/test/server-side-rendering/samples/bindings-group/main.svelte
@@ -0,0 +1,12 @@
+
+
+{fillings.toString()}
+
+
+
+
+
+
diff --git a/test/server-side-rendering/samples/bindings-zero/_expected.html b/test/server-side-rendering/samples/bindings-zero/_expected.html
new file mode 100644
index 0000000000..d634c4b80f
--- /dev/null
+++ b/test/server-side-rendering/samples/bindings-zero/_expected.html
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/bindings-zero/main.svelte b/test/server-side-rendering/samples/bindings-zero/main.svelte
new file mode 100644
index 0000000000..5689bb8d9c
--- /dev/null
+++ b/test/server-side-rendering/samples/bindings-zero/main.svelte
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/comment-preserve/_config.js b/test/server-side-rendering/samples/comment-preserve/_config.js
new file mode 100644
index 0000000000..f440f86013
--- /dev/null
+++ b/test/server-side-rendering/samples/comment-preserve/_config.js
@@ -0,0 +1,5 @@
+export default {
+ compileOptions: {
+ preserveComments: true
+ }
+};
diff --git a/test/server-side-rendering/samples/comment-preserve/_expected.html b/test/server-side-rendering/samples/comment-preserve/_expected.html
new file mode 100644
index 0000000000..8ecd344816
--- /dev/null
+++ b/test/server-side-rendering/samples/comment-preserve/_expected.html
@@ -0,0 +1,3 @@
+before
+
+after
diff --git a/test/server-side-rendering/samples/comment-preserve/main.svelte b/test/server-side-rendering/samples/comment-preserve/main.svelte
new file mode 100644
index 0000000000..8ecd344816
--- /dev/null
+++ b/test/server-side-rendering/samples/comment-preserve/main.svelte
@@ -0,0 +1,3 @@
+before
+
+after
diff --git a/test/server-side-rendering/samples/constructor-prefer-passed-context/ChildComponent.svelte b/test/server-side-rendering/samples/constructor-prefer-passed-context/ChildComponent.svelte
new file mode 100644
index 0000000000..af77418a1f
--- /dev/null
+++ b/test/server-side-rendering/samples/constructor-prefer-passed-context/ChildComponent.svelte
@@ -0,0 +1,6 @@
+
+
+Value in child component: {value}
diff --git a/test/server-side-rendering/samples/constructor-prefer-passed-context/_expected.html b/test/server-side-rendering/samples/constructor-prefer-passed-context/_expected.html
new file mode 100644
index 0000000000..d9a67c64e9
--- /dev/null
+++ b/test/server-side-rendering/samples/constructor-prefer-passed-context/_expected.html
@@ -0,0 +1 @@
+Value in child component: undefined
diff --git a/test/server-side-rendering/samples/constructor-prefer-passed-context/main.svelte b/test/server-side-rendering/samples/constructor-prefer-passed-context/main.svelte
new file mode 100644
index 0000000000..eaf89dd813
--- /dev/null
+++ b/test/server-side-rendering/samples/constructor-prefer-passed-context/main.svelte
@@ -0,0 +1,10 @@
+
+
+{@html content}
diff --git a/test/server-side-rendering/samples/spread-attributes-white-space/_expected.html b/test/server-side-rendering/samples/spread-attributes-white-space/_expected.html
index a73bb17e8c..24473a7b12 100644
--- a/test/server-side-rendering/samples/spread-attributes-white-space/_expected.html
+++ b/test/server-side-rendering/samples/spread-attributes-white-space/_expected.html
@@ -2,7 +2,4 @@
bar
">
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/test/sourcemaps/index.ts b/test/sourcemaps/index.ts
index 903629c06b..fc021cd6a7 100644
--- a/test/sourcemaps/index.ts
+++ b/test/sourcemaps/index.ts
@@ -85,11 +85,13 @@ describe('sourcemaps', () => {
);
}
- assert.deepEqual(
- js.map.sources.slice().sort(),
- (config.js_map_sources || ['input.svelte']).sort(),
- 'js.map.sources is wrong'
- );
+ if (js.map) {
+ assert.deepEqual(
+ js.map.sources.slice().sort(),
+ (config.js_map_sources || ['input.svelte']).sort(),
+ 'js.map.sources is wrong'
+ );
+ }
if (css.map) {
assert.deepEqual(
css.map.sources.slice().sort(),
diff --git a/test/sourcemaps/samples/attached-sourcemap/_config.js b/test/sourcemaps/samples/attached-sourcemap/_config.js
index 6d9786f6b0..86498caeba 100644
--- a/test/sourcemaps/samples/attached-sourcemap/_config.js
+++ b/test/sourcemaps/samples/attached-sourcemap/_config.js
@@ -14,7 +14,7 @@ function get_processor(tag_name, search, replace) {
// change line + column
const indent = Array.from({ length: indent_size }).join(' ');
- ms.prependLeft(idx, '\n'+indent);
+ ms.prependLeft(idx, '\n' + indent);
const map_opts = { source: filename, hires: true, includeContent: false };
const map = ms.generateMap(map_opts);
diff --git a/test/sourcemaps/samples/attached-sourcemap/test.js b/test/sourcemaps/samples/attached-sourcemap/test.js
index c5b4d7989d..ecb88ab11d 100644
--- a/test/sourcemaps/samples/attached-sourcemap/test.js
+++ b/test/sourcemaps/samples/attached-sourcemap/test.js
@@ -7,8 +7,8 @@ export function test({ input, css, js }) {
let out_obj, loc_output, actual, loc_input, expected;
out_obj = js;
- // we need the second occurence of 'done_replace_script_2' in output.js
- // the first occurence is mapped back to markup '{done_replace_script_2}'
+ // we need the second occurrence of 'done_replace_script_2' in output.js
+ // the first occurrence is mapped back to markup '{done_replace_script_2}'
loc_output = out_obj.locate_1('done_replace_script_2');
loc_output = out_obj.locate_1('done_replace_script_2', loc_output.character + 1);
actual = out_obj.mapConsumer.originalPositionFor(loc_output);
diff --git a/test/sourcemaps/samples/compile-option-dev/test.js b/test/sourcemaps/samples/compile-option-dev/test.js
index bf240a5a89..f169ab8832 100644
--- a/test/sourcemaps/samples/compile-option-dev/test.js
+++ b/test/sourcemaps/samples/compile-option-dev/test.js
@@ -4,8 +4,8 @@ const b64dec = s => Buffer.from(s, 'base64').toString();
export async function test({ assert, css, js }) {
- // We check that the css source map embedded in the js is accurate
- const match = js.code.match(/\tstyle\.textContent = "(.*?)(?:\\n\/\*# sourceMappingURL=data:(.*?);charset=(.*?);base64,(.*?) \*\/)?";\n/);
+ // We check that the css source map embedded in the js is accurate
+ const match = js.code.match(/\tappend_styles\(target, "svelte-.{6}", "(.*?)(?:\\n\/\*# sourceMappingURL=data:(.*?);charset=(.*?);base64,(.*?) \*\/)?"\);\n/);
assert.notEqual(match, null);
const [mimeType, encoding, cssMapBase64] = match.slice(2);
diff --git a/test/sourcemaps/samples/decoded-sourcemap/_config.js b/test/sourcemaps/samples/decoded-sourcemap/_config.js
index dd4eee9461..a0b2c82692 100644
--- a/test/sourcemaps/samples/decoded-sourcemap/_config.js
+++ b/test/sourcemaps/samples/decoded-sourcemap/_config.js
@@ -3,7 +3,7 @@ import { magic_string_preprocessor_result, magic_string_replace_all } from '../.
export default {
- js_map_sources: [], // test component has no scripts
+ js_map_sources: ['input.svelte'],
preprocess: {
markup: ({ content, filename }) => {
diff --git a/test/sourcemaps/samples/external/_config.js b/test/sourcemaps/samples/external/_config.js
index 400def20ac..07a0903482 100644
--- a/test/sourcemaps/samples/external/_config.js
+++ b/test/sourcemaps/samples/external/_config.js
@@ -10,7 +10,7 @@ export const STYLES = '.awesome { color: orange; }\n';
export default {
css_map_sources: ['common.scss', 'styles.scss'],
- js_map_sources: [],
+ js_map_sources: ['input.svelte'],
preprocess: [
{
style: () => {
diff --git a/test/sourcemaps/samples/markup/input.svelte b/test/sourcemaps/samples/markup/input.svelte
new file mode 100644
index 0000000000..d5baaac693
--- /dev/null
+++ b/test/sourcemaps/samples/markup/input.svelte
@@ -0,0 +1,2 @@
+decoded-sourcemap
+replace me
\ No newline at end of file
diff --git a/test/sourcemaps/samples/markup/test.js b/test/sourcemaps/samples/markup/test.js
new file mode 100644
index 0000000000..2c6abfdf41
--- /dev/null
+++ b/test/sourcemaps/samples/markup/test.js
@@ -0,0 +1,34 @@
+export function test({ assert, input, js }) {
+ let expected;
+
+ let start;
+ let actual;
+
+ start = js.locate('insert(target, h1');
+ expected = input.locate('
+ export let foo;
+
+
+ {foo}
+
+
diff --git a/test/sourcemaps/samples/no-sourcemap/test.js b/test/sourcemaps/samples/no-sourcemap/test.js
new file mode 100644
index 0000000000..127459a54e
--- /dev/null
+++ b/test/sourcemaps/samples/no-sourcemap/test.js
@@ -0,0 +1,4 @@
+export function test({ assert, js, css }) {
+ assert.equal(js.map, null);
+ assert.equal(css.map, null);
+}
diff --git a/test/sourcemaps/samples/only-css-sourcemap/_config.js b/test/sourcemaps/samples/only-css-sourcemap/_config.js
new file mode 100644
index 0000000000..767e10a4b9
--- /dev/null
+++ b/test/sourcemaps/samples/only-css-sourcemap/_config.js
@@ -0,0 +1,5 @@
+export default {
+ compile_options: {
+ enableSourcemap: { css: true }
+ }
+};
diff --git a/test/sourcemaps/samples/only-css-sourcemap/input.svelte b/test/sourcemaps/samples/only-css-sourcemap/input.svelte
new file mode 100644
index 0000000000..6d39eaad0e
--- /dev/null
+++ b/test/sourcemaps/samples/only-css-sourcemap/input.svelte
@@ -0,0 +1,11 @@
+
+
+{foo}
+
+
diff --git a/test/sourcemaps/samples/only-css-sourcemap/test.js b/test/sourcemaps/samples/only-css-sourcemap/test.js
new file mode 100644
index 0000000000..a7ac6a9b0b
--- /dev/null
+++ b/test/sourcemaps/samples/only-css-sourcemap/test.js
@@ -0,0 +1,4 @@
+export function test({ assert, js, css }) {
+ assert.equal(js.map, null);
+ assert.notEqual(css.map, null);
+}
diff --git a/test/sourcemaps/samples/only-js-sourcemap/_config.js b/test/sourcemaps/samples/only-js-sourcemap/_config.js
new file mode 100644
index 0000000000..0b3b7987f1
--- /dev/null
+++ b/test/sourcemaps/samples/only-js-sourcemap/_config.js
@@ -0,0 +1,5 @@
+export default {
+ compile_options: {
+ enableSourcemap: { js: true }
+ }
+};
diff --git a/test/sourcemaps/samples/only-js-sourcemap/input.svelte b/test/sourcemaps/samples/only-js-sourcemap/input.svelte
new file mode 100644
index 0000000000..6d39eaad0e
--- /dev/null
+++ b/test/sourcemaps/samples/only-js-sourcemap/input.svelte
@@ -0,0 +1,11 @@
+
+
+{foo}
+
+
diff --git a/test/sourcemaps/samples/only-js-sourcemap/test.js b/test/sourcemaps/samples/only-js-sourcemap/test.js
new file mode 100644
index 0000000000..b150653c3d
--- /dev/null
+++ b/test/sourcemaps/samples/only-js-sourcemap/test.js
@@ -0,0 +1,4 @@
+export function test({ assert, js, css }) {
+ assert.notEqual(js.map, null);
+ assert.equal(css.map, null);
+}
diff --git a/test/sourcemaps/samples/preprocessed-no-map/_config.js b/test/sourcemaps/samples/preprocessed-no-map/_config.js
index 9888b56ddf..78b0ee626f 100644
--- a/test/sourcemaps/samples/preprocessed-no-map/_config.js
+++ b/test/sourcemaps/samples/preprocessed-no-map/_config.js
@@ -1,5 +1,5 @@
export default {
- css_map_sources: [],
+ css_map_sources: ['input.svelte'],
preprocess: [
{
style: ({ content }) => {
diff --git a/test/sourcemaps/samples/sourcemap-basename-without-outputname/_config.js b/test/sourcemaps/samples/sourcemap-basename-without-outputname/_config.js
new file mode 100644
index 0000000000..15c346bfb9
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-basename-without-outputname/_config.js
@@ -0,0 +1,33 @@
+
+import {magic_string_bundle} from '../../helpers';
+
+export const component_filepath = 'src/some/deep/path/input.svelte';
+export const component_file_basename = 'input.svelte';
+export const css_file_basename = 'input.css';
+
+const input_css = ' h1 {color: blue;}';
+
+export default {
+ preprocess: [
+ {
+ style: ({ content, filename }) => {
+ const style_to_add = `/* Filename from preprocess: ${filename} */` + input_css;
+ return magic_string_bundle([
+ { code: content, filename: component_file_basename },
+ { code: style_to_add, filename: css_file_basename }
+ ],component_filepath);
+ }
+ }
+ ],
+ js_map_sources: [component_file_basename],
+ css_map_sources: [css_file_basename,component_file_basename],
+ options: {
+ filename: component_filepath
+ },
+ compile_options: {
+ filename: component_filepath,
+ // ../../index.ts initializes output filenames, reset to undefined for this test
+ outputFilename: undefined,
+ cssOutputFilename: undefined
+ }
+};
diff --git a/test/sourcemaps/samples/sourcemap-basename-without-outputname/input.svelte b/test/sourcemaps/samples/sourcemap-basename-without-outputname/input.svelte
new file mode 100644
index 0000000000..189f28c390
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-basename-without-outputname/input.svelte
@@ -0,0 +1,2 @@
+sourcemap-basename-without-outputname
+
diff --git a/test/sourcemaps/samples/sourcemap-basename-without-outputname/test.js b/test/sourcemaps/samples/sourcemap-basename-without-outputname/test.js
new file mode 100644
index 0000000000..c5747713a7
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-basename-without-outputname/test.js
@@ -0,0 +1,3 @@
+// no additional test needed, _config.js values and the js.map.sources assertion in ../../index.ts cover it
+export function test() {}
+
diff --git a/test/sourcemaps/samples/sourcemap-basename/_config.js b/test/sourcemaps/samples/sourcemap-basename/_config.js
index 33146af7e7..7692b7a6d9 100644
--- a/test/sourcemaps/samples/sourcemap-basename/_config.js
+++ b/test/sourcemaps/samples/sourcemap-basename/_config.js
@@ -15,7 +15,7 @@ span {
export default {
css_map_sources: [external_relative_filename],
- js_map_sources: [],
+ js_map_sources: ['input.svelte'],
preprocess: [
{
style: ({ content, filename }) => {
diff --git a/test/sourcemaps/samples/sourcemap-offsets/_config.js b/test/sourcemaps/samples/sourcemap-offsets/_config.js
index 392fb68a43..bbc24c3225 100644
--- a/test/sourcemaps/samples/sourcemap-offsets/_config.js
+++ b/test/sourcemaps/samples/sourcemap-offsets/_config.js
@@ -3,7 +3,7 @@ import { magic_string_bundle } from '../../helpers';
export const EXTERNAL = 'span { --external-var: 1px; }';
export default {
- js_map_sources: [],
+ js_map_sources: ['input.svelte'],
css_map_sources: ['input.svelte', 'external.css'],
preprocess: [
{
diff --git a/test/store/index.js b/test/store/index.ts
similarity index 90%
rename from test/store/index.js
rename to test/store/index.ts
index 2af4a6f35d..b6fc5940e1 100644
--- a/test/store/index.js
+++ b/test/store/index.ts
@@ -22,6 +22,19 @@ describe('store', () => {
assert.deepEqual(values, [0, 1, 2]);
});
+ it('creates an undefined writable store', () => {
+ const store = writable();
+ const values = [];
+
+ const unsubscribe = store.subscribe(value => {
+ values.push(value);
+ });
+
+ unsubscribe();
+
+ assert.deepEqual(values, [undefined]);
+ });
+
it('calls provided subscribe handler', () => {
let called = 0;
@@ -114,6 +127,32 @@ describe('store', () => {
assert.deepEqual(values, [0, 1, 2]);
});
+
+ it('creates an undefined readable store', () => {
+ const store = readable();
+ const values = [];
+
+ const unsubscribe = store.subscribe(value => {
+ values.push(value);
+ });
+
+ unsubscribe();
+
+ assert.deepEqual(values, [undefined]);
+ });
+
+ it('creates a readable store without updater', () => {
+ const store = readable(100);
+ const values = [];
+
+ const unsubscribe = store.subscribe(value => {
+ values.push(value);
+ });
+
+ unsubscribe();
+
+ assert.deepEqual(values, [100]);
+ });
});
const fake_observable = {
diff --git a/test/utils/index.ts b/test/utils/index.ts
new file mode 100644
index 0000000000..a8aed9387a
--- /dev/null
+++ b/test/utils/index.ts
@@ -0,0 +1,16 @@
+import * as assert from 'assert';
+import { trim_start, trim_end } from '../../src/compiler/utils/trim';
+
+describe('utils', () => {
+ describe('trim', () => {
+ it('trim_start', () => {
+ const value = trim_start(' \r\n\t svelte content \r\n\t ');
+ assert.equal(value, 'svelte content \r\n\t ');
+ });
+
+ it('trim_end', () => {
+ const value = trim_end(' \r\n\t svelte content \r\n\t ');
+ assert.equal(value, ' \r\n\t svelte content');
+ });
+ });
+});
diff --git a/test/validator/samples/a11y-anchor-has-content/input.svelte b/test/validator/samples/a11y-anchor-has-content/input.svelte
index ca81f90ae8..e246a1e593 100644
--- a/test/validator/samples/a11y-anchor-has-content/input.svelte
+++ b/test/validator/samples/a11y-anchor-has-content/input.svelte
@@ -1 +1,2 @@
-
\ No newline at end of file
+
+bar
diff --git a/test/validator/samples/a11y-media-has-caption/input.svelte b/test/validator/samples/a11y-media-has-caption/input.svelte
index 105269cddb..6d98fd3734 100644
--- a/test/validator/samples/a11y-media-has-caption/input.svelte
+++ b/test/validator/samples/a11y-media-has-caption/input.svelte
@@ -1,4 +1,4 @@
-
+
diff --git a/test/validator/samples/a11y-media-has-caption/warnings.json b/test/validator/samples/a11y-media-has-caption/warnings.json
index a8c894b1d4..72c2caae53 100644
--- a/test/validator/samples/a11y-media-has-caption/warnings.json
+++ b/test/validator/samples/a11y-media-has-caption/warnings.json
@@ -6,7 +6,7 @@
"column": 15,
"line": 2
},
- "message": "A11y: Media elements must have a ",
+ "message": "A11y: elements must have a ",
"pos": 40,
"start": {
"character": 40,
@@ -21,7 +21,7 @@
"column": 24,
"line": 3
},
- "message": "A11y: Media elements must have a ",
+ "message": "A11y: elements must have a ",
"pos": 56,
"start": {
"character": 56,
diff --git a/test/validator/samples/a11y-mouse-events-have-key-events/input.svelte b/test/validator/samples/a11y-mouse-events-have-key-events/input.svelte
new file mode 100644
index 0000000000..22de04f38a
--- /dev/null
+++ b/test/validator/samples/a11y-mouse-events-have-key-events/input.svelte
@@ -0,0 +1,15 @@
+
+
+ void 0} />
+
void 0} on:focus={() => void 0} />
+
void 0} {...otherProps} />
+
void 0} />
+
void 0} on:blur={() => void 0} />
+
void 0} {...otherProps} />
diff --git a/test/validator/samples/a11y-mouse-events-have-key-events/warnings.json b/test/validator/samples/a11y-mouse-events-have-key-events/warnings.json
new file mode 100644
index 0000000000..b3fe15feee
--- /dev/null
+++ b/test/validator/samples/a11y-mouse-events-have-key-events/warnings.json
@@ -0,0 +1,62 @@
+[
+ {
+ "code": "a11y-mouse-events-have-key-events",
+ "end": {
+ "character": 272,
+ "column": 35,
+ "line": 10
+ },
+ "message": "A11y: on:mouseover must be accompanied by on:focus",
+ "pos": 237,
+ "start": {
+ "character": 237,
+ "column": 0,
+ "line": 10
+ }
+ },
+ {
+ "code": "a11y-mouse-events-have-key-events",
+ "end": {
+ "character": 384,
+ "column": 51,
+ "line": 12
+ },
+ "message": "A11y: on:mouseover must be accompanied by on:focus",
+ "pos": 333,
+ "start": {
+ "character": 333,
+ "column": 0,
+ "line": 12
+ }
+ },
+ {
+ "code": "a11y-mouse-events-have-key-events",
+ "end": {
+ "character": 419,
+ "column": 34,
+ "line": 13
+ },
+ "message": "A11y: on:mouseout must be accompanied by on:blur",
+ "pos": 385,
+ "start": {
+ "character": 385,
+ "column": 0,
+ "line": 13
+ }
+ },
+ {
+ "code": "a11y-mouse-events-have-key-events",
+ "end": {
+ "character": 528,
+ "column": 50,
+ "line": 15
+ },
+ "message": "A11y: on:mouseout must be accompanied by on:blur",
+ "pos": 478,
+ "start": {
+ "character": 478,
+ "column": 0,
+ "line": 15
+ }
+ }
+]
\ No newline at end of file
diff --git a/test/validator/samples/a11y-no-onchange/input.svelte b/test/validator/samples/a11y-no-onchange/input.svelte
deleted file mode 100644
index af2041f406..0000000000
--- a/test/validator/samples/a11y-no-onchange/input.svelte
+++ /dev/null
@@ -1,16 +0,0 @@
-
{}}>
- foo
- bar
-
-
{}} on:blur={e => {}}>
- foo
- bar
-
-
- {}}>foo
- bar
-
-
- {}} on:blur={e => {}}>foo
- bar
-
\ No newline at end of file
diff --git a/test/validator/samples/a11y-no-onchange/warnings.json b/test/validator/samples/a11y-no-onchange/warnings.json
deleted file mode 100644
index 461f546c0b..0000000000
--- a/test/validator/samples/a11y-no-onchange/warnings.json
+++ /dev/null
@@ -1,32 +0,0 @@
-[
- {
- "code": "a11y-no-onchange",
- "end": {
- "character": 88,
- "column": 9,
- "line": 4
- },
- "message": "A11y: on:blur must be used instead of on:change, unless absolutely necessary and it causes no negative consequences for keyboard only or screen reader users.",
- "pos": 0,
- "start": {
- "character": 0,
- "column": 0,
- "line": 1
- }
- },
- {
- "code": "a11y-no-onchange",
- "end": {
- "character": 249,
- "column": 44,
- "line": 10
- },
- "message": "A11y: on:blur must be used instead of on:change, unless absolutely necessary and it causes no negative consequences for keyboard only or screen reader users.",
- "pos": 209,
- "start": {
- "character": 209,
- "column": 4,
- "line": 10
- }
- }
-]
diff --git a/test/validator/samples/a11y-no-redundant-roles/input.svelte b/test/validator/samples/a11y-no-redundant-roles/input.svelte
new file mode 100644
index 0000000000..05525effb6
--- /dev/null
+++ b/test/validator/samples/a11y-no-redundant-roles/input.svelte
@@ -0,0 +1,44 @@
+
a link
+
+
+
+
+
+
+
+
+
+
+
+
+
+
heading
+
heading
+
heading
+
heading
+
heading
+
heading
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/validator/samples/a11y-no-redundant-roles/warnings.json b/test/validator/samples/a11y-no-redundant-roles/warnings.json
new file mode 100644
index 0000000000..8aa3520b32
--- /dev/null
+++ b/test/validator/samples/a11y-no-redundant-roles/warnings.json
@@ -0,0 +1,632 @@
+[
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 23,
+ "column": 23,
+ "line": 1
+ },
+ "message": "A11y: Redundant role 'link'",
+ "pos": 12,
+ "start": {
+ "character": 12,
+ "column": 12,
+ "line": 1
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 58,
+ "column": 23,
+ "line": 2
+ },
+ "message": "A11y: Redundant role 'article'",
+ "pos": 44,
+ "start": {
+ "character": 44,
+ "column": 9,
+ "line": 2
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 89,
+ "column": 27,
+ "line": 3
+ },
+ "message": "A11y: Redundant role 'complementary'",
+ "pos": 69,
+ "start": {
+ "character": 69,
+ "column": 7,
+ "line": 3
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 114,
+ "column": 21,
+ "line": 4
+ },
+ "message": "A11y: Redundant role 'document'",
+ "pos": 99,
+ "start": {
+ "character": 99,
+ "column": 6,
+ "line": 4
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 139,
+ "column": 21,
+ "line": 5
+ },
+ "message": "A11y: Redundant role 'button'",
+ "pos": 126,
+ "start": {
+ "character": 126,
+ "column": 8,
+ "line": 5
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 167,
+ "column": 24,
+ "line": 6
+ },
+ "message": "A11y: Redundant role 'listbox'",
+ "pos": 153,
+ "start": {
+ "character": 153,
+ "column": 10,
+ "line": 6
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 192,
+ "column": 21,
+ "line": 7
+ },
+ "message": "A11y: Redundant role 'definition'",
+ "pos": 175,
+ "start": {
+ "character": 175,
+ "column": 4,
+ "line": 7
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 212,
+ "column": 16,
+ "line": 8
+ },
+ "message": "A11y: Redundant role 'term'",
+ "pos": 201,
+ "start": {
+ "character": 201,
+ "column": 5,
+ "line": 8
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 237,
+ "column": 21,
+ "line": 9
+ },
+ "message": "A11y: Redundant role 'group'",
+ "pos": 225,
+ "start": {
+ "character": 225,
+ "column": 9,
+ "line": 9
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 262,
+ "column": 21,
+ "line": 10
+ },
+ "message": "A11y: Redundant role 'dialog'",
+ "pos": 249,
+ "start": {
+ "character": 249,
+ "column": 8,
+ "line": 10
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 281,
+ "column": 15,
+ "line": 11
+ },
+ "message": "A11y: Redundant role 'term'",
+ "pos": 270,
+ "start": {
+ "character": 270,
+ "column": 4,
+ "line": 11
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 307,
+ "column": 22,
+ "line": 12
+ },
+ "message": "A11y: Redundant role 'group'",
+ "pos": 295,
+ "start": {
+ "character": 295,
+ "column": 10,
+ "line": 12
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 332,
+ "column": 21,
+ "line": 13
+ },
+ "message": "A11y: Redundant role 'figure'",
+ "pos": 319,
+ "start": {
+ "character": 319,
+ "column": 8,
+ "line": 13
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 353,
+ "column": 17,
+ "line": 14
+ },
+ "message": "A11y: Redundant role 'form'",
+ "pos": 342,
+ "start": {
+ "character": 342,
+ "column": 6,
+ "line": 14
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 383,
+ "column": 18,
+ "line": 15
+ },
+ "message": "A11y: Redundant role 'heading'",
+ "pos": 369,
+ "start": {
+ "character": 369,
+ "column": 4,
+ "line": 15
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 415,
+ "column": 18,
+ "line": 16
+ },
+ "message": "A11y: Redundant role 'heading'",
+ "pos": 401,
+ "start": {
+ "character": 401,
+ "column": 4,
+ "line": 16
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 447,
+ "column": 18,
+ "line": 17
+ },
+ "message": "A11y: Redundant role 'heading'",
+ "pos": 433,
+ "start": {
+ "character": 433,
+ "column": 4,
+ "line": 17
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 479,
+ "column": 18,
+ "line": 18
+ },
+ "message": "A11y: Redundant role 'heading'",
+ "pos": 465,
+ "start": {
+ "character": 465,
+ "column": 4,
+ "line": 18
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 511,
+ "column": 18,
+ "line": 19
+ },
+ "message": "A11y: Redundant role 'heading'",
+ "pos": 497,
+ "start": {
+ "character": 497,
+ "column": 4,
+ "line": 19
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 543,
+ "column": 18,
+ "line": 20
+ },
+ "message": "A11y: Redundant role 'heading'",
+ "pos": 529,
+ "start": {
+ "character": 529,
+ "column": 4,
+ "line": 20
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 577,
+ "column": 20,
+ "line": 21
+ },
+ "message": "A11y: Redundant role 'separator'",
+ "pos": 561,
+ "start": {
+ "character": 561,
+ "column": 4,
+ "line": 21
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 600,
+ "column": 19,
+ "line": 22
+ },
+ "message": "A11y: Redundant role 'listitem'",
+ "pos": 585,
+ "start": {
+ "character": 585,
+ "column": 4,
+ "line": 22
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 621,
+ "column": 17,
+ "line": 23
+ },
+ "message": "A11y: Redundant role 'link'",
+ "pos": 610,
+ "start": {
+ "character": 610,
+ "column": 6,
+ "line": 23
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 642,
+ "column": 17,
+ "line": 24
+ },
+ "message": "A11y: Redundant role 'main'",
+ "pos": 631,
+ "start": {
+ "character": 631,
+ "column": 6,
+ "line": 24
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 668,
+ "column": 17,
+ "line": 25
+ },
+ "message": "A11y: Redundant role 'list'",
+ "pos": 657,
+ "start": {
+ "character": 657,
+ "column": 6,
+ "line": 25
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 694,
+ "column": 22,
+ "line": 26
+ },
+ "message": "A11y: Redundant role 'navigation'",
+ "pos": 677,
+ "start": {
+ "character": 677,
+ "column": 5,
+ "line": 26
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 713,
+ "column": 15,
+ "line": 27
+ },
+ "message": "A11y: Redundant role 'list'",
+ "pos": 702,
+ "start": {
+ "character": 702,
+ "column": 4,
+ "line": 27
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 739,
+ "column": 22,
+ "line": 28
+ },
+ "message": "A11y: Redundant role 'group'",
+ "pos": 727,
+ "start": {
+ "character": 727,
+ "column": 10,
+ "line": 28
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 764,
+ "column": 21,
+ "line": 29
+ },
+ "message": "A11y: Redundant role 'option'",
+ "pos": 751,
+ "start": {
+ "character": 751,
+ "column": 8,
+ "line": 29
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 789,
+ "column": 21,
+ "line": 30
+ },
+ "message": "A11y: Redundant role 'status'",
+ "pos": 776,
+ "start": {
+ "character": 776,
+ "column": 8,
+ "line": 30
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 821,
+ "column": 28,
+ "line": 31
+ },
+ "message": "A11y: Redundant role 'progressbar'",
+ "pos": 803,
+ "start": {
+ "character": 803,
+ "column": 10,
+ "line": 31
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 847,
+ "column": 22,
+ "line": 32
+ },
+ "message": "A11y: Redundant role 'region'",
+ "pos": 834,
+ "start": {
+ "character": 834,
+ "column": 9,
+ "line": 32
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 873,
+ "column": 22,
+ "line": 33
+ },
+ "message": "A11y: Redundant role 'button'",
+ "pos": 860,
+ "start": {
+ "character": 860,
+ "column": 9,
+ "line": 33
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 896,
+ "column": 19,
+ "line": 34
+ },
+ "message": "A11y: Redundant role 'table'",
+ "pos": 884,
+ "start": {
+ "character": 884,
+ "column": 7,
+ "line": 34
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 922,
+ "column": 22,
+ "line": 35
+ },
+ "message": "A11y: Redundant role 'rowgroup'",
+ "pos": 907,
+ "start": {
+ "character": 907,
+ "column": 7,
+ "line": 35
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 950,
+ "column": 24,
+ "line": 36
+ },
+ "message": "A11y: Redundant role 'textbox'",
+ "pos": 936,
+ "start": {
+ "character": 936,
+ "column": 10,
+ "line": 36
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 976,
+ "column": 22,
+ "line": 37
+ },
+ "message": "A11y: Redundant role 'rowgroup'",
+ "pos": 961,
+ "start": {
+ "character": 961,
+ "column": 7,
+ "line": 37
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 1002,
+ "column": 22,
+ "line": 38
+ },
+ "message": "A11y: Redundant role 'rowgroup'",
+ "pos": 987,
+ "start": {
+ "character": 987,
+ "column": 7,
+ "line": 38
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 1020,
+ "column": 14,
+ "line": 39
+ },
+ "message": "A11y: Redundant role 'row'",
+ "pos": 1010,
+ "start": {
+ "character": 1010,
+ "column": 4,
+ "line": 39
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 1039,
+ "column": 15,
+ "line": 40
+ },
+ "message": "A11y: Redundant role 'list'",
+ "pos": 1028,
+ "start": {
+ "character": 1028,
+ "column": 4,
+ "line": 40
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 1125,
+ "column": 21,
+ "line": 43
+ },
+ "message": "A11y: Redundant role 'banner'",
+ "pos": 1112,
+ "start": {
+ "character": 1112,
+ "column": 8,
+ "line": 43
+ }
+ },
+ {
+ "code": "a11y-no-redundant-roles",
+ "end": {
+ "character": 1162,
+ "column": 26,
+ "line": 44
+ },
+ "message": "A11y: Redundant role 'contentinfo'",
+ "pos": 1144,
+ "start": {
+ "character": 1144,
+ "column": 8,
+ "line": 44
+ }
+ }
+]
\ No newline at end of file
diff --git a/test/validator/samples/css-invalid-global-placement-2/errors.json b/test/validator/samples/css-invalid-global-placement-2/errors.json
new file mode 100644
index 0000000000..4594469cc2
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-placement-2/errors.json
@@ -0,0 +1,15 @@
+[{
+ "code": "css-invalid-global",
+ "message": ":global(...) can be at the start or end of a selector sequence, but not in the middle",
+ "start": {
+ "line": 2,
+ "column": 6,
+ "character": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 19,
+ "character": 27
+ },
+ "pos": 14
+}]
diff --git a/test/validator/samples/css-invalid-global-placement-2/input.svelte b/test/validator/samples/css-invalid-global-placement-2/input.svelte
new file mode 100644
index 0000000000..75bd7b66e1
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-placement-2/input.svelte
@@ -0,0 +1,5 @@
+
diff --git a/test/validator/samples/css-invalid-global-placement-3/errors.json b/test/validator/samples/css-invalid-global-placement-3/errors.json
new file mode 100644
index 0000000000..dc9d605c2c
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-placement-3/errors.json
@@ -0,0 +1,15 @@
+[{
+ "code": "css-invalid-global",
+ "message": ":global(...) can be at the start or end of a selector sequence, but not in the middle",
+ "start": {
+ "line": 5,
+ "column": 6,
+ "character": 60
+ },
+ "end": {
+ "line": 5,
+ "column": 19,
+ "character": 73
+ },
+ "pos": 60
+}]
diff --git a/test/validator/samples/css-invalid-global-placement-3/input.svelte b/test/validator/samples/css-invalid-global-placement-3/input.svelte
new file mode 100644
index 0000000000..2a15c1086a
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-placement-3/input.svelte
@@ -0,0 +1,8 @@
+
diff --git a/test/validator/samples/css-invalid-global-selector-2/errors.json b/test/validator/samples/css-invalid-global-selector-2/errors.json
new file mode 100644
index 0000000000..3317925b00
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-2/errors.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "css-invalid-global-selector",
+ "message": ":global(...) must contain a single selector",
+ "start": {
+ "line": 11,
+ "column": 5,
+ "character": 156
+ },
+ "end": {
+ "line": 11,
+ "column": 29,
+ "character": 180
+ },
+ "pos": 156
+ }
+]
diff --git a/test/validator/samples/css-invalid-global-selector-2/input.svelte b/test/validator/samples/css-invalid-global-selector-2/input.svelte
new file mode 100644
index 0000000000..6acbabd7da
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-2/input.svelte
@@ -0,0 +1,18 @@
+
+
+
+
hello world
+
\ No newline at end of file
diff --git a/test/validator/samples/css-invalid-global-selector-3/errors.json b/test/validator/samples/css-invalid-global-selector-3/errors.json
new file mode 100644
index 0000000000..abc516a504
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-3/errors.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "css-invalid-global-selector",
+ "message": ":global(...) must contain a single selector",
+ "start": {
+ "line": 5,
+ "column": 5,
+ "character": 77
+ },
+ "end": {
+ "line": 5,
+ "column": 44,
+ "character": 116
+ },
+ "pos": 77
+ }
+]
diff --git a/test/validator/samples/css-invalid-global-selector-3/input.svelte b/test/validator/samples/css-invalid-global-selector-3/input.svelte
new file mode 100644
index 0000000000..dca0094a06
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-3/input.svelte
@@ -0,0 +1,12 @@
+
+
+
+
hello world
+
diff --git a/test/validator/samples/css-invalid-global-selector-4/errors.json b/test/validator/samples/css-invalid-global-selector-4/errors.json
new file mode 100644
index 0000000000..8d76cb63c0
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-4/errors.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "css-invalid-global-selector",
+ "message": ":global(...) must contain a single selector",
+ "start": {
+ "line": 2,
+ "column": 5,
+ "character": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 24,
+ "character": 32
+ },
+ "pos": 13
+ }
+]
diff --git a/test/validator/samples/css-invalid-global-selector-4/input.svelte b/test/validator/samples/css-invalid-global-selector-4/input.svelte
new file mode 100644
index 0000000000..ed33b6b385
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-4/input.svelte
@@ -0,0 +1,9 @@
+
+
+
+
hello world
+
diff --git a/test/validator/samples/css-invalid-global-selector-5/errors.json b/test/validator/samples/css-invalid-global-selector-5/errors.json
new file mode 100644
index 0000000000..8129b236e6
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-5/errors.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "css-invalid-global-selector",
+ "message": ":global(...) must contain a single selector",
+ "start": {
+ "line": 5,
+ "column": 1,
+ "character": 54
+ },
+ "end": {
+ "line": 5,
+ "column": 20,
+ "character": 73
+ },
+ "pos": 54
+ }
+]
diff --git a/test/validator/samples/css-invalid-global-selector-5/input.svelte b/test/validator/samples/css-invalid-global-selector-5/input.svelte
new file mode 100644
index 0000000000..67d4b9928a
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-5/input.svelte
@@ -0,0 +1,12 @@
+
+
+
+
hello world
+
\ No newline at end of file
diff --git a/test/validator/samples/css-invalid-global-selector-6/errors.json b/test/validator/samples/css-invalid-global-selector-6/errors.json
new file mode 100644
index 0000000000..8129b236e6
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-6/errors.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "css-invalid-global-selector",
+ "message": ":global(...) must contain a single selector",
+ "start": {
+ "line": 5,
+ "column": 1,
+ "character": 54
+ },
+ "end": {
+ "line": 5,
+ "column": 20,
+ "character": 73
+ },
+ "pos": 54
+ }
+]
diff --git a/test/validator/samples/css-invalid-global-selector-6/input.svelte b/test/validator/samples/css-invalid-global-selector-6/input.svelte
new file mode 100644
index 0000000000..e0b2ffd597
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-6/input.svelte
@@ -0,0 +1,12 @@
+
+
+
+
hello world
+
\ No newline at end of file
diff --git a/test/validator/samples/css-invalid-global-selector/errors.json b/test/validator/samples/css-invalid-global-selector/errors.json
new file mode 100644
index 0000000000..7b2d5123b0
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector/errors.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "css-invalid-global-selector",
+ "message": ":global(...) must contain a single selector",
+ "start": {
+ "line": 11,
+ "column": 5,
+ "character": 143
+ },
+ "end": {
+ "line": 11,
+ "column": 24,
+ "character": 162
+ },
+ "pos": 143
+ }
+]
diff --git a/test/validator/samples/css-invalid-global-selector/input.svelte b/test/validator/samples/css-invalid-global-selector/input.svelte
new file mode 100644
index 0000000000..0ec337edfb
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector/input.svelte
@@ -0,0 +1,18 @@
+
+
+
+
hello world
+
\ No newline at end of file
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
diff --git a/test/validator/samples/default-export-anonymous-class/errors.json b/test/validator/samples/default-export-anonymous-class/errors.json
new file mode 100644
index 0000000000..0a410e5eda
--- /dev/null
+++ b/test/validator/samples/default-export-anonymous-class/errors.json
@@ -0,0 +1,15 @@
+[{
+ "code": "default-export",
+ "message": "A component cannot have a default export",
+ "pos": 10,
+ "start": {
+ "line": 2,
+ "column": 1,
+ "character": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 30,
+ "character": 39
+ }
+}]
diff --git a/test/validator/samples/default-export-anonymous-class/input.svelte b/test/validator/samples/default-export-anonymous-class/input.svelte
new file mode 100644
index 0000000000..d78759e113
--- /dev/null
+++ b/test/validator/samples/default-export-anonymous-class/input.svelte
@@ -0,0 +1,3 @@
+
diff --git a/test/validator/samples/default-export-anonymous-function/errors.json b/test/validator/samples/default-export-anonymous-function/errors.json
new file mode 100644
index 0000000000..1f144e8392
--- /dev/null
+++ b/test/validator/samples/default-export-anonymous-function/errors.json
@@ -0,0 +1,15 @@
+[{
+ "code": "default-export",
+ "message": "A component cannot have a default export",
+ "pos": 10,
+ "start": {
+ "line": 2,
+ "column": 1,
+ "character": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 24,
+ "character": 33
+ }
+}]
diff --git a/test/validator/samples/default-export-anonymous-function/input.svelte b/test/validator/samples/default-export-anonymous-function/input.svelte
new file mode 100644
index 0000000000..5e98ca42ab
--- /dev/null
+++ b/test/validator/samples/default-export-anonymous-function/input.svelte
@@ -0,0 +1,3 @@
+
diff --git a/test/validator/samples/error-mode-warn/input.svelte b/test/validator/samples/error-mode-warn/input.svelte
new file mode 100644
index 0000000000..5304ef4c71
--- /dev/null
+++ b/test/validator/samples/error-mode-warn/input.svelte
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/test/validator/samples/error-mode-warn/options.json b/test/validator/samples/error-mode-warn/options.json
new file mode 100644
index 0000000000..8d48d2f34e
--- /dev/null
+++ b/test/validator/samples/error-mode-warn/options.json
@@ -0,0 +1,3 @@
+{
+ "errorMode": "warn"
+}
\ No newline at end of file
diff --git a/test/validator/samples/error-mode-warn/warnings.json b/test/validator/samples/error-mode-warn/warnings.json
new file mode 100644
index 0000000000..cce6324df5
--- /dev/null
+++ b/test/validator/samples/error-mode-warn/warnings.json
@@ -0,0 +1,47 @@
+[
+ {
+ "code": "invalid-binding",
+ "message": "Cannot bind to a variable which is not writable",
+ "pos": 61,
+ "start": {
+ "line": 5,
+ "column": 19,
+ "character": 61
+ },
+ "end": {
+ "line": 5,
+ "column": 24,
+ "character": 66
+ }
+ },
+ {
+ "code": "missing-declaration",
+ "message": "'undeclared' is not defined",
+ "pos": 88,
+ "start": {
+ "character": 88,
+ "column": 19,
+ "line": 6
+ },
+ "end": {
+ "character": 98,
+ "column": 29,
+ "line": 6
+ }
+ },
+ {
+ "code": "binding-undeclared",
+ "message": "undeclared is not declared",
+ "pos": 88,
+ "end": {
+ "character": 98,
+ "column": 29,
+ "line": 6
+ },
+ "start": {
+ "character": 88,
+ "column": 19,
+ "line": 6
+ }
+ }
+]
\ No newline at end of file
diff --git a/test/validator/samples/event-modifiers-invalid/errors.json b/test/validator/samples/event-modifiers-invalid/errors.json
index 59a142d632..ea6de4ce34 100644
--- a/test/validator/samples/event-modifiers-invalid/errors.json
+++ b/test/validator/samples/event-modifiers-invalid/errors.json
@@ -1,5 +1,5 @@
[{
- "message": "Valid event modifiers are preventDefault, stopPropagation, capture, once, passive, nonpassive or self",
+ "message": "Valid event modifiers are preventDefault, stopPropagation, capture, once, passive, nonpassive, self or trusted",
"code": "invalid-event-modifier",
"start": {
"line": 1,
diff --git a/test/validator/samples/reactive-module-const-variable/input.svelte b/test/validator/samples/reactive-module-const-variable/input.svelte
new file mode 100644
index 0000000000..c89cc1c1d0
--- /dev/null
+++ b/test/validator/samples/reactive-module-const-variable/input.svelte
@@ -0,0 +1,9 @@
+
+
+
diff --git a/test/validator/samples/reactive-module-const-variable/warnings.json b/test/validator/samples/reactive-module-const-variable/warnings.json
new file mode 100644
index 0000000000..0d4f101c7a
--- /dev/null
+++ b/test/validator/samples/reactive-module-const-variable/warnings.json
@@ -0,0 +1,2 @@
+[
+]
diff --git a/test/validator/samples/reactive-module-variable-2/input.svelte b/test/validator/samples/reactive-module-variable-2/input.svelte
new file mode 100644
index 0000000000..d36d9cf210
--- /dev/null
+++ b/test/validator/samples/reactive-module-variable-2/input.svelte
@@ -0,0 +1,7 @@
+
+
diff --git a/test/validator/samples/reactive-module-variable-2/warnings.json b/test/validator/samples/reactive-module-variable-2/warnings.json
new file mode 100644
index 0000000000..fe51488c70
--- /dev/null
+++ b/test/validator/samples/reactive-module-variable-2/warnings.json
@@ -0,0 +1 @@
+[]
diff --git a/test/validator/samples/reactive-module-variable/warnings.json b/test/validator/samples/reactive-module-variable/warnings.json
index c3c52cb479..d08fc1309f 100644
--- a/test/validator/samples/reactive-module-variable/warnings.json
+++ b/test/validator/samples/reactive-module-variable/warnings.json
@@ -2,15 +2,15 @@
{
"code": "module-script-reactive-declaration",
"message": "\"foo\" is declared in a module script and will not be reactive",
- "pos": 65,
+ "pos": 59,
"start": {
- "character": 65,
- "column": 10,
+ "character": 59,
+ "column": 4,
"line": 5
},
"end": {
- "character": 68,
- "column": 13,
+ "character": 69,
+ "column": 14,
"line": 5
}
}
diff --git a/test/validator/samples/silence-warnings-2/input.svelte b/test/validator/samples/silence-warnings-2/input.svelte
new file mode 100644
index 0000000000..81cb90b7be
--- /dev/null
+++ b/test/validator/samples/silence-warnings-2/input.svelte
@@ -0,0 +1,9 @@
+
+
+
+
diff --git a/test/validator/samples/silence-warnings-2/warnings.json b/test/validator/samples/silence-warnings-2/warnings.json
new file mode 100644
index 0000000000..fe51488c70
--- /dev/null
+++ b/test/validator/samples/silence-warnings-2/warnings.json
@@ -0,0 +1 @@
+[]
diff --git a/test/validator/samples/silence-warnings/input.svelte b/test/validator/samples/silence-warnings/input.svelte
new file mode 100644
index 0000000000..0e473f51db
--- /dev/null
+++ b/test/validator/samples/silence-warnings/input.svelte
@@ -0,0 +1,15 @@
+
+
+
+
+
+
diff --git a/test/validator/samples/silence-warnings/warnings.json b/test/validator/samples/silence-warnings/warnings.json
new file mode 100644
index 0000000000..fe51488c70
--- /dev/null
+++ b/test/validator/samples/silence-warnings/warnings.json
@@ -0,0 +1 @@
+[]
diff --git a/test/validator/samples/unreferenced-variables-each/input.svelte b/test/validator/samples/unreferenced-variables-each/input.svelte
new file mode 100644
index 0000000000..a96f9189a2
--- /dev/null
+++ b/test/validator/samples/unreferenced-variables-each/input.svelte
@@ -0,0 +1,20 @@
+
+
+
+
+ {#each array as default_value_5}
+ {#each array as { a = default_value_1, b: { b = [default_value_2, default_value_3], c: [c = default_value_4] }, d = default_value_5, e = default_value_6 }}
+ {a}{b}{c}{d}{e}
+ {/each}
+ {/each}
+
+
diff --git a/test/validator/samples/unreferenced-variables-each/warnings.json b/test/validator/samples/unreferenced-variables-each/warnings.json
new file mode 100644
index 0000000000..fa89da0e68
--- /dev/null
+++ b/test/validator/samples/unreferenced-variables-each/warnings.json
@@ -0,0 +1,32 @@
+[
+ {
+ "code": "unused-export-let",
+ "message": "Component_1 has unused export property 'default_value_5'. If it is for external reference only, please consider using `export const default_value_5`",
+ "pos": 172,
+ "start": {
+ "character": 172,
+ "column": 12,
+ "line": 8
+ },
+ "end": {
+ "character": 187,
+ "column": 27,
+ "line": 8
+ }
+ },
+ {
+ "code": "unused-export-let",
+ "message": "Component_1 has unused export property 'default_value_6'. If it is for external reference only, please consider using `export const default_value_6`",
+ "pos": 201,
+ "start": {
+ "character": 201,
+ "column": 12,
+ "line": 9
+ },
+ "end": {
+ "character": 216,
+ "column": 27,
+ "line": 9
+ }
+ }
+]
diff --git a/test/vars/samples/vars-report-false/_config.js b/test/vars/samples/vars-report-false/_config.js
new file mode 100644
index 0000000000..f4709f09c8
--- /dev/null
+++ b/test/vars/samples/vars-report-false/_config.js
@@ -0,0 +1,9 @@
+export default {
+ options: {
+ varsReport: false
+ },
+
+ test(assert, vars) {
+ assert.deepEqual(vars, []);
+ }
+};
diff --git a/test/vars/samples/vars-report-false/input.svelte b/test/vars/samples/vars-report-false/input.svelte
new file mode 100644
index 0000000000..7583c99845
--- /dev/null
+++ b/test/vars/samples/vars-report-false/input.svelte
@@ -0,0 +1,5 @@
+
+
+{foo}
\ No newline at end of file
diff --git a/test/vars/samples/vars-report-full-noscript/_config.js b/test/vars/samples/vars-report-full-noscript/_config.js
new file mode 100644
index 0000000000..9c39324518
--- /dev/null
+++ b/test/vars/samples/vars-report-full-noscript/_config.js
@@ -0,0 +1,19 @@
+export default {
+ options: {
+ varsReport: 'full'
+ },
+
+ test(assert, vars) {
+ assert.deepEqual(vars, [{
+ name: 'foo',
+ export_name: null,
+ injected: false,
+ module: false,
+ mutated: false,
+ reassigned: false,
+ referenced: true,
+ referenced_from_script: false,
+ writable: false
+ }]);
+ }
+};
diff --git a/test/vars/samples/vars-report-full-noscript/input.svelte b/test/vars/samples/vars-report-full-noscript/input.svelte
new file mode 100644
index 0000000000..e076ac55f8
--- /dev/null
+++ b/test/vars/samples/vars-report-full-noscript/input.svelte
@@ -0,0 +1 @@
+{foo}
\ No newline at end of file
diff --git a/test/vars/samples/vars-report-full-script/_config.js b/test/vars/samples/vars-report-full-script/_config.js
new file mode 100644
index 0000000000..2519dc5508
--- /dev/null
+++ b/test/vars/samples/vars-report-full-script/_config.js
@@ -0,0 +1,31 @@
+export default {
+ options: {
+ varsReport: 'full'
+ },
+
+ test(assert, vars) {
+ assert.deepEqual(vars, [
+ {
+ name: 'foo',
+ export_name: 'foo',
+ injected: false,
+ module: false,
+ mutated: false,
+ reassigned: false,
+ referenced: true,
+ referenced_from_script: false,
+ writable: true
+ }, {
+ name: 'bar',
+ export_name: null,
+ injected: false,
+ module: false,
+ mutated: false,
+ reassigned: false,
+ referenced: true,
+ referenced_from_script: false,
+ writable: false
+ }
+ ]);
+ }
+};
diff --git a/test/vars/samples/vars-report-full-script/input.svelte b/test/vars/samples/vars-report-full-script/input.svelte
new file mode 100644
index 0000000000..11870584a6
--- /dev/null
+++ b/test/vars/samples/vars-report-full-script/input.svelte
@@ -0,0 +1,5 @@
+
+
+{foo} {bar}
\ No newline at end of file
diff --git a/test/vars/samples/vars-report-full/_config.js b/test/vars/samples/vars-report-full/_config.js
new file mode 100644
index 0000000000..9c39324518
--- /dev/null
+++ b/test/vars/samples/vars-report-full/_config.js
@@ -0,0 +1,19 @@
+export default {
+ options: {
+ varsReport: 'full'
+ },
+
+ test(assert, vars) {
+ assert.deepEqual(vars, [{
+ name: 'foo',
+ export_name: null,
+ injected: false,
+ module: false,
+ mutated: false,
+ reassigned: false,
+ referenced: true,
+ referenced_from_script: false,
+ writable: false
+ }]);
+ }
+};
diff --git a/test/vars/samples/vars-report-full/input.svelte b/test/vars/samples/vars-report-full/input.svelte
new file mode 100644
index 0000000000..0178466fe3
--- /dev/null
+++ b/test/vars/samples/vars-report-full/input.svelte
@@ -0,0 +1,3 @@
+
+
+{foo}
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
index 248e3b5e98..f2e055a2a9 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -21,6 +21,9 @@
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
+ // Hides exports flagged with @internal from the d.ts output
+ "stripInternal": true,
+
// TODO: error all the things
//"strict": true,
"noImplicitThis": true,