-
Notifications
You must be signed in to change notification settings - Fork 702
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve
getPlatformProxy
's (no-op) caches (#5026)
* [wrangler] fix: make sure `getPlatformProxy` produces a production-like `caches` object * [wrangler] fix: relax the `getPlatformProxy`'s' cache request/response types
- Loading branch information
1 parent
efe8b44
commit 0458472
Showing
4 changed files
with
87 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
"wrangler": patch | ||
--- | ||
|
||
fix: make sure `getPlatformProxy` produces a production-like `caches` object | ||
|
||
make sure that the `caches` object returned to `getPlatformProxy` behaves | ||
in the same manner as the one present in production (where calling unsupported | ||
methods throws a helpful error message) | ||
|
||
note: make sure that the unsupported methods are however not included in the | ||
`CacheStorage` type definition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"wrangler": patch | ||
--- | ||
|
||
fix: relax the `getPlatformProxy`'s' cache request/response types | ||
|
||
prior to these changes the caches obtained from `getPlatformProxy` | ||
would use `unknown`s as their types, this proved too restrictive | ||
and incompatible with the equivalent `@cloudflare/workers-types` | ||
types, we decided to use `any`s instead to allow for more flexibility | ||
whilst also making the type compatible with workers-types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters