| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
should we do a pass at replacing all instances of require in docs with const?
Sorry, something went wrong.
There was a problem hiding this comment.
Incrementally, perhaps. I don't think it's critical enough to do all at once
Sorry, something went wrong.
There was a problem hiding this comment.
fair enough. my only thought on this is that it might be weird to have things in the docs inconsistent, but it makes sense to avoid massive churn
Sorry, something went wrong.
There was a problem hiding this comment.
It might actually be better to have huge docs only churn in a single commit, instead of 32 commits. People are a lot less likely to bisect and blame the docs.
Sorry, something went wrong.
There was a problem hiding this comment.
Looking it over, I agree. It's not a huge chunk of work. Already have it
mostly done. Will update this PR with the other updates.
On Dec 14, 2015 4:51 PM, "Colin Ihrig" notifications@github.com wrote:
In doc/api/http.markdown
#4282 (comment):@@ -103,7 +103,7 @@ of these values set to their respective defaults.
To configure any of them, you must create your own [http.Agent][] object.-var http = require('http'); +const http = require('http');It might actually be better to have huge docs only churn in a single
commit, instead of 32 commits #3662.
People are a lot less likely to bisect and blame the docs.—
Reply to this email directly or view it on GitHub
https://github.com/nodejs/node/pull/4282/files#r47583137.
Sorry, something went wrong.
|
LGTM. Small comment regarding using const in docs above, but that is not relevant to this landing |
Sorry, something went wrong.
|
Argh, the ES6 inline functions continue to creep in! |
Sorry, something went wrong.
|
lol ... they're not the prettiest thing in the world but it's the direction things are heading |
Sorry, something went wrong.
There was a problem hiding this comment.
I don't think we have any linting rules for arrow functions yet, but from a quick code search, it looks like the convention has been to put spaces on each side of the arrow. So, in this case (res) => {.
Sorry, something went wrong.
There was a problem hiding this comment.
agreed, I'm only seeing (args) => { in use in the wild at the moment with the extra space (not that I'm looking very widely)
Sorry, something went wrong.
There was a problem hiding this comment.
In this case it's probably fine to omit the parens, as well — http.get(options, res => {
Sorry, something went wrong.
There was a problem hiding this comment.
my vote would be to never omit parens to be explicit what's going on, I personally find the paren-free version little too terse
Sorry, something went wrong.
There was a problem hiding this comment.
It's definitely a brand new 🚲🏡; I don't feel strongly enough either way to propose setting a hard-and-fast rule for it. In my own projects, I lean towards minimizing characters in code examples to give other info more room, but two characters is not a huge amount of savings so I'm comfortable leaving this as a personal preference of the doc author for the time being.
Sorry, something went wrong.
|
@thealphanerd @cjihrig ... ok, just pushed a big update. Fixed up all of the doc examples at once. |
Sorry, something went wrong.
|
@nodejs/documentation |
Sorry, something went wrong.
|
Are you comfortable asserting that the code examples still work as authored? If so, this LGTM pending arrow function style nits! |
Sorry, something went wrong.
|
I'm going to be going through and testing the various cases. Gimme a day to
|
Sorry, something went wrong.
|
@jasnell Awesome, thanks — great work! |
Sorry, something went wrong.
|
While we're at it, is there a good reason to keep semicolons in these? |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
There was a problem hiding this comment.
what change happened here?
Sorry, something went wrong.
There was a problem hiding this comment.
Not a clue. Likely a whitespace change. Will fix.
Sorry, something went wrong.
|
New changes look good. Left one comment directly on the commit instead of the PR. |
Sorry, something went wrong.
|
const can be used without 'use strict', it's let that can't be used without it. bash-3.2$ cat ~/tmp/test.js
const m = 1;
let n = 1;
bash-3.2$ node ~/tmp.test
module.js:339
throw err;
^
Error: Cannot find module '/Users/james/tmp.test'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
bash-3.2$
|
Sorry, something went wrong.
|
Uh, yeah, never mind my previous comments about strict mode... |
Sorry, something went wrong.
|
Pushed update to pull the "fix" for #4296 back out. That change isn't necessary for master or v5 |
Sorry, something went wrong.
|
@cjihrig ... updated the 0022 to 0o022 per your suggestion |
Sorry, something went wrong.
|
I marked this for LTS watch but it likely won't land cleanly. If/when it lands, I'll put together a modified version for v4.x-staging |
Sorry, something went wrong.
|
I'd like to get this landed soon but would appreciate a bit more eyes on it. /cc @nodejs/documentation |
Sorry, something went wrong.
|
Rebased and updated... |
Sorry, something went wrong.
* Use single quotes consistently * Modernize examples to use template strings and arrow funcs * Fix a few typos
Additional example edits for consistency
Per @cjihrig's suggestion
|
Getting this landed momentarily |
Sorry, something went wrong.
* Use single quotes consistently * Modernize examples to use template strings and arrow funcs * Fix a few typos * Example edits for consistency PR-URL: #4282 Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Use single quotes consistently * Modernize examples to use template strings and arrow funcs * Fix a few typos * Example edits for consistency PR-URL: nodejs#4282 Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Use single quotes consistently * Modernize examples to use template strings and arrow funcs * Fix a few typos * Example edits for consistency PR-URL: #4282 Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Use single quotes consistently * Modernize examples to use template strings and arrow funcs * Fix a few typos * Example edits for consistency PR-URL: nodejs#4282 Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Use single quotes consistently * Modernize examples to use template strings and arrow funcs * Fix a few typos * Example edits for consistency PR-URL: #4282 Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Use single quotes consistently * Modernize examples to use template strings and arrow funcs * Fix a few typos * Example edits for consistency PR-URL: nodejs#4282 Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
| Back | FazBrowse Home | New Git URL |
/cc @nodejs/http