TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Redux Blog Example

80 pointsby olegakbarovover 9 years ago

5 comments

avolcanoover 9 years ago
Cool stuff!<p>In a somewhat similar vein, I&#x27;ve been working on a static site generator (like Jekyll) that uses React&#x2F;Redux instead of a templating system: <a href="https:&#x2F;&#x2F;github.com&#x2F;thomasboyt&#x2F;peridot" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;thomasboyt&#x2F;peridot</a><p>It actually is very similar to any other isomorphic React app, except instead of hosting an API, it simply renders each page out to a file, as well as a JSON version of each post that acts as the &quot;API&quot; used to retrieve further pages from the frontend app. There&#x27;s an example site here: <a href="http:&#x2F;&#x2F;loudplaces.disco.zone&#x2F;" rel="nofollow">http:&#x2F;&#x2F;loudplaces.disco.zone&#x2F;</a>
评论 #10207031 未加载
评论 #10206763 未加载
iandanforthover 9 years ago
Couple of requests<p>1. Add comments<p>There&#x27;s a lot going on here and very few comments<p>2. In the README point out the entry point of the code<p>There are a lot of places one could start reading, give users a hint as to the best place to start.<p>Your app template.html points toward a &#x2F;js&#x2F;app.js file which doesn&#x27;t exist in the source, which is fine, but if I&#x27;d like to read before I run a pointer would be helpful!
评论 #10206427 未加载
danmaz74over 9 years ago
Out of curiosity, why didn&#x27;t you use Immutable.js for your Store? You thought about it and chose a different path, or you just didn&#x27;t consider it at all?
评论 #10207296 未加载
madeofpalkover 9 years ago
Nice. I love Redux + React so much, so I appreciate any effort into making people more aware of it.<p>I was really excited that you found a way to return proper 404&#x27;s! <a href="https:&#x2F;&#x2F;github.com&#x2F;GetExpert&#x2F;redux-blog-example&#x2F;blob&#x2F;master&#x2F;app&#x2F;server.js#L50-L52" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;GetExpert&#x2F;redux-blog-example&#x2F;blob&#x2F;master&#x2F;...</a><p>There are a few things I would have done differently though. Check out:<p>- this sample project I made. it&#x27;s not ideal though and I have learnt a since I made this, but it has a few good ideas <a href="https:&#x2F;&#x2F;github.com&#x2F;joshhunt&#x2F;reactapus" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;joshhunt&#x2F;reactapus</a><p>- the official &#x27;real world&#x27; example <a href="https:&#x2F;&#x2F;github.com&#x2F;rackt&#x2F;redux&#x2F;tree&#x2F;master&#x2F;examples&#x2F;real-world" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rackt&#x2F;redux&#x2F;tree&#x2F;master&#x2F;examples&#x2F;real-wor...</a><p>Suggestions:<p>- Consider putting client, server, and universal code into seperate folders like in my example - it makes it easier to understand what code is executing where.<p>- Move routing into a &#x27;universalRouter.js&#x27; which is the one place that performs routing and returns the root component. Both the server and client use this. <a href="https:&#x2F;&#x2F;github.com&#x2F;joshhunt&#x2F;reactapus&#x2F;blob&#x2F;master&#x2F;src&#x2F;app&#x2F;universalRouter.js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;joshhunt&#x2F;reactapus&#x2F;blob&#x2F;master&#x2F;src&#x2F;app&#x2F;un...</a><p>- Actions should be very simple, return basic serialisable objects, and be super easy to test. Don&#x27;t make API calls directly in actions. Redux has fantastic middleware to make this easier for you. I do it in a basic way in my sample project, but the redux real-world example does it much better. Check out <a href="https:&#x2F;&#x2F;github.com&#x2F;rackt&#x2F;redux&#x2F;blob&#x2F;master&#x2F;examples&#x2F;real-world&#x2F;actions&#x2F;index.js#L38" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rackt&#x2F;redux&#x2F;blob&#x2F;master&#x2F;examples&#x2F;real-wor...</a><p>- Consider using ESLint. Airbnb has a premade config that does a pretty good job of providing best practices. <a href="https:&#x2F;&#x2F;github.com&#x2F;airbnb&#x2F;javascript&#x2F;tree&#x2F;master&#x2F;linters" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;airbnb&#x2F;javascript&#x2F;tree&#x2F;master&#x2F;linters</a> Beware, it&#x27;s going to flag a whole bunch of stuff in you project, but you&#x27;ll get much better code out of it.
评论 #10206887 未加载
评论 #10207820 未加载
awinderover 9 years ago
Really liked the auth workflow that was set up here: <a href="https:&#x2F;&#x2F;github.com&#x2F;GetExpert&#x2F;redux-blog-example&#x2F;blob&#x2F;master&#x2F;app&#x2F;routes&#x2F;index.js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;GetExpert&#x2F;redux-blog-example&#x2F;blob&#x2F;master&#x2F;...</a>. I had a hard time finding good examples recently and a LOT of trouble finding good examples w&#x2F; react-router&#x27;s 1.0 branch, so this is very much appreciated :-)