Context
PR #74827 "Implement WebAssembly support detection and fallbacks" was merged. PR #74993 addressed the unsafe delete operations in tests. Several review comments remain unaddressed and are tracked here.
Unaddressed feedback
From Copilot
Related PRs
Context
PR #74827 "Implement WebAssembly support detection and fallbacks" was merged. PR #74993 addressed the unsafe
deleteoperations in tests. Several review comments remain unaddressed and are tracked here.Unaddressed feedback
From @swissspidy
Remove redundant cross-origin isolation check (
feature-detection.ts:55-65) —SharedArrayBufferrequires cross-origin isolation, so without itSharedArrayBufferwould already beundefinedand caught by the check at line 47. The cross-origin isolation check will never trigger. Also, the guidance isn't accurate for Chrome which supportsDocument-Isolation-Policy.Consider removing WebAssembly check (
feature-detection.ts:38-44) — WebAssembly has been supported in all modern browsers for ~9 years; arguably unnecessary.From @andrewserong
Don't export
clearFeatureDetectionCache(upload-media/src/index.ts:13) — Only used in tests, feels like an internal implementation detail that shouldn't be part of the public API.Move
shouldEnableClientSideMediaProcessingtoupload-mediapackage (block-editor/src/components/provider/index.js:43-62) — So it can be reused from multiple packages (e.g., theeditorpackage for post locking in Media: Graduate client-side media processing from experimental #75112).Fix inconsistent trailing periods in reason strings (
feature-detection.ts) — Some reason strings end with., some don't. Theconsole.infoappends. Using server-side processing.which causes double..for reasons that already end with a period.From Copilot
shouldEnableClientSideMediaProcessingand the fallback path (including the one-time console log) are not tested inprovider/test/experimental-provider.js.Future enhancement (from @andrewserong)
navigator.hardwareConcurrency,navigator.deviceMemory, andnavigator.connectionfor detecting low-power/low-network devices and gating client-side processing accordingly.Related PRs
deleteoperations in tests