mirror of https://github.com/sveltejs/svelte
commit
79b7f112ab
@ -1,75 +1,36 @@
|
|||||||
# sapper-template-rollup
|
## Running locally
|
||||||
|
|
||||||
A version of the default [Sapper](https://github.com/sveltejs/sapper) template that uses Rollup instead of webpack. To clone it and get started:
|
Set up the project:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npx degit sveltejs/sapper-template#rollup my-app
|
git clone https://github.com/sveltejs/svelte.git
|
||||||
cd my-app
|
cd svelte/site
|
||||||
npm install # or yarn!
|
npm ci
|
||||||
npm run dev
|
npm run update
|
||||||
```
|
```
|
||||||
|
|
||||||
Open up [localhost:3000](http://localhost:3000) and start clicking around.
|
Start the server with `npm run dev`, and navigate to [localhost:3000](http://localhost:3000).
|
||||||
|
|
||||||
Consult [sapper.svelte.technology](https://sapper.svelte.technology) for help getting started.
|
|
||||||
|
|
||||||
*[Click here for the webpack version of this template](https://github.com/sveltejs/sapper-template)*
|
|
||||||
|
|
||||||
## Structure
|
|
||||||
|
|
||||||
Sapper expects to find three directories in the root of your project — `app`, `assets` and `routes`.
|
|
||||||
|
|
||||||
|
|
||||||
### app
|
|
||||||
|
|
||||||
The [app](app) directory contains the entry points for your app — `client.js`, `server.js` and (optionally) a `service-worker.js` — along with a `template.html` file.
|
|
||||||
|
|
||||||
|
## Using a local copy of Svelte
|
||||||
|
|
||||||
### assets
|
By default, the REPL will fetch the most recent version of Svelte from https://unpkg.com/svelte. If you need to test a local version of Svelte, you can do so by linking it and navigating to [localhost:3000/repl?version=local](http://localhost:3000/repl?version=local):
|
||||||
|
|
||||||
The [assets](assets) directory contains any static assets that should be available. These are served using [sirv](https://github.com/lukeed/sirv).
|
```bash
|
||||||
|
cd /path/to/svelte
|
||||||
In your [service-worker.js](app/service-worker.js) file, you can import these as `assets` from the generated manifest...
|
npm link
|
||||||
|
npm run dev # rebuild Svelte on changes
|
||||||
|
|
||||||
```js
|
cd /path/to/svelte/site
|
||||||
import { assets } from './manifest/service-worker.js';
|
npm link svelte
|
||||||
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
...so that you can cache them (though you can choose not to, for example if you don't want to cache very large files).
|
## REPL GitHub integration
|
||||||
|
|
||||||
|
|
||||||
### routes
|
|
||||||
|
|
||||||
This is the heart of your Sapper app. There are two kinds of routes — *pages*, and *server routes*.
|
|
||||||
|
|
||||||
**Pages** are Svelte components written in `.html` files. When a user first visits the application, they will be served a server-rendered version of the route in question, plus some JavaScript that 'hydrates' the page and initialises a client-side router. From that point forward, navigating to other pages is handled entirely on the client for a fast, app-like feel. (Sapper will preload and cache the code for these subsequent pages, so that navigation is instantaneous.)
|
|
||||||
|
|
||||||
**Server routes** are modules written in `.js` files, that export functions corresponding to HTTP methods. Each function receives Express `request` and `response` objects as arguments, plus a `next` function. This is useful for creating a JSON API, for example.
|
In order for the REPL's GitHub integration to work properly when running locally, you will need to create a GitHub OAuth app. Set its authorization callback URL to `http://localhost:3000/auth/callback`, and in this project, create `site/.env` containing:
|
||||||
|
|
||||||
There are three simple rules for naming the files that define your routes:
|
|
||||||
|
|
||||||
* A file called `routes/about.html` corresponds to the `/about` route. A file called `routes/blog/[slug].html` corresponds to the `/blog/:slug` route, in which case `params.slug` is available to the route
|
|
||||||
* The file `routes/index.html` (or `routes/index.js`) corresponds to the root of your app. `routes/about/index.html` is treated the same as `routes/about.html`.
|
|
||||||
* Files and directories with a leading underscore do *not* create routes. This allows you to colocate helper modules and components with the routes that depend on them — for example you could have a file called `routes/_helpers/datetime.js` and it would *not* create a `/_helpers/datetime` route
|
|
||||||
|
|
||||||
|
|
||||||
## Rollup config
|
|
||||||
|
|
||||||
Sapper uses Rollup to provide code-splitting and dynamic imports, as well as compiling your Svelte components. As long as you don't do anything daft, you can edit the configuration files to add whatever plugins you'd like.
|
|
||||||
|
|
||||||
|
|
||||||
## Production mode and deployment
|
|
||||||
|
|
||||||
To start a production version of your app, run `npm run build && npm start`.
|
|
||||||
|
|
||||||
You can deploy your application to any environment that supports Node 8 or above. As an example, to deploy to [Now](https://zeit.co/now), run these commands:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install -g now
|
|
||||||
now
|
|
||||||
```
|
```
|
||||||
|
GITHUB_CLIENT_ID=[your app's client id]
|
||||||
|
GITHUB_CLIENT_SECRET=[your app's client secret]
|
||||||
## Bugs and feedback
|
BASEURL=http://localhost:3000
|
||||||
|
```
|
||||||
Sapper is in early development, and may have the odd rough edge here and there. Please be vocal over on the [Sapper issue tracker](https://github.com/sveltejs/sapper/issues).
|
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
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')
|
||||||
|
|
||||||
|
// update repl-viewer.css based on template
|
||||||
|
sh.cp('scripts/svelte-app/public/global.css', 'static/repl-viewer.css')
|
||||||
|
|
||||||
|
// 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'
|
||||||
|
let files = []
|
||||||
|
|
||||||
|
for (const path of sh.find(appPath).filter(p => fs.lstatSync(p).isFile()) ) {
|
||||||
|
files.push({ path: path.slice(appPath.length + 1), data: fs.readFileSync(path).toString() });
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync('static/svelte-app.json', JSON.stringify(files));
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
cd `dirname $0`/..
|
|
||||||
|
|
||||||
# fetch svelte-app
|
|
||||||
rm -rf scripts/svelte-app
|
|
||||||
node_modules/.bin/degit sveltejs/template scripts/svelte-app
|
|
||||||
|
|
||||||
# update repl-viewer.css based on template
|
|
||||||
cp scripts/svelte-app/public/global.css static/repl-viewer.css
|
|
||||||
|
|
||||||
# remove src (will be recreated client-side) and node_modules
|
|
||||||
rm -rf scripts/svelte-app/src
|
|
||||||
rm -rf scripts/svelte-app/node_modules
|
|
||||||
|
|
||||||
# build svelte-app.json
|
|
||||||
node scripts/build-svelte-app-json.js `find scripts/svelte-app -type f`
|
|
@ -0,0 +1,87 @@
|
|||||||
|
export default class ReplProxy {
|
||||||
|
constructor(iframe) {
|
||||||
|
this.iframe = iframe;
|
||||||
|
this.cmdId = 1;
|
||||||
|
this.pendingCmds = new Map();
|
||||||
|
this.onPropUpdate = null;
|
||||||
|
this.onFetchProgress = null;
|
||||||
|
|
||||||
|
window.addEventListener("message", ev => this.handleReplMessage(ev), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
iframeCommand(command, args) {
|
||||||
|
return new Promise( (resolve, reject) => {
|
||||||
|
this.cmdId = this.cmdId + 1;
|
||||||
|
this.iframe.contentWindow.postMessage({
|
||||||
|
action: command,
|
||||||
|
cmdId: this.cmdId,
|
||||||
|
args: args
|
||||||
|
}, '*')
|
||||||
|
this.pendingCmds.set(this.cmdId, { resolve: resolve, reject: reject });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
handleCommandMessage(cmdData) {
|
||||||
|
let action = cmdData.action;
|
||||||
|
let id = cmdData.cmdId;
|
||||||
|
let handler = this.pendingCmds.get(id);
|
||||||
|
if (handler) {
|
||||||
|
this.pendingCmds.delete(id);
|
||||||
|
if (action == "cmdError") {
|
||||||
|
let { message, stack } = cmdData;
|
||||||
|
let e = new Error(message);
|
||||||
|
e.stack = stack;
|
||||||
|
console.log("cmd fail");
|
||||||
|
handler.reject(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (action == "cmdOk") {
|
||||||
|
console.log("cmd okay");
|
||||||
|
handler.resolve(cmdData.args)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.error("command not found", id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handleReplMessage(ev) {
|
||||||
|
|
||||||
|
let action = ev.data.action;
|
||||||
|
if ( action == "cmdError" || action == "cmdOk" ) {
|
||||||
|
this.handleCommandMessage(ev.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (action == "prop_update") {
|
||||||
|
let { prop, value } = ev.data.args;
|
||||||
|
if (this.onPropUpdate)
|
||||||
|
this.onPropUpdate(prop, value)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (action == "fetch_progress") {
|
||||||
|
if (this.onFetchProgress)
|
||||||
|
this.onFetchProgress(ev.data.args.remaining)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
eval(script) {
|
||||||
|
return this.iframeCommand("eval", { script: script });
|
||||||
|
}
|
||||||
|
|
||||||
|
setProp(prop, value) {
|
||||||
|
return this.iframeCommand("set_prop", {prop, value})
|
||||||
|
}
|
||||||
|
|
||||||
|
bindProps(props) {
|
||||||
|
return this.iframeCommand("bind_props", { props: props })
|
||||||
|
}
|
||||||
|
|
||||||
|
handleLinks() {
|
||||||
|
return this.iframeCommand("catch_clicks", {});
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchImports(bundle) {
|
||||||
|
return this.iframeCommand("fetch_imports", { bundle })
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,133 @@
|
|||||||
|
|
||||||
|
(function (){
|
||||||
|
const importCache = {};
|
||||||
|
|
||||||
|
function fetchImport(id) {
|
||||||
|
return new Promise((fulfil, reject) => {
|
||||||
|
curl([`https://bundle.run/${id}`]).then(module => {
|
||||||
|
importCache[id] = module;
|
||||||
|
fulfil(module);
|
||||||
|
}, err => {
|
||||||
|
console.error(err.stack);
|
||||||
|
reject(new Error(`Error loading ${id} from bundle.run`));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetchImports(bundle, progressFunc) {
|
||||||
|
const missingImports = bundle.imports.filter(x => !importCache[x]);
|
||||||
|
let pendingImports = missingImports.length;
|
||||||
|
|
||||||
|
if (missingImports.length) {
|
||||||
|
let promise = Promise.all(
|
||||||
|
missingImports.map(id => fetchImport(id).then(() => {
|
||||||
|
pendingImports -= 1;
|
||||||
|
if (progressFunc) progressFunc(pendingImports);
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
|
||||||
|
return promise
|
||||||
|
} else {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleMessage(ev) {
|
||||||
|
let { action, cmdId } = ev.data;
|
||||||
|
const sendMessage = (payload) => parent.postMessage( { ...payload }, ev.origin);
|
||||||
|
const sendReply = (payload) => sendMessage({ ...payload, cmdId })
|
||||||
|
const sendOk = () => sendReply({ action: "cmdOk" });
|
||||||
|
const sendError = (message, stack) => sendReply({ action: "cmdError", message, stack })
|
||||||
|
|
||||||
|
parent.postMessage({ action: "test" }, ev.origin);
|
||||||
|
|
||||||
|
if (action == "eval") {
|
||||||
|
let { script } = ev.data.args;
|
||||||
|
try {
|
||||||
|
eval(script);
|
||||||
|
sendOk();
|
||||||
|
} catch (e) {
|
||||||
|
sendError(e.message, e.stack)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (action == "bind_props") {
|
||||||
|
let { props } = ev.data.args
|
||||||
|
|
||||||
|
if (!window.component) {
|
||||||
|
// TODO can this happen?
|
||||||
|
console.error(`no component to bind to`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
props.forEach(prop => {
|
||||||
|
// TODO should there be a public API for binding?
|
||||||
|
// e.g. `component.$watch(prop, handler)`?
|
||||||
|
// (answer: probably)
|
||||||
|
window.component.$$.bound[prop] = value => {
|
||||||
|
sendMessage({ action:"prop_update", args: { prop, value } })
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (action == "set_prop") {
|
||||||
|
if (!window.component) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let { prop, value } = ev.data.args;
|
||||||
|
component[prop] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (action == "catch_clicks") {
|
||||||
|
let topOrigin = ev.origin;
|
||||||
|
document.body.addEventListener('click', event => {
|
||||||
|
if (event.which !== 1) return;
|
||||||
|
if (event.metaKey || event.ctrlKey || event.shiftKey) return;
|
||||||
|
if (event.defaultPrevented) return;
|
||||||
|
|
||||||
|
// ensure target is a link
|
||||||
|
let el = event.target;
|
||||||
|
while (el && el.nodeName !== 'A') el = el.parentNode;
|
||||||
|
if (!el || el.nodeName !== 'A') return;
|
||||||
|
|
||||||
|
if (el.hasAttribute('download') || el.getAttribute('rel') === 'external' || el.target) return;
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
if (el.href.startsWith(topOrigin)) {
|
||||||
|
const url = new URL(el.href);
|
||||||
|
if (url.hash[0] === '#') {
|
||||||
|
window.location.hash = url.hash;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.open(el.href, '_blank');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (action == "fetch_imports") {
|
||||||
|
let { bundle } = ev.data.args;
|
||||||
|
fetchImports(bundle, (remaining) => {
|
||||||
|
sendMessage({action: "fetch_progress", args: { remaining }});
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
bundle.imports.forEach(x=> {
|
||||||
|
const module = importCache[x];
|
||||||
|
const name = bundle.importMap.get(x);
|
||||||
|
window[name] = module;
|
||||||
|
});
|
||||||
|
sendOk();
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
sendError(e.message, e.stack);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("message", handleMessage, false)
|
||||||
|
|
||||||
|
console.log("repl-runner initialized");
|
||||||
|
|
||||||
|
})();
|
@ -1,8 +1,8 @@
|
|||||||
import Node from './shared/Node';
|
import Node from './shared/Node';
|
||||||
import EventHandler from './EventHandler';
|
import EventHandler from './EventHandler';
|
||||||
|
|
||||||
export default class Document extends Node {
|
export default class Body extends Node {
|
||||||
type: 'Document';
|
type: 'Body';
|
||||||
handlers: EventHandler[];
|
handlers: EventHandler[];
|
||||||
|
|
||||||
constructor(component, parent, scope, info) {
|
constructor(component, parent, scope, info) {
|
@ -1,21 +1,21 @@
|
|||||||
import Block from '../Block';
|
import Block from '../Block';
|
||||||
import Wrapper from './shared/Wrapper';
|
import Wrapper from './shared/Wrapper';
|
||||||
import deindent from '../../../utils/deindent';
|
import deindent from '../../../utils/deindent';
|
||||||
import Document from '../../nodes/Document';
|
import Body from '../../nodes/Body';
|
||||||
|
|
||||||
export default class DocumentWrapper extends Wrapper {
|
export default class BodyWrapper extends Wrapper {
|
||||||
node: Document;
|
node: Body;
|
||||||
|
|
||||||
render(block: Block, parentNode: string, parentNodes: string) {
|
render(block: Block, parentNode: string, parentNodes: string) {
|
||||||
this.node.handlers.forEach(handler => {
|
this.node.handlers.forEach(handler => {
|
||||||
const snippet = handler.render(block);
|
const snippet = handler.render(block);
|
||||||
|
|
||||||
block.builders.init.addBlock(deindent`
|
block.builders.init.addBlock(deindent`
|
||||||
document.addEventListener("${handler.name}", ${snippet});
|
document.body.addEventListener("${handler.name}", ${snippet});
|
||||||
`);
|
`);
|
||||||
|
|
||||||
block.builders.destroy.addBlock(deindent`
|
block.builders.destroy.addBlock(deindent`
|
||||||
document.removeEventListener("${handler.name}", ${snippet});
|
document.body.removeEventListener("${handler.name}", ${snippet});
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
}
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
let fulfil;
|
||||||
|
|
||||||
|
let thePromise = new Promise(f => {
|
||||||
|
fulfil = f;
|
||||||
|
});
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
thePromise,
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
|
||||||
|
html: `
|
||||||
|
<div><p>loading...</p></div>
|
||||||
|
`,
|
||||||
|
|
||||||
|
test({ assert, component, target }) {
|
||||||
|
fulfil(42);
|
||||||
|
|
||||||
|
return thePromise
|
||||||
|
.then(() => {
|
||||||
|
assert.htmlEqual(target.innerHTML, `
|
||||||
|
<div><p>the value is 42</p></div>
|
||||||
|
`);
|
||||||
|
|
||||||
|
component.show = false;
|
||||||
|
assert.htmlEqual(target.innerHTML, `<div></div>`);
|
||||||
|
|
||||||
|
component.show = true;
|
||||||
|
assert.htmlEqual(target.innerHTML, `
|
||||||
|
<div><p>the value is 42</p></div>
|
||||||
|
`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,11 @@
|
|||||||
|
<div>
|
||||||
|
{#await thePromise}
|
||||||
|
<p>loading...</p>
|
||||||
|
{:then theValue}
|
||||||
|
{#if show}
|
||||||
|
<p>the value is {theValue}</p>
|
||||||
|
{/if}
|
||||||
|
{:catch theError}
|
||||||
|
<p>oh no! {theError.message}</p>
|
||||||
|
{/await}
|
||||||
|
</div>
|
@ -1,13 +1,13 @@
|
|||||||
export default {
|
export default {
|
||||||
test({ assert, component, target, window }) {
|
test({ assert, component, window }) {
|
||||||
assert.deepEqual(component.events, []);
|
assert.deepEqual(component.events, []);
|
||||||
|
|
||||||
const event1 = new window.Event('mouseenter');
|
const event1 = new window.Event('mouseenter');
|
||||||
window.document.dispatchEvent(event1);
|
window.document.body.dispatchEvent(event1);
|
||||||
assert.deepEqual(component.events, ['enter']);
|
assert.deepEqual(component.events, ['enter']);
|
||||||
|
|
||||||
const event2 = new window.Event('mouseleave');
|
const event2 = new window.Event('mouseleave');
|
||||||
window.document.dispatchEvent(event2);
|
window.document.body.dispatchEvent(event2);
|
||||||
assert.deepEqual(component.events, ['enter', 'leave']);
|
assert.deepEqual(component.events, ['enter', 'leave']);
|
||||||
},
|
},
|
||||||
};
|
};
|
@ -1,10 +0,0 @@
|
|||||||
export default {
|
|
||||||
test({ assert, component, target, window, raf }) {
|
|
||||||
component.visible = true;
|
|
||||||
const div = target.querySelector('div');
|
|
||||||
assert.strictEqual(div.style.opacity, '0');
|
|
||||||
|
|
||||||
raf.tick(50);
|
|
||||||
assert.strictEqual(div.style.opacity, '');
|
|
||||||
}
|
|
||||||
};
|
|
@ -1,17 +0,0 @@
|
|||||||
<script>
|
|
||||||
export let visible;
|
|
||||||
|
|
||||||
function foo(node, params) {
|
|
||||||
return {
|
|
||||||
delay: 50,
|
|
||||||
duration: 100,
|
|
||||||
css: t => {
|
|
||||||
return `opacity: ${t}`;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{#if visible}
|
|
||||||
<div transition:foo>delayed</div>
|
|
||||||
{/if}
|
|
@ -0,0 +1,20 @@
|
|||||||
|
export default {
|
||||||
|
test({ assert, component, target, window, raf }) {
|
||||||
|
component.visible = true;
|
||||||
|
const div = target.querySelector('div');
|
||||||
|
|
||||||
|
assert.equal(div.style.animation, `__svelte_3809512021_0 100ms linear 0ms 1 both`);
|
||||||
|
|
||||||
|
raf.tick(50);
|
||||||
|
component.visible = false;
|
||||||
|
|
||||||
|
// both in and out styles
|
||||||
|
assert.equal(div.style.animation, `__svelte_3809512021_0 100ms linear 0ms 1 both, __svelte_3750847757_0 100ms linear 0ms 1 both`);
|
||||||
|
|
||||||
|
raf.tick(75);
|
||||||
|
component.visible = true;
|
||||||
|
|
||||||
|
// reset original styles
|
||||||
|
assert.equal(div.style.animation, `__svelte_3809512021_1 100ms linear 0ms 1 both`);
|
||||||
|
},
|
||||||
|
};
|
@ -0,0 +1,25 @@
|
|||||||
|
<script>
|
||||||
|
export let visible;
|
||||||
|
|
||||||
|
function foo() {
|
||||||
|
return {
|
||||||
|
duration: 100,
|
||||||
|
css: t => {
|
||||||
|
return `opacity: ${t}`;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function bar() {
|
||||||
|
return {
|
||||||
|
duration: 100,
|
||||||
|
css: t => {
|
||||||
|
return `opacity: ${t}`;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if visible}
|
||||||
|
<div in:foo out:bar></div>
|
||||||
|
{/if}
|
Loading…
Reference in new issue