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!: migrate gax to Node 18 #1699

Open
wants to merge 69 commits into
base: main
Choose a base branch
from
Open

chore!: migrate gax to Node 18 #1699

wants to merge 69 commits into from

Conversation

sofisl
Copy link
Contributor

@sofisl sofisl commented Feb 5, 2025

For gax and tools directory:

  • runs https://paste.googleplex.com/5722106875871232
  • updates all dependencies to their latest version if compatible
  • updates CI/CD and Kokoro to use Node 18
  • runs lint
  • updates post-processor version to latest
  • removes outdated Kokoro folders
  • additionally, migrates webpack to v5 in order to support modern JS conventions
  • adds exports subpaths (Fixes use subpath exports #1337)

@sofisl sofisl requested review from a team as code owners February 5, 2025 08:48
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Feb 5, 2025
Copy link

generated-files-bot bot commented Feb 5, 2025

Warning: This pull request is touching the following templated files:

  • .kokoro/common.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/continuous/node14/common.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/continuous/node14/lint.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/continuous/node14/samples-test.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/continuous/node14/system-test.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/continuous/node14/test.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/presubmit/node14/common.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/presubmit/node14/samples-test.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/presubmit/node14/system-test.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/presubmit/node14/test.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/release/docs.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/release/publish.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/samples-test.sh - .kokoro files are templated and should be updated in synthtool
  • .kokoro/system-test.sh - .kokoro files are templated and should be updated in synthtool
  • .kokoro/test.bat - .kokoro files are templated and should be updated in synthtool
  • .kokoro/test.sh - .kokoro files are templated and should be updated in synthtool
  • .github/workflows/ci.yaml - .github/workflows/ci.yaml (GitHub Actions) should be updated in synthtool

@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Feb 5, 2025
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: l Pull request size is large. labels Feb 5, 2025
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Feb 12, 2025
@@ -10,61 +10,62 @@
"!build/src/**/*.map"
],
"dependencies": {
"@grpc/grpc-js": "^1.10.9",
"@grpc/grpc-js": "^1.12.6",
"@grpc/proto-loader": "^0.7.13",
"@types/long": "^5.0.0",
"abort-controller": "^3.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is global in Node 18+; we can drop this dependency in this or separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking through the code, I believe this is only used in browser-contexts.

gax/package.json Outdated
"duplexify": "^4.0.0",
"google-auth-library": "^9.3.0",
"duplexify": "^4.1.3",
"google-auth-library": "^9.15.1",
"node-fetch": "^2.7.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

gax/package.json Outdated
"protobufjs": "^7.3.2"
"protobufjs": "^7.4.0",
"retry-request": "^7.0.2",
"uuid": "^11.0.5"
Copy link
Contributor

Choose a reason for hiding this comment

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

UUID is globally available as of Node 18+. Here’s how we can drop this dependency:

},
"devDependencies": {
"@types/uuid": "^9.0.7",
"@babel/plugin-proposal-private-methods": "^7.18.6",
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be good to remove this now in Node 18+

@@ -15,6 +15,7 @@
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **
/* eslint-disable @typescript-eslint/no-floating-promises */
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these should be handled rather than ignored - even if its adding .catch(console.error).

@@ -4,10 +4,11 @@
"rootDir": ".",
"outDir": "build",
"resolveJsonModule": true,
"lib": ["ES2018", "DOM"]
"lib": ["DOM"]
Copy link
Contributor

Choose a reason for hiding this comment

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

We may want ES2023 for language support, in case upstream dependencies use newer syntax or features.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We get this for free since it inherits from the top-level config!

@@ -15,7 +15,7 @@
"url": "https://github.com/googleapis/gax-nodejs/issues"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

[Optional] We can use npm workspaces now:

Which has the benefit of enabling top-level tests for all workspaces/packages among other features.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hm good call! Maybe a good process request?

Copy link
Contributor

@d-goog d-goog left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use subpath exports
2 participants