Reconcile feature-detection docblock with implemented checks#75851
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 7.5 MB |
Document the upcoming capability detection areas including credentialless iframe support, device memory, network conditions, and Web Worker checks. Notes that browsers without credentialless support will have client-side media disabled by default, with a server-side filter opt-in.
e91ba49 to
17bc3aa
Compare
Add four new checks to detectClientSideMediaSupport(): Web Worker support, credentialless iframe support, device memory (≤2 GB), and network conditions (data saver/2g). These gate client-side media processing on low-end devices and unsupported browsers before the expensive CSP check.
The saveData check already covers reduced data mode but the docblock only referenced "data saver". This makes it explicit.
This reverts commit 621138f.
This reverts commit 6951dda.
Union the PR's planned credentialless iframe bullet with trunk's hardware concurrency addition. Flag the credentialless check as planned so the docblock distinguishes implemented checks from future additions.
|
Flaky tests detected in 61090ee. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/27819048572
|
Reorder the docblock list to match the actual order of evaluation in detectClientSideMediaSupport(), and remove the placeholder for the unimplemented credentialless iframe check so the documentation reflects the current detection thresholds and configuration.
Summary
Updates the
detectClientSideMediaSupport()docblock inpackages/upload-media/src/feature-detection.tsso it matches the function's current implementation:saveDataor2g/slow-2gconnection, blob-URLWorkerCSP probe).Resolves #77763.
Context
Part of #74333 (Client Side Media iteration for WordPress 7.0). The broader capability-detection effort is tracked in #75849; this PR is scoped to keeping the docblock honest about what the function does today.
Test plan
detectClientSideMediaSupport().