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

chore: bump min Node.js to v14.17; update deps #3611

Merged
merged 8 commits into from
Sep 6, 2023

Conversation

trentm
Copy link
Member

@trentm trentm commented Sep 5, 2023

This bumps our min Node.js from v14.5 to v14.17; and bumps a number
of dependencies.

  • v14.5 was for AsyncLocalStorage
  • v14.6 brings a V8 with spport for private methods syntax, FinalizationRegistry (used by pino@8)
  • v14.8 brings AsyncResource.bind
  • v14.17 brings AbortController, AbortSignal.reason (used by readable-stream@4, glob@10, etc.)

Closes: #2760

This updates a number of dependencies now that our base Node.js version
is v14.

There is some subtlety in the 'pino' and 'glob' deps. They both use
AbortController (pino via its usage of readable-stream@4) or
<AbortSignal>.reason to support aborting async operations. Full support
for these were not added until Node.js 14.17 -- yet this APM agent
currently supports back to 14.5.0.

I feel this is not an issue. In node 14.x `AbortController` et al are only available
behind a flag (`node --experimental-abortcontroller`).  Node.js v14.17
added `<AbortSignal>.reason`, so the fail case with Pino is a user using
(a) a Node.js version in the range [v14.5, v14.17), and (b) with the
`--experimental-abortcontroller` flag, and (c) something in the APM
agent's code path tries to use `AbortSignal.reason`. When the flag is
not used both readable-stream@4 and glob@10 will use a polyfill.

We could consider setting min to >14.17, but I don't currently think it
is necessary.

Closes: #2760
@trentm trentm requested a review from david-luna September 5, 2023 22:26
@trentm trentm self-assigned this Sep 5, 2023
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Sep 5, 2023
@trentm
Copy link
Member Author

trentm commented Sep 5, 2023

Cannot use pino@8 either because its dep on-exit-leak-free uses FinalizationRegistry which isn't in node v14.5. It is in a later Node v14 -- v14.6.0 per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry

pino@7 is not more than a year old:

  '7.9.2': '2022-03-22T18:07:25.836Z',
  '7.10.0': '2022-04-08T21:40:47.262Z',
  '7.11.0': '2022-04-26T11:54:34.792Z',
  '8.0.0': '2022-06-01T11:24:00.188Z',
  '8.1.0': '2022-06-22T13:05:00.702Z',
  '8.2.0': '2022-07-18T09:13:22.796Z',
...
  '8.14.1': '2023-05-08T07:52:41.724Z',
  '8.14.2': '2023-07-27T17:13:42.041Z',
  '8.15.0': '2023-08-04T09:24:17.992Z'

This makes me want to consider bumping our min Node.js to v14.17. It would give us pino@8 (and glob@10, FWIW).

Node v14.17 was released 11-May-2021, over 2 years ago (https://nodejs.org/download/release/).

OTel JS SDK 1.x base version is >=14, by which I infer 14.0, but I don't know that.

I feel I'm agonizing over a minor thing. :)

@trentm trentm changed the title chore: update deps for new Node.js v14 base version chore: bump min Node.js to v14.17; update deps Sep 6, 2023
@trentm
Copy link
Member Author

trentm commented Sep 6, 2023

This makes me want to consider bumping our min Node.js to v14.17.

After some discussion: let's do it.

@trentm trentm merged commit b8df297 into main Sep 6, 2023
@trentm trentm deleted the trentm/update-deps-for-node-v14-min branch September 6, 2023 16:58
PeterEinberger pushed a commit to fpm-git/apm-agent-nodejs that referenced this pull request Aug 20, 2024
This bumps the mininum supported Node.js from v14.5 to v14.17;
and bumps a number of dependencies.

- v14.5 was for AsyncLocalStorage
- v14.6 brings a V8 with spport for private methods syntax, FinalizationRegistry (used by pino@8)
- v14.8 brings AsyncResource.bind
- v14.17 brings AbortController, AbortSignal.reason (used by readable-stream@4, glob@10, etc.)

Closes: elastic#2760
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

tracking delayed dep updates because of old Node support
2 participants