Comments (11)
All done and lots of great PRs.
Thanks for helping with review y'all
from code-and-learn.
Not sure these are good for code&learn
items, but I would like to see:
- Address all the warnings from the compiler (C/C++) for major platforms
- Annotate tests for better consumption (problem determination and enhancements)
from code-and-learn.
@gireeshpunathil The only warnings at the moment are about v8::Debug
functions being deprecated. Replacing those is probably not suited for a Code&Learn.
from code-and-learn.
Ah, ok. I double-checked the long list of warnings I usually get now, and see a number of warnings, but they are from SSL sources, which we don't have any control of. Thanks for clarifying!
from code-and-learn.
So here are the fixes I'm planning to run and the files they are related to. I only need around 35, so there should be some leftovers for tokyo. It is worth mentioning that there seems to be quite a bit of setTimeouts that are not using common.platformTimeout, perhaps there is a reason for this and I shouldn't get people to update all of these, but it seems like a good way to gather a non trivial number of changes for a larger event (such as tokyo).
Please let me know asap if you see any of these changes being problematic
Add missing common.crashOnUnhandledRejection: (all issues use promises or await)
- addons/callback-scope/test-resolve-async.js
- addons/make-callback-recurse/test.js
- addons-napi/test_promise/test.js
- async-hooks/test-promise.chain-promise-before-init-hooks.js
- async-hook/test-promise.js
- async-hooks/test-promise.promise-before-init-hooks.js
- known_issues/test-inspector-cluster-port-clash.js
- parallel/test-async-hooks-disable-during-promise.js
- parallel/test-async-hooks-enable-during-promise.js
- parallel/test-async-hooks-promise-enable-disable.js
- parallel/test-async-hooks-promise.js
- parallel/test-async-wrap-pop-id-during-load.js
- parallel/test-async-wrap-promise-after-enabled.js
- parallel/test-http-agent.js
- parallel/test-http2-client-promisify-connect.js
- parallel/test-http2-window-size.js
- parallel/test-microtask-queue-integration-domain.js
- parallel/test-microtask-queue-integration.js
- parallel/test-microtask-queue-run-domain.js
- parallel/test-microtask-queue-run-immediate-domain.js
- parallel/test-microtask-queue-run-immediate.js
- parallel/test-microtask-queue-run.js
- parallel/test-net-server-max-connections-close-makes-more-available.js
- parallel/test-repl-load-multiline.js
- parallel/test-wasm-simple.js
- sequential/test-inspector-port-cluster.js
- sequential/test-inspector-port-zero-cluster.js
- parallel/test-util-callbackify.js
- sequential/test-inspector-break-e.js
Replace fs.accessSync with common.fileExists
- parallel/test-npm-install.js
Replace string concatenation with template literals
- test/abort/test-zlib-invalid-internals-usage.js
- test/async-hooks/init-hooks.js
- test/parallel/test-assert.js
- test/parallel/test-buffer-alloc.js
- test/parallel/test-http-extra-response.js
- test/parallel/test-http-multi-line-headers.js
- test/parallel/test-http-parser.js
- test/parallel/test-readline-interface.js
- test/parallel/test-require-extensions-main.js
from code-and-learn.
here seems to be quite a bit of setTimeouts that are not using common.platformTimeout,
Sorry, but please please please do not add common.platformTimeout()
. It is an anti-pattern in most cases. Please, don't do it.
from code-and-learn.
from code-and-learn.
A simple one might be replacing assert.throws(fn, common.expectsError(err));
with common.expectsError(fn, err);
. There are a ton of those and there's even an eslint rule to help find them: https://gist.github.com/apapirovski/b8d0803e6bd9938d29c207d50717eef3 — let me know if you need any help getting it setup.
from code-and-learn.
Here's an easy one: I believe the remark-*
directories in tools
contain external code bases that we're linting. Add tools/remark-*
to .eslintignore
.
The following 33 files all have at least once case of string concatenation where template literals might be better. (You'll probably want to take a peek at the files to confirm that these aren't somehow non-trivial or cases where string concatenation really might be better. If you only need a few, stick to doc
/test
/tool
directories to avoid perf discussions.)
benchmark/zlib/creation.js
doc/api/stream.md
doc/api/util.md
lib/_http_client.js
lib/_http_incoming.js
lib/_http_outgoing.js
lib/_tls_legacy.js
lib/_tls_wrap.js
lib/buffer.js
lib/child_process.js
lib/fs.js
lib/internal/child_process.js
lib/internal/cluster/master.js
lib/internal/errors.js
lib/internal/http2/core.js
lib/internal/loader/ModuleRequest.js
lib/internal/process/promises.js
lib/internal/querystring.js
lib/internal/streams/BufferList.js
lib/internal/trace_events_async_hooks.js
lib/internal/util.js
lib/internal/util/comparisons.js
lib/internal/v8_prof_processor.js
lib/module.js
lib/net.js
lib/os.js
lib/path.js
lib/querystring.js
lib/repl.js
lib/string_decoder.js
lib/tls.js
lib/url.js
lib/util.js
test/abort/test-zlib-invalid-internals-usage.js
test/async-hooks/init-hooks.js
test/parallel/test-assert.js
test/parallel/test-buffer-alloc.js
test/parallel/test-http-extra-response.js
test/parallel/test-http-multi-line-headers.js
test/parallel/test-http-parser.js
test/parallel/test-readline-interface.js
test/parallel/test-require-extensions-main.js
tools/doc/html.js
tools/doc/json.js
tools/license2rtf.js
from code-and-learn.
thanks @Trott added to original comment
from code-and-learn.
I think you should totally go with them for tasks, but be aware that there's probably going to be some coaching needed a bit on the "use template literals rather than string concatenation" task. For example, in test/abort/test-zlib-invalid-internals-usage.js
, there's this:
'WARNING: You are likely using a version of node-tar or npm that ' +
'is incompatible with this version of Node.js.' + os.EOL +
'Please use either the version of npm that is bundled with Node.js, or ' +
'a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) that is ' +
'compatible with Node.js 9 and above.' + os.EOL
The concatenation across lines is totally fine. It's the concatenation within a line (the + os.EOL
stuff) that needs to be replaced with a template literal. So when the contributor is done, there will be three lines that are untouched and are still string literals, and two lines that are converted to template literals.
You'll need to either explain that sort of thing in writing, or else just make sure all the mentors know the deal.
Worst case, though, is it comes back as a nit in the PR, so...¯\(ツ)/¯
from code-and-learn.
Related Issues (20)
- Code & Learn Saint Petersburg 2020 HOT 2
- Next events? HOT 10
- Mentors for Code-and-Learn @ NodeConf EU (Nov 5) HOT 8
- Scope of Code + Learn for JS Interactive 2018 HOT 8
- Code + Learn Copy for the JS Interactive Website HOT 7
- Mentors for Code + Learn @ Node+JS Interactive 2018 HOT 36
- COSCon'18 (China Open Source Conf) wants to hold a Code + Learn Workshop HOT 55
- Common questions at C&L events HOT 7
- Mentors for Code + Learn @ NodeConf Colombia 2019 HOT 14
- Bangalore, November 17th HOT 16
- Example coverage task HOT 1
- Mentors for Code-and-Learn @ Seattle (Dec 18) HOT 7
- JSConf Budapest 2019 would like to hold a Code & Learn Workshop HOT 11
- Code And Learn at NodeFest 2018 HOT 4
- CFP: Code + Learn @ JSConf.Asia (Singapore) 2019-06-[14|15|16] HOT 5
- Code And Learn At Beijing April 28th HOT 7
- Code & Learn Saint Petersburg 2019 HOT 9
- Bangalore, May 25th HOT 4
- Node.js Code + Learn at COSCon'19 (China Open Source Conf) HOT 14
- Code & Learn Moscow 2019 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from code-and-learn.