oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.35k stars 2.78k forks source link

Impl empty markResourceTiming to make undici and wrangler work #15313

Open 7heMech opened 20 hours ago

7heMech commented 20 hours ago

I've poorly tried to impl Performance::markResourceTiming in order to fix #8867

7heMech commented 20 hours ago

Tbh, I'm not sure how it will behave these are the errors I've seen, how can I test my "impl" Since I see it accepts more params below

❯ bun run dev
$ bun --bun vite
12834 |       );
12835 |     }
12836 |     __name(finalizeAndReportTiming, "finalizeAndReportTiming");
12837 |     function markResourceTiming(timingInfo, originalURL, initiatorType, globalThis2, cacheState) {
12838 |       if (nodeMajor > 18 || nodeMajor === 18 && nodeMinor >= 2) {
12839 |         performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState);
                ^
TypeError: performance.markResourceTiming is not a function. (In 'performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState)', 'performance.markResourceTiming' is undefined)
      at markResourceTiming (/Users/ashcon/Desktop/code/sandbox/sveltekit-wrangler-bun-bug-reprod/node_modules/wrangler/wrangler-dist/cli.js:12839:9)
      at finalizeAndReportTiming (/Users/ashcon/Desktop/code/sandbox/sveltekit-wrangler-bun-bug-reprod/node_modules/wrangler/wrangler-dist/cli.js:12828:7)
      at /Users/ashcon/Desktop/code/sandbox/sveltekit-wrangler-bun-bug-reprod/node_modules/wrangler/wrangler-dist/cli.js:12771:109
      at /Users/ashcon/Desktop/code/sandbox/sveltekit-wrangler-bun-bug-reprod/node_modules/wrangler/wrangler-dist/cli.js:13115:44
error: "vite" exited with code 1
error: script "dev" exited with code 1
7heMech commented 20 hours ago

@Jarred-Sumner @paperdave can someone more experienced take a look