Repository navigation
[vite-plugin] Support remote Analytics Engine in v1 - #16579
Conversation
🦋 Changeset detectedLatest commit: eee42c8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Codeowners approval required for this PR:
|
|
@WalshyDev (original author) @dario-piotrowicz (verified human ant-core approver): please check this v1 backport of #16536 and approve it if it looks good. #16543 already supplies published Miniflare 5.20261023.2-beta, Wrangler 4.155.0 and workers-utils 0.50.0. V1 gets config conversion/options from installed Wrangler, so the remaining change is the retained proxy's Analytics Engine method wrapper. The real retained proxy regression fails before the fix and passes after; build/types/checks and all retained suites pass. No repeated dependency upgrade or upstream tests are included. |
|
✅ Approved — The only change since the last approval is the changeset text, which is accurate. I found no issues. The decision is advisory: this comment never approves, blocks or requests changes on the pull request. ✅ All checks passed📋 Code Quality: ✅ LGTMNo issues found. The 📝 Documentation: ✅ LGTMThe changeset is a minor bump for Reviewed commit: |
e0b7018 to
eee42c8
Compare
commit: |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Backports the independently necessary retained-code portion of #16536 to Vite plugin v1, stacked on #16578 and #16543.
V1 already gets legacy Wrangler config-to-binding conversion and Miniflare options from installed Wrangler, rather than v2's
src/remote-bindings.ts. #16543 supplies published Miniflare5.20261023.2-beta, Wrangler4.155.0, workers-utils0.50.0and the coupled helper graph. Those versions validate and forwardanalytics_engine_datasets[].remote; this PR makes no repeated dependency upgrade.The remaining required change is in the retained remote proxy: native Analytics Engine objects cannot be serialized directly by capnweb. Expose
writeDataPoint()through a plain object so local development and preview can write to the configured real dataset whenremote: true. Keep local writes as no-ops when remote mode is absent. Add one plugin minor changeset describing the user-facing feature.A regression test exercises the real bundled retained proxy in workerd over a WebSocket RPC connection, with an AnalyticsEngine-shaped non-serializable binding. It fails before the wrapper with
RPC stub points at a non-serializable typeand passes after it, asserting that the original event reaches the binding. This tests retained code; no public Wrangler/Miniflare source, CLI test, fixture or upstream unit test is copied. No credentialed live-dataset test was run.Validation with Node 22.22.1/pnpm 10.33.0:
pnpm test:cipasses all 8 retained tasks (including 32 remote-bindings and 231 plugin tests);pnpm checkpasses all 58 tasks including build, types, lint and format. Parent #16543 validates dependency installation, registry fixtures and plugin asset/Explorer dev/preview behavior; parent #16578 validates the HMR behavior.remote: truesetting and v1 feature behavior.Note
This is a contribution from an AI agent: Codex, under the authorized v1 backport automation.