@cloudflare/vite-plugin 2.0.0-rc.2 → 2.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { DurableObject, WorkerEntrypoint, WorkflowEntrypoint } from "cloudflare:workers";
1
+ import { DurableObject, WorkerEntrypoint, WorkflowEntrypoint, waitUntil } from "cloudflare:workers";
2
2
  import { ModuleRunner, ssrDynamicImportKey, ssrModuleExportsKey } from "vite/module-runner";
3
3
  //#region src/shared.ts
4
4
  const UNKNOWN_HOST = "http://localhost";
@@ -92,16 +92,20 @@ const callbackResults = /* @__PURE__ */ new Map();
92
92
  * since both run in the same V8 isolate). Only a numeric ID crosses the RPC
93
93
  * boundary.
94
94
  */
95
- async function runInRunnerObject(env, callback) {
96
- const id = nextCallbackId++;
97
- pendingCallbacks.set(id, callback);
98
- try {
99
- await env.__VITE_RUNNER_OBJECT__.get("singleton").executeCallback(id);
100
- return callbackResults.get(id);
101
- } finally {
102
- pendingCallbacks.delete(id);
103
- callbackResults.delete(id);
104
- }
95
+ function runInRunnerObject(env, callback) {
96
+ const operation = (async () => {
97
+ const id = nextCallbackId++;
98
+ pendingCallbacks.set(id, callback);
99
+ try {
100
+ await env.__VITE_RUNNER_OBJECT__.get("singleton").executeCallback(id);
101
+ return callbackResults.get(id);
102
+ } finally {
103
+ pendingCallbacks.delete(id);
104
+ callbackResults.delete(id);
105
+ }
106
+ })();
107
+ waitUntil(operation);
108
+ return operation;
105
109
  }
106
110
  /**
107
111
  * Durable Object that provides an IoContext for module evaluation and handles
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/vite-plugin",
3
- "version": "2.0.0-rc.2",
3
+ "version": "2.0.0-rc.3",
4
4
  "description": "Cloudflare plugin for Vite",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -38,14 +38,14 @@
38
38
  "dependencies": {
39
39
  "unenv": "2.0.0-rc.24",
40
40
  "ws": "8.21.0",
41
- "@cloudflare/build-output-utils": "1.0.0-rc.2",
42
- "@cloudflare/config": "1.0.0-rc.2",
43
- "@cloudflare/unenv-preset": "2.16.2",
44
- "@cloudflare/runtime-types": "0.1.31",
45
- "miniflare": "5.20261118.0-beta"
41
+ "@cloudflare/build-output-utils": "1.0.0-rc.3",
42
+ "@cloudflare/config": "1.0.0-rc.3",
43
+ "@cloudflare/runtime-types": "0.1.32",
44
+ "miniflare": "5.20261119.0-beta",
45
+ "@cloudflare/unenv-preset": "2.16.2"
46
46
  },
47
47
  "devDependencies": {
48
- "@cloudflare/workers-types": "^5.20261118.1",
48
+ "@cloudflare/workers-types": "^5.20261119.1",
49
49
  "@remix-run/node-fetch-server": "^1.0.0",
50
50
  "@types/node": "22.15.17",
51
51
  "@types/semver": "^7.5.1",
@@ -61,18 +61,18 @@
61
61
  "tinyglobby": "0.2.16",
62
62
  "tree-kill": "1.2.2",
63
63
  "tsdown": "0.22.14",
64
- "typescript": "5.8.3",
64
+ "typescript": "6.0.3",
65
65
  "vite": "8.3.4",
66
66
  "vite-legacy": "npm:vite@7.1.12",
67
67
  "vitest": "5.0.4",
68
- "@cloudflare/containers-shared": "0.27.0",
68
+ "@cloudflare/cli-shared-helpers": "0.3.12",
69
+ "@cloudflare/containers-shared": "0.27.1",
69
70
  "@cloudflare/mock-npm-registry": "0.0.0",
70
- "@cloudflare/remote-bindings": "0.0.68",
71
- "@cloudflare/workers-auth": "0.18.5",
71
+ "@cloudflare/remote-bindings": "0.0.69",
72
+ "@cloudflare/workers-auth": "0.18.6",
72
73
  "@cloudflare/workers-shared": "0.20.3",
73
74
  "@cloudflare/workers-tsconfig": "0.0.0",
74
- "@cloudflare/workers-utils": "0.55.0",
75
- "@cloudflare/cli-shared-helpers": "0.3.11"
75
+ "@cloudflare/workers-utils": "0.56.0"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "vite": "^7.0.0 || ^8.0.0"