Skip to content

Add getLocalWorkerdCompatibilityDate documentation in the wrangler programmatic API page#28082

Closed
dario-piotrowicz wants to merge 1 commit intoproductionfrom
dario/DEVX-2446/miniflare-getLocalWorkerdCompatibilityDate
Closed

Add getLocalWorkerdCompatibilityDate documentation in the wrangler programmatic API page#28082
dario-piotrowicz wants to merge 1 commit intoproductionfrom
dario/DEVX-2446/miniflare-getLocalWorkerdCompatibilityDate

Conversation

@dario-piotrowicz
Copy link
Copy Markdown
Member

Warning

This PR should not be merged until the changes in cloudflare/workers-sdk#12387 are released

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/workers/wrangler/ @cloudflare/wrangler, @irvinebroque, @cloudflare/pcx-technical-writing

@elithrar
Copy link
Copy Markdown
Collaborator

elithrar commented Feb 7, 2026

/bonk review

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Feb 7, 2026

Now I have full context on the implementation. Let me review the documentation changes.


Review Summary

This PR adds documentation for the new getLocalWorkerdCompatibilityDate function to the Wrangler programmatic API page. The changes are in src/content/docs/workers/wrangler/api.mdx (lines 460-490).

What's good

  • The documentation follows the same structure as the existing API entries (getPlatformProxy, unstable_startWorker, etc.) with Syntax, Parameters, Return Type, and Usage sections.
  • The description of the future-date clamping behavior is accurate and matches the implementation.
  • The return type documentation correctly states YYYY-MM-DD format.
  • The function is properly listed in the table of contents at the top (line 26).

Issues found

1. Missing CompatDate type in Return Type section (minor)

At line 480, the return type is described as <Type text="string" /> in YYYY-MM-DD format. In the implementation, the actual return type is CompatDate (a branded string type). It would be more precise and useful to mention this type, similar to how getPlatformProxy documents its return types. However, since CompatDate is just a template literal type alias for a string, documenting it as a string is not incorrect -- just less precise.

2. The function is synchronous but this isn't explicitly called out

The other APIs (getPlatformProxy, unstable_startWorker, unstable_dev) are all async. This function is synchronous, which is a notable difference. The code examples do show synchronous usage (no await), so this is implicitly communicated, but an explicit note could help users scanning the docs quickly.

3. No mention of miniflare as the underlying source

The upstream PR shows that wrangler re-exports this function from miniflare. The function is also available directly from miniflare. The docs only show importing from wrangler. For users who use miniflare directly (e.g., in Vite plugin configurations), it might be useful to mention the miniflare export as well, though documenting the wrangler import is the primary use case and keeping it simple is reasonable.

4. The example in Return Type has a hardcoded date that could become confusing

Line 480: (for example, "2025-09-27"). This is a specific date from the implementation's test fixtures. It's fine as an example but will look stale over time. Not a blocking concern.

Verdict

The documentation is clear, concise, accurate, and consistent with the rest of the page. The issues above are all minor. The PR is ready to merge once the upstream dependency (cloudflare/workers-sdk#12387) is released, as noted in the PR description.

github run

@github-actions
Copy link
Copy Markdown
Contributor

Hey there, we've marked this pull request as stale because there's no recent activity on it. This label is helps us identify PRs that might need updates (or to be closed out by our team if no longer relevant).

@github-actions github-actions bot added the stale label Feb 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Hey there, we've closed out this pull request because it's been stale for a while and there's been no additional action on it. If these changes are still relevant, open a new pull request (or flag to us in a GitHub issue).

@github-actions github-actions bot closed this Mar 24, 2026
@github-actions github-actions bot deleted the dario/DEVX-2446/miniflare-getLocalWorkerdCompatibilityDate branch April 6, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants