Skip to content
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

Merged
merged 10 commits into from
Feb 14, 2023
Merged

Conversation

SiobhyB
Copy link

@SiobhyB SiobhyB commented Feb 7, 2023

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

Proposed changes:

  • To enable the VideoPress block to be registered in Gutenberg Mobile, it's necessary to create an editor.native.js file in the VideoPress package that registers the block via the index.native.ts file.
  • A native version of the index.ts file, containing the registerBlockType 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.
  • Native versions of the block's edit.js and style.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:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

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.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2023

Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run

bin/jetpack-downloader test jetpack rnmobile/add-videopress-support

to get started. More details: p9dueE-5Nn-p2

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2023

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.

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.
@jeherve jeherve requested a review from a team February 9, 2023 15:18
Siobhan added 2 commits February 13, 2023 21:16
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 );
Copy link
Author

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,
Copy link
Author

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?

Copy link
Contributor

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.

Copy link
Contributor

@fluiddot fluiddot left a 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 🎊 .

@SiobhyB
Copy link
Author

SiobhyB commented Feb 14, 2023

Thanks @fluiddot! A temporary placeholder makes sense to me, done in beac4dd.

@renatoagds
Copy link
Contributor

LGTM! Approving and merging it, I think we're good to go. Nice work @SiobhyB

@renatoagds renatoagds enabled auto-merge (squash) February 14, 2023 22:17
@renatoagds renatoagds removed the request for review from jhnstn February 14, 2023 22:19
@renatoagds renatoagds merged commit 6549661 into trunk Feb 14, 2023
@renatoagds renatoagds deleted the rnmobile/add-videopress-support branch February 14, 2023 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants