Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update choo #527

Merged
merged 3 commits into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"debug": "DEBUG='*' ./bin.js start -q example"
},
"keywords": [],
"peerDependencies": {
"choo": "7.x"
},
"dependencies": {
"@choojs/findup": "^0.2.0",
"ansi-diff": "^1.0.10",
Expand Down Expand Up @@ -53,7 +56,7 @@
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"nanohtml": "^1.2.4",
"nanologger": "^1.3.1",
"nanologger": "^2.0.0",
"nanoraf": "^3.0.1",
"nanotiming": "^7.2.0",
"on-idle": "^3.1.4",
Expand Down Expand Up @@ -82,14 +85,14 @@
"v8-compile-cache": "^2.0.0",
"wasm-brotli": "^1.0.2",
"watchify": "^3.10.0",
"wayfarer": "^6.6.3"
"wayfarer": "^7.0.0"
},
"devDependencies": {
"a-module-with-babelrc": "^1.0.0",
"assert-html": "^1.1.5",
"choo": "^6.8.0",
"choo-devtools": "^2.3.3",
"choo-service-worker": "^2.4.0",
"choo": "^7.0.0",
"choo-devtools": "^3.0.0",
"choo-service-worker": "^3.0.0",
"read-file-tree": "^1.1.0",
"standard": "^11.0",
"tachyons": "^4.9.1",
Expand Down
8 changes: 2 additions & 6 deletions ssr/choo.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ module.exports.listRoutes = function (app) {
//
// NOTE: state is never passed in it seems. Funky fn signature, this should be
// fixed.
//
// NOTE: Choo currently doesn't use the passed-in state as the base. It probably
// should, so we can treat the state as the only stateful bits, and the rest is
// just context.

module.exports.render = function (app, route, cb) {
var state = {}
Expand All @@ -80,8 +76,8 @@ module.exports.render = function (app, route, cb) {
var res = { state: state }
res.body = app.toString(route, state)
delete res.state._experimental_prefetch // State needs to be serializable.
if (app.state.title) res.title = app.state.title
if (app.state.language) res.language = app.state.language
if (state.title) res.title = state.title
tornqvist marked this conversation as resolved.
Show resolved Hide resolved
if (state.language) res.language = state.language
if (app.selector) res.selector = app.selector
cb(null, res)
}
Expand Down