Compare commits

...

10 Commits

Author SHA1 Message Date
Rich Harris
fc855f30f8 -> v0.15.3 2018-07-31 15:06:47 -04:00
Rich Harris
4a75fff4ec Merge pull request #329 from sveltejs/parallel-exports
parallelize exports
2018-07-31 15:05:38 -04:00
Rich Harris
7b7b695938 Merge pull request #320 from sveltejs/gh-319
Some dev documentation
2018-07-31 14:59:57 -04:00
Rich Harris
2fca2e295f Merge pull request #328 from sveltejs/export-no-minify-js
don't minify JS when minifying HTML
2018-07-31 14:59:27 -04:00
Rich Harris
eae991d369 parallelize exports 2018-07-31 14:56:29 -04:00
Rich Harris
c2b393d3fd dont minify JS when minifying HTML 2018-07-31 14:43:58 -04:00
Robert Hall
1d611be83e Using npm 2018-07-25 15:50:56 -06:00
Robert Hall
1782904994 Some dev documentation 2018-07-25 10:10:22 -06:00
Rich Harris
e3ddbfc181 Merge pull request #314 from sveltejs/fix-child-segment
fix child.segment bug
2018-07-23 17:08:25 -04:00
Rich Harris
8e3830b646 fix child.segment bug 2018-07-23 17:02:35 -04:00
10 changed files with 5013 additions and 15 deletions

View File

@@ -1,5 +1,10 @@
# 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
* Collapse component chains where no intermediate layout component is specified ([#312](https://github.com/sveltejs/sapper/issues/312))

View File

@@ -31,6 +31,44 @@ npm run build
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

4954
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "sapper",
"version": "0.15.2",
"version": "0.15.3",
"description": "Military-grade apps, engineered by Svelte",
"main": "dist/middleware.ts.js",
"bin": {
@@ -23,7 +23,7 @@
"cheerio": "^1.0.0-rc.2",
"chokidar": "^2.0.3",
"cookie": "^0.3.1",
"devalue": "^1.0.1",
"devalue": "^1.0.4",
"glob": "^7.1.2",
"html-minifier": "^3.5.16",
"mkdirp": "^0.5.1",

View File

@@ -118,9 +118,7 @@ async function execute(emitter: EventEmitter, {
}
});
for (const url of urls) {
await handle(url);
}
await Promise.all(urls.map(handle));
}
}
}

View File

@@ -8,7 +8,7 @@ export function minify_html(html: string) {
decodeEntities: true,
html5: true,
minifyCSS: true,
minifyJS: true,
minifyJS: false,
removeAttributeQuotes: true,
removeComments: true,
removeOptionalTags: true,

View File

@@ -452,9 +452,9 @@ function get_page_handler(manifest: Manifest, store_getter: (req: Req) => Store)
let inline_script = `__SAPPER__={${[
error && `error:1`,
`baseUrl: "${req.baseUrl}"`,
serialized.preloaded && `preloaded: ${serialized.preloaded}`,
serialized.store && `store: ${serialized.store}`
`baseUrl:"${req.baseUrl}"`,
serialized.preloaded && `preloaded:${serialized.preloaded}`,
serialized.store && `store:${serialized.store}`
].filter(Boolean).join(',')}};`;
const has_service_worker = fs.existsSync(path.join(locations.dest(), 'service-worker.js'));

View File

@@ -233,7 +233,7 @@ function prepare_page(target: Target): Promise<{
path,
preloading: false,
child: Object.assign({}, root_props.child, {
segment: new_segments[0]
segment: segments[0]
})
};
if (changed(query, root_props.query)) data.query = query;
@@ -260,12 +260,11 @@ function prepare_page(target: Target): Promise<{
params: get_params(target.match),
}, results[i].preloaded);
level.props.child = {
segment: new_segments[i + 1]
};
level.props.child = {};
}
level = level.props.child;
level.segment = segments[i + 1];
}
return { data, nullable_depth };

View File

@@ -1,6 +1,8 @@
<span>y: {segment} {count}</span>
<svelte:component this={child.component} {...child.props}/>
<span>child segment: {child.segment}</span>
<script>
import counts from '../_counts.js';

View File

@@ -630,7 +630,8 @@ function run({ mode, basepath = '' }) {
.then(text => {
assert.deepEqual(text.split('\n').filter(Boolean), [
'y: bar 1',
'z: baz 1'
'z: baz 1',
'child segment: baz'
]);
return nightmare.click(`a`)
@@ -642,7 +643,8 @@ function run({ mode, basepath = '' }) {
.then(text => {
assert.deepEqual(text.split('\n').filter(Boolean), [
'y: bar 1',
'z: qux 2'
'z: qux 2',
'child segment: qux'
]);
});
});