fix: delay ObjectURL revocation and silence TS5 baseUrl deprecations (#1181)

- Delay URL.revokeObjectURL() from 0ms to 1000ms in useFrameCapture so
  the browser has time to initiate the download before the blob is freed.
  A 0ms timeout fires synchronously after the current microtask queue,
  before the browser's download machinery reads the URL.

- Add ignoreDeprecations: '5.0' to cli and studio tsconfigs to silence
  TypeScript baseUrl/paths deprecation warnings without changing behavior.

Co-authored-by: Jefsky Wong <jefsky@qq.com>
This commit is contained in:
Miguel Ángel
2026-06-03 20:38:40 -04:00
committed by GitHub
co-authored by Jefsky Wong
parent 1abe69f3e4
commit 6de6ea5349
3 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -14,7 +14,8 @@
"esModuleInterop": true,
"skipLibCheck": true,
"outDir": "./dist",
"declaration": true
"declaration": true,
"ignoreDeprecations": "5.0"
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
+1 -1
View File
@@ -69,7 +69,7 @@ export function useFrameCapture({
document.body.appendChild(link);
link.click();
link.remove();
setTimeout(() => URL.revokeObjectURL(blobUrl), 0);
setTimeout(() => URL.revokeObjectURL(blobUrl), 1000);
} catch (fetchErr) {
clearTimeout(timeout);
if (fetchErr instanceof DOMException && fetchErr.name === "AbortError") {
+2 -1
View File
@@ -23,7 +23,8 @@
"noEmit": true,
"incremental": true,
"resolveJsonModule": true,
"isolatedModules": true
"isolatedModules": true,
"ignoreDeprecations": "5.0"
},
"include": ["src"],
"exclude": ["dist", "node_modules", "src/**/*.test.ts"]