mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-15 12:24:47 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc855f30f8 | ||
|
|
4a75fff4ec | ||
|
|
7b7b695938 | ||
|
|
2fca2e295f | ||
|
|
eae991d369 | ||
|
|
c2b393d3fd | ||
|
|
1d611be83e | ||
|
|
1782904994 | ||
|
|
e3ddbfc181 | ||
|
|
8e3830b646 |
@@ -1,5 +1,10 @@
|
|||||||
# sapper changelog
|
# sapper changelog
|
||||||
|
|
||||||
|
## 0.15.3
|
||||||
|
|
||||||
|
* Crawl pages in parallel when exporting ([#329](https://github.com/sveltejs/sapper/pull/329))
|
||||||
|
* Don't minify inline JS when exporting ([#328](https://github.com/sveltejs/sapper/pull/328))
|
||||||
|
|
||||||
## 0.15.2
|
## 0.15.2
|
||||||
|
|
||||||
* Collapse component chains where no intermediate layout component is specified ([#312](https://github.com/sveltejs/sapper/issues/312))
|
* Collapse component chains where no intermediate layout component is specified ([#312](https://github.com/sveltejs/sapper/issues/312))
|
||||||
|
|||||||
38
README.md
38
README.md
@@ -31,6 +31,44 @@ npm run build
|
|||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
Pull requests are encouraged and always welcome. [Pick an issue](https://github.com/sveltejs/sapper/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) and help us out!
|
||||||
|
|
||||||
|
To install and work on Sapper locally:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone git@github.com:sveltejs/sapper.git
|
||||||
|
cd sapper
|
||||||
|
npm install
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
### Linking to a Live Project
|
||||||
|
|
||||||
|
You can make changes locally to Sapper and test it against a local Sapper project. For a quick project that takes almost no setup, use the default [sapper-template](https://github.com/sveltejs/sapper-template) project. Instruction on setup are found in that project repository.
|
||||||
|
|
||||||
|
To link Sapper to your project, from the root of your local Sapper git checkout:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd sapper
|
||||||
|
npm link
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, to link from `sapper-template` (or any other given project):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd sapper-template
|
||||||
|
npm link sapper
|
||||||
|
```
|
||||||
|
|
||||||
|
You should be good to test changes locally.
|
||||||
|
|
||||||
|
### Running Tests
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run test
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
4954
package-lock.json
generated
Normal file
4954
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sapper",
|
"name": "sapper",
|
||||||
"version": "0.15.2",
|
"version": "0.15.3",
|
||||||
"description": "Military-grade apps, engineered by Svelte",
|
"description": "Military-grade apps, engineered by Svelte",
|
||||||
"main": "dist/middleware.ts.js",
|
"main": "dist/middleware.ts.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
"cheerio": "^1.0.0-rc.2",
|
"cheerio": "^1.0.0-rc.2",
|
||||||
"chokidar": "^2.0.3",
|
"chokidar": "^2.0.3",
|
||||||
"cookie": "^0.3.1",
|
"cookie": "^0.3.1",
|
||||||
"devalue": "^1.0.1",
|
"devalue": "^1.0.4",
|
||||||
"glob": "^7.1.2",
|
"glob": "^7.1.2",
|
||||||
"html-minifier": "^3.5.16",
|
"html-minifier": "^3.5.16",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
|
|||||||
@@ -118,9 +118,7 @@ async function execute(emitter: EventEmitter, {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const url of urls) {
|
await Promise.all(urls.map(handle));
|
||||||
await handle(url);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export function minify_html(html: string) {
|
|||||||
decodeEntities: true,
|
decodeEntities: true,
|
||||||
html5: true,
|
html5: true,
|
||||||
minifyCSS: true,
|
minifyCSS: true,
|
||||||
minifyJS: true,
|
minifyJS: false,
|
||||||
removeAttributeQuotes: true,
|
removeAttributeQuotes: true,
|
||||||
removeComments: true,
|
removeComments: true,
|
||||||
removeOptionalTags: true,
|
removeOptionalTags: true,
|
||||||
|
|||||||
@@ -452,9 +452,9 @@ function get_page_handler(manifest: Manifest, store_getter: (req: Req) => Store)
|
|||||||
|
|
||||||
let inline_script = `__SAPPER__={${[
|
let inline_script = `__SAPPER__={${[
|
||||||
error && `error:1`,
|
error && `error:1`,
|
||||||
`baseUrl: "${req.baseUrl}"`,
|
`baseUrl:"${req.baseUrl}"`,
|
||||||
serialized.preloaded && `preloaded: ${serialized.preloaded}`,
|
serialized.preloaded && `preloaded:${serialized.preloaded}`,
|
||||||
serialized.store && `store: ${serialized.store}`
|
serialized.store && `store:${serialized.store}`
|
||||||
].filter(Boolean).join(',')}};`;
|
].filter(Boolean).join(',')}};`;
|
||||||
|
|
||||||
const has_service_worker = fs.existsSync(path.join(locations.dest(), 'service-worker.js'));
|
const has_service_worker = fs.existsSync(path.join(locations.dest(), 'service-worker.js'));
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ function prepare_page(target: Target): Promise<{
|
|||||||
path,
|
path,
|
||||||
preloading: false,
|
preloading: false,
|
||||||
child: Object.assign({}, root_props.child, {
|
child: Object.assign({}, root_props.child, {
|
||||||
segment: new_segments[0]
|
segment: segments[0]
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
if (changed(query, root_props.query)) data.query = query;
|
if (changed(query, root_props.query)) data.query = query;
|
||||||
@@ -260,12 +260,11 @@ function prepare_page(target: Target): Promise<{
|
|||||||
params: get_params(target.match),
|
params: get_params(target.match),
|
||||||
}, results[i].preloaded);
|
}, results[i].preloaded);
|
||||||
|
|
||||||
level.props.child = {
|
level.props.child = {};
|
||||||
segment: new_segments[i + 1]
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
level = level.props.child;
|
level = level.props.child;
|
||||||
|
level.segment = segments[i + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return { data, nullable_depth };
|
return { data, nullable_depth };
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<span>y: {segment} {count}</span>
|
<span>y: {segment} {count}</span>
|
||||||
<svelte:component this={child.component} {...child.props}/>
|
<svelte:component this={child.component} {...child.props}/>
|
||||||
|
|
||||||
|
<span>child segment: {child.segment}</span>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import counts from '../_counts.js';
|
import counts from '../_counts.js';
|
||||||
|
|
||||||
|
|||||||
@@ -630,7 +630,8 @@ function run({ mode, basepath = '' }) {
|
|||||||
.then(text => {
|
.then(text => {
|
||||||
assert.deepEqual(text.split('\n').filter(Boolean), [
|
assert.deepEqual(text.split('\n').filter(Boolean), [
|
||||||
'y: bar 1',
|
'y: bar 1',
|
||||||
'z: baz 1'
|
'z: baz 1',
|
||||||
|
'child segment: baz'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return nightmare.click(`a`)
|
return nightmare.click(`a`)
|
||||||
@@ -642,7 +643,8 @@ function run({ mode, basepath = '' }) {
|
|||||||
.then(text => {
|
.then(text => {
|
||||||
assert.deepEqual(text.split('\n').filter(Boolean), [
|
assert.deepEqual(text.split('\n').filter(Boolean), [
|
||||||
'y: bar 1',
|
'y: bar 1',
|
||||||
'z: qux 2'
|
'z: qux 2',
|
||||||
|
'child segment: qux'
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user