-
Notifications
You must be signed in to change notification settings - Fork 798
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
[RNMobile] Register VideoPress block #28812
Conversation
Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run
to get started. More details: p9dueE-5Nn-p2 |
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. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. |
9c1e01f
to
f60484d
Compare
With this commit, native-specific edit.js and style.scss files are added with placeholder components. This serves as a starting point for the VideoPress block.
The native-specific index file is necessary in order to limit the block in Mobile Gutenberg.
* @returns {object|boolean} Either false if the block is not available, or the results of `registerBlockType` | ||
*/ | ||
export default function registerVideoPressBlock() { | ||
const { available } = getJetpackExtensionAvailability( name ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the same pattern that we're using to check for the availability of other Jetpack blocks on mobile, as seen in the register-jetpack-block.native.js
file.
save, | ||
icon, | ||
attributes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@renatoagds, as we have a native-specific index.ts
file now, we could remove these changes. I wanted to check with you before doing that. Is there any reason we should keep these changes for the web?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could keep it, no problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SiobhyB I noticed that rendering the block with a VideoPress block displays the warning Trying to load empty source.
. This can be dismissed and since the block is under development it shouldn't block the PR, however, we might consider disabling it somehow. A potential workaround would be that instead of rendering the VideoPlayer
component, render a temporary placeholder, WDYT?
On a different note, before approving the PR, I'd like to hear from @renatoagds in relation to this comment. If it's ok to proceed with it, from my side the PR is good to go 🎊 .
projects/packages/videopress/src/client/block-editor/blocks/video/index.native.ts
Outdated
Show resolved
Hide resolved
projects/packages/videopress/src/client/block-editor/blocks/video/index.native.ts
Outdated
Show resolved
Hide resolved
LGTM! Approving and merging it, I think we're good to go. Nice work @SiobhyB |
With this PR, the VideoPress block has been registered behind a DEV flag. The block itself is not complete or fully functional, but is intended to serve as a useful placeholder to be iterated on.
Related PRs
Gutenberg
: [RNMobile] Enable new block in Gutenberg Mobile WordPress/gutenberg#47836Gutenberg Mobile
: Register VideoPress block behind a DEV flag wordpress-mobile/gutenberg-mobile#5459iOS
: Enable VideoPress block on iOS wordpress-mobile/WordPress-iOS#20100Android
: Enable VideoPress block on Android wordpress-mobile/WordPress-Android#17928Proposed changes:
editor.native.js
file in the VideoPress package that registers the block via theindex.native.ts
file.index.ts
file, containing theregisterBlockType
function, has also been created. The native version differs slightly in that it checks for the block's availability before registering it, which is needed due to the way the code is referenced in Gutenberg Mobile.edit.js
andstyle.scss
files have been created, using some of the components found in the native version of the Video block. As mentioned, the code here is purely intended to act as a starting point, and will change as we iterate on the block. The block itself is not functional at this stage.Screenshot:
Other information:
Jetpack product discussion
p9ugOq-3mV-p2
Does this pull request change what data or activity we track or use?
No, it does not.
Testing instructions:
Please refer to the Gutenberg Mobile PR as the "central PR" with the most up-to-date testing instructions.