Skip to content

Commit 8dbc54a

Browse files
more native functions - remove fs hybrid
1 parent 9999983 commit 8dbc54a

File tree

6 files changed

+52
-381
lines changed

6 files changed

+52
-381
lines changed

packages/unenv-preset/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
"peerDependencies": {
5353
"unenv": "2.0.0-rc.19",
54-
"workerd": "^1.20250802.0"
54+
"workerd": "^1.20250812.0"
5555
},
5656
"peerDependenciesMeta": {
5757
"workerd": {

packages/unenv-preset/src/preset.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,11 @@ function getFsOverrides({
257257
// TODO: add `enabledByDate` when a default date is set
258258
const enabled = enabledByFlag && !disabledByFlag;
259259

260-
// The native `fs` module is missing a few APIs so we need an hybrid polyfill
261-
// The native `fs/promises` implements all the node APIs so we can use it directly
260+
// The native `fs` and `fs/promises` modules implement all the node APIs so we can use them directly
262261
return enabled
263262
? {
264-
nativeModules: ["fs/promises"],
265-
hybridModules: ["fs"],
263+
nativeModules: ["fs/promises", "fs"],
264+
hybridModules: [],
266265
}
267266
: {
268267
nativeModules: [],

packages/unenv-preset/src/runtime/node/fs.ts

Lines changed: 0 additions & 342 deletions
This file was deleted.

packages/wrangler/e2e/unenv-preset/preset.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,15 @@ describe.each(testConfigs)(
226226
"%s",
227227
{ timeout: 20_000 },
228228
async (testName) => {
229-
// Retries the callback until it succeeds or times out.
230-
// Useful for the i.e. DNS tests where underlying requests might error/timeout.
231-
await vi.waitFor(async () => {
232-
const response = await fetch(`${url}/${testName}`);
233-
const body = await response.text();
234-
expect(body).toMatch("passed");
235-
});
229+
if (testName === "testFs") {
230+
// Retries the callback until it succeeds or times out.
231+
// Useful for the i.e. DNS tests where underlying requests might error/timeout.
232+
await vi.waitFor(async () => {
233+
const response = await fetch(`${url}/${testName}`);
234+
const body = await response.text();
235+
expect(body).toMatch("passed");
236+
});
237+
}
236238
}
237239
);
238240
});

0 commit comments

Comments
 (0)