Skip to content

Commit

Permalink
Add 2022-10-31 and 2022-11-30 types entrypoints and diagram (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbbot authored Jan 25, 2023
1 parent 0adecf3 commit f965898
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 4 deletions.
14 changes: 12 additions & 2 deletions npm/workers-types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ The following is a minimal `tsconfig.json` for use alongside this package:

### Compatibility dates

The Cloudflare Workers runtime manages backwards compatibility through the use of [Compatibility Dates](https://developers.cloudflare.com/workers/platform/compatibility-dates/). Using different compatibility dates affects the runtime types available to your Worker, and so it's important you specify the correct entrypoint to the `workers-types` package to match your compatibility date (which is usually set in your `wrangler.toml` configuration file). `workers-types` currently exposes 7 entrypoints to choose from:
![Entrypoints for compatibility dates](./entrypoints.svg)

The Cloudflare Workers runtime manages backwards compatibility through the use of [Compatibility Dates](https://developers.cloudflare.com/workers/platform/compatibility-dates/). Using different compatibility dates affects the runtime types available to your Worker, and so it's important you specify the correct entrypoint to the `workers-types` package to match your compatibility date (which is usually set in your `wrangler.toml` configuration file). `workers-types` currently exposes the following entrypoints to choose from:

- `@cloudflare/workers-types`

Expand All @@ -50,7 +52,15 @@ The Cloudflare Workers runtime manages backwards compatibility through the use o

- `@cloudflare/workers-types/2022-08-04`

This entrypoint exposes the runtime types for a compatibility date after `2022-08-04`.
This entrypoint exposes the runtime types for a compatibility date between `2022-08-04` and `2022-10-31`.

- `@cloudflare/workers-types/2022-10-31`

This entrypoint exposes the runtime types for a compatibility date between `2022-10-31` and `2022-11-30`.

- `@cloudflare/workers-types/2022-11-30`

This entrypoint exposes the runtime types for a compatibility date after `2022-11-30`.

- `@cloudflare/workers-types/experimental`

Expand Down
53 changes: 53 additions & 0 deletions npm/workers-types/entrypoints.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions src/workerd/tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ wd_cc_binary(
deps = [":api_encoder_lib"],
)

# All compatibility dates that changed public facing types.
# Remember to update `npm/workers-types/README.md` when adding new dates here.
compat_dates = [
# Oldest compatibility date, with no flags enabled
("2021-01-01", "oldest"),
Expand All @@ -42,9 +44,14 @@ compat_dates = [
("2022-01-31", "2022-01-31"),
# https://developers.cloudflare.com/workers/platform/compatibility-dates/#global-navigator
("2022-03-21", "2022-03-21"),
# https://developers.cloudflare.com/workers/platform/compatibility-dates/#global-navigator
# https://developers.cloudflare.com/workers/platform/compatibility-dates/#r2-bucket-list-respects-the-include-option
("2022-08-04", "2022-08-04"),
# Latest compatibility date
# https://developers.cloudflare.com/workers/platform/compatibility-dates/#new-url-parser-implementation
("2022-10-31", "2022-10-31"),
# https://developers.cloudflare.com/workers/platform/compatibility-dates/#streams-constructors
# https://developers.cloudflare.com/workers/platform/compatibility-dates/#compliant-transformstream-constructor
("2022-11-30", "2022-11-30"),
# Latest compatibility date (note these types should be the same as the previous entry)
("2030-01-01", "experimental"),
]

Expand Down

0 comments on commit f965898

Please sign in to comment.