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

Pin to the latest compatibility date for Cloudflare workers #2237

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AdiRishi
Copy link
Contributor

This change applies to the kv-response-cache plugin

Description

The @cloudflare/worker-types package has multiple versions of its types that are pinned to different compatibility dates. The When you create a new cloudflare project using their CLI, they now default to the latest date whcih is 2023-07-01.

This PR updates the imports for the kv response cache plugin to use the name compatibility dates as the default for new projects, this should incraese compatibility for users.

For issue #2104

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Testing this is a bit challenging. The types are correct locally, the hope is that when this package is imported there will be fewer conflicts with types.

Checklist:

  • I have followed the
    CONTRIBUTING doc and the
    style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

This change applies to the kv-response-cache plugin
Copy link

changeset-bot bot commented May 18, 2024

🦋 Changeset detected

Latest commit: e5e197c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@envelop/response-cache-cloudflare-kv Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@EmrysMyrddin
Copy link
Collaborator

Great ! Thank you for the PR!
Does this fix all the types issues we had ?

@@ -1,5 +1,5 @@
import type { ExecutionResult } from 'graphql';
import type { ExecutionContext, KVNamespace } from '@cloudflare/workers-types';
import type { ExecutionContext, KVNamespace } from '@cloudflare/workers-types/2023-07-01';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't this have the potential to age poorly ? We will have to update all imports when we update the types dependency ?

@EmrysMyrddin
Copy link
Collaborator

@AdiRishi We also have another PR (#2238) which should even remove the necessity to have a type matching on user land. This PR doesn't take any CFW types anymore and takes the namespace name as string instead. Which both simplify the usage and should fix the type issue :-)

But I still think we should pin the typing anyway

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