Repository navigation
Image Cropper: Deprecate the package in favour of the image editor - #86417
Conversation
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: 0 B Total Size: 8.61 MB
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Page List converts to Navigation Links with entity bindings in
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the change deprecating @wordpress/image-cropper in favor of @wordpress/image-editor.
No open issues 🎉
What changed in this PR
Deprecates @wordpress/image-cropper in favour of @wordpress/image-editor, preserving existing cropping behaviour until a future removal.
Changes:
- Adds a mount-time deprecation notice to
ImageCropperProvider. - Adds the
@wordpress/deprecateddependency and TypeScript references. - Updates documentation and the changelog to describe deprecation rather than rebuilding the cropper.
| File | Description |
|---|---|
| packages/image-editor/README.md | Replaces the rebuild plan with the cropper’s deprecation status. |
| packages/image-cropper/tsconfig.json | Adds the deprecation package reference for development. |
| packages/image-cropper/tsconfig.build.json | Adds the deprecation package reference for builds. |
| packages/image-cropper/src/provider/index.tsx | Logs a deprecation notice when the provider mounts. |
| packages/image-cropper/README.md | Adds migration guidance and future removal notices. |
| packages/image-cropper/package.json | Declares the deprecation utility dependency. |
| packages/image-cropper/CHANGELOG.md | Records the package deprecation. |
| package-lock.json | Records the added dependency in the lockfile. |
Review effort: Balanced
Mounting ImageCropperProvider logs a deprecation notice once, naming @wordpress/image-editor as the replacement. The README says the package will be removed in a later release and that the one consumer in this repository, wp.blockEditor.__experimentalImageEditor, is deprecated as well. Nothing else in the package changes.
Shorten the README banner to the shape @wordpress/nux uses, and start the package description with "Deprecated" so the npm page and search results say so.
530ce58 to
51c8e8b
Compare
andrewserong
left a comment
There was a problem hiding this comment.
Generally looking good to me, and it logs out correctly in storybook:
Smoke-tested that it doesn't log anything out by default the block editor since we're not rendering the __experimentalImageEditor anywhere.
Just left a comment about whether or not we need the runtime deprecation call (not a strong opinion, just a question). One other thought is that (in a follow up) we could remove the Image Cropper story book story altogether now that we're stabilising and consolidating around the Image Editor?
In any case, LGTM
|
Thanks for testing @andrewserong! Note to self: Need to deprecate during RC1 before final release. When Not because we have to (see #84318 (comment)), but because |
Update. After chatting with @ciampo I learned that it can’t be safely deprecated until we take away block-editor’s dependency on it. So we have to
No. 1 might be 2-3 versions out still as it's on the public API, despite having the |
…ordPress#86417) Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
What?
Follow-up to #86223, part of #86145. Deprecates
@wordpress/image-cropperin favour of@wordpress/image-editor. The package implementation remains unchanged.Why?
@wordpress/image-editorhas the canvas, the controller and the save helpers the media editor is built on, so new croppers should start there. Rebuilding the old package on it (#86407) was more than the package warrants: its only consumer in this repository iswp.blockEditor.__experimentalImageEditor, itself deprecated since 7.1 and rendered by no core block. Deprecating in place and removing the package later costs outside consumers one migration instead of two.How?
@wordpress/nuxuses, which also notes thatwp.blockEditor.__experimentalImageEditoris deprecated. The package description starts with "Deprecated", as nux's does, so the npm page says so.Testing Instructions
Follow-ups
npm deprecateon the package when this ships.wp.blockEditor.__experimentalImageEditor, then the package.