Skip to content

Conversation

@aimensahnoun
Copy link
Member

@aimensahnoun aimensahnoun commented Mar 28, 2025

Description of the changes

Changes

  • Upgrade all packages to use Node.js 22
  • Upgrade graphql-request package to latest version for Node.js 22 support.
  • Updated Jest config to properly transform graphql-request and its dependencies
  • Added necessary Babel dependencies for TypeScript and ES modules support

Why

  • graphql-request package uses ES modules, causing Jest test failures
  • The new configuration ensures proper transformation of ES modules to CommonJS
  • The babel.config and jest config is setup in two places because setting it up globally effects the remaining tests.

Resolves #1492

Summary by CodeRabbit

  • Chores

    • Upgraded the Node.js runtime requirement to v22 across all environments and CI configurations for enhanced compatibility and performance.
  • New Features

    • Introduced updated build and testing tooling, including refined configurations that ensure smoother development and streamlined dependency management.
  • Refactor

    • Modified error handling to prevent exposure of sensitive internal details.
    • Optimized client initialization processes for more robust and stable operations.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 28, 2025

Walkthrough

This pull request primarily upgrades Node.js version requirements across the repository. The changes update various CI configurations and package engine declarations—from Node 18.x to Node 22.x—in files such as CircleCI configuration, .nvmrc, and numerous package.json files. In addition, new Babel configuration files and related dependencies have been added to support the updated runtime. A few implementation changes have been made as well: one improves error handling by removing the exposure of raw errors, and another enhances the GraphQL client initialization with dynamic imports and revised type definitions.

Changes

File(s) Change Summary
.circleci/config.yml, .npmpackagejsonlintrc.json, .nvmrc, package.json, and packages/*/package.json (advanced-logic, currency, data-access, data-format, epk-cipher, epk-decryption, epk-signature, ethereum-storage, request-logic, multi-format, payment-detection, payment-processor, request-client.js, smart-contracts, toolbox, transaction-manager, types, usage-examples, utils, web3-signature) Upgraded Node.js version requirements from 18.x to 22.x across CI, runtime, and engine declarations.
packages/integration-test/babel.config.js, packages/request-node/babel.config.js Added new Babel configuration files that specify presets and plugins (preset-env, transform-runtime, transform-modules-commonjs) for Node.js v22 compatibility.
packages/integration-test/package.json, packages/request-node/package.json Introduced new Babel-related dependencies (e.g., @babel/core, @babel/runtime, babel-jest) alongside engine updates to support modern tooling.
packages/thegraph-data-access/package.json, packages/thegraph-data-access/src/subgraph-client.ts, packages/thegraph-data-access/src/types.ts Updated engine requirement, revised test script and dependency versions (e.g., graphql-request upgrade, new load-esm), and enhanced GraphQL client initialization with dynamic import and new type alias for client configuration.
packages/request-node/src/request/getTransactionsByChannelId.ts Modified error handling in the transaction retrieval handler to avoid exposing the raw error object to clients.

Sequence Diagram(s)

sequenceDiagram
  participant C as Client
  participant S as SubgraphClient
  participant G as GraphQLClient

  C->>S: Call getBlockNumber or fetchAndFormat()
  S->>S: ensureGraphQLClientInitialized()
  alt GraphQL client not initialized
      S->>S: initGraphQLClient()
      S->>G: Dynamically import and instantiate
      G-->>S: Return initialized client
  end
  S->>G: Execute GraphQL query
  G-->>S: Return response
  S-->>C: Return processed data
Loading

Assessment against linked issues

Objective Addressed Explanation
Support Node v20 before End-of-Life on April 30, 2025 (#1492); also consider supporting Node v22

Possibly related PRs

Suggested reviewers

  • alexandre-abrioux
  • kevindavee

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@aimensahnoun aimensahnoun force-pushed the 1492-support-node-v20-before-end-of-life-on-april-30-2025 branch from c89e272 to 5ca36ab Compare March 28, 2025 14:32
@aimensahnoun aimensahnoun changed the title ci: update Node.js version in CircleCI config from 18.18 to 22.14 feat: upgrade packages to use node 22 Mar 28, 2025
@aimensahnoun aimensahnoun force-pushed the 1492-support-node-v20-before-end-of-life-on-april-30-2025 branch from 90b1bb1 to bcf0665 Compare March 28, 2025 21:00
@aimensahnoun aimensahnoun marked this pull request as ready for review March 28, 2025 21:41
@aimensahnoun aimensahnoun requested review from MantisClone and leoslr and removed request for kevindavee and yomarion March 28, 2025 21:41
Copy link
Member

@MantisClone MantisClone left a comment

Choose a reason for hiding this comment

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

Surgical 🎯 nice work!

Copy link
Contributor

@alexandre-abrioux alexandre-abrioux left a comment

Choose a reason for hiding this comment

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

If this setup with Babel is required to run the tests, does that mean that our library consumers will also have to implement such a config?

As an alternative, have you tried importing asyncronously the graphql-request package?

const graphqlRequest = await import("graphql-request");

; this can usually solve ESM module imports in a CommonJS codebase.

However, this solution can also conflict with TypeScript which may transpile await import() to require(). At Request Finance we had luck in the past using the following package to import ESM modules: https://github.com/Borewit/load-esm. It bypasses TypeScript so that asynchronous import() are not converted to require().

Copy link
Member

@rodrigopavezi rodrigopavezi left a comment

Choose a reason for hiding this comment

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

Awesome work!!!

@aimensahnoun aimensahnoun force-pushed the 1492-support-node-v20-before-end-of-life-on-april-30-2025 branch from d43bf8f to 713b757 Compare March 31, 2025 08:18
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
packages/thegraph-data-access/src/subgraph-client.ts (3)

21-24: Lazy initialization is fine, but be aware of concurrency.
Using private graphql!: GraphQLClient; with a boolean flag is straightforward. However, if multiple threads or async calls race to initialize, you could get duplicate in-flight calls to initGraphQLClient. Consider adding synchronization if concurrency is expected.


35-35: Re-check concurrency in initialize().
Calling ensureGraphQLClientInitialized is sensible for lazy loading. If initialize() is called multiple times concurrently, you might get repeated calls. If concurrency is not a concern, this is fine.


135-140: Check for race conditions in ensureGraphQLClientInitialized().
If multiple calls race in parallel before graphQLClientInitialized toggles to true, you might create multiple client instances. If concurrency is possible, consider adding a lock or WaitGroup-like mechanism.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d43bf8f and 163bbec.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • packages/integration-test/package.json (1 hunks)
  • packages/request-node/package.json (1 hunks)
  • packages/thegraph-data-access/src/subgraph-client.ts (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/request-node/package.json
  • packages/integration-test/package.json
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-and-test
🔇 Additional comments (8)
packages/thegraph-data-access/src/subgraph-client.ts (8)

2-2: Importing 'Variables' from 'graphql-request' is valid.
No concerns—this is the correct type to represent query variables used in fetchAndFormat and other methods.


18-18: Ensure the custom headers type won't conflict with advanced usage.
Omitting 'headers' from RequestConfig and reintroducing headers?: Record<string, string> might exclude certain header transformations (e.g. multi-value or function-based headers). Verify that no usage needs other header forms.


40-40: Correct usage of lazy initialization in getBlockNumber().
This is consistent with the pattern of deferring GraphQL client creation until needed, preventing unnecessary overhead in some scenarios.


64-64: Ensuring the client is ready in getTransactionsByTopics().
This follows the same lazy initialization pattern. Good job keeping it consistent.


94-94: Verifying the GraphQL client in fetchAndFormat().
Again, calling ensureGraphQLClientInitialized() just before the request is made ensures correctness if the client was never set up beforehand.


129-133: Dynamic import in initGraphQLClient is a flexible approach for lazy loading.
Delaying the import of graphql-request can reduce startup overhead if the client isn’t often used. Implementation looks solid.


13-13:

❓ Verification inconclusive

Consider verifying the import path for RequestConfig.
RequestConfig might be re-exported at a top-level from graphql-request, which would be simpler than referencing a legacy path.

Below is a script to check if RequestConfig can be safely imported from 'graphql-request':


🏁 Script executed:

#!/bin/bash
# Searches if `RequestConfig` is re-exported by the top-level of `graphql-request`.
rg -A 5 "export .*RequestConfig" node_modules/graphql-request

Length of output: 132


Action: Manually Verify the Import Path for RequestConfig

The automated check couldn’t confirm a re-export at the top-level because the search failed due to the absence of the node_modules/graphql-request directory in this environment. Please manually verify whether your version of graphql-request re-exports RequestConfig. If it does, update the import in packages/thegraph-data-access/src/subgraph-client.ts to:

import type { RequestConfig } from 'graphql-request';

Otherwise, continue using the current legacy path:

import type { RequestConfig } from 'graphql-request/build/legacy/helpers/types';

29-31:

❓ Verification inconclusive

Confirm backward compatibility with new constructor signature.
Switching the options parameter from RequestConfig to ClientConfig may break external usage if they previously relied on the original RequestConfig shape. Confirm no consumers are impacted.

Here’s a script to locate references to new SubgraphClient:


🏁 Script executed:

#!/bin/bash
# Searches for all constructor calls to SubgraphClient to verify argument shape
ast-grep --pattern $'new SubgraphClient($_, $_)' 

Length of output: 158


Ensure Updated Constructor Signature Maintains Backward Compatibility
Our verification found a single internal usage at packages/thegraph-data-access/src/data-access.ts (line 18) where SubgraphClient is instantiated as follows:

const graphqlClient = new SubgraphClient(url, rest);

Please confirm that the rest argument in this call conforms to the new ClientConfig requirements. Additionally, if this package is published for external consumption, double-check that no external consumers are relying on the older RequestConfig shape.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/thegraph-data-access/src/queries.ts (1)

41-41: Consider thread-safety for lazy import.

Storing gqlTag in a module-level variable and lazily initializing it could, in rare concurrent scenarios, cause inconsistent states if multiple calls to getGqlTag() happen at once. Although import() calls are typically cached, it might still be prudent to either guard initialization with a lock or simply perform top-level imports for a more predictable approach.

Also applies to: 43-49

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 163bbec and bcbe9d9.

📒 Files selected for processing (2)
  • packages/thegraph-data-access/src/queries.ts (1 hunks)
  • packages/thegraph-data-access/src/subgraph-client.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/thegraph-data-access/src/subgraph-client.ts
🔇 Additional comments (3)
packages/thegraph-data-access/src/queries.ts (3)

33-39: Type definition looks good.

The Queries type is clear and cohesive. It neatly encapsulates all relevant query strings for consistent usage throughout the codebase.


51-70: Good approach for organizing GraphQL fragments.

Bundling the TransactionsBodyFragment with lazy gql loading helps keep queries responsive and modular. Ensure that your build and bundling pipeline properly handles dynamic imports so that performance isn’t adversely affected.


72-125:

❓ Verification inconclusive

Verify naming consistency and schema alignment with dataHash.

  1. The export name GetTransactionByDataHashQuery differs slightly from the internal GraphQL query name GetTransactionsByDataHash. While functional, consider aligning them for clarity.
  2. The query references a field dataHash, but the Transaction type does not have a dataHash property. Confirm that the subgraph schema includes this field and update the Transaction type accordingly to avoid confusion.

To confirm correctness, run the following script to search for references to dataHash in the codebase and compare against any subgraph schema definitions:


🏁 Script executed:

#!/bin/bash
# Validate references to 'dataHash' and ensure the subgraph schema includes it

# Search for usage of 'dataHash' across the project
rg -A 5 "dataHash"

# If there's a subgraph schema, check for 'dataHash' field declarations
fd "schema.graphql" | xargs cat | rg "dataHash" -A 5

Length of output: 5001


Action Required: Address Naming Consistency and Confirm Schema Alignment for dataHash

  • Naming Consistency: The exported query is named GetTransactionByDataHashQuery while the internal GraphQL query is declared as GetTransactionsByDataHash. For clarity, please align these naming conventions—either update the export to match the internal query or vice versa.
  • Schema Alignment: The query filters on a dataHash field; however, based on the verification script output, there’s no clear evidence in the subgraph schema (e.g., in schema.graphql) that the Transaction type includes a dataHash property. Please manually verify that the subgraph schema defines dataHash on the Transaction type. If it doesn’t, update the schema accordingly or reconsider the query’s filter.

@aimensahnoun aimensahnoun force-pushed the 1492-support-node-v20-before-end-of-life-on-april-30-2025 branch from bcbe9d9 to 163bbec Compare March 31, 2025 09:06
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bcbe9d9 and 1ff0db6.

📒 Files selected for processing (2)
  • packages/thegraph-data-access/src/queries.ts (1 hunks)
  • packages/thegraph-data-access/src/subgraph-client.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/thegraph-data-access/src/subgraph-client.ts
🔇 Additional comments (2)
packages/thegraph-data-access/src/queries.ts (2)

33-39: Good addition of the Queries type

The new Queries type provides clear structure for the GraphQL queries being exported, improving type safety and making the API contract more explicit.


41-49: Well implemented lazy loading pattern for the gql tag

The lazy loading approach for the GraphQL tag is a good pattern for handling ES modules from graphql-request. This approach properly caches the imported gql tag and handles the asynchronous nature of dynamic imports, ensuring the import only happens once.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/thegraph-data-access/src/queries.ts (2)

45-51: Consider adding error handling for dynamic import.

loadEsm('graphql-request') might fail under certain conditions (e.g., unavailable network resources, corrupted packages, etc.). Adding a try-catch or fallback can safeguard against runtime errors.


53-128: Potential performance improvement: caching the queries object.

getQueries() returns a new object each time, which can be suboptimal if called frequently. Consider caching the result to avoid redundant object creation.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ff0db6 and cb29dc0.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • packages/thegraph-data-access/package.json (2 hunks)
  • packages/thegraph-data-access/src/queries.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-and-test
🔇 Additional comments (4)
packages/thegraph-data-access/package.json (2)

22-22: No concerns with Node.js version upgrade.

Upgrading to Node.js >=22.0.0 aligns well with the PR objective to standardize on Node.js 22.


48-49:

✅ Verification successful

Confirm package versions.

The graphql-request dependency has been raised to 7.1.2 and load-esm has been introduced. Although these updates fit the PR’s Node 22 objective, it might be beneficial to confirm that 7.1.2 is indeed the most robust and stable option for your needs, and that load-esm is compatible with your overall build and testing pipeline.


🏁 Script executed:

#!/bin/bash
# Check for the latest version of graphql-request
npm info graphql-request version

# Check for available metadata on load-esm
npm info load-esm

Length of output: 872


Confirmed Dependency Versions

The updated dependencies in packages/thegraph-data-access/package.json have been verified. Specifically:

  • graphql-request: Set to version 7.1.2, which is confirmed as the latest stable release.
  • load-esm: Introduced at version ^1.0.2, and the latest version from npm is 1.0.2.

These changes align with the PR's Node 22 objective. No further changes are required, though please ensure that these updates integrate well with your build and testing pipeline.

packages/thegraph-data-access/src/queries.ts (2)

1-3: Good approach to dynamic ESM loading.

Utilizing load-esm for on-demand importing of gql is a neat strategy that can reduce overhead in environments where gql is not always required.


37-43: Well-structured type definition.

Exporting a dedicated Queries type consolidates and standardizes GraphQL queries into a single definition, improving type safety and maintainability.

@aimensahnoun aimensahnoun force-pushed the 1492-support-node-v20-before-end-of-life-on-april-30-2025 branch from 4d571f8 to 548f460 Compare March 31, 2025 11:59
@aimensahnoun
Copy link
Member Author

@alexandre-abrioux that's a very good question. thegraph-data-access seems to be used only in the integration tests and the request-node.

So I installed and ran the request-node locally in a commonjs repo with the following setup:

{
  "name": "test-request-node",
  "version": "1.0.0",
  "type": "commonjs",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "description": "",
  "dependencies": {
    "@requestnetwork/request-node": "file:requestnetwork-request-node-0.44.0.tgz"
  }
}
require("dotenv").config();
const { startNode } = require("@requestnetwork/request-node/dist/server");

// Start the request node
startNode().catch((error) => {
  console.error("Failed to start request node:", error);
  process.exit(1);
});

And was able to read transactions:

CleanShot 2025-03-31 at 16 03 45

Copy link
Contributor

@alexandre-abrioux alexandre-abrioux left a comment

Choose a reason for hiding this comment

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

Nicely done! Thanks for testing 🙏

…ndency resolution; remove TypeScript preset from Babel configurations in integration-test and request-node packages
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/integration-test/package.json (1)

44-48: Introduce Babel Core and Plugin Dependencies

The addition of @babel/core, @babel/plugin-transform-modules-commonjs, @babel/plugin-transform-runtime, and @babel/preset-env in the devDependencies facilitates proper ES module transformation (especially for Jest). Make sure your Babel configuration file (e.g., .babelrc or babel.config.js) is updated accordingly to leverage these plugins.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d571f8 and 56e35dd.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • packages/integration-test/babel.config.js (1 hunks)
  • packages/integration-test/package.json (4 hunks)
  • packages/request-node/babel.config.js (1 hunks)
  • packages/request-node/package.json (3 hunks)
✅ Files skipped from review due to trivial changes (2)
  • packages/request-node/babel.config.js
  • packages/integration-test/babel.config.js
🔇 Additional comments (7)
packages/integration-test/package.json (3)

20-20: Update Node Engine Version Requirement

The engines section now specifies "node": ">=22.0.0", which aligns with the PR objective to support Node.js 22. Please ensure that this change is also reflected in your CI and local development configurations.


68-68: Addition of babel-jest Dependency

Introducing babel-jest ensures that Jest can correctly transform ES modules during testing. This is essential given the ES module dependencies in the project.


79-80: Add @babel/runtime as a Dependency

Including "@babel/runtime": "7.23.9" provides runtime helpers that optimize Babel-transpiled code. Confirm that this version is consistent across packages.

packages/request-node/package.json (4)

22-22: Upgrade Node Engine Requirement

The engines field now declares "node": ">=22.0.0", ensuring that this package runs on Node.js 22. This update is consistent with the overall upgrade objective.


44-44: Include @babel/runtime in Dependencies

Adding "@babel/runtime": "7.23.9" in dependencies is a good move to leverage shared Babel helpers at runtime. Verify that this version matches the one used in other packages.


73-76: Update Babel Development Dependencies

The devDependencies now include essential Babel packages—@babel/core, @babel/plugin-transform-modules-commonjs, @babel/plugin-transform-runtime, and @babel/preset-env—which will aid in transforming ES modules. Ensure that your Babel configurations are aligned with these updates.


84-84: Ensure Jest Transforms ES Modules with babel-jest

The addition of babel-jest in the devDependencies ensures that Jest properly processes ES modules for testing. This aligns with the changes for Node 22 compatibility.

… and refine module handling in integration-test and request-node packages
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/integration-test/package.json (1)

43-43: Empty Dependencies Object Notice:
An empty "dependencies": {} object has been added. If this is intentional (perhaps as a placeholder or for future packages), it is acceptable. Otherwise, consider removing it to keep the file clean.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56e35dd and 92c2c4d.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • packages/integration-test/package.json (3 hunks)
  • packages/request-node/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/request-node/package.json
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-and-test
🔇 Additional comments (3)
packages/integration-test/package.json (3)

19-21: Node Engine Requirement Update:
The "engines" field now requires "node": ">=22.0.0", which aligns with the PR objective of upgrading to Node.js 22. Ensure that all environments (local development, CI/CD, and production) are configured accordingly to avoid any runtime discrepancies.


45-49: Addition of Babel Dependencies:
New Babel packages have been added—namely, @babel/core, @babel/plugin-transform-modules-commonjs, @babel/plugin-transform-runtime, @babel/preset-env, and @babel/runtime—all with pinned versions. These dependencies are essential for transforming ES modules into CommonJS, which is particularly important given the recent changes in the graphql-request package. Please ensure that your Babel configuration (e.g., in your Babel config file) utilizes these plugins properly.


70-70: Babel-Jest Integration for ESM Transformation:
The inclusion of babel-jest (version "29.7.0") facilitates proper transformation of ES modules in tests. This change is critical for resolving issues that arose with modules like graphql-request when run under Jest.

@aimensahnoun aimensahnoun merged commit e0dfdb0 into master Apr 2, 2025
10 checks passed
@aimensahnoun aimensahnoun deleted the 1492-support-node-v20-before-end-of-life-on-april-30-2025 branch April 2, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Node v20 before End-of-Life on April 30, 2025

6 participants