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

feat: Add Node 22 support #9187

Merged
merged 14 commits into from
Jul 9, 2024
Merged

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented Jul 9, 2024

Pull Request

Approach

Just trying out CI; this also removes specific Node.js versions for testing; still to be discussed whether we want that.

Tasks

Copy link

parse-github-assistant bot commented Jul 9, 2024

Thanks for opening this pull request!

  • ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as Closes: #123 in the PR description, so I can recognize it.

Copy link

codecov bot commented Jul 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.16%. Comparing base (da2f24d) to head (008084b).
Report is 63 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha    #9187   +/-   ##
=======================================
  Coverage   94.16%   94.16%           
=======================================
  Files         186      186           
  Lines       14750    14750           
=======================================
  Hits        13889    13889           
  Misses        861      861           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

spec/CLI.spec.js Outdated Show resolved Hide resolved
@mtrezza
Copy link
Member Author

mtrezza commented Jul 9, 2024

@dplewis the issue is that there are 4 tests failing. The punycode library that should be used instead of the deprecated Node.js feature describes how to implement it, but that doesn't seem to work. It still seems to be using the Node.js feature.

@mtrezza
Copy link
Member Author

mtrezza commented Jul 9, 2024

From the failing tests I assume this these deprecation warnings come from certain dependencies which have a sub-dependency on Node.js internal punycode. With --trace-deprecation enabled the trace is:

1) execution should start Parse Server
  - Failed: (node:2521) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
      at node:punycode:3:9
      at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:398:7)
      at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:337:10)
      at loadBuiltinModule (node:internal/modules/helpers:96:7)
      at Module._load (node:internal/modules/cjs/loader:1070:17)
      at TracingChannel.traceSync (node:diagnostics_channel:315:14)
      at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
      at Module.require (node:internal/modules/cjs/loader:1304:12)
      at require (node:internal/modules/helpers:123:16)
      at Object.<anonymous> (/home/runner/work/parse-server/parse-server/node_modules/tr46/index.js:3:18)
      at Module._compile (node:internal/modules/cjs/loader:1467:14)
      at Module.replacementCompile (/home/runner/work/parse-server/parse-server/node_modules/append-transform/index.js:60:13)
      at Module._extensions..js (node:internal/modules/cjs/loader:1551:10)
      at Object.<anonymous> (/home/runner/work/parse-server/parse-server/node_modules/append-transform/index.js:64:4)
      at Module.load (node:internal/modules/cjs/loader:1282:32)
      at Module._load (node:internal/modules/cjs/loader:1098:12)
      at TracingChannel.traceSync (node:diagnostics_channel:315:14)
      at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
      at Module.require (node:internal/modules/cjs/loader:1304:12)
      at require (node:internal/modules/helpers:123:16)
      at Object.<anonymous> (/home/runner/work/parse-server/parse-server/node_modules/whatwg-url/lib/url-state-machine.js:2:14)
      at Module._compile (node:internal/modules/cjs/loader:1467:14)
      at Module.replacementCompile (/home/runner/work/parse-server/parse-server/node_modules/append-transform/index.js:60:13)
      at Module._extensions..js (node:internal/modules/cjs/loader:1551:10)
      at Object.<anonymous> (/home/runner/work/parse-server/parse-server/node_modules/append-transform/index.js:64:4)
      at Module.load (node:internal/modules/cjs/loader:1282:32)
      at Module._load (node:internal/modules/cjs/loader:1098:12)
      at TracingChannel.traceSync (node:diagnostics_channel:315:14)
      at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
      at Module.require (node:internal/modules/cjs/loader:1304:12)
      at require (node:internal/modules/helpers:123:16)
      at Object.<anonymous> (/home/runner/work/parse-server/parse-server/node_modules/whatwg-url/lib/URL-impl.js:2:13)
      at Module._compile (node:internal/modules/cjs/loader:1467:14)
      at Module.replacementCompile (/home/runner/work/parse-server/parse-server/node_modules/append-transform/index.js:60:13)
      at Module._extensions..js (node:internal/modules/cjs/loader:1551:10)
      at Object.<anonymous> (/home/runner/work/parse-server/parse-server/node_modules/append-transform/index.js:64:4)
      at Module.load (node:internal/modules/cjs/loader:1282:32)
      at Module._load (node:internal/modules/cjs/loader:1098:12)
      at TracingChannel.traceSync (node:diagnostics_channel:315:14)
      at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
      at Module.require (node:internal/modules/cjs/loader:1304:12)
      at require (node:internal/modules/helpers:123:16)
      at Object.<anonymous> (/home/runner/work/parse-server/parse-server/node_modules/whatwg-url/lib/URL.js:442:14)
      at Module._compile (node:internal/modules/cjs/loader:1467:14)
      at Module.replacementCompile (/home/runner/work/parse-server/parse-server/node_modules/append-transform/index.js:60:13)
      at Module._extensions..js (node:internal/modules/cjs/loader:1551:10)
      at Object.<anonymous> (/home/runner/work/parse-server/parse-server/node_modules/append-transform/index.js:64:4)
      at Module.load (node:internal/modules/cjs/loader:1282:32)
      at Module._load (node:internal/modules/cjs/loader:1098:12)
      at TracingChannel.traceSync (node:diagnostics_channel:315:14)

I believe these errors come from 3rd party dependencies, so we cannot do much about it. A solution is to change the tests so they ignore deprecation warnings in the stderr output. This is just a deprecation warnings after all, not an error. The history of DEP0040 shows that while the deprecation happened in Node 7, only since Node 21 is it a runtime deprecation, so that's why it became visible now.

@mtrezza
Copy link
Member Author

mtrezza commented Jul 9, 2024

Changed the tests so that deprecation gets ignored; once the feature gets removed from Node.js, the process should fail to launch a Parse Server instance and the tests will also fail.

Also removed Parse Server's internal code reliance on Node.js punycode feature to make it ready for the feature removal.

@mtrezza mtrezza merged commit 7778471 into parse-community:alpha Jul 9, 2024
26 of 27 checks passed
parseplatformorg pushed a commit that referenced this pull request Jul 9, 2024
# [7.3.0-alpha.1](7.2.0...7.3.0-alpha.1) (2024-07-09)

### Features

* Add Node 22 support ([#9187](#9187)) ([7778471](7778471))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.3.0-alpha.1

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jul 9, 2024
@mtrezza mtrezza deleted the feat/node-22 branch July 9, 2024 11:27
parseplatformorg pushed a commit that referenced this pull request Oct 3, 2024
# [7.3.0-beta.1](7.2.0...7.3.0-beta.1) (2024-10-03)

### Bug Fixes

* Custom object ID allows to acquire role privileges ([GHSA-8xq9-g7ch-35hg](GHSA-8xq9-g7ch-35hg)) ([#9317](#9317)) ([13ee52f](13ee52f))
* Parse Server `databaseOptions` nested keys incorrectly identified as invalid ([#9213](#9213)) ([77206d8](77206d8))
* Parse Server installation fails due to post install script incorrectly parsing required min. Node version ([#9216](#9216)) ([0fa82a5](0fa82a5))
* Parse Server option `maxLogFiles` doesn't recognize day duration literals such as `1d` to mean 1 day ([#9215](#9215)) ([0319cee](0319cee))
* Security upgrade path-to-regexp from 6.2.1 to 6.3.0 ([#9314](#9314)) ([8b7fe69](8b7fe69))

### Features

* Add atomic operations for Cloud Config parameters ([#9219](#9219)) ([35cadf9](35cadf9))
* Add Cloud Code triggers `Parse.Cloud.beforeSave` and `Parse.Cloud.afterSave` for Parse Config ([#9232](#9232)) ([90a1e4a](90a1e4a))
* Add Node 22 support ([#9187](#9187)) ([7778471](7778471))
* Add support for asynchronous invocation of `FilesAdapter.getFileLocation` ([#9271](#9271)) ([1a2da40](1a2da40))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.3.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Oct 3, 2024
parseplatformorg pushed a commit that referenced this pull request Oct 3, 2024
# [7.3.0](7.2.0...7.3.0) (2024-10-03)

### Bug Fixes

* Custom object ID allows to acquire role privileges ([GHSA-8xq9-g7ch-35hg](GHSA-8xq9-g7ch-35hg)) ([#9317](#9317)) ([13ee52f](13ee52f))
* Parse Server `databaseOptions` nested keys incorrectly identified as invalid ([#9213](#9213)) ([77206d8](77206d8))
* Parse Server installation fails due to post install script incorrectly parsing required min. Node version ([#9216](#9216)) ([0fa82a5](0fa82a5))
* Parse Server option `maxLogFiles` doesn't recognize day duration literals such as `1d` to mean 1 day ([#9215](#9215)) ([0319cee](0319cee))
* Security upgrade path-to-regexp from 6.2.1 to 6.3.0 ([#9314](#9314)) ([8b7fe69](8b7fe69))

### Features

* Add atomic operations for Cloud Config parameters ([#9219](#9219)) ([35cadf9](35cadf9))
* Add Cloud Code triggers `Parse.Cloud.beforeSave` and `Parse.Cloud.afterSave` for Parse Config ([#9232](#9232)) ([90a1e4a](90a1e4a))
* Add Node 22 support ([#9187](#9187)) ([7778471](7778471))
* Add support for asynchronous invocation of `FilesAdapter.getFileLocation` ([#9271](#9271)) ([1a2da40](1a2da40))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.3.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants