Docs: Add client-side media processing documentation - #75895
Conversation
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.
Architecture explanation, developer how-to guide, editor filters reference, and make/core announcement draft for the client-side media processing feature shipping in WP 7.0.
- Fix wasm-vips links to point to canonical kleisauke/wasm-vips repo - Add wp_ prefix to filter name in feature-detection docblock - Use wp.apiFetch instead of hardcoded /wp-json/ path in sideload example Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document the finalize REST endpoint, editor.media.imageQuality JS filter, and server-side hook compatibility added in PR #74913 across architecture, how-to, and Make Core post docs. Also fixes a typo ("eprocessing") in the Make Core post.
|
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. |
- Replace COEP/COOP cross-origin isolation with Document-Isolation-Policy (Chromium 137+ only; Firefox/Safari not supported) - Remove outdated "not yet wired through" note on imageQuality hook - Add client_side_supported_mime_types PHP filter documentation - Add replace_file parameter to sideload endpoint docs - Update browser compatibility table and troubleshooting section - Update feature detection table to match current implementation
Adopt trunk's feature-detection docblock listing — it accurately reflects implemented checks (hardware concurrency). Drop the credentialless-iframe bullet since no such check exists in the code.
|
Flaky tests detected in e9a2ab9. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/29544340374
|
The feature shipping target moved from 7.0 to 7.1 (per #76756). Bring the architecture explanation and how-to guide up to date with the post-7.0-cycle state of the code: - Reposition introductions around 7.1 with 7.0 as the groundwork cycle. - HEIC/HEIF: document the canvas-based fallback path (createImageBitmap, HTMLImageElement+OffscreenCanvas, HEIC container parsing + WebCodecs VideoDecoder), JPEG companion file, and isHeicCanvasSupported() gate. - AVIF: note the wp_prevent_unsupported_mime_type_uploads bypass when generate_sub_sizes=false (#76371). - Batch thumbnail generation via image.copyMemory() / thumbnailImage() (#76979). - Sub-size deduplication via image_size: string|string[] on the sideload route (#77036). - Single VIPS instance via promise caching (#76780). - Build-output trimming: remove vips-jxl.wasm (#76639), skip non-min worker (#76615), skip WASM-inlined sourcemaps (#75993). - COI: <img> excluded from cross-origin attribute injection (#76618). - Loosened feature-detection thresholds: 2 cores, 3g (#76616). - Post-saving lock fix: Save Draft now respects the lock (#76973). - convert_format declared as boolean on sideload route (#77565). - Fix incorrect REST index settings list (only image_sizes and image_size_threshold are exposed). - Remove references to client_side_supported_mime_types filter (PR #76549 was closed unmerged); state the supported MIME set is fixed at CLIENT_SIDE_SUPPORTED_MIME_TYPES. Refs #75111.
The feature ships in 7.1 instead of 7.0 (per #76756). Reframe the post as a 7.1 announcement with a dedicated 'What's new in 7.1' section listing HEIC support, end-to-end AVIF uploads, batch thumbnail generation, sub-size deduplication, single VIPS instance, save lock fix, loosened device requirements, <img> COI exclusion, smaller build output, and the convert_format boolean coercion fix. Each item is linked to its merged PR. Move the original 7.0 cycle deliverables under 'What changed during 7.0' so the historical context stays available for the announcement audience. Update technical overview to use the actual function name (gutenberg_is_client_side_media_processing_enabled), reflect that DIP replaces COEP/COOP, and remove the inaccurate note that the imageQuality hook isn't wired up. Drop the make-believe client_side_supported_mime_types filter; PR #76549 was closed unmerged. State that the supported MIME set is fixed at CLIENT_SIDE_SUPPORTED_MIME_TYPES. Update browser compatibility table to reflect the DIP-based gating (Chromium 137+, no Firefox/Safari) and add a feature detection thresholds section.
The handbook generator derives slugs from filename basenames, so docs/how-to-guides/client-side-media.md and docs/explanations/architecture/client-side-media.md collided on the slug "client-side-media" and broke docs:gen in CI. Rename the architecture file to client-side-media-architecture.md and update all internal cross-references plus the public-URL references in the Make/Core draft post.
Run docs:build to add manifest entries for the new how-to guide and architecture explanation pages, fixing the check-local-changes CI step.
Adds a Frequently Asked Questions section addressing common public misconceptions raised on issue #76756 — bandwidth-vs-CPU/RAM framing, the 'never trust the client' security objection, fallback behavior, hook compatibility, format conversion, and browser support.
GitHub user-attachments URLs can break over time in published WP docs. Store the diagram images in docs/assets and reference them via raw.githubusercontent HEAD URLs, matching the existing docs convention.
|
Good call, thanks! Moved the diagrams into |
andrewserong
left a comment
There was a problem hiding this comment.
Thanks for the updates, this is reading well to me and we can always polish in follow-ups 👍
The goal of client-side media is to provide the highest quality media processing to all WordPress sites.
Nice opening sentence 🎉
|
Question: Are SVGs for the assets available? This would be better, if possible. |
good suggestion, I'll work on adding those. |
Replace the four PNG diagrams with hand-authored SVGs so they stay crisp at any zoom, carry selectable text, and weigh less. Content, layout, and styling match the originals; markdown references updated to the .svg files.
|
Good call, @westonruter. I've replaced all four PNGs with hand-authored SVGs in b938d7f - crisp at any zoom, real selectable text, and smaller files. Content, layout, and styling match the originals, and the markdown references now point at the |
The REST API panel's heading and endpoint lines set light fills via presentation attributes (fill="#ffffff"/"#e8eaed"), but the .ct and .body classes set dark fills in the <style> block. Stylesheet class rules outrank presentation attributes in the CSS cascade, so the dark fills won and the text rendered nearly invisible on the #1e1e1e panel. Move the light fills into .ct-inv/.body-inv classes declared after .ct/.body so they win the cascade, matching how the sibling diagrams use fill-setting classes (.pill/.num) for text on dark backgrounds.
Summarize the findings of the hooks audit in #80210: which hooks fire on each REST request of a client-side upload, which filters now fire at settings-computation time instead of during encoding, the three hooks that never fire on the client path and their replacement signals, and how EXIF rotation ownership moves to the client. Also document the image_strip_meta and image_max_bit_depth REST index fields and their customization examples (#80216, honored client-side via #80218).
|
Added hooks documentation based on the audit in #80210 (faf7a74):
Note: the |
|
@adamsilverstein This is amazing! Thank you for putting all of this together. |
Thanks! Now that we hit Beta1 and not much is likely to change, I will merge it soon. We can always update anything we change during beta. I also have a draft make post I will share with you separately. |
Couldn't agree more! |
|
I'm going to give this a final review then get it merged. We can always update the documentation as we land new items. |
PR #80072 made the editor block switch user-initiated via a "Display as video" toolbar control on the Image block, replacing the automatic swap-on-upload. Update the architecture doc, how-to guide, filters reference, and pipeline diagram to match, and remove references to the "Display as original GIF" toggle and preserveAnimatedGif attribute, which no longer exist.
Drop the WASM MIME-type troubleshooting row: the WASM binaries are inlined as base64 data URLs at build time (as the architecture doc states), so no separate .wasm fetch exists and a server MIME type can never be the cause. Reword the low-spec device row since the detection gates are not configurable. Join the architecture index bullet to the existing list so it renders as one tight list.
Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org> Co-authored-by: juanmaguitar <juanmaguitar@git.wordpress.org> Co-authored-by: aaronjorbin <jorbin@git.wordpress.org> Co-authored-by: westonruter <westonruter@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org> Co-authored-by: swissspidy <swissspidy@git.wordpress.org>
Summary
Adds comprehensive documentation for the Client-Side Media Processing feature shipping in WordPress 7.1. The underlying infrastructure landed during the 7.0 cycle when the feature graduated from a Gutenberg experiment; the 7.1 release adds HEIC support, AVIF end-to-end uploads, performance improvements, and finishes hardening before the public release.
docs/explanations/architecture/client-side-media-architecture.md): How the system works - the three-package split (@wordpress/upload-media,@wordpress/vips,@wordpress/media-utils), upload queue and operation chaining, WebAssembly/libvips pipeline, Cross-Origin Isolation and SharedArrayBuffer requirements, browser feature detection, and graceful fallback to server-side processing.docs/how-to-guides/client-side-media.md): Practical guide for plugin/theme developers - disabling the feature, customizing image processing via existing WordPress filters, handling compatibility with metadata hooks, and debugging.docs/reference-guides/filters/editor-filters.md): New "Client-side media processing" section documenting thewp_client_side_media_processing_enabledPHP filter, thegenerate_sub_sizesandconvert_formatREST API parameters, and the existing core filters that the client-side pipeline respects (big_image_size_threshold,image_editor_output_format,image_save_progressive,wp_image_maybe_exif_rotate).docs/assets/client-side-media-*.svg): Four SVG illustrations covering the upload flow, architecture overview, processing pipeline, and GIF-to-video conversion.docs/manifest.jsonanddocs/toc.jsonregenerated to surface the new pages in the handbook.Closes #75111
Test plan