Live data from Hacker News

Create a character voting app using React, Node.js, MongoDB and Socket.io

sahatyalkabov.com

11–20 of 59 posts

Re: Create a character voting app using React, Node.js, MongoDB and Socket.io

#12
Impressive and awesome. This is perfect to catch up on using build tools. I focus on core programming concepts in my own work, and at work most of that stuff is automated to just a few commands, so I appreciate the gulp.js part of your tutorial most. Thanks for the great work.

Re: Create a character voting app using React, Node.js, MongoDB and Socket.io

#16

Swig seems superfluous in that stack given it already has React, one could just use React to prerender the pages.

He provides his rational towards the bottom of the post:

> But do we really need a separate template for this? Why not just render everything inside the App component? Yes, you could do it, as long as you are okay with invalid HTML markup and not being able to include inline script tags like Google Analytics directly in the App component. But having said that, invalid markup is probably not relevant to SEO anymore and there are workarounds to include inline script tags in React components. So it's up to you, but for the purposes of this tutorial we will be using a Swig template.

Re: Create a character voting app using React, Node.js, MongoDB and Socket.io

#17
post #12

Impressive and awesome. This is perfect to catch up on using build tools. I focus on core programming concepts in my own work, and at work most of that stuff is automated to just a few commands, so I appreciate the gulp.js part of your tutorial most. Thanks for the great work.

I can't claim to be a Gulp expert, but it's always shocking to me how tools like Gulp and Grunt become so pervasive without strong tutorials.

I ignored Grunt for years, always implementing my own hackneyed systems in Python, until I eventually discovered this tutorial[1], which at least got me a good introductory "this is how you use this thing that everybody else already knows how to use, dummy" lesson.

[1] - http://24ways.org/2013/grunt-is-not-weird-and-hard/

Re: Create a character voting app using React, Node.js, MongoDB and Socket.io

#18
post #10
post #4

Why is modern webdev this hard? Even the todo-mvcs are all ~500 to 1000+ lines.

What are you talking about? I've never seen a 2k lines todomvc.

Here's my unscientific LOC count results (that I did in 5 minutes).

I've removed node_modules and bower_components from the items in: https://github.com/tastejs/todomvc/examples

I've also deleted "polymer" and "emberjs_require" since they didn't have any files in them and messes up the `wc -l`

    $ for x in *; do echo $x; wc -l `find $x/ -name '*js*' -type f | egrep -v 'test|lib|public|vendor|.bundle.js|.cache.js'`; echo; done
Results: http://pastebin.com/GqF0g3qF

Obviously one can improve the filtering to get more accurate results but you get the point. To make a TODO mvc you need at least 5+ different files and totalling a lot of lines. The fact that jQuery solution (which is very nice code, not the typical spaghetti) beats the majority of them in line count is pretty ironic.

Post reply on HN