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

server rendering #39

Merged
merged 4 commits into from
Jan 29, 2018
Merged

server rendering #39

merged 4 commits into from
Jan 29, 2018

Conversation

yoshuawuyts
Copy link
Member

Wrote a bunch about server rendering. Figured we should just cover the basics first, as we don't quite have a story for async rendering. Hope this works out alright!

@yoshuawuyts yoshuawuyts requested a review from a user January 10, 2018 14:42
ghost
ghost previously requested changes Jan 10, 2018
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very good!

server. The server then sends the right HTML to the client, so the first render
happens instantly.

Choo was built with both Node and the Browser in mind. One of its main feature
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

features

There hasn't been too much going on so far. Instead of rendering to the DOM,
we've been creating strings instead. However, what's often the case with server
rendering is that you need some data passed in for your initial rendering.
Luckily the `.toString()` method accepts a seonc argument: `state`. Let's see
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

second

a slightly different approach.

```js
var choo = require('choo')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it supposed to use import here then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol yup

@yoshuawuyts yoshuawuyts merged commit 8305ea6 into master Jan 29, 2018
@yoshuawuyts yoshuawuyts deleted the server-rendering branch January 29, 2018 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant