Since I want to have the commits in order I want to get what needs to be changed sorted out before starting to work on them... otherwise I can just keep rebasing over and over. :stuck_out_tongue_winking_eye:
Why?
Some things are just not working out the way I had planned and there is always room for improvement. Most likely I didn’t think of everything here so input is greatly appreciated!
ToDo
[x] Wait for Koa 2? Use Express instead of Koa?
[ ] I don’t like how koa-router comes after koa-static.
[x] Prebuild server code for production.
[x] Get rid of all the 'use strict;'?
[x] Maybe use CSS modules instead of Sass, or both.
[x] Maybe linting and testing.
[x] Skip the React and ReactDOM aliases in webpack.
[ ] Redux DevTools in addition to Redux DevTools Extension?
[ ] Better documentation.
[x] Return proper 404 status code for /blog/:slug when slug is not found.
[x] Changing page title and other meta data depending on route.
[x] Remove ./node_modules/.bin/ from scripts.
Wait for Koa 2? Use Express instead of Koa?
Seems like Koa won’t win in popularity from Express. Maybe Koa 2 will change this. Maybe we should just stick to Express.
I don’t like how koa-router comes after koa-static
This probably means that the file system is hit on every request to see if there is a static file. Possible solutions:
Only serve static files from a subdirectory like /static.
Put koa-router first but instead of using a wildcard route we have to match all routes from the React Router.
Prebuild server code for production
I don’t know if there are any other disadvantages to use babel-register in production code than a slow startup time, but it’s probably best to prebuild anyway.
Get rid of all the 'use strict;'?
It was needed for ES6 syntax like let and const but if all server code is transpiled anyway.
Maybe use CSS modules instead of Sass, or both
I don’t know.
Maybe linting and testing
Adds complexicity but it’s probably required in any serious project anyway.
Skip the React and ReactDOM aliases in webpack
I got better compression rates using the pre-minified version from React, but it’s probably better to figure out how to get those compression rates outselves.
Redux DevTools in addition to Redux DevTools Extension
Better documentation
Not just from the README.md, but also explain why some choices are made. Maybe also more inline comments.
Return proper 404 status code for /blog/:slug when slug is not found
I don’t know how, but this is essential for server-side rendering. We need proper status codes.
Changing page title and other meta data depending on route
It should be possible to change page title, description and other meta tags like Open Graph depending on route.
v2 Roadmap
Since I want to have the commits in order I want to get what needs to be changed sorted out before starting to work on them... otherwise I can just keep rebasing over and over. :stuck_out_tongue_winking_eye:
Why?
Some things are just not working out the way I had planned and there is always room for improvement. Most likely I didn’t think of everything here so input is greatly appreciated!
ToDo
koa-router
comes afterkoa-static
.'use strict;'
?/blog/:slug
when slug is not found../node_modules/.bin/
from scripts.Wait for Koa 2? Use Express instead of Koa?
Seems like Koa won’t win in popularity from Express. Maybe Koa 2 will change this. Maybe we should just stick to Express.
I don’t like how
koa-router
comes afterkoa-static
This probably means that the file system is hit on every request to see if there is a static file. Possible solutions:
/static
.koa-router
first but instead of using a wildcard route we have to match all routes from the React Router.Prebuild server code for production
I don’t know if there are any other disadvantages to use
babel-register
in production code than a slow startup time, but it’s probably best to prebuild anyway.Get rid of all the
'use strict;'
?It was needed for ES6 syntax like
let
andconst
but if all server code is transpiled anyway.Maybe use CSS modules instead of Sass, or both
I don’t know.
Maybe linting and testing
Adds complexicity but it’s probably required in any serious project anyway.
Skip the React and ReactDOM aliases in webpack
I got better compression rates using the pre-minified version from React, but it’s probably better to figure out how to get those compression rates outselves.
Redux DevTools in addition to Redux DevTools Extension
Better documentation
Not just from the README.md, but also explain why some choices are made. Maybe also more inline comments.
Return proper 404 status code for
/blog/:slug
when slug is not foundI don’t know how, but this is essential for server-side rendering. We need proper status codes.
Changing page title and other meta data depending on route
It should be possible to change page title, description and other meta tags like Open Graph depending on route.
Remove
./node_modules/.bin/
from scriptsBecause
npm run
automatically resolves those.