Skip to content

feat(node-sdk): Cloudflare worker support#436

Merged
roncohen merged 12 commits intomainfrom
cloudflare
Jun 25, 2025
Merged

feat(node-sdk): Cloudflare worker support#436
roncohen merged 12 commits intomainfrom
cloudflare

Conversation

@roncohen
Copy link
Contributor

@roncohen roncohen commented Jun 25, 2025

This PR adds Cloudflare Worker support to the Node SDK by introducing an edge-optimized cache strategy, updating the client to select between cache strategies, and providing example configurations and documentation.

  • Introduce inRequestCache and rename the existing cache to periodicallyUpdatingCache
  • Add EdgeClient class with "in-request" cache strategy and update BucketClient to choose based on cacheStrategy
  • Supply Cloudflare Worker examples, configuration files, and update documentation

@roncohen roncohen requested a review from Copilot June 25, 2025 09:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds Cloudflare Worker support to the Node SDK by introducing an edge-optimized cache strategy, updating the client to select between cache strategies, and providing example configurations and documentation.

  • Introduce inRequestCache and rename the existing cache to periodicallyUpdatingCache
  • Add EdgeClient class with "in-request" cache strategy and update BucketClient to choose based on cacheStrategy
  • Supply Cloudflare Worker examples, configuration files, and update documentation

Reviewed Changes

Copilot reviewed 25 out of 35 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/node-sdk/src/periodicallyUpdatingCache.ts Rename default cache export and add stubbed waitRefresh
packages/node-sdk/src/inRequestCache.ts Add serverless-friendly request-scoped cache implementation
packages/node-sdk/src/edgeClient.ts New EdgeClient class preconfigured for edge runtimes
packages/node-sdk/src/client.ts Wire up cacheStrategy, branch cache instantiation, add waitRefresh to flush
packages/node-sdk/src/types.ts Introduce CacheStrategy and waitRefresh in Cache<T> type
packages/node-sdk/test/inRequestCache.test.ts New tests for inRequestCache
packages/node-sdk/README.md Document Cloudflare Worker usage and links to examples

@roncohen roncohen enabled auto-merge June 25, 2025 13:35
@roncohen roncohen added this pull request to the merge queue Jun 25, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 25, 2025
@roncohen roncohen added this pull request to the merge queue Jun 25, 2025
Merged via the queue into main with commit e1e77eb Jun 25, 2025
6 checks passed
@roncohen roncohen deleted the cloudflare branch June 25, 2025 14:09
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