Skip to content

[vite-plugin] Resolve Durable Object runtime imports in v1 - #16479

Merged
petebacondarwin merged 1 commit into
codex/vite-v1-backport-14900from
codex/vite-v1-backport-16452
Oct 28, 2026
Merged

petebacondarwin merged 1 commit into
codex/vite-v1-backport-14900from
codex/vite-v1-backport-16452

Conversation

@petebacondarwin

@petebacondarwin petebacondarwin commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Backport #16452 so Vite plugin v1 can build Workers importing retryable() from cloudflare:durable-objects. V1 has the same built-in module list omission as main, causing Vite to resolve this runtime module as an npm package. Add it to the list and retain the original module-resolution playground assertion in both normal and nodejs_compat variants.

Stacked on the existing Hyperdrive backport #16407. The remaining diff is exactly the original four files: one built-in list entry, the playground import/assertion, and a plugin patch changeset. Published Miniflare 5.20261019.2-beta already provides this runtime module; no dependency upgrade or removed public package source is needed. The separate unpublished October 23 runtime draft #16444 will follow the testable backports.

Validation with Node 22.22.1 and pnpm 10.33.0: pnpm build, all 58 pnpm check tasks, and all retained pnpm test:ci suites pass (211 plugin tests and 31 remote-binding tests). Both module-resolution playground variants pass in dev and build/preview: 22 tests per mode. pnpm test:fixtures also passes, including the retained dev-registry and test-harness integrations. Three selected local package-manager E2E assertions also pass with the pinned pnpm. No credentialed E2E tests were run. The initial sandboxed unit run could not open local sockets; rerunning with the required access passed.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: this fixes resolution of an existing runtime module without adding configuration or API.

Note

This is a contribution from an AI agent: Codex, preparing maintainer-requested v1 backports.


Devin Review

@changeset-bot

changeset-bot Bot commented Oct 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ecd5512

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/vite-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@petebacondarwin

Copy link
Copy Markdown
Contributor Author

@apeacock1991 (author of #16452) and @petebacondarwin (verified human ant-core approver), please check this Vite plugin v1 backport and approve it if it looks good.

V1 has the same built-in-module omission. The remaining four-file diff preserves the original runtime externalization, module-resolution playground import/assertion, and plugin patch changeset. Published Miniflare 5.20261019.2-beta already supports the module, so no dependency upgrade is needed. This is stacked on existing #16407; the separate runtime draft #16444 will follow the testable backports.

Build, all 58 checks, retained unit suites/fixtures, three selected local package-manager E2E tests, and both module-resolution variants in dev and preview pass with Node 22.22.1 and pnpm 10.33.0.

@workers-devprod
workers-devprod requested review from a team and jamesopstad and removed request for a team October 25, 2026 14:08
@workers-devprod

workers-devprod commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@clanky-the-clanker

Copy link
Copy Markdown

✅ Approved — This is a minimal, correct backport that adds one built-in module entry, with playground coverage and a patch changeset. No issues were found.

The decision is advisory: this comment never approves, blocks or requests changes on the pull request.


✅ All checks passed

📋 Code Quality: ✅ LGTM

Adding cloudflare:durable-objects to cloudflareBuiltInModules (packages/vite-plugin-cloudflare/src/cloudflare-environment.ts) is the right fix and matches how the other cloudflare:* modules are handled. The playground import and assertion test the new behaviour directly.


📝 Documentation: ✅ LGTM

The changeset .changeset/vite-plugin-durable-objects-module.md is a correctly scoped @cloudflare/vite-plugin patch and explains the user-facing fix clearly. No public documentation changes are needed.


Reviewed commit: ecd55120

@pkg-pr-new

pkg-pr-new Bot commented Oct 25, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@cloudflare/vite-plugin@16479

commit: ecd5512

@dario-piotrowicz
dario-piotrowicz removed the request for review from jamesopstad October 26, 2026 11:26

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@petebacondarwin
petebacondarwin removed this pull request from stack #16481 October 26, 2026 21:57
@petebacondarwin
petebacondarwin removed this pull request from stack #16505 October 28, 2026 11:08
@petebacondarwin
petebacondarwin merged commit 1d5354b into vite-plugin-v1 Oct 28, 2026
58 of 59 checks passed
@petebacondarwin
petebacondarwin deleted the codex/vite-v1-backport-16452 branch October 28, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants