Implement proper preact-ssr#767
Closed
arunoda wants to merge 15 commits into
Closed
Conversation
So, no need to define a custom .babelrc for the user.
This was referenced Jan 23, 2017
Contributor
|
Hiya @arunoda - I'd love to play around with this and see if I can run into (and thus fix) any issues with SSR. Would you be able to explain how you're testing this out? Am I right in thinking it's just this: git clone && npm i && cd examples/using-preact && npm i && npm start |
Contributor
Author
|
@developit Yep. That's it. |
|
@arunoda any plan to merge this? It seems like you're working on may PRs at a time |
Contributor
Author
|
@thangngoc89 this is marked for 2.1 release. |
Contributor
|
This can be closed because of the new preact example. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the current version of preact, it only works(barely) in the client side. But in the server, it still using react.
So, this fixes that issue and improve the use of preact.
Here we've introduce a module alias system where it alias correctly in different places.(Node, webpack, babel)
Preact also doesn't work well with
react-hot-loader. And we don't really need preact in the dev mode. So with this, we only run preact only in production.How to add preact as mentioned above?
Now it's pretty easy. Just create a config in
next.config.jslike this: