-
Notifications
You must be signed in to change notification settings - Fork 10k
Document several missing compat flags #19129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vicb
merged 10 commits into
cloudflare:production
from
jasnell:jasnell/document-several-missing-compat-flags
Apr 29, 2025
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
82c4597
Document several missing compat flags
jasnell f2fa829
Apply suggestions from code review
jasnell 3c1abbe
Update src/content/compatibility-flags/disable-top-level-await-in-req…
ToriLindsay e49e6fd
Update src/content/compatibility-flags/streams-transform-backpressure.md
ToriLindsay 81079aa
Update src/content/compatibility-flags/to-string-tag.md
ToriLindsay 266acef
Update src/content/compatibility-flags/to-string-tag.md
ToriLindsay 14132cd
Update src/content/compatibility-flags/upper-case-http-methods.md
ToriLindsay e594246
Update src/content/compatibility-flags/disable-top-level-await-in-req…
ToriLindsay 1b9a848
Apply suggestions from code review
ToriLindsay 4f1fa83
Apply suggestions from code review
jasnell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/content/compatibility-flags/disable-top-level-await-in-require.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| _build: | ||
| publishResources: false | ||
| render: never | ||
ToriLindsay marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| list: never | ||
ToriLindsay marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| name: "Disable top-level await in require(...)" | ||
| sort_date: "2024-12-02" | ||
| enable_date: "2024-12-02" | ||
| enable_flag: "disable_top_level_await_in_require" | ||
| disable_flag: "enable_top_level_await_in_require" | ||
| --- | ||
|
|
||
| Workers implements the ability to use the Node.js style `require(...)` method | ||
| to import modules in the Worker bundle. Historically, this mechanism allowed | ||
| required modules to use top-level await. This, however, is not Node.js | ||
| compatible. | ||
|
|
||
| The `disable_top_level_await_in_require` compat flag will cause `require()` | ||
| to fail if the module uses a top-level await. This flag is default enabled | ||
| with a compatibility date of 2024-12-02 or later. | ||
|
|
||
| To restore the original behavior allowing top-level await, use the | ||
| `enable_top_level_await_in_require` compatibility flag. | ||
23 changes: 23 additions & 0 deletions
23
src/content/compatibility-flags/streams-transform-backpressure.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| _build: | ||
| publishResources: false | ||
ToriLindsay marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| render: never | ||
ToriLindsay marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| list: never | ||
ToriLindsay marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| name: "Apply TransformStream backpressure fix" | ||
| sort_date: "2024-12-16" | ||
| enable_date: "2024-12-16" | ||
| enable_flag: "fixup-transform-stream-backpressure" | ||
| disable_flag: "original-transform-stream-backpressure" | ||
| --- | ||
|
|
||
| The original implementation of `TransformStream` included a bug that would | ||
| cause backpressure signaling to fail after the first write to the transform. | ||
| Unfortunately, the fix can cause existing code written to address the bug to | ||
| fail. Therefore, the `fixup-transform-stream-backpressure` compat flag is | ||
| provided to enable the fix. | ||
|
|
||
| The fix is enabled by default with compatibility dates of 2024-12-16 or later. | ||
|
|
||
| To restore the original buggy backpressure logic, disable the fix using the | ||
jasnell marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| `original-transform-stream-backpressure` flag. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| _build: | ||
| publishResources: false | ||
ToriLindsay marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| render: never | ||
ToriLindsay marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| list: never | ||
ToriLindsay marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| name: "Automatically set the Symbol.toStringTag for Workers API objects" | ||
| sort_date: "2024-09-26" | ||
| enable_date: "2024-09-26" | ||
| enable_flag: "set_tostring_tag" | ||
| disable_flag: "do_not_set_tostring_tag" | ||
| --- | ||
|
|
||
| A change was made to set the Symbol.toStringTag on all Workers API objects | ||
| in order to fix several spec compliance bugs. Unfortunately it turns out | ||
jasnell marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| that was more breaking than expected. The `do_not_set_tostring_tag` compat | ||
jasnell marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| flag restores the original behavior with compatibility dates of 2024-09-26 or earlier. | ||
24 changes: 24 additions & 0 deletions
24
src/content/compatibility-flags/upper-case-http-methods.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| _build: | ||
| publishResources: false | ||
ToriLindsay marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| render: never | ||
ToriLindsay marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| list: never | ||
ToriLindsay marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| name: "Upper-case HTTP methods" | ||
| sort_date: "2024-10-14" | ||
| enable_date: "2024-10-14" | ||
| enable_flag: "upper_case_all_http_methods" | ||
| disable_flag: "no_upper_case_all_http_methods" | ||
| --- | ||
|
|
||
| HTTP methods are expected to be upper-cased. Per the fetch spec, if the | ||
| method is specified as `get`, `post`, `put`, `delete`, `head`, or `options`, | ||
| implementations are expected to uppercase the method. All other method names | ||
| would generally be expected to throw as unrecognized (e.g. `patch` would be | ||
| an error while `PATCH` is accepted). This is a bit restrictive, even if it | ||
| is in the spec. This flag modifies the behavior to uppercase all methods | ||
| prior to parsing so that the method is always recognized if it is a known | ||
| method. | ||
|
|
||
| To restore the standard behavior, use the `no_upper_case_all_http_methods` | ||
| compatibility flag. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.