-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[api-minor] Update the minimum supported Node.js version to 20, and only support the Fetch API for "remote" PDF documents in Node.js #18959
Conversation
d66951c
to
5e94521
Compare
ac5c671
to
35dbfb9
Compare
Do you have e.g. a traceback of what's failing? I can have a look to see if we can perhaps easily fix that. |
This comment was marked as resolved.
This comment was marked as resolved.
35dbfb9
to
0d3dd5c
Compare
This comment was marked as resolved.
This comment was marked as resolved.
The types tests run in Node.js and therefore use Node types for e.g. builtins. However, we didn't explicitly indicate this in `tsconfig.json` (see [1] for more information and [2] for the PR where we found this). Moreover, we didn't explicitly install the most recent version of `@types/node` which implicitly made us fall back to version 14.14.45 (because that was installed as a dependency of other modules) whereas much newer versions are available and we need those after changes in Node.js (see [3] for more information and [4] for the PR where we found this). This commit fixes both issues by explicitly installing and using the most recent Node.js types, which should also avoid future issues with the types tests. [1] TypeStrong/ts-node#1012 [2] mozilla#18237 [3] https://stackoverflow.com/questions/78790943/in-typescript-5-6-buffer-is-not-assignable-to-arraybufferview-or-uint8arr [4] mozilla#18959
0d3dd5c
to
bd26c55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, with the two comments addressed and #18996 resolved. Thanks!
This patch updates the minimum supported environments as follows: - Node.js 20, which was released on 2023-04-18 and has now entered the "Maintenance"-phase; see https://github.com/nodejs/release#release-schedule Furthermore, note also that Node.js 18 will fairly soon reach EOL.
…odule` This allows *synchronous* loading of Node.js modules and (indirectly) packages, thus simplifying the code a fair bit.
…Node.js environments The Fetch API has been supported since Node.js version 18, see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#browser_compatibility
…/display/node_stream.js` file After the previous patch these base-classes are only extended once each and they can thus be combined with the final classes.
bd26c55
to
9269fb9
Compare
The types tests run in Node.js and therefore use Node types for e.g. builtins. However, we didn't explicitly indicate this in `tsconfig.json` (see [1] for more information and [2] for the PR where we found this). Moreover, we didn't explicitly install the most recent version of `@types/node` which implicitly made us fall back to version 14.14.45 (because that was installed as a dependency of other modules) whereas much newer versions are available and we need those after changes in Node.js (see [3] for more information and [4] for the PR where we found this). This commit fixes both issues by explicitly installing and using the most recent Node.js types, which should also avoid future issues with the types tests. [1] TypeStrong/ts-node#1012 [2] mozilla#18237 [3] https://stackoverflow.com/questions/78790943/in-typescript-5-6-buffer-is-not-assignable-to-arraybufferview-or-uint8arr [4] mozilla#18959
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/f6cd146445c9fbe/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/8ff76d9de7c3070/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/f6cd146445c9fbe/output.txt Total script time: 32.27 mins
Image differences available at: http://54.241.84.105:8877/f6cd146445c9fbe/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/8ff76d9de7c3070/output.txt Total script time: 46.07 mins
|
This PR seems to break semver? If the minimum nodejs version is now 20, the package version should be now changed 5.x? |
[api-minor] Update the minimum supported Node.js version to 20
This patch updates the minimum supported environments as follows:
Furthermore, note also that Node.js 18 will fairly soon reach EOL.
[api-minor] Load Node.js packages/polyfills with
process.getBuiltinModule
This allows synchronous loading of Node.js modules and (indirectly) packages, thus simplifying the code a fair bit.
[api-minor] Only support the Fetch API for "remote" PDF documents in Node.js environments
The Fetch API has been supported since Node.js version 18, see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#browser_compatibility
Remove the
BaseFullReader
andBaseRangeReader
classes in thesrc/display/node_stream.js
fileAfter the previous patch these base-classes are only extended once each and they can thus be combined with the final classes.
Edit: I intend to submit this for review after the upcoming release.