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

Transfer Verbum app into into jetpack-mu-wpcom #34993

Merged
merged 56 commits into from
Jan 23, 2024

Conversation

agrullon95
Copy link
Contributor

@agrullon95 agrullon95 commented Jan 12, 2024

Proposed changes:

Moves Verbum Comments project into Jetpack mu wpcom plugin. It also has some glue code to handle the transition between the deployed and the upcoming versions.

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)?

Does this pull request change what data or activity we track or use?

Not at all.

Testing instructions:

  • Navigate to projects/packages/jetpack-mu-wpcom
  • Run pnpm run build-js to build Verbum (development) or Run npm run build-production-js (production)
  • Run jetpack rsync jetpack mu-wpcom-plugin and select your sandbox as the destination (full command example jetpack rsync mu-wpcom-plugin user@hostname:~/public_html/wp-content/mu-plugins/jetpack-mu-wpcom-plugin/production
  • Make sure you have set define( 'JETPACK_AUTOLOAD_DEV', true ); in a mu-plugin/0-sandbox.php.
  • On WPCOM, modify comment-experience-loader.php and make load_verbum_comments return early.
  • The comment experience should continue to function, and it should be Verbum (not Highlander or core's).
  • Verify further that the new experience is in charge by checking the path of the verbum-comment.js bundle in Network tab.
  • Try your best to break the comment experience. Comment as a guest, comment from Atomic, and log in using FB.

Copy link
Contributor

github-actions bot commented Jan 12, 2024

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.
  • ✅ 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 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 reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Mu Wpcom plugin:

  • Next scheduled release: February 6, 2024.
  • Scheduled code freeze: January 29, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

Copy link
Contributor

github-actions bot commented Jan 12, 2024

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the add/verbum-comment-into-jetpack-mu-wpcom branch.

    • For jetpack-mu-wpcom changes, also add define( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true ); to your wp-config.php file.
  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack add/verbum-comment-into-jetpack-mu-wpcom
    
    bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/verbum-comment-into-jetpack-mu-wpcom
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

h: [ 'preact', 'h' ],
Fragment: [ 'preact', 'Fragment' ],
} ),
new CopyPlugin( {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copies Verbum php files into build/verbum-comments folder.

@@ -34,7 +58,10 @@ module.exports = {
} ),

// Handle CSS.
jetpackConfig.CssRule(),
jetpackConfig.CssRule( {
extensions: [ 'css', 'sass', 'scss' ],
Copy link
Contributor Author

@agrullon95 agrullon95 Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handles scss conversion to css

plugins: [
...jetpackConfig.StandardPlugins( {
DependencyExtractionPlugin: { injectPolyfill: true },
MiniCssExtractPlugin: { filename: '[name]/[name].css' },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outputs CSS in the same build directory as the entry.

For Verbum, css will output in build/verbum-comments.

{
"plugins": [
[
"@babel/plugin-transform-react-jsx",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converts JSX to react function calls.

Example
-> React.createElement("div", null, "Example");

@github-actions github-actions bot added [Tests] Includes Tests Docs [mu wpcom Feature] Verbum Comments Verbum, a better comment experience, app developed in the mu-wpcom plugin labels Jan 13, 2024
* Load Verbum Comments.
*/
public static function load_verbum_comments() {
if ( class_exists( 'Verbum_Comments' ) ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class_exists condition will be removed when this is finalized, merged into WPCOM, removed from mu-plugins/verbum and we're ready to transfer over to Verbum_Comments inside of jetpack-mu-wpcom plugin.

@agrullon95 agrullon95 changed the title Add/verbum comment into jetpack mu wpcom Add/verbum comment into jetpack mu wpcom [DO NOT MERGE] Jan 13, 2024
@agrullon95 agrullon95 added the DO NOT MERGE don't merge it! label Jan 13, 2024
*/
export function isFastConnection() {
// Hardcoding the size of the bundle.
const bytes = 30000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prod build is 232kb for me and 51.6kb are transferred in the networks tab.
how do we plan to manage this value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a solution for calculating and setting this value as of now.
I removed my initial solution since it wouldn't be efficient enough. However, we still need to figure out a way to either calculate this value or another method to determine what a "fast connection" would be.

Copy link
Contributor Author

@agrullon95 agrullon95 Jan 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

51.6kb are transferred in the networks tab.

I see 51.3kb transferred if I use the dev build and 29.5kb with the production build.
Can you check again?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting the same now
Screenshot 2024-01-22 at 18 38 14

@agrullon95
Copy link
Contributor Author

Hey @fushar can you please smoke test the block-theme-previews feature? I see that you recently added it to jetpack-mu-wpcom. We made a few changes to the webpack config and want to ensure we don't cause issues in your code. Thanks!

Copy link
Contributor

@heavyweight heavyweight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-01-22 at 18 19 32 When clicking "continue reading" I get this. This looks like a regression

@heavyweight
Copy link
Contributor

Screenshot 2024-01-22 at 18 26 32 also reproducible by writing a comment, logging in with facebook and clicking "Reply"

@agrullon95
Copy link
Contributor Author

@heavyweight

Screenshot 2024-01-22 at 18 19 32 When clicking "continue reading" I get this. This looks like a regression

I'm taking a look at these issues

@daledupreez
Copy link
Contributor

Hi @daledupreez! Would you mind taking error-reporting for a smoke test? We changed the webpack config and I'm trying to make sure things are working well.

@fullofcaffeine, could you take a look at this? I honestly don't know how to fully test the error-reporting logic!

@github-actions github-actions bot added the [Plugin] mu wpcom jetpack-mu-wpcom plugin label Jan 22, 2024
@agrullon95
Copy link
Contributor Author

@heavyweight - I pushed a change to fix the logic when you click outside of the Subscription modal

@fushar
Copy link
Contributor

fushar commented Jan 23, 2024

Hey @fushar can you please smoke test the block-theme-previews feature?

Thanks for the ping! I tested on Simple and the feature looks broken now:

image

I don't have the bandwidth to investigate this, could you help? All information should be available in this PR, the only PR that introduced the feature:

@heavyweight
Copy link
Contributor

Hey @fushar can you please smoke test the block-theme-previews feature?

Thanks for the ping! I tested on Simple and the feature looks broken now:

image I don't have the bandwidth to investigate this, could you help? All information should be available in this PR, the only PR that introduced the feature:

Thanks for taking the time.
We will take a look at this

@heavyweight
Copy link
Contributor

@heavyweight - I pushed a change to fix the logic when you click outside of the Subscription modal

Checked and works great!

Copy link
Contributor

@heavyweight heavyweight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alshakero alshakero merged commit f5139c0 into trunk Jan 23, 2024
66 checks passed
@alshakero alshakero deleted the add/verbum-comment-into-jetpack-mu-wpcom branch January 23, 2024 13:17
@heavyweight heavyweight restored the add/verbum-comment-into-jetpack-mu-wpcom branch January 23, 2024 15:02
* @return boolean
*/
private function should_disable_comment_experience( $blog_id ) {
require_once WP_CONTENT_DIR . '/lib/wpforteams/functions.php';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought: this is going to fail on Atomic sites, as this code only exists on WordPress.com Simple. Or did we already verify that it will work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it did fail on Atomic sites, leading to the revert in #35194. The second attempt at this in #35196 (specifically e89db35) both added a check before the require and added a check to only register the action that calls this method on Simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs [JS Package] Webpack Config [mu wpcom Feature] Verbum Comments Verbum, a better comment experience, app developed in the mu-wpcom plugin [Package] Jetpack mu wpcom WordPress.com Features [Plugin] mu wpcom jetpack-mu-wpcom plugin RNA [Tests] Includes Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants