feat(miniflare): add getWorkerdFeatureFlags() for compatibility flag resolution#11919
Closed
petebacondarwin wants to merge 1 commit intomainfrom
Closed
feat(miniflare): add getWorkerdFeatureFlags() for compatibility flag resolution#11919petebacondarwin wants to merge 1 commit intomainfrom
petebacondarwin wants to merge 1 commit intomainfrom
Conversation
…resolution Add a TypeScript implementation that replicates workerd's C++ compileCompatibilityFlags() function. This computes which compatibility flags are enabled based on: - Compatibility date (flags enabled after their compatEnableDate) - Explicit compatibility flags (enable/disable overrides) - Implied flags (cascading dependencies between flags) Files added: - scripts/build-capnp-compat.mjs: Build script that downloads compatibility-date.capnp from workerd, compiles it with capnp-es, and extracts annotation metadata - src/shared/compatibility-date.ts: Cap'n Proto types generated by capnp-es - src/shared/compatibility-flags-metadata.ts: Extracted annotation metadata - src/shared/compatibility-flags.ts: Main implementation with getWorkerdFeatureFlags() - test/shared/compatibility-flags.spec.ts: Test suite Also updates: - package.json: Added capnp:compat script - tsconfig.json: Include the build script for type checking - GitHub workflow: Auto-regenerate compatibility flags on workerd dependency updates
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
vicb
reviewed
Jan 16, 2026
| }; | ||
|
|
||
| /** | ||
| * Parses a compatibility date string (YYYY-MM-DD) into a comparable integer. |
Contributor
There was a problem hiding this comment.
YYYY-MM-DD is a comparable string, do we need to parse?
Contributor
Author
|
Closing as we don't have a strong need for this right now. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a TypeScript implementation that replicates workerd's C++ compileCompatibilityFlags() function. This computes which compatibility flags are enabled based on:
Files added:
Also updates: