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

Cleanup unnecessary peer dependencies #695

Merged
merged 2 commits into from
Feb 20, 2025
Merged

Conversation

ardatan
Copy link
Member

@ardatan ardatan commented Feb 20, 2025

Copy link

coderabbitai bot commented Feb 20, 2025

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Streamlined dependency management by removing outdated peer dependencies to enhance module compatibility.
  • New Features
    • Improved handling of asynchronous execution results, offering greater flexibility in processing varied data flows.

Walkthrough

This pull request updates dependency management and type handling within two packages. In the @graphql-hive/gateway-runtime and its corresponding runtime package, the optional dependency on @parcel/watcher has been removed from the peerDependencies configuration. In the @graphql-mesh/plugin-prometheus package, the peer dependency on graphql-yoga has been removed. Additionally, the Prometheus plugin code now includes the isAsyncIterable import from @graphql-tools/utils and applies it within the execution flow to distinguish between synchronous and asynchronous results.

Changes

File(s) Change Summary
.changeset/@graphql-hive_gateway-runtime-695-dependencies.md, packages/.../runtime/package.json Removed @parcel/watcher@^2.1.0 from peerDependencies (and associated peerDependenciesMeta in package.json).
.changeset/@graphql-mesh_plugin-prometheus-695-dependencies.md, packages/.../prometheus/package.json Removed graphql-yoga@^5.10.11 from peerDependencies.
packages/.../prometheus/src/index.ts Updated import to include isAsyncIterable from @graphql-tools/utils and modified onSubgraphExecute to handle both synchronous and asynchronous execution results.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Plugin
    participant Utility
    Client->>Plugin: Call onSubgraphExecute(request)
    Plugin->>Utility: isAsyncIterable(result)
    alt Asynchronous result
        Utility-->>Plugin: Returns true
        Plugin->>Client: Process async result stream
    else Synchronous result
        Utility-->>Plugin: Returns false
        Plugin->>Client: Process sync result
    end
Loading

Suggested reviewers

  • ardatan
  • dotansimha

Poem

I'm a rabbit, hopping with glee,
Through lines of code so swift and free,
Dependencies pruned like a garden neat,
Async and sync now perfectly meet,
With every hop and little cheer,
I celebrate changes far and near!
🐰🌟


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b864f23 and 0ef548f.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • .changeset/@graphql-hive_gateway-runtime-695-dependencies.md (1 hunks)
  • .changeset/@graphql-mesh_plugin-prometheus-695-dependencies.md (1 hunks)
  • packages/plugins/prometheus/package.json (0 hunks)
  • packages/plugins/prometheus/src/index.ts (2 hunks)
  • packages/runtime/package.json (0 hunks)
💤 Files with no reviewable changes (2)
  • packages/plugins/prometheus/package.json
  • packages/runtime/package.json
🧰 Additional context used
📓 Path-based instructions (3)
`packages/**`: In this directory we keep all packages releva...

packages/**: In this directory we keep all packages relevant to the gateway.

In most cases, when changes are made to the source code / dependencies in these directories, we also require to have a corresponding changeset file, created using yarn changeset with a full description on the changes with an example.
Also, when new features are added the packages, the changeset file should mention minor semver change. When a bug is fixed, patch needs to be used. The major bump is used for a PR that has breaking changes.

  • packages/plugins/prometheus/src/index.ts
`packages/plugins/**`: The directories inside this dir are g...

packages/plugins/**: The directories inside this dir are gateway plugins. Plugins adds functionality to the GraphQL gateway, at the runtime level. Plugins included are authorization, authentication, caching, persisted documents and more.

  • packages/plugins/prometheus/src/index.ts
`**`: For all PRs, we would like to verify that a Linear iss...

**: For all PRs, we would like to verify that a Linear issue is linked. Check if there's a mention for "GW-*" in the PR description, and the us know when it's missing.

In most cases, when a PR adds a new functionality, we would like to make sure it has documentation in the corresponding console project.
Use the global knowledge feature to search for PRs in graphql-hive/console repository that adds documentation. Suggest to create a follow up issue to add the missing documentation.

  • packages/plugins/prometheus/src/index.ts
⏰ Context from checks skipped due to timeout of 90000ms (30)
  • GitHub Check: Binary built on ubuntu-24.04-arm
  • GitHub Check: Binary built on windows-latest
  • GitHub Check: Binary built on macos-14
  • GitHub Check: Binary built on macos-13
  • GitHub Check: Bun Docker image
  • GitHub Check: Binary built on ubuntu-latest
  • GitHub Check: Node Docker image
  • GitHub Check: E2E / Bun Docker on Ubuntu
  • GitHub Check: E2E / Bun on Ubuntu
  • GitHub Check: Unit / Bun
  • GitHub Check: E2E / Node Binary on Windows
  • GitHub Check: E2E / Node Binary on Ubuntu
  • GitHub Check: E2E / Node Docker on Ubuntu
  • GitHub Check: Leaks / Node v23
  • GitHub Check: Leaks / Node v22
  • GitHub Check: E2E / Node 23 on Ubuntu
  • GitHub Check: Unit / Node v20
  • GitHub Check: Leaks / Node v20
  • GitHub Check: E2E / Node 22 on Ubuntu
  • GitHub Check: Leaks / Node v18
  • GitHub Check: E2E / Node 20 on Ubuntu
  • GitHub Check: E2E / Node 18 on Ubuntu
  • GitHub Check: Benchmark / bun / 1000 items
  • GitHub Check: Bundle
  • GitHub Check: Benchmark / bun / 100 items
  • GitHub Check: Benchmark / bun / 10 items
  • GitHub Check: Benchmark / node / 1000 items
  • GitHub Check: Benchmark / node / 100 items
  • GitHub Check: Benchmark / node / 10 items
  • GitHub Check: Mend Security Check
🔇 Additional comments (5)
packages/plugins/prometheus/src/index.ts (3)

16-20: LGTM! Improved type imports and async handling.

The changes properly separate type imports and add isAsyncIterable for better async result handling.


39-39: LGTM! Proper type import from graphql-yoga.

Changed to type-only import from graphql-yoga, which aligns with removing it from peer dependencies while maintaining type safety.


327-338: LGTM! Proper handling of async iterable results.

Added proper handling of async iterable results using isAsyncIterable check, which improves the robustness of the plugin.

.changeset/@graphql-hive_gateway-runtime-695-dependencies.md (1)

1-7: LGTM! Appropriate version bump and clear dependency removal.

The patch version bump is correct for removing an optional peer dependency. The changeset clearly documents the removal of @parcel/watcher.

.changeset/@graphql-mesh_plugin-prometheus-695-dependencies.md (1)

1-7: LGTM! Appropriate version bump and clear dependency removal.

The patch version bump is correct for removing the graphql-yoga peer dependency, as the plugin maintains compatibility through type imports.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

@ardatan ardatan force-pushed the cleanup-unnecessary-peer-deps branch from ff29fb3 to 0ef548f Compare February 20, 2025 12:12
@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-hive/gateway 1.10.4-alpha-0ef548ff96b8d80848311bcf55d42d7b5023d31f npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-opentelemetry 1.3.44-alpha-0ef548ff96b8d80848311bcf55d42d7b5023d31f npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-prometheus 1.3.32-alpha-0ef548ff96b8d80848311bcf55d42d7b5023d31f npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-runtime 1.4.17-alpha-0ef548ff96b8d80848311bcf55d42d7b5023d31f npm ↗︎ unpkg ↗︎

@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (Binary for Linux-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (Binary for macOS-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (Node Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:1.10.4-alpha-0ef548ff96b8d80848311bcf55d42d7b5023d31f

@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (Bun Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:1.10.4-alpha-0ef548ff96b8d80848311bcf55d42d7b5023d31f-bun

@ardatan ardatan merged commit 2e3ce14 into main Feb 20, 2025
64 checks passed
@ardatan ardatan deleted the cleanup-unnecessary-peer-deps branch February 20, 2025 12:18
@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (Binary for Linux-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (Binary for macOS-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

🚀 Snapshot Release (Binary for Windows-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

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.

2 participants