sveltejs / sapper-template Goto Github PK
View Code? Open in Web Editor NEWStarter template for Sapper apps
Starter template for Sapper apps
(A descendant of sveltejs/sapper#478.)
Returning partial content responses from service worker caches is apparently possible - see this blog post. We might want to consider supporting that if it dosen't make things too hairy.
If I open localhost:3000/
and then click the blog
link, it works fine. I suppose it is just refreshing the DOM on the client side.
However, opening localhost:3000/blog
directly, by entering the URL in the browser (or by reloading the page), results in no response from the server.
Similar behaviour for the individual blog pages, such as localhost:3000/blog/what-is-sapper
.
And same behavior on both the webpack and the rollup branches.
The rollup
branch is at the very least outputting some unfortunate-looking paths and acting very broken. webpack version works fine however.
PS C:\Users\Patrick\Desktop\sapper-rollup> npx sapper dev
✔ server (669ms)
• client
outesindex.css' is imported by routes\index.html, but could not be resolved – treating it as an external dependency
outes_layout.css' is imported by routes\_layout.html, but could not be resolved – treating it as an external dependency
outes_error.css' is imported by routes\_error.html, but could not be resolved – treating it as an external dependency
'C:UsersPatrickDesktopsapper-rollupcomponentsNav.css' is imported by components\Nav.html, but could not be resolved – treating it as an external dependency
outelogindex.css' is imported by routes\blog\index.html, but could not be resolved – treating it as an external dependency
outelog[slug].css' is imported by routes\blog\[slug].html, but could not be resolved – treating it as an external dependency
✗ client
Could not find chunk that owns blog/index.html
I also tried building the client directly using rollup in case that was more illuminating.
PS C:\Users\Patrick\Desktop\sapper-rollup> npx rollup --config .\rollup\client.config.js
C:\Users\Patrick\Desktop\sapper-rollup\app/client.js → .sapper\dev\client...
1 | import { a as append, b as assign, c as children, d as claimElement, e as claimText, f as createElement, g as createText, h as detachNode, i as init, j as insert, k as proto, l as flush, m as getSpreadUpdate, n as setData } from './chunk.1dd3859c.js';
2 | import 'C:UsersPatrickDesktopsapper-rollupcomponentsNav.css';
> 3 | import 'C:UsersPatrickDesktopsapper-rollup
| ^ Unterminated string constant
4 | outes_layout.css';
5 | import 'C:UsersPatrickDesktopsapper-rollup
6 | outes_error.css';
1 | import { a as append, b as assign, c as children, d as claimElement, e as claimText, f as createElement, g as createText, h as detachNode, i as init, j as insert, o as noop, k as proto } from './chunk.1dd3859c.js';
> 2 | import 'C:UsersPatrickDesktopsapper-rollup
| ^ Unterminated string constant
3 | outesindex.css';
4 |
5 | /* routes\index.html generated by Svelte v2.13.2 */
1 | import { a as append, b as assign, c as children, d as claimElement, e as claimText, f as createElement, g as createText, p as destroyEach, h as detachNode, i as init, j as insert, k as proto, n as setData } from './chunk.1dd3859c.js';
> 2 | import 'C:UsersPatrickDesktopsapper-rollup
| ^ Unterminated string constant
3 | outelogindex.css';
4 |
5 | /* routes\blog\index.html generated by Svelte v2.13.2 */
1 | import { a as append, b as assign, c as children, d as claimElement, e as claimText, f as createElement, g as createText, h as detachNode, i as init, j as insert, k as proto, n as setData } from './chunk.1dd3859c.js';
> 2 | import 'C:UsersPatrickDesktopsapper-rollup
| ^ Unterminated string constant
3 | outelog[slug].css';
4 |
5 | /* routes\blog\[slug].html generated by Svelte v2.13.2 */
(!) Unresolved dependencies
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
outes_error.css (imported by routes\_error.html)
outes_layout.css (imported by routes\_layout.html)
outesindex.css (imported by routes\index.html)
C:UsersPatrickDesktopsapper-rollupcomponentsNav.css (imported by components\Nav.html)
outelog[slug].css (imported by routes\blog\[slug].html)
outelogindex.css (imported by routes\blog\index.html)
[!] (terser plugin) SyntaxError: Error transforming bundle with 'terser' plugin: Unterminated string constant
SyntaxError: Error transforming bundle with 'terser' plugin: Unterminated string constant
at JS_Parse_Error.get (eval at <anonymous> (C:\Users\Patrick\Desktop\sapper-rollup\node_modules\terser\tools\node.js:21:1), <anonymous>:75:23)
at handleError (C:\Users\Patrick\Desktop\sapper-rollup\node_modules\rollup\bin\rollup:738:35)
at C:\Users\Patrick\Desktop\sapper-rollup\node_modules\rollup\bin\rollup:1193:9
at <anonymous>
Here's my environment info:
PS C:\Users\Patrick\Desktop\sapper-rollup> npm --versions
{ TODO: '0.0.1',
npm: '6.4.1',
ares: '1.10.1-DEV',
cldr: '32.0',
http_parser: '2.8.0',
icu: '60.1',
modules: '57',
napi: '3',
nghttp2: '1.29.0',
node: '8.11.2',
openssl: '1.0.2o',
tz: '2017c',
unicode: '10.0',
uv: '1.19.1',
v8: '6.2.414.54',
zlib: '1.2.11' }
PS C:\Users\Patrick\Desktop\sapper-rollup> node -p process.platform
win32
PORT
is not defined, in app/server.js, therefore node-fetch
is not working.
This was introduced when switching to polka: 6abeb06#diff-f53e59f241bb62f0261e245350683e07L11
When running the webpack build running
npm run build
in CI it should be possible to check for failure on the returned exit code.
Expected behaviour:
npm run build
# -> some build error happens
Error: Encountered errors while building app
at /.../node_modules/sapper/cli.js:80:24
echo $?
127
What currently happens:
npm run build
# -> some build error happens
Error: Encountered errors while building app
at /.../node_modules/sapper/cli.js:80:24
echo $?
0
This would allow detection of broken builds.
Might be out of scope, but should caching be on by default?
https://github.com/sveltejs/sapper-template/blob/master/routes/api/blog/index.js#L13
If you reload the page with an unexpired cache after there's been a new post, it'll show up for a split second as part of the static html before getting deleted when the page hydrates.
Hi,
A small open question : I plan to use sapper-template to experiment with client-side only PWAs. First for myself and small projects, but it also could be interesting to other people.
What would be the best way ?
It could be saw as a dumb question :) but I find the neat build configuration and tooling packed with the sapper template very useful and well done.
Sapper looks pretty cool but I'm not keen on adding yet more things to configure to my projects.
ERROR in ./routes/index.html
Module not found: Error: Can't resolve 'C:Users c7AppDataLocalTemp/svelte-1190322880.css' in 'C:\Apps\Testarea\svelte\sapper\my-app\routes'
@ ./routes/index.html 158:0-64
@ ./templates/.main.rendered.js
.....
.....
I've migrated from webpack to rollup and despite a few minor minor issues I got it to a point where I could push it live to replace my webpack build. However upon pushing to the server, clearing node_modules, running npm i, then npm run build and finally npm start, i'm seeing a failure.
Here's the log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/runcloud/webapps/docs/frontend/node_modules/.bin:/home/runcloud/.local/bin:/RunCloud/Packages/httpd-rc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle [email protected]~start: CWD: /home/runcloud/webapps/docs/frontend
10 silly lifecycle [email protected]~start: Args: [ '-c', 'node __sapper__/build' ]
11 silly lifecycle [email protected]~start: Returned: code: 1 signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `node __sapper__/build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:915:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/runcloud/webapps/docs/frontend
16 verbose Linux 4.15.0-36-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v8.12.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `node __sapper__/build`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Looks like maybe sapper/build is missing the index.js perhaps?
When I attempt to deploy to the Now 2.0 nerveless, it does not produce a working app, just shows the file system of the app in web browser,
The demo URL linked in this repo is currently displaying a 404 error.
the link to service-worker.js
at https://github.com/sveltejs/sapper-template#assets is broken, if you click on it you get a 404
error at handle_route()
Module not found: Error: Can't resolve 'c:AppsTestareasvelte_sappermyappoutes/about.html' in 'c:\Apps\Testarea\svelte_sapper\myapp.sapper'
Also error messages suggest a typo:
outes rather than routes
"./.sapper/server-routes.js
Module not found: Error: Can't resolve 'c:AppsTestareasvelte_sappermyappoutes/about.html' in 'c:\Apps\Testarea\svelte_sapper\myapp.sapper'
resolve 'c:AppsTestareasvelte_sappermyapp
outes/about.html' in 'c:\Apps\Testarea\svelte_sapper\myapp.sapper'
Parsed request is a module
using description file: c:\Apps\Testarea\svelte_sapper\myapp\package.json (relative path: ./.sapper)
after using description file: c:\Apps\Testarea\svelte_sapper\myapp\package.json (relative path: ./.sapper)
resolve as module
c:\Apps\Testarea\svelte_sapper\myapp.sapper\node_modules doesn't exist or is not a directory
c:\Apps\Testarea\svelte_sapper\node_modules doesn't exist or is not a directory
c:\Apps\Testarea\svelte\node_modules doesn't exist or is not a directory
c:\Apps\Testarea\node_modules doesn't exist or is not a directory
c:\Apps\node_modules doesn't exist or is not a directory
c:\node_modules doesn't exist or is not a directory
looking for modules in c:\Apps\Testarea\svelte_sapper\myapp\node_modules
using description file: c:\Apps\Testarea\svelte_sapper\myapp\package.json (relative path: ./node_modules)
after using description file: c:\Apps\Testarea\svelte_sapper\myapp\package.json (relative path: ./node_modules)
using description file: c:\Apps\Testarea\svelte_sapper\myapp\package.json (relative path: ./node_modules/c:AppsTestareasvelte_sappermyappoutes/about.html)
no extension
c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html doesn't exist
.js
c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html.js doesn't exist
.html
c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html.html doesn't exist
as directory
c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html doesn't exist
[c:\Apps\Testarea\svelte_sapper\myapp.sapper\node_modules]
[c:\Apps\Testarea\svelte_sapper\node_modules]
[c:\Apps\Testarea\svelte\node_modules]
[c:\Apps\Testarea\node_modules]
[c:\Apps\node_modules]
[c:\node_modules]
[c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html]
[c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html.js]
[c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html.html]
[c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html]
@ ./.sapper/server-routes.js 1:0-76"
Navigating on root page (source at src/routes/index.html
), which loads data on preload
, doesn't load data (warning <Index> was created without expected data property
) only after visiting a 404 page.
npm install
npm run dev
about
route (which return 404) and click on Home to see that data is not loaded.about
and then blog
: data is loaded there even if blog
and /index.html
have the same logic.What would it take to use import instead of require?
Currently CSS processing is rather rudimentary; static global CSS in the assets dir and svelte component CSS included in JS bundles. That's all well and good for a demo or PoC but the reality is production sites need more flexibility, repeatability, and automation.
Since we're using webpack for bundling, it should also be set up to handle generating CSS file/s. A link to the file/s should also be injected into the page template.
Using css-loader
+ style-loader
/mini-css-extract-plugin
is probably all we need for most projects to get started. This is easy to set up but now we also need to add a <link rel=stylesheet>
to the head which doesn't automatically happen. In other webpack projects I would use html-webpack-plugin
but that seems like overkill when sapper is already handling template.html
.
So, what we need for this is:
<link>
.For reference, here's what I'm using in one of my new projects, which covers 1. It also uses postcss but that's not necessary for sapper-template.
sapper-template/src/service-worker.js
Line 7 in 6e74431
Probably should be files
How authentication can be achieved? Is there a best practice?
I think the best way is to integrate with ooth.
I was testing the tutorial to install sapper-template. and when I run npm run dev. I found Module not found: can not solve 'E: proyectossveltemy-app'. The platform that I am using Windows 10.
Not found
Could not GET /blog
home & about links are fine
Using d93604d and following the steps from the "getting started" guide:
degit sveltejs/sapper-template my-app
cd my-app
npm install
npm run build
npm start
Then navigate to http://localhost:3000/blog/what-is-sapper
.
Result: the page loads fine, but there's an error in the console because one of the modules apparently can't be loaded by webpack:
Stacktrace (with minification turned off):
Uncaught (in promise) TypeError: Cannot read property 'call' of undefined
at __webpack_require__ (bootstrap b018e58b911432dbd00b:49)
at Object.11 (svelte-2284459081.css:1)
at __webpack_require__ (bootstrap b018e58b911432dbd00b:49)
at Object.10 (svelte-2284459081.css?b9c7:4)
at __webpack_require__ (bootstrap b018e58b911432dbd00b:49)
at Object.15 ([slug].html:9)
at __webpack_require__ (bootstrap b018e58b911432dbd00b:49)
at <anonymous>
Seems it can be traced back to a require()
in a generated svelte-***.css
file:
exports = module.exports = require("../../../../../tmp/workspace/my-app/node_modules/css-loader/lib/css-base.js")(true);
This can be repro'd in both Firefox and Chrome. I'm using macOS, Node v8.9.3.
I'll get an error like this on the client:
process-update.js:136 [HMR] Update check failed: Error: Manifest request to /client/7f71269cd30032b87e4f.hot-update.json timed out.
at XMLHttpRequest.request.onreadystatechange (http://localhost:3000/client/main.7f71269cd30032b87e4f.js:64:22)
handleError @ process-update.js:136
cb @ process-update.js:47
Promise rejected (async)
check @ process-update.js:84
module.exports @ process-update.js:42
processMessage @ client.js:251
handleMessage @ client.js:131
handleMessage @ client.js:94
bootstrap 7f71269cd30032b87e4f:63 Uncaught (in promise) Error: Manifest request to /client/7f71269cd30032b87e4f.hot-update.json timed out.
at XMLHttpRequest.request.onreadystatechange (bootstrap 7f71269cd30032b87e4f:63)
request.onreadystatechange @ bootstrap 7f71269cd30032b87e4f:63
Promise rejected (async)
check @ process-update.js:81
module.exports @ process-update.js:42
processMessage @ client.js:251
handleMessage @ client.js:131
handleMessage @ client.js:94
And then everything hangs. API routes don't start processing requests (no console.log
printing in the terminal) until the process is killed and then requests finish.
Don't know enough about this stack of tools to debug, but might have something to do with lack of error handling here?
preload({ params, query }) {
return fetch(`/api/feed`).then(r => r.json()).then(posts => {
return {posts}
})
}
npm i -D cypress
should be good enough to fix it ;)
are there any plans to support koa?
thanks either way
edit: realized this doesn't belong in the template repo
Hi - ran the setup instructions (on Windows 10) and after npm install
tried running npm run dev
- server fails to startup; Cannot find module 'tslib'
. Adding tslib
to the root package.json dependencies seems to fix it.
Here's the output:
C:\Users\Me\sapper\my-app>npm run dev
> [email protected] dev C:\Users\Me\sapper\my-app
> sapper dev
module.js:557
throw err;
^
Error: Cannot find module 'tslib'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\Me\sapper\my-app\node_modules\sapper\dist\cli.ts.js:5:15)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `sapper dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Me\AppData\Roaming\npm-cache\_logs\2018-03-12T01_38_01_754Z-debug.log
Doing a PR because I had a build
folder elsewhere getting ignored, and took me a while to figure out what was happening.
See: https://labs.consol.de/development/git/2017/02/22/gitignore.html
This code in templates/main.js
...
if (__dev__) {
// Enable hot-module reloading
import('sapper/webpack/hmr');
if (module.hot) module.hot.accept();
}
...causes problems. Because webpack isn't quite smart enough to remove the dead code (__dev__
is rewritten as false
), we're left with the import
statement when webpack tries to concatenate the modules, and Acorn fails to parse.
One possible solution would be to replace the whole lot with an injected __hmr__
block. That's a bit mysterious though, and I'd prefer something less so, though I can't quite figure out what.
Changing any file generates following error:
Uncaught (in promise) Error: Manifest request to client/4b956183ae495052a330.hot-update.json timed out.
at XMLHttpRequest.request.onreadystatechange
I added a timeout according to this comment, but I'm still getting the error. Changes are not appearing.
I have noticed that enabling custom elements when using webpack (not sure about rollup) prevents hot reloading from working.
I tested this with a fresh install of this template and adding tag names to all routes, pages and components and enabling customElement: true
in both client.config.js
and server.config.js
.
README needs updating to reflect removal of templates.
Was getting the following bug when NODE_ENV
was set to staging
:
$ sapper build
> Building...
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.mode should be one of these:
"development" | "production" | "none"
In other words, mode
is not vis-a-vis the same as NODE_ENV
in Webpack land. So this won't fly:
const mode = process.env.NODE_ENV;
Gosh. 🙃
We could in theory do something like the following:
const mode = process.env.NODE_ENV === 'production' ? 'production' : 'development';
But that's pretty limiting. CLI option? ENV var? https://webpack.js.org/concepts/mode/ mentions passing as config:
webpack --mode=production
$ npm run build
> The transformBundle hook used by plugin terser is deprecated. The renderChunk
hook should be used instead.
This is almost certainly a problem with rollup-plugin-terser.
Wait, no, it's just that the dependency is out of date: package.json references v1.0.1 while the latest version is v4.0.2
Few issues making it difficult to load svelte components from the node_modules folder out of the box.
Firstly, mainFields is not specified with 'svelte' in it.
Secondly node_modules is being excluded in the rule to load .html files.
And lastly, on the server side, this line is preventing webpack from bundling the svelte component and makes it load it as an external module which fails.
sapper-template/webpack/server.config.js
Line 11 in 280f48f
See conversation on this commit.
I've thrown together a possible initial implementation of this here. Running _template/build.sh
creates and force-pushes two branches rollup
and webpack
from the current master
- each with appropriate package.json
customization and removes the other bundler's config file.
When enabling custom elements and adding a component to the page creates a duplicate of the components contents at the top of the document (although not as a custom element).
Below is a screenshot where you can see <nav>
and <main>
are inserted inside <div id="sapper">
which come from the route _layout.html
and the component Nav.html
.
Chrome devtools on https://svelte.technology/guide
The FetchEvent for "https://svelte.technology/guide" resulted in a network error response: the promise was rejected.
Promise.catch (async)
self.addEventListener.event @ service-worker.js:45
service-worker.js:52 Uncaught (in promise) TypeError: Failed to execute 'fetch' on 'ServiceWorkerGlobalScope': 'only-if-cached' can be set only with 'same-origin' mode
@Rich-Harris I am absolutely loving svelte and sapper... But am having trouble understanding how to deploy say to Heroku or AWS. I have built, run, and deployed to "now"(obviously you made that ridiculously simple, thanks..).
Once built is everything I would need in the "app" or "build" dir?
Any advice or pointers would be truly appreciated.
Thanks!!
When generating the service worker manifest file (app/manifest/service-worker.js
) it currently also includes source map files (e.g. "client/fbd4e5d87f8d7dec1966/main.0.js.map"
). These files don't belong here and should be excluded. Perhaps there could be some way for the developer to exclude arbitrary files here?
Once this is implemented, it would be worth considering enabling source map generation in production builds.
Have wrestled a bit with the question of how to adequately test something like Sapper. I think the easiest thing to do is test a sample application instead, and this one is an obvious candidate.
At the same time, the apps themselves need to have a good, obvious way to test them.
Makes sense therefore to do the initial work here, then add tests in the Sapper repo that basically just run the tests for this app.
Gleb Bahmutov was kind enough to write up his experience of using Cypress to test a Svelte app, and I think Cypress is probably the right go-to choice for testing Sapper apps.
Moving this issue by @maxmilton from sapper-template-rollup, since I'm about to delete it in favour of the rollup
branch on this repo:
After an epic debugging session this morning trying to get Closure Compiler working with this project I ran into some showstoppers.
The service worker will compile with only small changes, however, compiling the other JS bundles is another story. Due to the use of dynamic import, import()
, the compiler ran into issues.
@ampproject/rollup-plugin-closure-compiler
can't parse import()
because it's using acorn which doesn't support it out of the box. I've created an issue over there suggesting they use acorn-dynamic-import
to add support: ampproject/rollup-plugin-closure-compiler#48.
Even after I was able to implement a workaround with @ampproject/rollup-plugin-closure-compiler
locally, I discovered Closure Compiler itself can't parse import()
at all and throws an error preventing the build. Opened an issue for that too: google/closure-compiler#2770.
So as it stands, both of these are blockers preventing us from using Closure Compiler right now.
FYI the progress I made is in https://github.com/MaxMilton/sapper-template-rollup/tree/feat/use-closure-compiler.
To make debugging easier, it would be nice to have _error.html
render error.stack
While it's trivial to create a new folder for static assets and the service worker tells us all files in assets
are precached, this might not be obvious to newcomers (especially if they are not familiar with service workers).
Perhaps explicitly having two asset folders would ease their way into sapper.
Just wanted to say, that it's missing as it's beeing linked to from the README
See
sapper-template/routes/api/blog/_posts.js
Lines 1 to 4 in 8687bf3
Generating blog post HTML from Markdown is common enough that IMHO it makes sense to have this be part of the template. Or maybe there could be a separate sapper-blog-template
that does this.
I mentioned a while ago I would provide these for the sake of conversation, but never got around to it. Since I just upgraded again, I documented things.
--
It's difficult to spot version diffs and/or conflict resolve difference between my updates and sapper-template. Example: in the package.json
file, I've added a bunch of new dependencies and scripts. Because of that it's hard to spot when you delete or add some from the template, especially in the cases where I'm actually still using a dependency that you've deleted, i.e., node-fetch
. The only mechanism I can think of to spot check the differences is to do something like this: f1c9e0a...ab69886
Other examples include changes to app/template.html
(I reference different favicon links that the template, for example), and various routes files changes. Also, changes in the app/server.js file can be really hard to trace, for example, the differences between Polka use and Express.
Finally, I use yarn for package managing, but the .gitignore
file has the yarn.lock
and yarn-error.log
files commented out.
I'm wondering if I'm doing things the hard way? I basically have to back up my whole project before copying this template over my git committed local version and then run through the whole diff. Would be nice if there was a much more convenient way to diff things between your changes and mine. I can't imagine how though.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.