These are chat archives for redfin/react-server

3rd
Jun 2016
Sasha Aickin
@aickin
Jun 03 2016 20:08
slightly off topic, but probably interesting for a lot of the folks here: the new nightly node v7 releases have the v8 inspector built in. So now all you need to do to debug is add --inspect to the node command line. It will output a URL on the console that you can paste into Chrome and use current devtools to debug
Douglas Wade
@doug-wade
Jun 03 2016 20:08
node v7
Bo Borgerson
@gigabo
Jun 03 2016 20:09
Nice!
Douglas Wade
@doug-wade
Jun 03 2016 20:09
This is the first I’ve heard of this and I’m so excited
Sasha Aickin
@aickin
Jun 03 2016 20:09
You still have to use --debug-brk if you want it to start paused. Also, you can do CPU and heap profiling.
They are planning to port it to node v6 before the LTS release in October, although there's some fighting on the core team about whether that's a good idea or not
Douglas Wade
@doug-wade
Jun 03 2016 20:10
dougwade code/react-server ‹start-server-tests*› » n 7.0.0                                                                                                                                                                                1install : node-v7.0.0

  Error: invalid version 7.0.0
Sasha Aickin
@aickin
Jun 03 2016 20:11
But it sounds like it's just one person who is skeptical, and everyone else is pretty positive. It was going to make it in to the next v6 release until the one guy got a bit angry
yeah, hold on
Douglas Wade
@doug-wade
Jun 03 2016 20:11
I can’t ever remember where I can download the nightly build
Bo Borgerson
@gigabo
Jun 03 2016 20:11
@aickin - Link for the discussion thread?
Bo Borgerson
@gigabo
Jun 03 2016 20:11
This message was deleted
Douglas Wade
@doug-wade
Jun 03 2016 20:12
:mindblown:
Sasha Aickin
@aickin
Jun 03 2016 20:12
I got it working with that comment (although obviously changed the node version to the newest v7 nightly from https://nodejs.org/download/nightly/ )
One messed up thing is that something about the node version name means it doesn't show up correctly in the name list when you type n, so I have to switch at command line by passing the version in
@gigabo nodejs/node#6792
Bo Borgerson
@gigabo
Jun 03 2016 20:14
Thanks. :popcorn:
Sasha Aickin
@aickin
Jun 03 2016 20:15
https://github.com/nodejs/node/pull/6792#issuecomment-222522183 if you want to jump straight to the drama
Douglas Wade
@doug-wade
Jun 03 2016 20:15
:exclamation:
dougwade code/react-server ‹start-server-tests*› » PROJECT_NAME="node" PROJECT_URL="https://nodejs.org/download/nightly/" n project 7.0.0-nightly20160602aac79dfd78

     install : node-v7.0.0-nightly20160602aac79dfd78
       mkdir : /usr/local/n/versions/node/7.0.0-nightly20160602aac79dfd78
       fetch : https://nodejs.org/download/nightly/v7.0.0-nightly20160602aac79dfd78/node-v7.0.0-nightly20160602aac79dfd78-darwin-x64.tar.gz
######################################################################## 100.0%
   installed : v7.0.0-nightly20160602aac79dfd78
:rocket:
Sasha Aickin
@aickin
Jun 03 2016 20:15
awesome sauce.
now node --inspect --debug-brk somefile.js
Douglas Wade
@doug-wade
Jun 03 2016 20:16
Perhaps this can be solved with some blogging
puts on his blogging hat
Sasha Aickin
@aickin
Jun 03 2016 20:17
I'm pretty confident given the totality of reactions that it will make it in to v6 and therefore be released in October. Big step forward for the platform.
And as some folks pointed out, there are a lot of features in Chrome DevTools that don't exist in node-inspector. Among them: async call stacks and line-by-line notation of variable values when debugging.
Douglas Wade
@doug-wade
Jun 03 2016 20:34
hmmmmm
dougwade ~/example-react-server » node --inspect --debug-brk node_modules/.bin/ava test.js
Debugger listening on port 5858.
To start debugging, open the following URL in Chrome:
    chrome-devtools://devtools/remote/serve_file/@521e5b7e2b7cc66b4006a8a54cb9c4e57494a5ef/inspector.html?experiments=true&v8only=true&ws=localhost:5858/node
Debugger attached.
process.on(SIGPROF) is reserved while debugging
Unable to open devtools socket: address already in use

   1 exception


   ✖ test.js exited due to SIGABRT
Douglas Wade
@doug-wade
Jun 03 2016 20:42
looks like you can’t use it for anything that runs in a cluster :/ nodejs/node#4419
Bo Borgerson
@gigabo
Jun 03 2016 20:43
Oh. Bummer.
Douglas Wade
@doug-wade
Jun 03 2016 20:44
looks like the fix is blocked on windows :grimacing: nodejs/node#5025
Sasha Aickin
@aickin
Jun 03 2016 20:48
you could in theory turn off clustering to debug, right?
I mean, obviously not awesome, but ok for hacking about
Douglas Wade
@doug-wade
Jun 03 2016 20:49
Screen Shot 2016-06-03 at 1.48.09 PM.png
Screen Shot 2016-06-03 at 1.49.51 PM.png
Or just debug something single threaded :wink:
this is sweet
Sasha Aickin
@aickin
Jun 03 2016 20:50
awwww, happy you're happy
Douglas Wade
@doug-wade
Jun 03 2016 20:50
that’s using » node --inspect --debug-brk /usr/local/bin/yo react-server
Sasha Aickin
@aickin
Jun 03 2016 20:51
and yeah, it is pretty great. I was using it to debug and profile my react core PRs this week
Bo Borgerson
@gigabo
Jun 03 2016 21:10
v0.3.1 is out!
You can try it with npm install -g generator-react-server@latest
Douglas Wade
@doug-wade
Jun 03 2016 22:27
Big ups to @gigabo — the releases page is pretty cool now https://github.com/redfin/react-server/releases