File
Blob: src/workerd/io/compatibility-date.capnp
| 1 | # Copyright (c) 2017-2022 Cloudflare, Inc. |
| 2 | # Licensed under the Apache 2.0 license found in the LICENSE file or at: |
| 3 | # https://opensource.org/licenses/Apache-2.0 |
| 4 | |
| 5 | @0x8b3d4aaa36221ec8; |
| 6 | |
| 7 | using Cxx = import "/capnp/c++.capnp"; |
| 8 | $Cxx.namespace("workerd"); |
| 9 | $Cxx.allowCancellation; |
| 10 | |
| 11 | struct ImpliedByAfterDate @0x8f8c1b68151b6cff { |
| 12 | # Annotates a compatibility flag to indicate that it is implied by the enablement |
| 13 | # of the named flag(s) after the specified date. |
| 14 | union { |
| 15 | name @0 :Text; |
| 16 | names @2 :List(Text); |
| 17 | } |
| 18 | date @1 :Text; |
| 19 | } |
| 20 | |
| 21 | struct CompatibilityFlags @0x8f8c1b68151b6cef { |
| 22 | # Flags that change the basic behavior of the runtime API, especially for |
| 23 | # backwards-compatibility with old bugs. |
| 24 | # |
| 25 | # Note: At one time, this was called "FeatureFlags", and many places in the codebase still call |
| 26 | # it that. We could do a mass-rename but there's some tricky spots involving JSON |
| 27 | # communications with other systems... I'm leaving it for now. |
| 28 | |
| 29 | annotation compatEnableFlag @0xb6dabbc87cd1b03e (field) :Text; |
| 30 | annotation compatDisableFlag @0xd145cf1adc42577c (field) :Text; |
| 31 | # Compatibility flag names which enable or disable this feature, overriding what the worker's |
| 32 | # compatibility date would otherwise set. |
| 33 | # |
| 34 | # An enable-flag is used to enable the feature before it becomes the default, probably for |
| 35 | # testing purposes. All features probably should have an enable-flag defined first, then get |
| 36 | # a date assigned once testing is done. |
| 37 | # |
| 38 | # A disable-flag is used when a worker needs to keep long-term backwards compatibility with one |
| 39 | # bug but doesn't want to hold back everything else. This is hopefully rare! Most features |
| 40 | # should have a disable-flag defined. |
| 41 | |
| 42 | annotation compatEnableDate @0x91a5d5d7244cf6d0 (field) :Text; |
| 43 | # The compatibility date (date string, like "2021-05-17") after which this flag should always |
| 44 | # be enabled. |
| 45 | |
| 46 | annotation compatEnableAllDates @0x9a1d37c8030d9418 (field) :Void; |
| 47 | # All compatibility dates should start using the flag as enabled. |
| 48 | # NOTE: This is almost NEVER what you actually want because you're most likely breaking back |
| 49 | # compat. Note that workers uploaded with the flag will fail validation, so this will break |
| 50 | # uploads for anyone still using the flag. |
| 51 | # |
| 52 | # However, this is useful in some cases where the back compat you're breaking is for |
| 53 | # pre-release users who you've communicated this in advance to. Turning this on for a field |
| 54 | # will also cause test failures in compatibility-date-test.c++ and validation-test.ekam-rule |
| 55 | # because the default set of flags that are enabled changes from being the empty set to including |
| 56 | # this flag (at some point presumably it also means you're removing the compat flags at some point |
| 57 | # and you'll have to repeat this exercise). |
| 58 | |
| 59 | annotation neededByFl @0xbd23aff9deefc308 (field) :Void; |
| 60 | # A tag to tell us which fields we'll need to propagate to FL on subrequests and responses. |
| 61 | # |
| 62 | # ("FL" refers to Cloudflare's HTTP proxy stack which is used for all outbound requests. Except |
| 63 | # for `brotliContentEncoding`, flags with this annotation have no effect when `workerd` is used |
| 64 | # outside of Cloudflare.) |
| 65 | |
| 66 | annotation experimental @0xe3e5a63e76284d88 (field):Void; |
| 67 | # Flags with this annotation can only be used when workerd is run with the --experimental flag. |
| 68 | # These flags may be subject to change or even removal in the future with no warning -- they are |
| 69 | # not covered by Workers' usual backwards-compatibility promise. Experimental flags cannot be |
| 70 | # used in Workers deployed on Cloudflare except by test accounts belonging to Cloudflare team |
| 71 | # members. |
| 72 | |
| 73 | annotation impliedByAfterDate @0xe3e5a63e76284d89 (field) :ImpliedByAfterDate; |
| 74 | |
| 75 | annotation pythonSnapshotRelease @0xef74c0cc5d18cc0c (field) :Void; |
| 76 | # This annotation marks a compat flag as introducing a potentially breaking change to Python |
| 77 | # memory snapshots. See the doc comment for the `PythonSnapshotRelease` struct above for more |
| 78 | # details. |
| 79 | |
| 80 | formDataParserSupportsFiles @0 :Bool |
| 81 | $compatEnableFlag("formdata_parser_supports_files") |
| 82 | $compatEnableDate("2021-11-03") |
| 83 | $compatDisableFlag("formdata_parser_converts_files_to_strings"); |
| 84 | # Our original implementations of FormData made the mistake of turning files into strings. |
| 85 | # We hadn't implemented `File` yet, and we forgot. |
| 86 | |
| 87 | fetchRefusesUnknownProtocols @1 :Bool |
| 88 | $compatEnableFlag("fetch_refuses_unknown_protocols") |
| 89 | $compatEnableDate("2021-11-10") |
| 90 | $compatDisableFlag("fetch_treats_unknown_protocols_as_http"); |
| 91 | # Our original implementation of fetch() incorrectly accepted URLs with any scheme (protocol). |
| 92 | # It happily sent any scheme to FL in the `X-Forwarded-Proto` header. FL would ignore any |
| 93 | # scheme it didn't recgonize, which effectively meant it treated all schemes other than `https` |
| 94 | # as `http`. |
| 95 | |
| 96 | esiIncludeIsVoidTag @2 :Bool |
| 97 | $compatEnableFlag("html_rewriter_treats_esi_include_as_void_tag"); |
| 98 | # Our original implementation of `esi:include` treated it as needing an end tag. |
| 99 | # We're worried that fixing this could break existing workers. |
| 100 | |
| 101 | obsolete3 @3 :Bool; |
| 102 | |
| 103 | durableObjectFetchRequiresSchemeAuthority @4 :Bool |
| 104 | $compatEnableFlag("durable_object_fetch_requires_full_url") |
| 105 | $compatEnableDate("2021-11-10") |
| 106 | $compatDisableFlag("durable_object_fetch_allows_relative_url"); |
| 107 | # Our original implementation allowed URLs without schema and/or authority components and |
| 108 | # interpreted them relative to "https://fake-host/". |
| 109 | |
| 110 | streamsByobReaderDetachesBuffer @5 :Bool |
| 111 | $compatEnableFlag("streams_byob_reader_detaches_buffer") |
| 112 | $compatEnableDate("2021-11-10") |
| 113 | $compatDisableFlag("streams_byob_reader_does_not_detach_buffer"); |
| 114 | # The streams specification dictates that ArrayBufferViews that are passed in to the |
| 115 | # read() operation of a ReadableStreamBYOBReader are detached, making it impossible |
| 116 | # for user code to modify or observe the data as it is being read. Our original |
| 117 | # implementation did not do that. |
| 118 | |
| 119 | streamsJavaScriptControllers @6 :Bool |
| 120 | $compatEnableFlag("streams_enable_constructors") |
| 121 | $compatEnableDate("2022-11-30") |
| 122 | $compatDisableFlag("streams_disable_constructors"); |
| 123 | # Controls the availability of the work in progress new ReadableStream() and |
| 124 | # new WritableStream() constructors backed by JavaScript underlying sources |
| 125 | # and sinks. |
| 126 | |
| 127 | jsgPropertyOnPrototypeTemplate @7 :Bool |
| 128 | $compatEnableFlag("workers_api_getters_setters_on_prototype") |
| 129 | $compatEnableDate("2022-01-31") |
| 130 | $compatDisableFlag("workers_api_getters_setters_on_instance"); |
| 131 | # Originally, JSG_PROPERTY registered getter/setters on an objects *instance* |
| 132 | # template as opposed to its prototype template. This broke subclassing at |
| 133 | # the JavaScript layer, preventing a subclass from correctly overriding the |
| 134 | # superclasses getters/setters. This flag controls the breaking change made |
| 135 | # to set those getters/setters on the prototype template instead. |
| 136 | |
| 137 | minimalSubrequests @8 :Bool |
| 138 | $compatEnableFlag("minimal_subrequests") |
| 139 | $compatEnableDate("2022-04-05") |
| 140 | $compatDisableFlag("no_minimal_subrequests") |
| 141 | $neededByFl; |
| 142 | # Turns off a bunch of redundant features for outgoing subrequests from Cloudflare. Historically, |
| 143 | # a number of standard Cloudflare CDN features unrelated to Workers would sometimes run on |
| 144 | # Workers subrequests despite not making sense there. For example, Cloudflare might automatically |
| 145 | # apply gzip compression when the origin server responds without it but the client supports it. |
| 146 | # This doesn't make sense to do when the response is going to be consumed by Workers, since the |
| 147 | # Workers Runtime is typically running on the same machine. When Workers itself returns a |
| 148 | # response to the client, Cloudflare's stack will have another chance to apply gzip, and it |
| 149 | # makes much more sense to do there. |
| 150 | |
| 151 | noCotsOnExternalFetch @9 :Bool |
| 152 | $compatEnableFlag("no_cots_on_external_fetch") |
| 153 | $compatEnableDate("2022-03-08") |
| 154 | $compatDisableFlag("cots_on_external_fetch") |
| 155 | $neededByFl; |
| 156 | # Tells FL not to use the Custom Origin Trust Store for grey-cloud / external subrequests. Fixes |
| 157 | # EW-5299. |
| 158 | |
| 159 | specCompliantUrl @10 :Bool |
| 160 | $compatEnableFlag("url_standard") |
| 161 | $compatEnableDate("2022-10-31") |
| 162 | $compatDisableFlag("url_original"); |
| 163 | # The original URL implementation based on kj::Url is not compliant with the |
| 164 | # WHATWG URL Standard, leading to a number of issues reported by users. Unfortunately, |
| 165 | # making it spec compliant is a breaking change. This flag controls the availability |
| 166 | # of the new spec-compliant URL implementation. |
| 167 | |
| 168 | globalNavigator @11 :Bool |
| 169 | $compatEnableFlag("global_navigator") |
| 170 | $compatEnableDate("2022-03-21") |
| 171 | $compatDisableFlag("no_global_navigator"); |
| 172 | |
| 173 | captureThrowsAsRejections @12 :Bool |
| 174 | $compatEnableFlag("capture_async_api_throws") |
| 175 | $compatEnableDate("2022-10-31") |
| 176 | $compatDisableFlag("do_not_capture_async_api_throws"); |
| 177 | # Many worker APIs that return JavaScript promises currently throw synchronous errors |
| 178 | # when exceptions occur. Per the Web Platform API specs, async functions should never |
| 179 | # throw synchronously. This flag changes the behavior so that async functions return |
| 180 | # rejections instead of throwing. |
| 181 | |
| 182 | r2PublicBetaApi @13 :Bool |
| 183 | $compatEnableFlag("r2_public_beta_bindings") |
| 184 | $compatDisableFlag("r2_internal_beta_bindings") |
| 185 | $compatEnableAllDates; |
| 186 | # R2 public beta bindings are the default. |
| 187 | # R2 internal beta bindings is back-compat. |
| 188 | |
| 189 | obsolete14 @14 :Bool |
| 190 | $compatEnableFlag("durable_object_alarms"); |
| 191 | # Used to gate access to durable object alarms to authorized workers, no longer used (alarms |
| 192 | # are now enabled for everyone). |
| 193 | |
| 194 | noSubstituteNull @15 :Bool |
| 195 | $compatEnableFlag("dont_substitute_null_on_type_error") |
| 196 | $compatEnableDate("2022-06-01") |
| 197 | $compatDisableFlag("substitute_null_on_type_error"); |
| 198 | # There is a bug in the original implementation of the kj::Maybe<T> type wrapper |
| 199 | # that had it inappropriately interpret a nullptr result as acceptable as opposed |
| 200 | # to it being a type error. Enabling this flag switches on the correct behavior. |
| 201 | # Disabling the flag switches back to the original broken behavior. |
| 202 | |
| 203 | transformStreamJavaScriptControllers @16 :Bool |
| 204 | $compatEnableFlag("transformstream_enable_standard_constructor") |
| 205 | $compatEnableDate("2022-11-30") |
| 206 | $compatDisableFlag("transformstream_disable_standard_constructor"); |
| 207 | # Controls whether the TransformStream constructor conforms to the stream standard or not. |
| 208 | # Must be used in combination with the streamsJavaScriptControllers flag. |
| 209 | |
| 210 | r2ListHonorIncludeFields @17 :Bool |
| 211 | $compatEnableFlag("r2_list_honor_include") |
| 212 | $compatEnableDate("2022-08-04"); |
| 213 | # Controls if R2 bucket.list honors the `include` field as intended. It previously didn't |
| 214 | # and by default would result in http & custom metadata for an object always being returned |
| 215 | # in the list. |
| 216 | |
| 217 | exportCommonJsDefaultNamespace @18 :Bool |
| 218 | $compatEnableFlag("export_commonjs_default") |
| 219 | $compatEnableDate("2022-10-31") |
| 220 | $compatDisableFlag("export_commonjs_namespace"); |
| 221 | # Unfortunately, when the CommonJsModule type was implemented, it mistakenly exported the |
| 222 | # module namespace (an object like `{default: module.exports}`) rather than exporting only |
| 223 | # the module.exports. When this flag is enabled, the export is fixed. |
| 224 | |
| 225 | obsolete19 @19 :Bool |
| 226 | $compatEnableFlag("durable_object_rename") |
| 227 | $experimental; |
| 228 | # Obsolete flag. Has no effect. |
| 229 | |
| 230 | webSocketCompression @20 :Bool |
| 231 | $compatEnableFlag("web_socket_compression") |
| 232 | $compatEnableDate("2023-08-15") |
| 233 | $compatDisableFlag("no_web_socket_compression"); |
| 234 | # Enables WebSocket compression. Without this flag, all attempts to negotiate compression will |
| 235 | # be refused for scripts prior to the compat date, so WebSockets will never use compression. |
| 236 | # With this flag, the system will automatically negotiate the use of the permessage-deflate |
| 237 | # extension where appropriate. The Worker can also request specific compression settings by |
| 238 | # specifying a valid Sec-WebSocket-Extensions header, or setting the header to the empty string |
| 239 | # to explicitly request that no compression be used. |
| 240 | |
| 241 | nodeJsCompat @21 :Bool |
| 242 | $compatEnableFlag("nodejs_compat") |
| 243 | $compatDisableFlag("no_nodejs_compat"); |
| 244 | # Enables nodejs compat imports in the application. |
| 245 | |
| 246 | obsolete22 @22 :Bool |
| 247 | $compatEnableFlag("tcp_sockets_support"); |
| 248 | # Used to enables TCP sockets in workerd. |
| 249 | |
| 250 | specCompliantResponseRedirect @23 :Bool |
| 251 | $compatEnableDate("2023-03-14") |
| 252 | $compatEnableFlag("response_redirect_url_standard") |
| 253 | $compatDisableFlag("response_redirect_url_original"); |
| 254 | # The original URL implementation based on kj::Url is not compliant with the |
| 255 | # WHATWG URL Standard, leading to a number of issues reported by users. Unfortunately, |
| 256 | # the specCompliantUrl flag did not contemplate the redirect usage. This flag is |
| 257 | # specifically about the usage in a redirect(). |
| 258 | |
| 259 | workerdExperimental @24 :Bool |
| 260 | $compatEnableFlag("experimental") |
| 261 | $experimental; |
| 262 | # Experimental, do not use. |
| 263 | # This is a catch-all compatibility flag for experimental development within workerd |
| 264 | # that is not covered by another more-specific compatibility flag. It is the intention |
| 265 | # of this flag to always have the $experimental attribute. |
| 266 | # This is intended to guard new features that do not introduce any backwards-compatibility |
| 267 | # concerns (e.g. they only add a new API), and therefore do not need a compat flag of their own |
| 268 | # in the long term, but where we still want to guard access to the feature while it is in |
| 269 | # development. Don't use this for backwards-incompatible changes; give them their own flag. |
| 270 | # WARNING: Any feature blocked by this flag is subject to change at any time, including |
| 271 | # removal. Do not ignore this warning. |
| 272 | |
| 273 | durableObjectGetExisting @25 :Bool |
| 274 | $compatEnableFlag("durable_object_get_existing") |
| 275 | $experimental; |
| 276 | # Experimental, allows getting a durable object stub that ensures the object already exists. |
| 277 | # This is currently a work in progress mechanism that is not yet available for use in workerd. |
| 278 | |
| 279 | httpHeadersGetSetCookie @26 :Bool |
| 280 | $compatEnableFlag("http_headers_getsetcookie") |
| 281 | $compatDisableFlag("no_http_headers_getsetcookie") |
| 282 | $compatEnableDate("2023-03-01"); |
| 283 | # Enables the new headers.getSetCookie() API and the corresponding changes in behavior for |
| 284 | # the Header objects keys() and entries() iterators. |
| 285 | |
| 286 | dispatchExceptionTunneling @27 :Bool |
| 287 | $compatEnableDate("2023-03-01") |
| 288 | $compatEnableFlag("dynamic_dispatch_tunnel_exceptions") |
| 289 | $compatDisableFlag("dynamic_dispatch_treat_exceptions_as_500"); |
| 290 | # Enables the tunneling of exceptions from a dynamic dispatch callee back into the caller. |
| 291 | # Previously any uncaught exception in the callee would be returned to the caller as an empty |
| 292 | # HTTP 500 response. |
| 293 | |
| 294 | serviceBindingExtraHandlers @28 :Bool |
| 295 | $compatEnableFlag("service_binding_extra_handlers") |
| 296 | $experimental; |
| 297 | # Allows service bindings to call additional event handler methods on the target Worker. |
| 298 | # Initially only includes support for calling the queue() handler. |
| 299 | # WARNING: this flag exposes the V8 deserialiser to users via `Fetcher#queue()` `serializedBody`. |
| 300 | # Historically, this has required a trusted environment to be safe. If we decide to make this |
| 301 | # flag non-experimental, we must ensure we take appropriate precuations. |
| 302 | |
| 303 | noCfBotManagementDefault @29 :Bool |
| 304 | $compatEnableFlag("no_cf_botmanagement_default") |
| 305 | $compatDisableFlag("cf_botmanagement_default") |
| 306 | $compatEnableDate("2023-08-01"); |
| 307 | # This one operates a bit backwards. With the flag *enabled* no default cfBotManagement |
| 308 | # data will be included. The the flag *disable*, default cfBotManagement data will be |
| 309 | # included in the request.cf if the field is not present. |
| 310 | |
| 311 | urlSearchParamsDeleteHasValueArg @30 :Bool |
| 312 | $compatEnableFlag("urlsearchparams_delete_has_value_arg") |
| 313 | $compatDisableFlag("no_urlsearchparams_delete_has_value_arg") |
| 314 | $compatEnableDate("2023-07-01"); |
| 315 | # When enabled, the delete() and has() methods of the standard URLSearchParams object |
| 316 | # (see url-standard.h) will have the recently added second value argument enabled. |
| 317 | |
| 318 | strictCompression @31 :Bool |
| 319 | $compatEnableFlag("strict_compression_checks") |
| 320 | $compatDisableFlag("no_strict_compression_checks") |
| 321 | $compatEnableDate("2023-08-01"); |
| 322 | # Perform additional error checking in the Web Compression API and throw an error if a |
| 323 | # DecompressionStream has trailing data or gets closed before the full compressed data has been |
| 324 | # provided. |
| 325 | |
| 326 | brotliContentEncoding @32 :Bool |
| 327 | $compatEnableFlag("brotli_content_encoding") |
| 328 | $compatEnableDate("2024-04-29") |
| 329 | $compatDisableFlag("no_brotli_content_encoding") |
| 330 | $neededByFl; |
| 331 | # Enables compression/decompression support for the brotli compression algorithm. |
| 332 | # With the flag enabled workerd will support the "br" content encoding in the Request and |
| 333 | # Response APIs and compress or decompress data accordingly as with gzip. |
| 334 | |
| 335 | strictCrypto @33 :Bool |
| 336 | $compatEnableFlag("strict_crypto_checks") |
| 337 | $compatDisableFlag("no_strict_crypto_checks") |
| 338 | $compatEnableDate("2023-08-01"); |
| 339 | # Perform additional error checking in the Web Crypto API to conform with the specification as |
| 340 | # well as reject key parameters that may be unsafe based on key length or public exponent. |
| 341 | |
| 342 | rttiApi @34 :Bool |
| 343 | $compatEnableFlag("rtti_api") |
| 344 | $experimental; |
| 345 | # Enables the `workerd:rtti` module for querying runtime-type-information from JavaScript. |
| 346 | |
| 347 | obsolete35 @35 :Bool |
| 348 | $compatEnableFlag("webgpu") |
| 349 | $experimental; |
| 350 | # The experimental webgpu API was removed. |
| 351 | |
| 352 | cryptoPreservePublicExponent @36 :Bool |
| 353 | $compatEnableFlag("crypto_preserve_public_exponent") |
| 354 | $compatDisableFlag("no_crypto_preserve_public_exponent") |
| 355 | $compatEnableDate("2023-12-01"); |
| 356 | # In the WebCrypto API, the `publicExponent` field of the algorithm of RSA keys would previously |
| 357 | # be an ArrayBuffer. Using this flag, publicExponent is a Uint8Array as mandated by the |
| 358 | # specification. |
| 359 | |
| 360 | vectorizeQueryMetadataOptional @37 :Bool |
| 361 | $compatEnableFlag("vectorize_query_metadata_optional") |
| 362 | $compatEnableDate("2023-11-08") |
| 363 | $compatDisableFlag("vectorize_query_original"); |
| 364 | # Vectorize query option change to allow returning of metadata to be optional. Accompanying this: |
| 365 | # a return format change to move away from a nested object with the VectorizeVector. |
| 366 | |
| 367 | unsafeModule @38 :Bool |
| 368 | $compatEnableFlag("unsafe_module") |
| 369 | $experimental; |
| 370 | # Enables the `workerd:unsafe` module for performing dangerous operations from JavaScript. |
| 371 | # Intended for local development and testing use cases. Currently just supports aborting all |
| 372 | # Durable Objects running in a `workerd` process. |
| 373 | |
| 374 | jsRpc @39 :Bool |
| 375 | $compatEnableFlag("js_rpc") |
| 376 | $experimental; |
| 377 | # Enables JS RPC on the server side for Durable Object classes that do not explicitly extend |
| 378 | # `DurableObjects`. |
| 379 | # |
| 380 | # This flag is obsolete but supported temporarily to avoid breaking people who used it. All code |
| 381 | # should switch to using `extends DurableObject` as the way to enable RPC. |
| 382 | # |
| 383 | # As of this writing, it is still necessary to enable the general `experimental` flag to use RPC |
| 384 | # on both the client and server sides. |
| 385 | |
| 386 | noImportScripts @40 :Bool |
| 387 | $compatEnableFlag("no_global_importscripts") |
| 388 | $compatDisableFlag("global_importscripts") |
| 389 | $compatEnableDate("2024-03-04"); |
| 390 | # Removes the non-implemented importScripts() function from the global scope. |
| 391 | |
| 392 | nodeJsAls @41 :Bool |
| 393 | $compatEnableFlag("nodejs_als") |
| 394 | $compatDisableFlag("no_nodejs_als"); |
| 395 | # Enables the availability of the Node.js AsyncLocalStorage API independently of the full |
| 396 | # node.js compatibility option. |
| 397 | |
| 398 | queuesJsonMessages @42 :Bool |
| 399 | $compatEnableFlag("queues_json_messages") |
| 400 | $compatDisableFlag("no_queues_json_messages") |
| 401 | $compatEnableDate("2024-03-18"); |
| 402 | # Queues bindings serialize messages to JSON format by default (the previous default was v8 format) |
| 403 | |
| 404 | pythonWorkers @43 :Bool |
| 405 | $compatEnableFlag("python_workers") |
| 406 | $pythonSnapshotRelease |
| 407 | $impliedByAfterDate(name = "pythonWorkersDevPyodide", date = "2000-01-01"); |
| 408 | # Enables Python Workers. Access to this flag is not restricted, instead bundles containing |
| 409 | # Python modules are restricted in EWC. |
| 410 | # |
| 411 | # WARNING: Python Workers are still an experimental feature and thus subject to change. |
| 412 | |
| 413 | fetcherNoGetPutDelete @44 :Bool |
| 414 | $compatEnableFlag("fetcher_no_get_put_delete") |
| 415 | $compatDisableFlag("fetcher_has_get_put_delete") |
| 416 | $compatEnableDate("2024-03-26"); |
| 417 | # Historically, the `Fetcher` type -- which is the type of Service Bindings, and also the parent |
| 418 | # type of Durable Object stubs -- had special methods `get()`, `put()`, and `delete()`, which |
| 419 | # were shortcuts for calling `fetch()` with the corresponding HTTP method. These methods were |
| 420 | # never documented. |
| 421 | # |
| 422 | # To make room for people to define their own RPC methods with these names, this compat flag |
| 423 | # makes them no longer defined. |
| 424 | |
| 425 | unwrapCustomThenables @45 :Bool |
| 426 | $compatEnableFlag("unwrap_custom_thenables") |
| 427 | $compatDisableFlag("no_unwrap_custom_thenables") |
| 428 | $compatEnableDate("2024-04-01"); |
| 429 | |
| 430 | fetcherRpc @46 :Bool |
| 431 | $compatEnableFlag("rpc") |
| 432 | $compatDisableFlag("no_rpc") |
| 433 | $compatEnableDate("2024-04-03"); |
| 434 | # Whether the type `Fetcher` type -- which is the type of Service Bindings, and also the parent |
| 435 | # type of Durable Object stubs -- support RPC. If so, this type will have a wildcard method, so |
| 436 | # it will appear that all possible property names are present on any fetcher instance. This could |
| 437 | # break code that tries to infer types based on the presence or absence of methods. |
| 438 | |
| 439 | internalStreamByobReturn @47 :Bool |
| 440 | $compatEnableFlag("internal_stream_byob_return_view") |
| 441 | $compatDisableFlag("internal_stream_byob_return_undefined") |
| 442 | $compatEnableDate("2024-05-13"); |
| 443 | # Sadly, the original implementation of ReadableStream (now called "internal" streams), did not |
| 444 | # properly implement the result of ReadableStreamBYOBReader's read method. When done = true, |
| 445 | # per the spec, the result `value` must be an empty ArrayBufferView whose underlying ArrayBuffer |
| 446 | # is the same as the one passed to the read method. Our original implementation returned |
| 447 | # undefined instead. This flag changes the behavior to match the spec and to match the behavior |
| 448 | # implemented by the JS-backed ReadableStream implementation. |
| 449 | |
| 450 | blobStandardMimeType @48 :Bool |
| 451 | $compatEnableFlag("blob_standard_mime_type") |
| 452 | $compatDisableFlag("blob_legacy_mime_type") |
| 453 | $compatEnableDate("2024-06-03"); |
| 454 | # The original implementation of the Blob mime type normalization when extracting a blob |
| 455 | # from the Request or Response body is not compliant with the standard. Unfortunately, |
| 456 | # making it compliant is a breaking change. This flag controls the availability of the |
| 457 | # new spec-compliant Blob mime type normalization. |
| 458 | |
| 459 | fetchStandardUrl @49 :Bool |
| 460 | $compatEnableFlag("fetch_standard_url") |
| 461 | $compatDisableFlag("fetch_legacy_url") |
| 462 | $compatEnableDate("2024-06-03"); |
| 463 | # Ensures that WHATWG standard URL parsing is used in the fetch API implementation. |
| 464 | |
| 465 | nodeJsCompatV2 @50 :Bool |
| 466 | $compatEnableFlag("nodejs_compat_v2") |
| 467 | $compatDisableFlag("no_nodejs_compat_v2") |
| 468 | $impliedByAfterDate(name = "nodeJsCompat", date = "2024-09-23"); |
| 469 | # Implies nodeJSCompat with the following additional modifications: |
| 470 | # * Node.js Compat built-ins may be imported/required with or without the node: prefix |
| 471 | # * Node.js Compat the globals Buffer and process are available everywhere |
| 472 | |
| 473 | globalFetchStrictlyPublic @51 :Bool |
| 474 | $compatEnableFlag("global_fetch_strictly_public") |
| 475 | $compatDisableFlag("global_fetch_private_origin"); |
| 476 | # Controls what happens when a Worker hosted on Cloudflare uses the global `fetch()` function to |
| 477 | # request a hostname that is within the Worker's own Cloudflare zone (domain). |
| 478 | # |
| 479 | # Historically, such requests would be routed to the zone's origin server, ignoring any Workers |
| 480 | # mapped to the URL and also bypassing Cloudflare security settings. This behavior made sense |
| 481 | # when Workers was first introduced as a way to rewrite requests before passing them along to |
| 482 | # the origin, and bindings didn't exist: the only way to forward the request to origin was to |
| 483 | # use global fetch(), and if it didn't bypass Workers, you'd end up looping back to the same |
| 484 | # Worker. |
| 485 | # |
| 486 | # However, this behavior has a problem: it opens the door for SSRF attacks. Imagine a Worker is |
| 487 | # designed to fetch a resource from a user-provided URL. An attacker could provide a URL that |
| 488 | # points back to the Worker's own zone, and possibly cause the Worker to fetch a resource from |
| 489 | # origin that isn't meant to be reachable by the public. |
| 490 | # |
| 491 | # Traditionally, this kind of attack is considered a bug in the application: an application that |
| 492 | # fetches untrusted URLs must verify that the URL doesn't refer to a private resource that only |
| 493 | # the application itself is meant to access. However, applications can easily get this wrong. |
| 494 | # Meanwhile, by using bindings, we can make this class of problem go away. |
| 495 | # |
| 496 | # When global_fetch_strictly_public is enabled, the global `fetch()` function (when invoked on |
| 497 | # Cloudflare Workers) will strictly route requests as if they were made on the public internet. |
| 498 | # Thus, requests to a Worker's own zone will loop back to the "front door" of Cloudflare and |
| 499 | # will be treated like a request from the internet, possibly even looping back to the same Worker |
| 500 | # again. If an application wishes to send requests to its origin, it must configure an "origin |
| 501 | # binding". An origin binding behaves like a service binding (it has a `fetch()` method) but |
| 502 | # sends requests to the zone's origin servers, bypassing Cloudflare. E.g. the Worker would write |
| 503 | # `env.ORIGIN.fetch(req)` to send a request to its origin. |
| 504 | # |
| 505 | # Note: This flag only impacts behavior on Cloudflare. It has no effect when using workerd. |
| 506 | # Under workerd, the config file can control where global `fetch()` goes by configuring the |
| 507 | # worker's `globalOutbound` implicit binding. By default, under workerd, global `fetch()` has |
| 508 | # always been configured to accept publicly-routable internet hosts only; hostnames which map |
| 509 | # to private IP addresses (as defined in e.g. RFC 1918) will be rejected. Thus, workerd has |
| 510 | # always been SSRF-safe by default. |
| 511 | |
| 512 | newModuleRegistry @52 :Bool |
| 513 | $compatEnableFlag("new_module_registry") |
| 514 | $compatDisableFlag("legacy_module_registry") |
| 515 | $experimental; |
| 516 | # Enables of the new module registry implementation. |
| 517 | |
| 518 | cacheOptionEnabled @53 :Bool |
| 519 | $compatEnableFlag("cache_option_enabled") |
| 520 | $compatDisableFlag("cache_option_disabled") |
| 521 | $compatEnableDate("2024-11-11"); |
| 522 | # Enables the use of no-store headers from requests |
| 523 | |
| 524 | kvDirectBinding @54 :Bool |
| 525 | $compatEnableFlag("kv_direct_binding") |
| 526 | $experimental; |
| 527 | # Enables bypassing FL by translating pipeline tunnel configuration to subpipeline. |
| 528 | # This flag is used only by the internal repo and not directly by workerd. |
| 529 | |
| 530 | allowCustomPorts @55 :Bool |
| 531 | $compatEnableFlag("allow_custom_ports") |
| 532 | $compatDisableFlag("ignore_custom_ports") |
| 533 | $compatEnableDate("2024-09-02") |
| 534 | $neededByFl; |
| 535 | # Enables fetching hosts with a custom port from workers. |
| 536 | # For orange clouded sites only standard ports are allowed (https://developers.cloudflare.com/fundamentals/reference/network-ports/#network-ports-compatible-with-cloudflares-proxy). |
| 537 | # For grey clouded sites all ports are allowed. |
| 538 | |
| 539 | increaseWebsocketMessageSize @56 :Bool |
| 540 | $compatEnableFlag("increase_websocket_message_size") |
| 541 | $experimental; |
| 542 | # For local development purposes only, increase the message size limit to 128MB. |
| 543 | # This is not expected ever to be made available in production, as large messages are inefficient. |
| 544 | |
| 545 | internalWritableStreamAbortClearsQueue @57 :Bool |
| 546 | $compatEnableFlag("internal_writable_stream_abort_clears_queue") |
| 547 | $compatDisableFlag("internal_writable_stream_abort_does_not_clear_queue") |
| 548 | $compatEnableDate("2024-09-02"); |
| 549 | # When using the original WritableStream implementation ("internal" streams), the |
| 550 | # abort() operation would be handled lazily, meaning that the queue of pending writes |
| 551 | # would not be cleared until the next time the queue was processed. This behavior leads |
| 552 | # to a situtation where the stream can hang if the consumer stops consuming. When set, |
| 553 | # this flag changes the behavior to clear the queue immediately upon abort. |
| 554 | |
| 555 | pythonWorkersDevPyodide @58 :Bool |
| 556 | $compatEnableFlag("python_workers_development") |
| 557 | $pythonSnapshotRelease |
| 558 | $experimental; |
| 559 | # Enables Python Workers and uses the bundle from the Pyodide source directory directly. For testing only. |
| 560 | # |
| 561 | # Note that the baseline snapshot hash here refers to the one used in |
| 562 | # `baseline-from-gcs.ew-test-bin.c++`. We don't intend to ever load it in production. |
| 563 | |
| 564 | nodeJsZlib @59 :Bool |
| 565 | $compatEnableFlag("nodejs_zlib") |
| 566 | $compatDisableFlag("no_nodejs_zlib") |
| 567 | $impliedByAfterDate(names = ["nodeJsCompat", "nodeJsCompatV2"], date = "2024-09-23"); |
| 568 | # Enables node:zlib implementation while it is in-development. |
| 569 | # Once the node:zlib implementation is complete, this will be automatically enabled when |
| 570 | # nodejs_compat or nodejs_compat_v2 are enabled. |
| 571 | |
| 572 | replicaRouting @60 :Bool |
| 573 | $compatEnableFlag("replica_routing") |
| 574 | $experimental; |
| 575 | # Enables routing to a replica on the client-side. |
| 576 | # Doesn't mean requests *will* be routed to a replica, only that they can be. |
| 577 | |
| 578 | obsolete61 @61 :Bool |
| 579 | $compatEnableFlag("enable_d1_with_sessions_api") |
| 580 | $experimental; |
| 581 | # Was used to enable the withSession(bookmarkOrConstraint) method that allows users |
| 582 | # to use read-replication Sessions API for D1. This is now enabled for everyone. |
| 583 | |
| 584 | handleCrossRequestPromiseResolution @62 :Bool |
| 585 | $compatEnableFlag("handle_cross_request_promise_resolution") |
| 586 | $compatDisableFlag("no_handle_cross_request_promise_resolution") |
| 587 | $compatEnableDate("2024-10-14"); |
| 588 | # Historically, it has been possible to resolve a promise from an incorrect request |
| 589 | # IoContext. This leads to issues with promise continuations being scheduled to run |
| 590 | # in the wrong IoContext leading to errors and difficult to diagnose bugs. With this |
| 591 | # compatibility flag we arrange to have such promise continuations scheduled to run |
| 592 | # in the correct IoContext if it is still alive, or dropped on the floor with a warning |
| 593 | # if the correct IoContext is not still alive. |
| 594 | obsolete63 @63 :Bool |
| 595 | $experimental; |
| 596 | |
| 597 | setToStringTag @64 :Bool |
| 598 | $compatEnableFlag("set_tostring_tag") |
| 599 | $compatDisableFlag("do_not_set_tostring_tag") |
| 600 | $compatEnableDate("2024-09-26"); |
| 601 | # A change was made that set the Symbol.toStringTag on all jsg::Objects in order to |
| 602 | # fix several spec compliance bugs. Unfortunately it turns out that was more breaking |
| 603 | # than expected. This flag restores the original behavior for compat dates before |
| 604 | # 2024-09-26 |
| 605 | |
| 606 | upperCaseAllHttpMethods @65 :Bool |
| 607 | $compatEnableFlag("upper_case_all_http_methods") |
| 608 | $compatDisableFlag("no_upper_case_all_http_methods") |
| 609 | $compatEnableDate("2024-10-14"); |
| 610 | # HTTP methods are expected to be upper-cased. Per the fetch spec, if the methods |
| 611 | # is specified as `get`, `post`, `put`, `delete`, `head`, or `options`, implementations |
| 612 | # are expected to uppercase the method. All other method names would generally be |
| 613 | # expected to throw as unrecognized (e.g. `patch` would be an error while `PATCH` is |
| 614 | # accepted). This is a bit restrictive, even if it is in the spec. This flag modifies |
| 615 | # the behavior to uppercase all methods prior to parsing to that the method is always |
| 616 | # recognized if it is a known method. |
| 617 | |
| 618 | obsolete66 @66 :Bool |
| 619 | $compatEnableFlag("python_external_packages"); |
| 620 | |
| 621 | noTopLevelAwaitInRequire @67 :Bool |
| 622 | $compatEnableFlag("disable_top_level_await_in_require") |
| 623 | $compatDisableFlag("enable_top_level_await_in_require") |
| 624 | $compatEnableDate("2024-12-02"); |
| 625 | # When enabled, use of top-level await syntax in require() calls will be disallowed. |
| 626 | # The ecosystem and runtimes are moving to a state where top level await in modules |
| 627 | # is being strongly discouraged. |
| 628 | |
| 629 | fixupTransformStreamBackpressure @68 :Bool |
| 630 | $compatEnableFlag("fixup-transform-stream-backpressure") |
| 631 | $compatDisableFlag("original-transform-stream-backpressure") |
| 632 | $compatEnableDate("2024-12-16"); |
| 633 | # A bug in the original implementation of TransformStream failed to apply backpressure |
| 634 | # correctly. The fix, however, can break existing implementations that don't account |
| 635 | # for the bug so we need to put the fix behind a compat flag. |
| 636 | |
| 637 | obsolete69 @69 :Bool |
| 638 | $compatEnableFlag("tail_worker_user_spans") |
| 639 | $experimental; |
| 640 | |
| 641 | cacheNoCache @70 :Bool |
| 642 | $compatEnableFlag("cache_no_cache_enabled") |
| 643 | $compatDisableFlag("cache_no_cache_disabled") |
| 644 | $impliedByAfterDate(name = "cacheOptionEnabled", date = "2025-08-07"); |
| 645 | # Enables the use of cache: no-cache in the fetch api. |
| 646 | |
| 647 | pythonWorkers20250116 @71 :Bool |
| 648 | $compatEnableFlag("python_workers_20250116") |
| 649 | $compatDisableFlag("no_python_workers_20250116") |
| 650 | $impliedByAfterDate(name = "pythonWorkers", date = "2025-09-29") |
| 651 | $pythonSnapshotRelease; |
| 652 | |
| 653 | requestCfOverridesCacheRules @72 :Bool |
| 654 | $compatEnableFlag("request_cf_overrides_cache_rules") |
| 655 | $compatDisableFlag("no_request_cf_overrides_cache_rules") |
| 656 | $compatEnableDate("2025-04-02") |
| 657 | $neededByFl; |
| 658 | # Enables cache settings specified request in fetch api cf object to override cache rules. (only for user owned or grey-clouded sites) |
| 659 | |
| 660 | memoryCacheDelete @73 :Bool |
| 661 | $compatEnableFlag("memory_cache_delete") |
| 662 | $experimental; |
| 663 | # Enables delete operations on memory cache if enabled. |
| 664 | |
| 665 | obsolete74 @74: Bool |
| 666 | $compatEnableFlag("unique_ctx_per_invocation") |
| 667 | $compatEnableDate("2025-03-10"); |
| 668 | # Creates a unique ExportedHandler for each call to `export default` thus allowing a unique ctx |
| 669 | # per invocation. |
| 670 | # |
| 671 | # OBSOLETE: We decided to apply this change even to old workers as we've found some old workers |
| 672 | # that assumed this behavior all along, and so this change actually fixes bugs for them. |
| 673 | # It seems unlikely to break anyone because there's no way a Worker could depend on any two |
| 674 | # requests hitting the same isolate, so how could they depend on any two requests having the |
| 675 | # same `ctx` object? At worst they might store some sort of cache on it which becomes |
| 676 | # ineffective, but their Worker would still work, and anyway this would be a very weird thing |
| 677 | # for someone to do. |
| 678 | |
| 679 | reuseCtxAcrossNonclassEvents @92: Bool |
| 680 | $compatEnableFlag("nonclass_entrypoint_reuses_ctx_across_invocations"); |
| 681 | # Just in case someone somewhere somehow actually relied on every event receiving the same `ctx` |
| 682 | # object, this restores the original behavior. We do not recommend this. |
| 683 | |
| 684 | queueConsumerNoWaitForWaitUntil @75 :Bool |
| 685 | $compatEnableFlag("queue_consumer_no_wait_for_wait_until") |
| 686 | $compatDisableFlag("queue_consumer_wait_for_wait_until"); |
| 687 | # If enabled, does not require all waitUntil'ed promises to resolve successfully before reporting |
| 688 | # succeeded/failed messages/batches back from a queue consumer to the Queues service. This |
| 689 | # prevents a slow waitUntil'ed promise from slowing down consumption of messages from a queue, |
| 690 | # which has been a recurring problem for the prior behavior (which did wait for all waitUntil'ed |
| 691 | # tasks to complete. |
| 692 | # This intentionally doesn't have a compatEnableDate yet until so we can let some users opt-in to |
| 693 | # try it before enabling it for all new scripts, but will eventually need one. |
| 694 | |
| 695 | populateProcessEnv @76 :Bool |
| 696 | $compatEnableFlag("nodejs_compat_populate_process_env") |
| 697 | $compatDisableFlag("nodejs_compat_do_not_populate_process_env") |
| 698 | $impliedByAfterDate(name = "nodeJsCompat", date = "2025-04-01"); |
| 699 | # Automatically populate process.env from text bindings only |
| 700 | # when nodejs_compat is being used. |
| 701 | |
| 702 | cacheApiRequestCfOverridesCacheRules @77 :Bool |
| 703 | $compatEnableFlag("cache_api_request_cf_overrides_cache_rules") |
| 704 | $compatDisableFlag("no_cache_api_request_cf_overrides_cache_rules") |
| 705 | $compatEnableDate("2025-05-19") |
| 706 | $neededByFl; |
| 707 | # Enables cache settings specified request in cache api cf object to override cache rules. (only for user owned or grey-clouded sites) |
| 708 | |
| 709 | disableImportableEnv @78 :Bool |
| 710 | $compatEnableFlag("disallow_importable_env") |
| 711 | $compatDisableFlag("allow_importable_env"); |
| 712 | # When allowed, `import { env, exports } from 'cloudflare:workers'` will provide access |
| 713 | # to the per-request environment/bindings. This flag also disables importable exports |
| 714 | # (the exports proxy) since both features are conceptually related. |
| 715 | |
| 716 | assetsSecFetchModeNavigateHeaderPrefersAssetServing @79 :Bool |
| 717 | $compatEnableFlag("assets_navigation_prefers_asset_serving") |
| 718 | $compatDisableFlag("assets_navigation_has_no_effect") |
| 719 | $compatEnableDate("2025-04-01"); |
| 720 | # Enables routing to asset-worker over a user worker when an appropriate |
| 721 | # `assets.not_found_handling` configuration option is set and `Sec-Fetch-Mode: navigate` header |
| 722 | # is present. This flag is used only by @cloudflare/workers-shared (within workers-sdk) and not |
| 723 | # directly by workerd. |
| 724 | |
| 725 | cacheApiCompatFlags @80 :Bool |
| 726 | $compatEnableFlag("cache_api_compat_flags") |
| 727 | $compatDisableFlag("no_cache_api_compat_flags") |
| 728 | $compatEnableDate("2025-04-19"); |
| 729 | # when enabled, exports compability flags for FL to Cache API requests. |
| 730 | |
| 731 | obsolete81 @81 :Bool |
| 732 | $compatEnableFlag("python_workers_durable_objects") |
| 733 | $experimental; |
| 734 | # when enabled, enables Durable Object support for Python Workers. |
| 735 | |
| 736 | obsolete82 @82 :Bool |
| 737 | $compatEnableFlag("streaming_tail_worker") |
| 738 | $experimental; |
| 739 | # Obsolete flag. Has no effect. |
| 740 | |
| 741 | specCompliantUrlpattern @83 :Bool |
| 742 | $compatEnableFlag("urlpattern_standard") |
| 743 | $compatEnableDate("2025-05-01") |
| 744 | $compatDisableFlag("urlpattern_original"); |
| 745 | # The original URLPattern implementation is not compliant with the |
| 746 | # WHATWG URLPattern Standard, leading to a number of issues reported by users. Unfortunately, |
| 747 | # making it spec compliant is a breaking change. This flag controls the availability |
| 748 | # of the new spec-compliant URLPattern implementation. |
| 749 | |
| 750 | jsWeakRef @84 :Bool |
| 751 | $compatEnableFlag("enable_weak_ref") |
| 752 | $compatEnableDate("2025-05-05") |
| 753 | $compatDisableFlag("disable_weak_ref"); |
| 754 | # Enables WeakRefs and FinalizationRegistry API. |
| 755 | # WebAssembly based projects often rely on this API for wasm memory cleanup |
| 756 | |
| 757 | requestSignalPassthrough @85 :Bool |
| 758 | $compatEnableFlag("request_signal_passthrough") |
| 759 | $compatDisableFlag("no_request_signal_passthrough"); |
| 760 | # When enabled, the AbortSignal of the incoming request is not passed through to subrequests. |
| 761 | # As a result, outgoing subrequests will not be cancelled when the incoming request is. |
| 762 | |
| 763 | enableNavigatorLanguage @86 :Bool |
| 764 | $compatEnableFlag("enable_navigator_language") |
| 765 | $compatEnableDate("2025-05-19") |
| 766 | $compatDisableFlag("disable_navigator_language"); |
| 767 | # Enables Navigator.language API. |
| 768 | |
| 769 | webFileSystem @87 :Bool |
| 770 | $compatEnableFlag("enable_web_file_system") |
| 771 | $experimental; |
| 772 | # Enables the experimental Web File System API. |
| 773 | # WARNING: This API is still in development and may change or be removed in the future. |
| 774 | |
| 775 | abortSignalRpc @88 :Bool |
| 776 | $compatEnableFlag("enable_abortsignal_rpc") |
| 777 | $experimental; |
| 778 | # Enables experimental support for passing AbortSignal over RPC. |
| 779 | |
| 780 | allowEvalDuringStartup @89 :Bool |
| 781 | $compatEnableFlag("allow_eval_during_startup") |
| 782 | $compatEnableDate("2025-06-01") |
| 783 | $compatDisableFlag("disallow_eval_during_startup"); |
| 784 | # Enables eval() and new Function() during startup. |
| 785 | |
| 786 | enableRequestSignal @90 :Bool |
| 787 | $compatEnableFlag("enable_request_signal") |
| 788 | $compatDisableFlag("disable_request_signal"); |
| 789 | # Enables Request.signal for incoming requests. |
| 790 | # This feature is still experimental and the compat flag has no default enable date. |
| 791 | |
| 792 | connectPassThrough @91 :Bool |
| 793 | $compatEnableFlag("connect_pass_through") |
| 794 | $experimental; |
| 795 | # Causes the Worker to handle incoming connect events by simply passing them through to the |
| 796 | # Worker's globalOutbound (typically, the internet). |
| 797 | # |
| 798 | # As of this writing, Workers cannot yet receive raw socket connections, because no API has been |
| 799 | # defined for doing so. But a Worker can be configured to be the `globalOutbound` for another |
| 800 | # Worker, causing the first Worker to intercept all outbound network requests that the second |
| 801 | # Worker makes by calling `fetch()` or `connect()`. Since there's no way for the first Worker |
| 802 | # to actually handle the `connect()` requests, this implies the second Worker cannot make any |
| 803 | # raw TCP connections in this configuration. This is intended: often, the first Worker |
| 804 | # implements some sort of security rules governing what kinds of requests the second Worker can |
| 805 | # send to the internet, and if `connect()` requests were allowed to go directly to the internet, |
| 806 | # that could be used to bypass said security checks. |
| 807 | # |
| 808 | # However, sometimes outbound workers are used for reasons other than security, and in fact the |
| 809 | # outbound Worker does not really care to block `connect()` requests. Until such a time as we |
| 810 | # create an actual API for proxying connections, such outbound workers can set this compat flag |
| 811 | # to opt into allowing connect requests to pass through. |
| 812 | |
| 813 | # NOTE: `reuseCtxAcrossNonclassEvents @92` was declared earlier in the file. Next ordinal is |
| 814 | # @93. |
| 815 | |
| 816 | bindAsyncLocalStorageSnapshot @93 :Bool |
| 817 | $compatEnableFlag("bind_asynclocalstorage_snapshot_to_request") |
| 818 | $compatDisableFlag("do_not_bind_asynclocalstorage_snapshot_to-request") |
| 819 | $compatEnableDate("2025-06-16"); |
| 820 | # The AsyncLocalStorage frame can capture values that are bound to the |
| 821 | # current IoContext. This is not always in the users control since we use |
| 822 | # the ALS storage frame to propagate internal trace spans as well as |
| 823 | # user-provided values. This flag, when set, binds the snapshot / bound |
| 824 | # functions to the current IoContext and will throw an error if the bound |
| 825 | # functions are called outside of the IoContext in which they were created. |
| 826 | |
| 827 | throwOnUnrecognizedImportAssertion @94 :Bool |
| 828 | $compatEnableFlag("throw_on_unrecognized_import_assertion") |
| 829 | $compatDisableFlag("ignore_unrecognized_import_assertion") |
| 830 | $compatEnableDate("2025-06-16"); |
| 831 | # In the original module registry implementation, import attributes that are not recognized |
| 832 | # would be ignored. This is not compliant with the spec which strongly recommends that runtimes |
| 833 | # throw an error when unknown import attributes are encountered. In the new module registry |
| 834 | # implementation the recommended behavior is what is implemented. With this compat flag |
| 835 | # enabled, the original module registry implementation will follow the recommended behavior. |
| 836 | |
| 837 | pythonWorkflows @95 :Bool |
| 838 | $compatEnableFlag("python_workflows") |
| 839 | $compatDisableFlag("disable_python_workflows") |
| 840 | $impliedByAfterDate(name = "pythonWorkers", date = "2025-09-20"); |
| 841 | # Enables support for Python workflows. |
| 842 | # This is still in development and may change in the future. |
| 843 | |
| 844 | unsupportedProcessActualPlatform @96 :Bool |
| 845 | $compatEnableFlag("unsupported_process_actual_platform") |
| 846 | $experimental; |
| 847 | # By default, Workerd will always expose "linux" as the process.platform. |
| 848 | # This flag enables support for process.platform to expose the actual system platform. |
| 849 | # This is unsupported, as this feature will never ever be supported as non-experimental and is a |
| 850 | # temporary WPT test path only. |
| 851 | |
| 852 | enableNodeJsProcessV2 @97 :Bool |
| 853 | $compatEnableFlag("enable_nodejs_process_v2") |
| 854 | $compatDisableFlag("disable_nodejs_process_v2") |
| 855 | $impliedByAfterDate(name = "nodeJsCompat", date="2025-09-15"); |
| 856 | # Switches from the partial process implementation with only "nextTick", "env", "exit", |
| 857 | # "getBuiltinModule", "platform" and "features" property implementations, to the full-featured |
| 858 | # Node.js-compatibile process implementation with all process properties either stubbed or |
| 859 | # implemented. It is required to use this flag with nodejs_compat (or nodejs_compat_v2). |
| 860 | |
| 861 | setEventTargetThis @98 :Bool |
| 862 | $compatEnableFlag("set_event_target_this") |
| 863 | $compatDisableFlag("no_set_event_target_this") |
| 864 | $compatEnableDate("2025-08-01"); |
| 865 | # The original implementation of EventTarget was not correctly setting the `this` value |
| 866 | # for event handlers. This flag enables the correct behavior, which is compliant with the spec. |
| 867 | |
| 868 | enableForwardableEmailFullHeaders @99 :Bool |
| 869 | $compatEnableFlag("set_forwardable_email_full_headers") |
| 870 | $compatDisableFlag("set_forwardable_email_single_headers") |
| 871 | $compatEnableDate("2025-08-01"); |
| 872 | # The original version of the headers sent to edgeworker were truncated to a single |
| 873 | # value for specific header names, such as To and Cc. With this compat flag we will send |
| 874 | # the full header values to the worker script. |
| 875 | |
| 876 | enableNodejsHttpModules @100 :Bool |
| 877 | $compatEnableFlag("enable_nodejs_http_modules") |
| 878 | $compatDisableFlag("disable_nodejs_http_modules") |
| 879 | $impliedByAfterDate(name = "nodeJsCompat", date = "2025-08-15"); |
| 880 | # Enables Node.js http related modules such as node:http and node:https |
| 881 | |
| 882 | pedanticWpt @101 :Bool |
| 883 | $compatEnableFlag("pedantic_wpt") |
| 884 | $compatDisableFlag("non_pedantic_wpt"); |
| 885 | # Enables a "pedantic mode" for WPT compliance. Multiple changes are grouped under |
| 886 | # this flag that are known to be required to pass more web platform tests but which |
| 887 | # otherwise are likely not to be strictly necessary for most users. |
| 888 | |
| 889 | exposeGlobalMessageChannel @102 :Bool |
| 890 | $compatEnableFlag("expose_global_message_channel") |
| 891 | $compatDisableFlag("no_expose_global_message_channel") |
| 892 | $compatEnableDate("2025-08-15"); |
| 893 | # Enables exposure of the MessagePort and MessageChannel classes on the global scope. |
| 894 | |
| 895 | enableNodejsHttpServerModules @103 :Bool |
| 896 | $compatEnableFlag("enable_nodejs_http_server_modules") |
| 897 | $compatDisableFlag("disable_nodejs_http_server_modules") |
| 898 | $impliedByAfterDate(name = "enableNodejsHttpModules", date = "2025-09-01"); |
| 899 | # Enables Node.js http server related modules such as node:_http_server |
| 900 | # It is required to use this flag with `enable_nodejs_http_modules` since |
| 901 | # it enables the usage of http related node.js modules, and this flag enables |
| 902 | # the methods exposed by the node.js http modules. |
| 903 | # Regarding the recommendation for using import { env, waitUntil } from 'cloudflare:workers'; |
| 904 | # `disallow_importable_env` compat flag should not be set if you are using this |
| 905 | # and need access to the env since that will prevent access. |
| 906 | |
| 907 | pythonNoGlobalHandlers @104 :Bool |
| 908 | $compatEnableFlag("python_no_global_handlers") |
| 909 | $compatDisableFlag("disable_python_no_global_handlers") |
| 910 | $compatEnableDate("2025-08-14"); |
| 911 | # Disables the global handlers for Python workers and enforces their use via default entrypoint |
| 912 | # classes. |
| 913 | |
| 914 | enableNodeJsFsModule @105 :Bool |
| 915 | $compatEnableFlag("enable_nodejs_fs_module") |
| 916 | $compatDisableFlag("disable_nodejs_fs_module") |
| 917 | $impliedByAfterDate(name = "nodeJsCompat", date = "2025-09-15"); |
| 918 | # Enables the Node.js fs module. It is required to use this flag with |
| 919 | # nodejs_compat (or nodejs_compat_v2). |
| 920 | |
| 921 | enableNodeJsOsModule @106 :Bool |
| 922 | $compatEnableFlag("enable_nodejs_os_module") |
| 923 | $compatDisableFlag("disable_nodejs_os_module") |
| 924 | $impliedByAfterDate(name = "nodeJsCompat", date = "2025-09-15"); |
| 925 | # Enables the Node.js os module. It is required to use this flag with |
| 926 | # nodejs_compat (or nodejs_compat_v2). |
| 927 | |
| 928 | pythonWorkersForceNewVendorPath @107 :Bool |
| 929 | $compatEnableFlag("python_workers_force_new_vendor_path") |
| 930 | $compatEnableDate("2025-08-11"); |
| 931 | # Disables adding `/session/metadata/vendor` to the Python Worker's sys.path. So Workers using |
| 932 | # this flag will have to place their vendored modules in a `python_modules` directory. |
| 933 | |
| 934 | removeNodejsCompatEOL @108 :Bool |
| 935 | $compatEnableFlag("remove_nodejs_compat_eol") |
| 936 | $compatDisableFlag("add_nodejs_compat_eol") |
| 937 | $impliedByAfterDate(name = "nodeJsCompat", date = "2025-09-01"); |
| 938 | # Removes the Node.js compatibility layer for EOL versions of Node.js. |
| 939 | # When the flag is enabled, APIs that have reached End-of-Life in Node.js |
| 940 | # will be removed for workers. When disabled, the APIs are present (but |
| 941 | # might still be non-functional stubs) |
| 942 | # This flag is intended to be a roll-up flag. That is, as additional APIs |
| 943 | # reach EOL, new compat flags will be added for those that will have |
| 944 | # `impliedByAfterDate(name = "removeNodeJsCompatEOL", ...` annotations. |
| 945 | |
| 946 | enableWorkflowScriptValidation @109 :Bool |
| 947 | $compatEnableFlag("enable_validate_workflow_entrypoint") |
| 948 | $compatDisableFlag("disable_validate_workflow_entrypoint") |
| 949 | $compatEnableDate("2025-09-20"); |
| 950 | # This flag enables additional checks in the control plane to validate that workflows are |
| 951 | # defined and used correctly |
| 952 | |
| 953 | pythonDedicatedSnapshot @110 :Bool |
| 954 | $compatEnableFlag("python_dedicated_snapshot") |
| 955 | $compatDisableFlag("disable_python_dedicated_snapshot") |
| 956 | $impliedByAfterDate(name = "pythonWorkers20250116", date = "2025-10-16"); |
| 957 | # Enables the generation of dedicated snapshots on Python Worker upload. The snapshot will be |
| 958 | # stored inside the resulting WorkerBundle of the Worker. The snapshot will be taken after the |
| 959 | # top-level execution of the Worker. |
| 960 | |
| 961 | typescriptStripTypes @111 :Bool |
| 962 | $compatEnableFlag("typescript_strip_types") |
| 963 | $experimental; |
| 964 | # Strips all Typescript types from loaded files. |
| 965 | # If loaded files contain unsupported typescript construct beyond type annotations (e.g. enums), |
| 966 | # or is not a syntactically valid Typescript, the worker will fail to load. |
| 967 | |
| 968 | enableNodeJsHttp2Module @112 :Bool |
| 969 | $compatEnableFlag("enable_nodejs_http2_module") |
| 970 | $compatDisableFlag("disable_nodejs_http2_module") |
| 971 | $impliedByAfterDate(name = "nodeJsCompat", date = "2025-09-01"); |
| 972 | # Enables the Node.js http2 module stubs. |
| 973 | |
| 974 | experimentalAllowEvalAlways @113 :Bool |
| 975 | $compatEnableFlag("allow_insecure_inefficient_logged_eval") |
| 976 | $experimental; |
| 977 | # Enables eval() and new Function() always, even during request handling. |
| 978 | # ***This flag should *never* be enabled by default.*** |
| 979 | # The name of the enable flag is intentionally long and scary-sounding to |
| 980 | # discourage casual use. |
| 981 | # * "insecure" because code-gen during request handling can lead to security issues. |
| 982 | # * "inefficient" because repeated code-gen during request handling can be slow. |
| 983 | # * "logged" because each use would likely be logged in production for security |
| 984 | # auditing so users should avoid including PII and other sensitive data in dynamically |
| 985 | # generated and evaluated code. |
| 986 | # This flag is experimental and may be removed in the future. It is added for |
| 987 | # testing purposes. |
| 988 | |
| 989 | stripAuthorizationOnCrossOriginRedirect @114 :Bool |
| 990 | $compatEnableFlag("strip_authorization_on_cross_origin_redirect") |
| 991 | $compatDisableFlag("retain_authorization_on_cross_origin_redirect") |
| 992 | $compatEnableDate("2025-09-01"); |
| 993 | # This flag specifies that when automatic redirects are enabled, and a redirect points to a URL |
| 994 | # at a different origin, if the original request contained an Authorization header, that header |
| 995 | # is removed before following the redirect. This behavior is required by the current version of |
| 996 | # the Fetch API specification. |
| 997 | # |
| 998 | # This requirement was added to the Fetch spec in 2022, well after Cloudflare Workers |
| 999 | # originally implemented it. Hence, Workers did not originally implement this requirement. This |
| 1000 | # requirement is backwards-incompatible, and so the new behavior is guarded by a compatibility |
| 1001 | # flag. |
| 1002 | # |
| 1003 | # Note that the old behavior was not inherently insecure, and indeed could be desirable in many |
| 1004 | # circumstances. For example, if an API that requires authorization wishes to change its |
| 1005 | # hostname, it might wish to redirect to the new hostname while having the client send along |
| 1006 | # their credentials. Under the new fetch behavior, such a redirect will break clients, and this |
| 1007 | # has legitimately broken real use cases. However, it's true that the old behavior could be a |
| 1008 | # "gotcha" leading to security problems when combined with other mistakes. Hence, the spec was |
| 1009 | # changed, and Workers must follow the spec. |
| 1010 | |
| 1011 | enhancedErrorSerialization @115 :Bool |
| 1012 | $compatEnableFlag("enhanced_error_serialization") |
| 1013 | $compatDisableFlag("legacy_error_serialization") |
| 1014 | $compatEnableDate("2026-04-21"); |
| 1015 | # Enables enhanced error serialization for errors serialized using structuredClone / |
| 1016 | # v8 serialization. More error types are supported, and own properties are included. |
| 1017 | # Note that when enabled, deserialization of the errors will not preserve the original |
| 1018 | # stack by default. |
| 1019 | |
| 1020 | emailSendingQueuing @116 :Bool |
| 1021 | $compatEnableFlag("enable_email_sending_queuing") |
| 1022 | $compatDisableFlag("disable_email_sending_queuing"); |
| 1023 | # Enables Queuing on the `.send(message: EmailMessage)` function on send_email binding if there's |
| 1024 | # a temporary error on email delivery. |
| 1025 | # Note that by enabling this, user-provided Message-IDs are stripped and |
| 1026 | # Email Workers will generate and use its own. |
| 1027 | |
| 1028 | removeNodejsCompatEOLv22 @117 :Bool |
| 1029 | $compatEnableFlag("remove_nodejs_compat_eol_v22") |
| 1030 | $compatDisableFlag("add_nodejs_compat_eol_v22") |
| 1031 | $impliedByAfterDate(name = "removeNodejsCompatEOL", date = "2027-04-30"); |
| 1032 | # Removes APIs that reached end-of-life in Node.js 22.x. When using the |
| 1033 | # removeNodejsCompatEOL flag, this will default enable on/after 2027-04-30. |
| 1034 | |
| 1035 | removeNodejsCompatEOLv23 @118 :Bool |
| 1036 | $compatEnableFlag("remove_nodejs_compat_eol_v23") |
| 1037 | $compatDisableFlag("add_nodejs_compat_eol_v23") |
| 1038 | $impliedByAfterDate(name = "removeNodejsCompatEOLv24", date = "2025-09-01"); |
| 1039 | # Removes APIs that reached end-of-life in Node.js 23.x. This will default |
| 1040 | # enable when the removeNodejsCompatEOLv24 flag is enabled after 2025-09-01. |
| 1041 | # Went EOL on 2025-06-01 |
| 1042 | |
| 1043 | removeNodejsCompatEOLv24 @119 :Bool |
| 1044 | $compatEnableFlag("remove_nodejs_compat_eol_v24") |
| 1045 | $compatDisableFlag("add_nodejs_compat_eol_v24") |
| 1046 | $impliedByAfterDate(name = "removeNodejsCompatEOL", date = "2028-04-30"); |
| 1047 | # Removes APIs that reached end-of-life in Node.js 24.x. When using the |
| 1048 | # removeNodejsCompatEOL flag, this will default enable on/after 2028-04-30. |
| 1049 | |
| 1050 | enableNodeJsConsoleModule @120 :Bool |
| 1051 | $compatEnableFlag("enable_nodejs_console_module") |
| 1052 | $compatDisableFlag("disable_nodejs_console_module") |
| 1053 | $impliedByAfterDate(name = "nodeJsCompat", date = "2025-09-21"); |
| 1054 | # Enables the Node.js console module. It is required to use this flag with |
| 1055 | # nodejs_compat (or nodejs_compat_v2). |
| 1056 | |
| 1057 | enableNodeJsVmModule @121 :Bool |
| 1058 | $compatEnableFlag("enable_nodejs_vm_module") |
| 1059 | $compatDisableFlag("disable_nodejs_vm_module") |
| 1060 | $impliedByAfterDate(name = "nodeJsCompat", date = "2025-10-01"); |
| 1061 | # Enables the Node.js non-functional stub vm module. It is required to use this flag with |
| 1062 | # nodejs_compat (or nodejs_compat_v2). |
| 1063 | |
| 1064 | enableNodeJsPerfHooksModule @122 :Bool |
| 1065 | $compatEnableFlag("enable_nodejs_perf_hooks_module") |
| 1066 | $compatDisableFlag("disable_nodejs_perf_hooks_module") |
| 1067 | $impliedByAfterDate(name = "nodeJsCompat", date = "2026-03-17"); |
| 1068 | # Enables the Node.js perf_hooks module. It is required to use this flag with |
| 1069 | # nodejs_compat (or nodejs_compat_v2). This flag also implicitly enables the |
| 1070 | # global Performance classes (PerformanceEntry, PerformanceMark, etc.). |
| 1071 | |
| 1072 | enableGlobalPerformanceClasses @123 :Bool |
| 1073 | $compatEnableFlag("enable_global_performance_classes") |
| 1074 | $compatDisableFlag("disable_global_performance_classes") |
| 1075 | $impliedByAfterDate(name = "nodeJsCompat", date = "2026-03-17"); |
| 1076 | # Enables PerformanceEntry, PerformanceMark, PerformanceMeasure, PerformanceResourceTiming, |
| 1077 | # PerformanceObserver and PerformanceObserverEntryList global classes. |
| 1078 | # These are also implicitly enabled by enableNodeJsPerfHooksModule. |
| 1079 | |
| 1080 | enableNodeJsDomainModule @124 :Bool |
| 1081 | $compatEnableFlag("enable_nodejs_domain_module") |
| 1082 | $compatDisableFlag("disable_nodejs_domain_module") |
| 1083 | $impliedByAfterDate(name = "nodeJsCompat", date = "2025-12-04"); |
| 1084 | # Enables the Node.js non-functional stub domain module. It is required to use this flag with |
| 1085 | # nodejs_compat (or nodejs_compat_v2). |
| 1086 | |
| 1087 | enableNodeJsV8Module @125 :Bool |
| 1088 | $compatEnableFlag("enable_nodejs_v8_module") |
| 1089 | $compatDisableFlag("disable_nodejs_v8_module") |
| 1090 | $impliedByAfterDate(name = "nodeJsCompat", date = "2026-03-17"); |
| 1091 | # Enables the Node.js non-functional stub v8 module. It is required to use this flag with |
| 1092 | # nodejs_compat (or nodejs_compat_v2). |
| 1093 | |
| 1094 | enableNodeJsTtyModule @126 :Bool |
| 1095 | $compatEnableFlag("enable_nodejs_tty_module") |
| 1096 | $compatDisableFlag("disable_nodejs_tty_module") |
| 1097 | $impliedByAfterDate(name = "nodeJsCompat", date = "2026-03-17"); |
| 1098 | # Enables the Node.js non-functional stub tty module. It is required to use this flag with |
| 1099 | # nodejs_compat (or nodejs_compat_v2). |
| 1100 | |
| 1101 | enableNodeJsPunycodeModule @127 :Bool |
| 1102 | $compatEnableFlag("enable_nodejs_punycode_module") |
| 1103 | $compatDisableFlag("disable_nodejs_punycode_module") |
| 1104 | $impliedByAfterDate(name = "nodeJsCompat", date = "2025-12-04"); |
| 1105 | # Enables the Node.js deprecated punycode module. It is required to use this flag with |
| 1106 | # nodejs_compat (or nodejs_compat_v2). |
| 1107 | |
| 1108 | enableNodeJsClusterModule @128 :Bool |
| 1109 | $compatEnableFlag("enable_nodejs_cluster_module") |
| 1110 | $compatDisableFlag("disable_nodejs_cluster_module") |
| 1111 | $impliedByAfterDate(name = "nodeJsCompat", date = "2025-12-04"); |
| 1112 | # Enables the Node.js non-functional stub cluster module. It is required to use this flag with |
| 1113 | # nodejs_compat (or nodejs_compat_v2). |
| 1114 | |
| 1115 | enableNodeJsChildProcessModule @129 :Bool |
| 1116 | $compatEnableFlag("enable_nodejs_child_process_module") |
| 1117 | $compatDisableFlag("disable_nodejs_child_process_module") |
| 1118 | $impliedByAfterDate(name = "nodeJsCompat", date = "2026-03-17"); |
| 1119 | # Enables the Node.js non-functional stub child_process module. It is required to use this |
| 1120 | # flag with nodejs_compat (or nodejs_compat_v2). |
| 1121 | |
| 1122 | enableNodeJsWorkerThreadsModule @130 :Bool |
| 1123 | $compatEnableFlag("enable_nodejs_worker_threads_module") |
| 1124 | $compatDisableFlag("disable_nodejs_worker_threads_module") |
| 1125 | $impliedByAfterDate(name = "nodeJsCompat", date = "2026-03-17"); |
| 1126 | # Enables the Node.js non-functional stub worker_threads module. It is required to use this |
| 1127 | # flag with nodejs_compat (or nodejs_compat_v2). |
| 1128 | |
| 1129 | enableNodeJsStreamWrapModule @131 :Bool |
| 1130 | $compatEnableFlag("enable_nodejs_stream_wrap_module") |
| 1131 | $compatDisableFlag("disable_nodejs_stream_wrap_module") |
| 1132 | $impliedByAfterDate(name = "nodeJsCompat", date = "2026-01-29"); |
| 1133 | # Enables the Node.js non-functional stub _stream_wrap module. It is required to use this |
| 1134 | # flag with nodejs_compat (or nodejs_compat_v2). |
| 1135 | |
| 1136 | enableNodeJsWasiModule @132 :Bool |
| 1137 | $compatEnableFlag("enable_nodejs_wasi_module") |
| 1138 | $compatDisableFlag("disable_nodejs_wasi_module") |
| 1139 | $impliedByAfterDate(name = "nodeJsCompat", date = "2025-12-04"); |
| 1140 | # Enables the Node.js non-functional stub wasi module. It is required to use this |
| 1141 | # flag with nodejs_compat (or nodejs_compat_v2). |
| 1142 | |
| 1143 | enableNodeJsDgramModule @133 :Bool |
| 1144 | $compatEnableFlag("enable_nodejs_dgram_module") |
| 1145 | $compatDisableFlag("disable_nodejs_dgram_module") |
| 1146 | $impliedByAfterDate(name = "nodeJsCompat", date = "2026-01-29"); |
| 1147 | # Enables the Node.js non-functional stub dgram module. It is required to use this |
| 1148 | # flag with nodejs_compat (or nodejs_compat_v2). |
| 1149 | |
| 1150 | enableNodeJsInspectorModule @134 :Bool |
| 1151 | $compatEnableFlag("enable_nodejs_inspector_module") |
| 1152 | $compatDisableFlag("disable_nodejs_inspector_module") |
| 1153 | $impliedByAfterDate(name = "nodeJsCompat", date = "2026-01-29"); |
| 1154 | # Enables the Node.js non-functional stub inspector module. It is required to use this |
| 1155 | # flag with nodejs_compat (or nodejs_compat_v2). |
| 1156 | |
| 1157 | enableNodeJsTraceEventsModule @135 :Bool |
| 1158 | $compatEnableFlag("enable_nodejs_trace_events_module") |
| 1159 | $compatDisableFlag("disable_nodejs_trace_events_module") |
| 1160 | $impliedByAfterDate(name = "nodeJsCompat", date = "2025-12-04"); |
| 1161 | # Enables the Node.js non-functional stub trace_events module. It is required to use this |
| 1162 | # flag with nodejs_compat (or nodejs_compat_v2). |
| 1163 | |
| 1164 | enableNodeJsReadlineModule @136 :Bool |
| 1165 | $compatEnableFlag("enable_nodejs_readline_module") |
| 1166 | $compatDisableFlag("disable_nodejs_readline_module") |
| 1167 | $impliedByAfterDate(name = "nodeJsCompat", date = "2026-03-17"); |
| 1168 | # Enables the Node.js non-functional stub readline module. It is required to use this |
| 1169 | # flag with nodejs_compat (or nodejs_compat_v2). |
| 1170 | |
| 1171 | enableNodeJsReplModule @137 :Bool |
| 1172 | $compatEnableFlag("enable_nodejs_repl_module") |
| 1173 | $compatDisableFlag("disable_nodejs_repl_module") |
| 1174 | $impliedByAfterDate(name = "nodeJsCompat", date = "2026-03-17"); |
| 1175 | # Enables the Node.js non-functional stub repl module. It is required to use this |
| 1176 | # flag with nodejs_compat (or nodejs_compat_v2). |
| 1177 | |
| 1178 | enableNodeJsSqliteModule @138 :Bool |
| 1179 | $compatEnableFlag("enable_nodejs_sqlite_module") |
| 1180 | $compatDisableFlag("disable_nodejs_sqlite_module") |
| 1181 | $impliedByAfterDate(name = "nodeJsCompat", date = "2026-01-29"); |
| 1182 | # Enables the Node.js non-functional stub sqlite module. It is required to use this |
| 1183 | # flag with nodejs_compat (or nodejs_compat_v2). |
| 1184 | |
| 1185 | enableCtxExports @139 :Bool |
| 1186 | $compatEnableFlag("enable_ctx_exports") |
| 1187 | $compatDisableFlag("disable_ctx_exports") |
| 1188 | $compatEnableDate("2025-11-17"); |
| 1189 | # Enable the ctx.exports API. |
| 1190 | |
| 1191 | pythonExternalSDK @140 :Bool |
| 1192 | $compatEnableFlag("enable_python_external_sdk") |
| 1193 | $compatDisableFlag("disable_python_external_sdk") |
| 1194 | $compatEnableDate("2026-04-21"); |
| 1195 | # Don't include the Python sdk from the runtime, use a vendored copy. |
| 1196 | |
| 1197 | fastJsgStruct @141 :Bool |
| 1198 | $compatEnableFlag("enable_fast_jsg_struct") |
| 1199 | $compatDisableFlag("disable_fast_jsg_struct") |
| 1200 | $compatEnableDate("2025-12-03"); |
| 1201 | # Enables the fast jsg::Struct optimization. With this enabled, JSG_STRUCTS |
| 1202 | # will use a more efficient creation pattern that reduces construction time. |
| 1203 | # However, optional fields will be explicitly set to undefined rather than |
| 1204 | # being omitted, which is an observable behavior change. |
| 1205 | |
| 1206 | cacheReload @142 :Bool |
| 1207 | $compatEnableFlag("cache_reload_enabled") |
| 1208 | $compatDisableFlag("cache_reload_disabled") |
| 1209 | $experimental; |
| 1210 | # Enables the use of cache: reload in the fetch api. |
| 1211 | |
| 1212 | streamsNodejsV24Compat @143 :Bool |
| 1213 | $compatEnableFlag("enable_streams_nodejs_v24_compat") |
| 1214 | $compatDisableFlag("disable_streams_nodejs_v24_compat"); |
| 1215 | # Enables breaking changes to Node.js streams done with the release of Node.js v24. |
| 1216 | |
| 1217 | pythonCheckRngState @144 : Bool |
| 1218 | $compatEnableFlag("python_check_rng_state") |
| 1219 | $compatDisableFlag("disable_python_check_rng_state") |
| 1220 | $impliedByAfterDate(name = "pythonWorkers", date = "2025-12-16"); |
| 1221 | |
| 1222 | shouldSetImmutablePrototype @145 :Bool |
| 1223 | $compatEnableFlag("immutable_api_prototypes") |
| 1224 | $compatDisableFlag("mutable_api_prototypes"); |
| 1225 | # When set, tells JSG to make the prototype of all jsg::Objects immutable. |
| 1226 | # TODO(soon): Add the default on date once the flag is verified to be |
| 1227 | # generally safe. |
| 1228 | |
| 1229 | fetchIterableTypeSupport @146 :Bool |
| 1230 | $compatEnableFlag("fetch_iterable_type_support") |
| 1231 | $compatDisableFlag("no_fetch_iterable_type_support") |
| 1232 | $compatEnableDate("2026-02-19"); |
| 1233 | # Enables passing sync and async iterables as the body of fetch Request or Response. |
| 1234 | # Previously, sync iterables like Arrays would be accepted but stringified, and async |
| 1235 | # iterables would be treated as regular objects and not iterated over at all. With this |
| 1236 | # flag enabled, sync and async iterables will be properly iterated over and their values |
| 1237 | # used as the body of the request or response. |
| 1238 | # The actual compat flag enables the specific AsyncGeneratorIgnoringStrings type wrapper |
| 1239 | # that allows this behavior and allows sync Generator and AsyncGenerator objects to be |
| 1240 | # included in kj::OneOf declarations safely with strings and other types. When enabled, |
| 1241 | # strings are ignored but Arrays will be treated as iterables and not stringified as before. |
| 1242 | # Also see fetchIterableTypeSupportOverrideAdjustment. |
| 1243 | |
| 1244 | envModuleNullableSupport @147 :Bool |
| 1245 | $compatEnableFlag("env_module_nullable_support") |
| 1246 | $compatDisableFlag("no_env_module_nullable_support"); |
| 1247 | # Enables support for null and undefined values in EnvModule's getCurrentEnv() and |
| 1248 | # getCurrentExports() methods. When enabled, if the async context contains null or |
| 1249 | # undefined values, they will be returned instead of falling through to the worker |
| 1250 | # env/exports. This allows more explicit control over env and exports values in async |
| 1251 | # contexts. |
| 1252 | |
| 1253 | preciseTimers @148 :Bool |
| 1254 | $compatEnableFlag("precise_timers") |
| 1255 | $compatDisableFlag("no_precise_timers") |
| 1256 | $experimental; |
| 1257 | # Enables precise timers with 3ms granularity. This provides more accurate timing for performance |
| 1258 | # measurements and time-sensitive operations. |
| 1259 | |
| 1260 | fetchIterableTypeSupportOverrideAdjustment @149 :Bool |
| 1261 | $compatEnableFlag("fetch_iterable_type_support_override_adjustment") |
| 1262 | $compatDisableFlag("no_fetch_iterable_type_support_override_adjustment") |
| 1263 | $impliedByAfterDate(name = "fetchIterableTypeSupport", date = "2026-01-15"); |
| 1264 | # Further adapts the fetch iterable type support to adjust for toString/toPrimitive |
| 1265 | # overrides on sync iterable objects. Specifically, if an object passed as the body |
| 1266 | # of a fetch Request or Response is sync iterable but has a custom toString or |
| 1267 | # toPrimitive method, we will skip treating it as a sync iterable and instead allow |
| 1268 | # it to fall through to being handled as a stringified object. |
| 1269 | |
| 1270 | stripBomInReadAllText @150 :Bool |
| 1271 | $compatEnableFlag("strip_bom_in_read_all_text") |
| 1272 | $compatDisableFlag("do_not_strip_bom_in_read_all_text") |
| 1273 | $compatEnableDate("2026-01-13") |
| 1274 | $impliedByAfterDate(name = "pedanticWpt", date = "2026-01-13"); |
| 1275 | # Instructs the readAllText method in streams to strip the leading UTF8 BOM if present. |
| 1276 | |
| 1277 | allowIrrevocableStubStorage @151 :Bool |
| 1278 | $compatEnableFlag("allow_irrevocable_stub_storage") |
| 1279 | $experimental; |
| 1280 | # Permits various stub types (e.g. ServiceStub aka Fetcher, DurableObjectClass) to be stored in |
| 1281 | # long-term Durable Object storage without any mechanism for the stub target to audit or revoke |
| 1282 | # incoming connections. |
| 1283 | # |
| 1284 | # This feature exists for experimental use only, and will be removed once we have a properly |
| 1285 | # auditable and revocable storage mechanism. |
| 1286 | |
| 1287 | rpcParamsDupStubs @152 :Bool |
| 1288 | $compatEnableFlag("rpc_params_dup_stubs") |
| 1289 | $compatDisableFlag("rpc_params_transfer_stubs") |
| 1290 | $compatEnableDate("2026-01-20"); |
| 1291 | # Changes the ownership semantics of RPC stubs embedded in the parameters of an RPC call. |
| 1292 | # |
| 1293 | # When the RPC system was first introduced, RPC stubs that were embedded in the params or return |
| 1294 | # value of some other call had their ownership transferred. That is, the original stub was |
| 1295 | # implicitly disposed, with a duplicate stub being delivered to the destination. |
| 1296 | # |
| 1297 | # This turns out to compose poorly with another rule: in the callee, any stubs received in the |
| 1298 | # params of a call are automatically disposed when the call returns. These two rules combine to |
| 1299 | # mean that if you proxy a call -- i.e. the implementation of an RPC just makes another RPC call |
| 1300 | # passing along the same params -- then any stubs in the params get disposed twice. Worse, if |
| 1301 | # the eventual recipient of the stub wants to keep a duplicate past the end of the call, this |
| 1302 | # may not work because the copy of the stub in the proxy layer gets disposed anyway, breaking the |
| 1303 | # connection. |
| 1304 | # |
| 1305 | # For this reason, the pure-JS implementation of Cap'n Web switched to saying that stubs in params |
| 1306 | # do NOT transfer ownership -- they are simply duplicated. This compat flag fixes the Workers |
| 1307 | # Runtime built-in RPC to match Cap'n Web behavior. |
| 1308 | # |
| 1309 | # In particular, this fixes: https://github.com/cloudflare/capnweb/issues/110 |
| 1310 | |
| 1311 | enableNodejsGlobalTimers @153 :Bool |
| 1312 | $compatEnableFlag("enable_nodejs_global_timers") |
| 1313 | $compatDisableFlag("no_nodejs_global_timers") |
| 1314 | $impliedByAfterDate(name = "nodeJsCompat", date = "2026-02-10"); |
| 1315 | # When enabled, setTimeout, setInterval, clearTimeout, and clearInterval |
| 1316 | # are available on globalThis as Node.js-compatible versions from node:timers. |
| 1317 | # setTimeout and setInterval return Timeout objects with methods like |
| 1318 | # refresh(), ref(), unref(), and hasRef(). |
| 1319 | # This flag requires nodejs_compat or nodejs_compat_v2 to be enabled. |
| 1320 | |
| 1321 | noAutoAllocateChunkSize @154 :Bool |
| 1322 | $compatEnableFlag("streams_no_default_auto_allocate_chunk_size") |
| 1323 | $compatDisableFlag("streams_auto_allocate_chunk_size_default") |
| 1324 | $experimental; |
| 1325 | # Per the WHATWG Streams spec, byte streams should only have autoAllocateChunkSize |
| 1326 | # set when the user explicitly provides it. When not set, non-BYOB reads on byte |
| 1327 | # streams won't have a byobRequest available in the pull() callback, and the |
| 1328 | # underlying source must use controller.enqueue() to provide data instead. |
| 1329 | # |
| 1330 | # Our original implementation always defaulted autoAllocateChunkSize to 4096, |
| 1331 | # which meant all byte stream reads behaved as BYOB reads. This flag enables |
| 1332 | # the spec-compliant behavior where autoAllocateChunkSize is only set when |
| 1333 | # explicitly provided by the user. |
| 1334 | # |
| 1335 | # Code relying on the old behavior that accesses controller.byobRequest without |
| 1336 | # checking for null will break. To migrate, either: |
| 1337 | # 1. Add a null check: if (controller.byobRequest) { ... } |
| 1338 | # 2. Explicitly set autoAllocateChunkSize when creating the stream |
| 1339 | |
| 1340 | pythonWorkflowsImplicitDeps @155 :Bool |
| 1341 | $compatEnableFlag("python_workflows_implicit_dependencies") |
| 1342 | $compatDisableFlag("no_python_workflows_implicit_dependencies") |
| 1343 | $impliedByAfterDate(name = "pythonWorkers", date = "2026-02-25"); |
| 1344 | # replaces depends param on steps to an implicit approach with step callables passed as params |
| 1345 | # these steps are called internally and act as dependencies |
| 1346 | |
| 1347 | requireReturnsDefaultExport @156 :Bool |
| 1348 | $compatEnableFlag("require_returns_default_export") |
| 1349 | $compatDisableFlag("require_returns_namespace") |
| 1350 | $compatEnableDate("2026-01-22"); |
| 1351 | # When enabled, require() will return the default export of a module if it exists. |
| 1352 | # If the default export does not exist, it falls back to returning a mutable |
| 1353 | # copy of the module namespace object. This matches the behavior that Node.js |
| 1354 | # uses for require(esm) where the default export is returned when available. |
| 1355 | # This flag is useful for frameworks like Next.js that expect to patch module exports. |
| 1356 | # |
| 1357 | # TODO(later): Once this is no longer experimental, this flag should be implied by |
| 1358 | # exportCommonJsDefaultNamespace (or vice versa) for consistency. |
| 1359 | |
| 1360 | pythonRequestHeadersPreserveCommas @157 :Bool |
| 1361 | $compatEnableFlag("python_request_headers_preserve_commas") |
| 1362 | $compatDisableFlag("disable_python_request_headers_preserve_commas") |
| 1363 | $compatEnableDate("2026-02-17"); |
| 1364 | # Preserve commas in Python Request headers rather than treating them as separators, |
| 1365 | # while still exposing multiple Set-Cookie headers as distinct values. |
| 1366 | |
| 1367 | queueExposeErrorCodes @158 :Bool |
| 1368 | $compatEnableFlag("queue_expose_error_codes") |
| 1369 | $compatDisableFlag("no_queue_expose_error_codes") |
| 1370 | $compatEnableDate("2026-03-12"); |
| 1371 | # When enabled, queue operations will include detailed error information (error code and cause) |
| 1372 | |
| 1373 | textDecoderReplaceSurrogates @159 :Bool |
| 1374 | $compatEnableFlag("text_decoder_replace_surrogates") |
| 1375 | $compatDisableFlag("disable_text_decoder_replace_surrogates") |
| 1376 | $compatEnableDate("2026-02-24") |
| 1377 | $impliedByAfterDate(name = "pedanticWpt", date = "2026-02-24"); |
| 1378 | # When enabled, the UTF-16le TextDecoder will replace lone surrogates with U+FFFD |
| 1379 | # (the Unicode replacement character) as required by the spec. Previously, lone |
| 1380 | # surrogates were passed through unchanged, producing non-well-formed strings. |
| 1381 | |
| 1382 | containersPidNamespace @160 :Bool |
| 1383 | $compatEnableFlag("containers_pid_namespace") |
| 1384 | $compatDisableFlag("no_containers_pid_namespace") |
| 1385 | $compatEnableDate("2026-04-01"); |
| 1386 | # When enabled, containers attached to Durable Objects do NOT share the host PID namespace |
| 1387 | # (they get their own isolated PID namespace). When disabled (the default), containers share |
| 1388 | # the host PID namespace. |
| 1389 | |
| 1390 | deleteAllDeletesAlarm @161 :Bool |
| 1391 | $compatEnableFlag("delete_all_deletes_alarm") |
| 1392 | $compatDisableFlag("delete_all_preserves_alarm") |
| 1393 | $compatEnableDate("2026-02-24"); |
| 1394 | # When enabled, calling storage.deleteAll() on a Durable Object also deletes |
| 1395 | # any scheduled alarm, in addition to deleting all stored key-value data. |
| 1396 | # |
| 1397 | # Previously, deleteAll() preserved the alarm state. This was surprising |
| 1398 | # behavior since the intent of deleteAll() is to clear all state. |
| 1399 | |
| 1400 | unhandledRejectionAfterMicrotaskCheckpoint @162 :Bool |
| 1401 | $compatEnableFlag("unhandled_rejection_after_microtask_checkpoint") |
| 1402 | $compatDisableFlag("no_unhandled_rejection_after_microtask_checkpoint") |
| 1403 | $compatEnableDate("2026-03-03"); |
| 1404 | # When enabled, unhandledrejection processing is deferred until the microtask |
| 1405 | # checkpoint completes, avoiding misfires on multi-tick promise chains. |
| 1406 | |
| 1407 | textDecoderCjkDecoder @163 :Bool |
| 1408 | $compatEnableFlag("text_decoder_cjk_decoder") |
| 1409 | $compatDisableFlag("disable_text_decoder_cjk_decoder") |
| 1410 | $compatEnableDate("2026-03-03"); |
| 1411 | # Enables the dedicated CJK TextDecoder implementation for overrides and |
| 1412 | # Big5 lead-byte handling instead of the legacy ICU-only path. |
| 1413 | |
| 1414 | websocketCloseReasonByteLimit @164 :Bool |
| 1415 | $compatEnableFlag("websocket_close_reason_byte_limit") |
| 1416 | $compatDisableFlag("no_websocket_close_reason_byte_limit") |
| 1417 | $compatEnableDate("2026-03-03"); |
| 1418 | # When enabled, WebSocket close() throws a SyntaxError DOMException if the |
| 1419 | # reason string exceeds 123 bytes when UTF-8 encoded, as required by the |
| 1420 | # WHATWG WebSocket spec and RFC 6455 Section 5.5. Previously, workerd allowed |
| 1421 | # arbitrarily long close reasons without validation. |
| 1422 | |
| 1423 | enableVersionApi @165 :Bool |
| 1424 | $compatEnableFlag("enable_version_api") |
| 1425 | $experimental; |
| 1426 | # Enables version-related APIs. This currently only enables the `version` option in loopback |
| 1427 | # bindings to specify a requested version and exposes `ctx.version`. The behaviour of this flag |
| 1428 | # will change in the future. |
| 1429 | |
| 1430 | websocketBinaryTypeDefault @166 :Bool |
| 1431 | $compatEnableFlag("websocket_standard_binary_type") |
| 1432 | $compatDisableFlag("no_websocket_standard_binary_type") |
| 1433 | $compatEnableDate("2026-03-17"); |
| 1434 | # Per the WHATWG WebSocket spec, the binaryType attribute defaults to "blob" |
| 1435 | # and binary messages are delivered as Blob objects. Previously, workerd did |
| 1436 | # not expose the binaryType property at all and always delivered binary |
| 1437 | # messages as ArrayBuffer. When this flag is enabled, binaryType defaults to |
| 1438 | # "blob" and binary messages are delivered as Blob. Workers that set |
| 1439 | # binaryType to "arraybuffer" will continue to receive ArrayBuffer regardless |
| 1440 | # of this flag. |
| 1441 | # |
| 1442 | # Note: This flag has no effect on the Durable Object hibernatable WebSocket |
| 1443 | # message handler (webSocketMessage). That handler always receives binary data |
| 1444 | # as ArrayBuffer, since it operates outside the normal WebSocket read loop. |
| 1445 | |
| 1446 | writableStreamSpecCompliantWriter @167 :Bool |
| 1447 | $compatEnableFlag("writable_stream_spec_compliant_writer") |
| 1448 | $compatDisableFlag("no_writable_stream_spec_compliant_writer") |
| 1449 | $compatEnableDate("2026-03-24"); |
| 1450 | # Fixes several WritableStream spec compliance issues around writer |
| 1451 | # lock/release behavior. |
| 1452 | |
| 1453 | encoderStreamSpecCompliantBackpressure @168 :Bool |
| 1454 | $compatEnableFlag("encoder_stream_spec_compliant_backpressure") |
| 1455 | $compatDisableFlag("no_encoder_stream_spec_compliant_backpressure") |
| 1456 | $compatEnableDate("2026-03-24"); |
| 1457 | # Fixes TextEncoderStream and TextDecoderStream to use the correct readable |
| 1458 | # side high water mark of 0 (per the WHATWG Encoding spec), instead of 1. |
| 1459 | # With HWM=0 the readable side starts with backpressure, so writes correctly |
| 1460 | # block until a reader pulls. Previously HWM defaulted to 1, which caused |
| 1461 | # pull() to fire at startup, clearing backpressure before any write. |
| 1462 | |
| 1463 | specCompliantPropertyAttributes @169 :Bool |
| 1464 | $compatEnableFlag("spec_compliant_property_attributes") |
| 1465 | $compatDisableFlag("no_spec_compliant_property_attributes") |
| 1466 | $experimental; |
| 1467 | # Fixes several Web IDL compliance issues on property attributes: |
| 1468 | # - Constructor .length reflects the number of required arguments instead |
| 1469 | # of always being 0. |
| 1470 | # - Method and static method .length reflects the number of required |
| 1471 | # arguments instead of always being 0. |
| 1472 | # - Getter .length is explicitly 0 and setter .length is 1. |
| 1473 | # - Getter .name is "get <name>" and setter .name is "set <name>" per the |
| 1474 | # Web IDL spec, instead of empty strings. |
| 1475 | # - Constants gain DontDelete (non-configurable) on both the constructor |
| 1476 | # and prototype, matching { writable: false, enumerable: true, |
| 1477 | # configurable: false } per Web IDL. |
| 1478 | # - Interface objects (nested types) become own properties of globalThis |
| 1479 | # with { writable: true, enumerable: false, configurable: true }, instead |
| 1480 | # of being inherited from the prototype chain. |
| 1481 | |
| 1482 | workflowsPreserveNonRetryableErrorMessage @170 :Bool |
| 1483 | $compatEnableFlag("workflows_preserve_non_retryable_error_message") |
| 1484 | $compatDisableFlag("workflows_replace_non_retryable_error_message") |
| 1485 | $compatEnableDate("2026-05-14"); |
| 1486 | # When enabled, if a Workflow step throws a NonRetryableError, the error message |
| 1487 | # and name are preserved on the thrown exception instead of being replaced with |
| 1488 | # a generic "NonRetryableError" string. |
| 1489 | |
| 1490 | webSocketAutoReplyToClose @171 :Bool |
| 1491 | $compatEnableFlag("web_socket_auto_reply_to_close") |
| 1492 | $compatDisableFlag("web_socket_manual_reply_to_close") |
| 1493 | $compatEnableDate("2026-04-07"); |
| 1494 | # When enabled, a reciprocal Close frame is automatically sent through the |
| 1495 | # outgoing message pump when a server-initiated close is received, and the |
| 1496 | # WebSocket readyState is CLOSED (3) when the close event fires. Previously, |
| 1497 | # no close reply was sent and readyState was CLOSING (2). The WebSocket spec |
| 1498 | # requires readyState to be CLOSED when the close event is dispatched. |
| 1499 | |
| 1500 | enableCtxVersionMetadata @172 :Bool |
| 1501 | $compatEnableFlag("enable_ctx_version_metadata") |
| 1502 | $experimental; |
| 1503 | # When paired with `enable_version_api`, also exposes `ctx.version.metadata`. This is a separate |
| 1504 | # flag as we haven't decided on the exact behaviour of `ctx.version.metadata`, but the rest of |
| 1505 | # `ctx.version` is much more well defined. The behaviour of this flag will change in the future. |
| 1506 | |
| 1507 | noResizableArrayBufferInBlob @173 :Bool |
| 1508 | $compatEnableFlag("no_resizable_array_buffer_in_blob") |
| 1509 | $compatDisableFlag("resizable_array_buffer_in_blob"); |
| 1510 | # When enabled, creating a Blob with a resizable ArrayBuffer will throw a TypeError, matching |
| 1511 | # expected spec behavior. |
| 1512 | |
| 1513 | diagnosticsChannelHasSubscribersGetter @174 :Bool |
| 1514 | $compatEnableFlag("diagnostics_channel_has_subscribers_getter") |
| 1515 | $compatDisableFlag("no_diagnostics_channel_has_subscribers_getter") |
| 1516 | $compatEnableDate("2026-05-19"); |
| 1517 | # Node.js' `diagnostics_channel.Channel.hasSubscribers` and |
| 1518 | # `TracingChannel.hasSubscribers` are boolean getter properties, not methods. |
| 1519 | # Originally, workerd registered `Channel.hasSubscribers` as a method (so users |
| 1520 | # had to call `ch.hasSubscribers()` with parentheses). When this flag is |
| 1521 | # enabled, `hasSubscribers` becomes a read-only getter that evaluates directly |
| 1522 | # to a boolean, matching Node.js behavior. |
| 1523 | # See: https://nodejs.org/dist/latest-v20.x/docs/api/diagnostics_channel.html#channelhassubscribers |
| 1524 | |
| 1525 | workflowsStepRollback @175 :Bool |
| 1526 | $compatEnableFlag("workflows_step_rollback") |
| 1527 | $experimental; |
| 1528 | # When enabled, WorkflowEntrypoint wraps the step object so that step.do() |
| 1529 | # and step.waitForEvent() return a StepPromise with a .rollback() method. |
| 1530 | # The rollback function is bundled into the RPC call for the engine to invoke |
| 1531 | # as a compensation action on failure. Without this flag, the step object is |
| 1532 | # passed through unwrapped and .rollback() is not available. |
| 1533 | |
| 1534 | pythonProcessPthFiles @176 :Bool |
| 1535 | $compatEnableFlag("python_process_pth_files") |
| 1536 | $compatDisableFlag("disable_python_process_pth_files") |
| 1537 | $compatEnableDate("2026-05-26"); |
| 1538 | # When enabled, Python Workers process `.pth` files placed in the |
| 1539 | # `python_modules/` directory by calling `site.addsitedir()` on it during |
| 1540 | # startup. This allows packages to extend `sys.path` declaratively (e.g. to |
| 1541 | # add subdirectories or register import hooks). Without this flag, `.pth` |
| 1542 | # files in `python_modules/` are ignored. |
| 1543 | } |