Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: refactor update-authors.js to ESM #43098

Merged
merged 1 commit into from
May 21, 2022

Conversation

F3n67u
Copy link
Member

@F3n67u F3n67u commented May 14, 2022

Motivation

  1. make tools directory's js file format more consistent
  2. shifting towards ESM which is the official standard.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/actions

@nodejs-github-bot nodejs-github-bot added meta Issues and PRs related to the general management of the project. tools Issues and PRs related to the tools directory. labels May 14, 2022
Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to refactor this to ESM?

tools/update-authors.mjs Outdated Show resolved Hide resolved
tools/update-authors.mjs Outdated Show resolved Hide resolved
@F3n67u F3n67u force-pushed the esm/update-author branch 3 times, most recently from e8fd4de to b080a08 Compare May 14, 2022 13:47
@F3n67u
Copy link
Member Author

F3n67u commented May 14, 2022

Is there a reason to refactor this ESM?

@aduh95 Thanks for the review.

I see the newly added file on tools directory is all ESM module, so I think we could also refactor other commonjs format file to esm module format to make:

  1. all tools js file is more consistent: they are all esm module
  2. shifting towards ESM which is the official standard.

@F3n67u F3n67u requested a review from aduh95 May 14, 2022 14:33
@aduh95
Copy link
Contributor

aduh95 commented May 14, 2022

FYI ESM means 'ECMAScript module', so "esm module" is redundant. I'd suggest using refactor … to ESM or refactor … to ESM syntax instead.

Maybe instead of rl.line, we should use for await(const line of rl), using to our advantage top-level await to improve the script readability would be a very good argument for switching to ESM.

@F3n67u F3n67u changed the title tools: refactor update-authors.js to esm module tools: refactor update-authors.js to ESM May 15, 2022
@F3n67u F3n67u force-pushed the esm/update-author branch 2 times, most recently from 56e9d15 to f8f0a15 Compare May 15, 2022 02:29
@F3n67u
Copy link
Member Author

F3n67u commented May 15, 2022

FYI ESM means 'ECMAScript module', so "esm module" is redundant. I'd suggest using refactor … to ESM or refactor … to ESM syntax instead.

Maybe instead of rl.line, we should use for await(const line of rl), using to our advantage top-level await to improve the script readability would be a very good argument for switching to ESM.

Good suggestion. I have refactored rl.on('line' to for await(const line of rl). please take another look. the pr title is also changed to refactor … to ESM

@F3n67u F3n67u force-pushed the esm/update-author branch from f8f0a15 to 1aae44d Compare May 15, 2022 02:34
@F3n67u F3n67u force-pushed the esm/update-author branch from 03c759b to e7a41e5 Compare May 16, 2022 02:18
@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label May 21, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label May 21, 2022
@nodejs-github-bot nodejs-github-bot merged commit 5cb2579 into nodejs:master May 21, 2022
@nodejs-github-bot
Copy link
Collaborator

Landed in 5cb2579

@F3n67u F3n67u deleted the esm/update-author branch May 21, 2022 15:33
bengl pushed a commit that referenced this pull request May 30, 2022
PR-URL: #43098
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
@bengl bengl mentioned this pull request May 31, 2022
juanarbol pushed a commit that referenced this pull request May 31, 2022
PR-URL: #43098
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this pull request Jun 27, 2022
PR-URL: #43098
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
targos pushed a commit that referenced this pull request Jul 12, 2022
PR-URL: #43098
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2022
PR-URL: #43098
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
PR-URL: nodejs/node#43098
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Issues and PRs related to the general management of the project. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants