-
Notifications
You must be signed in to change notification settings - Fork 805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External Media: Move the external-media to the new @automattic/jetpack-external-media package #41078
base: trunk
Are you sure you want to change the base?
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Backup plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Boost plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Search plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Social plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Starter Plugin plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Protect plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Videopress plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Mu Wpcom plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Inspect plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Wpcomsh plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Automattic For agencies client plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Classic Theme helper plugin plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Jumping in here as the title caught my eye. Is there a p2 post about this, so I can l learn more about the project? I must say it feels odd at first to have a full feature moved to a utility package. |
5042902
to
6ca8de7
Compare
@jeherve It's related to https://github.com/Automattic/dotcom-forge/issues/10251 and pbxlJb-6P2-p2 We want to add the import media page to allow users to import external media on WP Admin to eliminate the feature gaps of the Media page between Calypso and WP Admin. The goal of this PR is to share the external media modal so it can be used by jetpack-mu-wpcom. I'm just trying and unsure whether this is a correct solution. Do you have any thoughts? Thanks for catching up this so quickly 🙂 |
fc75f1d
to
56e0b58
Compare
b55d703
to
570c40a
Compare
I was moving the external media to the shared utils package. I thought it was wrong at that time, and it works when the external media is moved to the new package. It's moved to shared utils package by bf921ac.
See #41078 (comment). |
Related to https://github.com/Automattic/dotcom-forge/issues/10251 and pbxlJb-6P2-p2
Proposed changes:
Referring to p1737356188889759-slack-CDLH4C1UZ, let's try to create a new package,
external-media
to complete our project, https://github.com/Automattic/dotcom-forge/issues/10251 and pbxlJb-6P2-p2, to add the ”Import Media” page on WP Admin to allow users to import photos from external media.Here are the proposal of this PR:
@automattic/jetpack-ai-client
@automattic/jetpack-external-media
@automattic/jetpack-shared-extension-utils
Main changes
js-packages/ai-client
components/ai-icon
components/ai-images
components/modal
components/quota-exceeded-message
hooks/use-ai-checkout
hooks/use-ai-feature
hooks/use-post-content
hooks/use-save-to-media-library
libs/connection
store/wordpress-com
and export it under the subpath,@automattic/jetpack-ai-client/store/wordpress-com
js-packages/components
getRedirectUrl
under the subpath,@automattic/jetpack-components/tools/jp-redirect
. The issue isai-client
is built with different way,nodenext
, and we cannot import this package directly. Otherwise, you will see lots of following error:Relative import paths need explicit file extensions in EcmaScript imports when ‘--moduleResolution’ is ‘node16’ or ‘nodenext’
js-packages/shared-extension-utils
block-icons
components/number-control
components/upgrade-nudge
hooks/use-autosave-and-redirect
hooks/use-plan-type
hooks/use-ref-interval
icons
js-packages/storybook
es2018
toesnext
. There are components with stories that is moved to thejs-packages/ai-client
, and it seems to break the build of the storybook. As a result, we have to change the target toesnext
packages/external-media
external-media
to this packageplugins/jetpack/extensions/shared
js-packages/ai-client
orjs-packages/shared-extension-utils
external-media
topackages/external-media
plugins/jetpack/modules/external-media
external-media
module by themodule-extra.php
suggested by p1737706488009929/1737356188.889759-slack-CDLH4C1UZ 🙂Issues
projects/plugins/jetpack/extensions/store/wordpress-com
- Thewordpress-com/plans
store that is used byai-assistent-plugin
(e.g.: useAiImage). I'm unsure whether it's good to move to@automattic/jetpack-ai-client
@automattic/jetpack-shared-extension-utils
because of the circular dependency. Maybe we need to create another new package for this case.JP_CONNECTION_INITIAL_STATE
- Some of the components related to AI requires datafrom the injected global variable,
JP_CONNECTION_INITIAL_STATE
. I'm unsure whether these components can be moved to a package or not.Quick Demo
See #41282 for a quick demo. The PR shows importing external media on the new Import Media page.
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
/wp-admin/admin.php?page=jetpack_modules