0edd92e
Thanks @mrbbot! - Merge and make optional allIncomingRequestCfPropertiesGeographicInformation
properties
- #314
59b3f55
Thanks @GregBrimble! - feat: AddpassThroughOnException()
to Pages Functions
- #307
0721beb
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-10-21
-
#301
17b6d16
Thanks @caass! - Improve theIncomingRequestCfProperties
type.Previously, this type was based on our docs, which didn't include some fields. Now we've gone through the code that generates these fields and ensured that every property matches up.
Additionally, we added examples and documentation for almost everything, so it should be more clear exactly what a certain property is or isn't.
- #294
fba318b
Thanks @Frederik-Baetens! - Updated auto-generated types @ 2022-10-13
- #280
6e55069
Thanks @WalshyDev! - Make clientTcpRtt optional
- #288
4fe75b2
Thanks @florianmartens! - Add 'origin-auth' to RequestInitCfPropertiesImage interface. This changes fixes types for users attempting to fetch images from authenticated sources. Before this fix, users had to manually extend the fetch interface to satisfy the TS compiler.
- #273
bc80605
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-08-30
- #259
38b7e0f
Thanks @vlovich! - Fix DurableObject transactionget
to properly returnPromise<T | undefined>
instead ofPromise<T>
- #245
bf5d870
Thanks @jacobbednarz! - Added support forisEUCountry
property onIncomingRequestCfProperties
- #253
f45703c
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-06-20
-
#247
2cdc8cf
Thanks @iveelsm! - Allow for cacheTags to be passed on fetch requestsAllowing cacheTags within the workers process to be processed as part of a standard fetch has been a highly requested feature. This new object within the request initialization will allow for supplemental Cache-Tag headers to be returned so that they can be stored with the relevant content. This will allow for better control over Purge by Tag mechanisms within the workers processes.
Implementation:
- Adds a new object to the
cf.d.ts
declaration.
- Adds a new object to the
- #236
9409be6
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-05-11
- #230
ceec72b
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-05-04
- #232
97499a2
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-05-05
- #234
18ca7fc
Thanks @GregBrimble! - feat: Adds the Pages Functions asset imports type. More info on our docs.
- #228
edaac15
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-04-29
- #226
c2c7c2e
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-04-27
- #224
a016b11
Thanks @GregBrimble! - feature: Adds thePagesPluginFunction
type and internalfunctionPath
to Functions' context.
- #222
b96c23c
Thanks @GregBrimble! - feature: Adds thePagesPluginFunction
type and internalfunctionPath
to Functions' context.
- #218
402e4cc
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-04-15
f776bc6
Thanks @threepointone! - Fixes for R2 types via #216
- #202
921f05a
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-03-07
- #210
f498fd9
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-04-13
- #186
c117b5a
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-01-19
- #194
74c94f8
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-02-08
- #175
17d21e9
Thanks @threepointone! - fix: FormData::entries(), FormData::Symbol.iterator
- #184
f1c3c40
Thanks @threepointone! - chore: update marked to 4.0.10
d7c4f73
Thanks @threepointone! - via #178, thanks @kulla: Add possibility to narrow down key space of KVNamespace
-
#170
771ce75
Thanks @JacobMGEvans! - CI/CD Improvements:- Added Changeset PR creation & publish Workflows
- Added Typechecking workflow
- Consolidated old workflows as jobs in new workflows
- Added configuration for Changeset CLI
- Installing Changeset bot for non-blocking PR support
- #181
0dc3fe4
Thanks @autodecl-bot! - Updated auto-generated types @ 2022-01-15
- Updated types for 2021-12-14 [vlovich]
- Updated types for 2021.12.300 [vlovich]
- Updated types for 2021.12.100 [vlovich]
- Adds env.ASSETS.fetch typings [@GregBrimble][pull/157]
- Adding missing types in RequestInitCfPropertiesImage [@itsmatteomanf][pull/156]
- Add 'error' WebSocket event types overrides [@bretthoerner], [pull/143] & [pull/150]
- Add PagesFunction type @GregBrimble, [pull/154]
- Updated types for 2021.11.400 [@autodecl-bot], [pull/145]
- Updated types for 2021.11.700 [@autodecl-bot], [pull/149]
- Add
polish
key toRequestInitCfProperties
- [@threepointone], [pull/131] - Added support for gravity: 'auto' to BasicImageTransformations - [@threepointone], [@@jonnedeprez], [pull/132]
- Fixup DurableObject options names - [@vlovich], [pull/136]
- Fixes for some crypto APIs - [@vlovich], [pull/137]
- Updated types for 2021.10.800 - [@autodecl-bot], [pull/120]
- Preserve the
@deprecated
tag when generating types - [@vlovich], [pull/123] - Cleanup unneeded overrides and replace with standard names - [@vlovich], [pull/123]
- Support merging overrides automatically - [@vlovich], [pull/126]
- Updated types for 2021.11.0 - [@autodecl-bot], [pull/128]
- DurableObjectState storage should not be undefined in practice - [@koeninger], [pull/118]
- Add
asOrganization
toIncomingRequestCfProperties
- [@mrkldshv], [pull/111]
- Types are automatically generated from the runtime - @mrbbot, pull/112
Types now match exactly what's defined in the runtime source code, meaning
webworker
should be removed from users'tsconfig.json
s
- Add KVNamespace.get options parameter, with cacheTtl - [@bretthoerner], [pull/87]
- fix DurableObjectStorage transaction method signature - [@sbfaulkner], [pull/89]
-
Add types for Durable Objects - @mathew-cf, pull/63, issue/64 Types for Durable Objects Beta, subject to change.
-
Add ScheduledEvent - @qwtel, pull/61 Types for Scheduled Events
-
Add AVIF Format for Image Resizing - @GregBrimble, pull/59
-
Add metadata typings for KV - @GregBrimble, pull/54 Adds the new metadata types to the getWithMetadata, put and list methods on a KV namespace.
-
Complete Image Resizing properties - @GregBrimble, pull/50 Adds missing options for the Image Resizing API.
-
Add API for async handlers and end handler - @ObsidianMinor, pull/48 Types for HTML Rewriter end of document append method
-
Make Element.attributes iterable - @jdanyow, pull/47
Fixing a bug in the type definitions that prevents writing valid code like this:
rewriter.on('bla', { element: element => { for (const [name, value] of element.attributes) {
-
Update README.md instructions to avoid typescript error - @jeremistadler, pull/60 Add empty export to bindings.d.ts example to avoid an typescript error
-
Add a GitHub action to lint the Markdown - @jbampton,pull/51
-
Add CODEOWNERS - @ispivey, [pull/49] This will ensure we have default reviewers.
-
Add prettier and typescript as devDependencies - @1000hz, pull/46 Automated formatting via prettier
-
Types now only provided via automatic type inclusion, rather than explicit import - @jdanyow, issue/33, pull/34
Users should no longer use an empty import to include
workers-types
, which used to be the recommendation in the README.Remove this from your code:
import {} from "@cloudflare/workers-types";
And instead include the types explicitly in your TypeScript configuration compiler options:
{ "compilerOptions": { "types": ["@cloudflare/workers-types"] } }
-
Add Cache behavior modifiers to outbound Requests - @trjstewart, issue/22, pull/17
When constructing a request, you can now include the following cache-manipulating properties in the initializer dictionary:
// Force response to be cached for 300 seconds. fetch(event.request, { cf: { cacheTtl: 300 } }); // Force response to be cached for 86400 seconds for 200 status codes, 1 second for 404, and do not cache 500 errors fetch(request, { cf: { cacheTtlByStatus: { "200-299": 86400, "404": 1, "500-599": 0 } } });
Read more about these properties in the
Request
docs. -
Add support for
caches.default
- @ispivey, @ashnewmanjones, issue/8, pull/21The Workers runtime exposes a default global cache as
caches.default
, accessed like:let cache = caches.default;
This is an extension to the Service Workers spec for
CacheStorage
, and thus needed to be added explicitly to our type definitions. -
Add missing properties to inbound
Request
cf
object - @ispivey, @brycematheson1234, issue/23, pull/24, pull/35Adds:
clientTcpRtt
metroCode
botManagement.score
botManagement.staticResource
botManagement.verifiedBot
Makes most geolocation properties optional, because they are not guaranteed to be set on every request.
Changes the type of
asn
from string to number. -
Adds
cf.cacheKey
property toRequestInit
- @ispivey, issue/22, pull/28Adds the
cacheKey
property of thecf
object to theRequestInit
interface. -
Allow passing another Request as the
init
arg toRequest
constructor - @ispivey, issue/15, pull/18Previously, this pattern wasn't allowed:
new Request(parsedUrl.toString(), request);
This is because the
cf
object on inbound Request objects, and that expected in theinit
dictionary arg to the Request constructor, have a different shape.This change creates explicit
IncomingRequestCfProperties
(inbound) andRequestInitCfProperties
(outbound) interfaces, and updates theRequest
constructor to accept either type:interface RequestInit { cf?: RequestInitCfProperties | IncomingRequestCfProperties; }
Read more about the
Request
constructor in theRequest
docs. -
Add
CfRequestInit
type - @third774, issue/37, pull/44Because of the union mentioned above, if an object is declared as
RequestInit
and sets thecf
property, subproperties ofcf
can not later be reassigned. For this scenario, a more specificCfRequestInit
type has been introduced to use instead ofRequestInit
that doesn't exhibit the same assignability issues. -
Add iterable methods to
FormData
,Headers
, andURLSearchParams
- @ispivey, issue/25, pull/26The iterable methods
entries()
,keys()
andvalues()
are not present on these three types inlib.webworker.d.ts
. They are instead supplied inlib.dom.iterable.d.ts
.However, as discussed in this issue on the TypeScript repo,
lib.dom.d.ts
andlib.webworker.d.ts
have conflicting type definitions, and the maintainers hope to solve this issue by refactoring shared components into a newweb.iterable.d.ts
lib: microsoft/TypeScript#32435 (comment)Until then, we will include the iterable methods supported by Workers in our own type definitions.
-
Remove
selector
parameter fromonDocument()
- @jdanyow, pull/41The type signature for HTMLRewriter's
onDocument()
method previously erroneously included aselector
parameter as its first argument. This has been removed. -
Make
KVNamespace.list()
options argument optional - @motiejunas, pull/10Previously, the
KVNamespace
interface required that callers provide an empty options object when listing all the keys in a namespace, like so:await NAMESPACE.list({});
However, this argument is not actually required. This change updates the interface to match the runtime.
-
Add a Release Checklist - @ispivey, issue/20, pull/27
As we onboard more contributors, we're documenting release procedures.
-
Add BSD-3 License - @ispivey, issue/31, pull/30, pull/40
As we transition this to a project supported by the Cloudflare Workers team, we're releasing the code under a BSD-3 license. Thanks to all the contributors for their help!