Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Taipei Nov 22 #77

Closed
MylesBorins opened this issue Nov 14, 2017 · 11 comments
Closed

Taipei Nov 22 #77

MylesBorins opened this issue Nov 14, 2017 · 11 comments

Comments

@MylesBorins
Copy link
Contributor

MylesBorins commented Nov 14, 2017

I'll be working with about 35 folks to get their first PRs in

Could use some help with generating content

/cc @Trott


We will be working on

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
@gireeshpunathil
Copy link
Member

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)

@fhinkel
Copy link
Member

fhinkel commented Nov 14, 2017

@gireeshpunathil The only warnings at the moment are about v8::Debug functions being deprecated. Replacing those is probably not suited for a Code&Learn.

@gireeshpunathil
Copy link
Member

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!

@MylesBorins
Copy link
Contributor Author

MylesBorins commented Nov 20, 2017

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

@Trott
Copy link
Member

Trott commented Nov 20, 2017

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.

@MylesBorins
Copy link
Contributor Author

MylesBorins commented Nov 20, 2017 via email

@apapirovski
Copy link
Member

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.

@Trott
Copy link
Member

Trott commented Nov 20, 2017

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

@MylesBorins
Copy link
Contributor Author

thanks @Trott added to original comment

@Trott
Copy link
Member

Trott commented Nov 20, 2017

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...¯\(ツ)

@MylesBorins
Copy link
Contributor Author

All done and lots of great PRs.

Thanks for helping with review y'all

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants