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

Upgrade Node.js to version 14 #83425

Merged
merged 14 commits into from
Dec 2, 2020
Merged

Upgrade Node.js to version 14 #83425

merged 14 commits into from
Dec 2, 2020

Conversation

watson
Copy link
Contributor

@watson watson commented Nov 16, 2020

This upgrades the Node.js runtime to a new major version.

For a complete list of changes in the Node.js runtime, see the Node.js CHANGELOG. For only the breaking changes, see the list of notable changes for v13 and v14 respectively.

Closes #54039

What's new?

Node.js 14 brings with it a lot of new features and improvements. Among the most interesting are:

  • Native support for optional chaining and nullish coalescing (via the new V8 JavaScript engine). However, it seem that we need to upgrade to webpack v5 before it can be used natively without a Babel transform, which is also why I've not removed our existing Babel plugins in this PR.
  • Major overhaul of streams, which makes the stream API much more concise.
  • Support for EcmaScript Modules without the need to use the --experimental-modules flag.
  • Diagnostic Report now stable. The reports contains information that can be useful to help diagnose problems in production including crashes, slow performance, memory leaks, high CPU usage, unexpected errors and more.

Read more here.

Todo

  • Use released version of lmdb-store with fixes for @types/node v13+ included.
  • Use released version of @elastic/good with fixes for Node.js 14 included.
  • Use released version of @elastic/good with other fixes for Node.js 14 included.

Notes to reviewers

Release note

Upgrades the major Node.js version used by and shipped with Kibana from v12 to v14.

@watson watson marked this pull request as ready for review November 30, 2020 22:33
@watson watson requested review from a team as code owners November 30, 2020 22:33
Copy link
Contributor

@patrykkopycinski patrykkopycinski left a comment

Choose a reason for hiding this comment

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

SIEM/Endpoint LGTM

@@ -70,7 +70,7 @@ describe('reduceStream', () => {
const errorStub = jest.fn();
reduce$.on('data', dataStub);
reduce$.on('error', errorStub);
const endEvent = promiseFromEvent('end', reduce$);
const closeEvent = promiseFromEvent('close', reduce$);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm somewhat concerned about this change. Looks like transform.destroy() is what leads to the close event being emitted, but we don't call it... any idea what change in node 14 lead to this being necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. I must say I didn't go into too many details when debugging the test-failure, so I'm not sure my solution is correct. I'll take a closer look...

package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@mshustov mshustov left a comment

Choose a reason for hiding this comment

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

reviewed the core code & tested locally. ❤️

Copy link
Contributor

@jportner jportner left a comment

Choose a reason for hiding this comment

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

One nit and a question below, LGTM!

Comment on lines 29 to 33
const url = parseUrl(rawUrl);
// @ts-expect-error `queryReplacer` expects key/value pairs with values of type `string | string[] | null`,
// however `@types/node` says that `url.query` has values of type `string | string[] | undefined`.
// After investigating this, it seems that no matter what the values will be of type `string | string[]`
const newQuery = queryReplacer(url.query || {});
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Distributable file count

id before after diff
default 43339 43459 +120
oss 22645 22744 +99

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@watson watson merged commit fb48e90 into elastic:master Dec 2, 2020
@watson watson deleted the bump-node branch December 2, 2020 22:40
@eyalkoren eyalkoren mentioned this pull request Dec 3, 2020
10 tasks
watson added a commit that referenced this pull request Dec 3, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Dec 3, 2020
* master: (40 commits)
  fix: 🐛 don't add separator befor group on no main items (elastic#83166)
  [Security Solution][Detections] Implements indicator match rule cypress test (elastic#84323)
  [APM] Add APM agent config options (elastic#84678)
  Fixed a11y issue on rollup jobs table selection (elastic#84567)
  [Discover] Refactor getContextUrl to separate file (elastic#84503)
  [Embeddable] Export CSV action for Lens embeddables in dashboard (elastic#83654)
  [TSVB] [Cleanup] Remove extra dateFormat props (elastic#84749)
  [Lens] Migrate legacy es client and remove total hits as int (elastic#84340)
  Improve logging pipeline in @kbn/legacy-logging (elastic#84629)
  Catch @hapi/podium errors (elastic#84575)
  [Discover] Unskip date histogram test (elastic#84727)
  Rename server.xsrf.whitelist to server.xsrf.allowlist (elastic#84791)
  [Enterprise Search] Fix schema errors button (elastic#84842)
  [APM] Removes react-sticky dependency in favor of using CSS (elastic#84589)
  [Maps] Always initialize routes on server-startup (elastic#84806)
  [Fleet] EPM support to handle uploaded file paths (elastic#84708)
  [Snapshot Restore] Fix initial policy form state (elastic#83928)
  Upgrade Node.js to version 14 (elastic#83425)
  [Security Solution] Keep Endpoint policies up to date with license changes (elastic#83992)
  [Security Solution][Exceptions] Implement exceptions for ML rules (elastic#84006)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Dec 3, 2020
* master: (236 commits)
  fix: 🐛 don't add separator befor group on no main items (elastic#83166)
  [Security Solution][Detections] Implements indicator match rule cypress test (elastic#84323)
  [APM] Add APM agent config options (elastic#84678)
  Fixed a11y issue on rollup jobs table selection (elastic#84567)
  [Discover] Refactor getContextUrl to separate file (elastic#84503)
  [Embeddable] Export CSV action for Lens embeddables in dashboard (elastic#83654)
  [TSVB] [Cleanup] Remove extra dateFormat props (elastic#84749)
  [Lens] Migrate legacy es client and remove total hits as int (elastic#84340)
  Improve logging pipeline in @kbn/legacy-logging (elastic#84629)
  Catch @hapi/podium errors (elastic#84575)
  [Discover] Unskip date histogram test (elastic#84727)
  Rename server.xsrf.whitelist to server.xsrf.allowlist (elastic#84791)
  [Enterprise Search] Fix schema errors button (elastic#84842)
  [APM] Removes react-sticky dependency in favor of using CSS (elastic#84589)
  [Maps] Always initialize routes on server-startup (elastic#84806)
  [Fleet] EPM support to handle uploaded file paths (elastic#84708)
  [Snapshot Restore] Fix initial policy form state (elastic#83928)
  Upgrade Node.js to version 14 (elastic#83425)
  [Security Solution] Keep Endpoint policies up to date with license changes (elastic#83992)
  [Security Solution][Exceptions] Implement exceptions for ML rules (elastic#84006)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Dec 3, 2020
…overy-action-group

* upstream/master: (48 commits)
  [Lens] accessibility screen reader issues (elastic#84395)
  [Logs UI] Fetch single log entries via a search strategy (elastic#81710)
  fix: 🐛 don't add separator befor group on no main items (elastic#83166)
  [Security Solution][Detections] Implements indicator match rule cypress test (elastic#84323)
  [APM] Add APM agent config options (elastic#84678)
  Fixed a11y issue on rollup jobs table selection (elastic#84567)
  [Discover] Refactor getContextUrl to separate file (elastic#84503)
  [Embeddable] Export CSV action for Lens embeddables in dashboard (elastic#83654)
  [TSVB] [Cleanup] Remove extra dateFormat props (elastic#84749)
  [Lens] Migrate legacy es client and remove total hits as int (elastic#84340)
  Improve logging pipeline in @kbn/legacy-logging (elastic#84629)
  Catch @hapi/podium errors (elastic#84575)
  [Discover] Unskip date histogram test (elastic#84727)
  Rename server.xsrf.whitelist to server.xsrf.allowlist (elastic#84791)
  [Enterprise Search] Fix schema errors button (elastic#84842)
  [APM] Removes react-sticky dependency in favor of using CSS (elastic#84589)
  [Maps] Always initialize routes on server-startup (elastic#84806)
  [Fleet] EPM support to handle uploaded file paths (elastic#84708)
  [Snapshot Restore] Fix initial policy form state (elastic#83928)
  Upgrade Node.js to version 14 (elastic#83425)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to Node 14.x
7 participants