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

Remove jQuery from CoBlocks #2276

Merged
merged 7 commits into from
Feb 16, 2022
Merged

Remove jQuery from CoBlocks #2276

merged 7 commits into from
Feb 16, 2022

Conversation

olafleur-godaddy
Copy link
Member

@olafleur-godaddy olafleur-godaddy commented Feb 11, 2022

Description

Remove the remains of jQuery that are not needed anymore.

Please tell me if I broke something or if I forgot to remove something :)

Fixes #1365

This is the culmination of the work of a lot of folks, especially @AnthonyLedesma and @snovosel :)

Copy link
Member

@jonathanbardo jonathanbardo left a comment

Choose a reason for hiding this comment

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

@olafleur-godaddy this seems to work as expected on my test CoBlocks page. I think this will probably need another pair of eyes though before merging.

Comment on lines -356 to -364
if ( $this->is_page_gutenberg() || has_block( 'coblocks/gallery-masonry' ) || has_block( 'core/block' ) ) {
wp_enqueue_script(
'coblocks-masonry',
$dir . 'coblocks-masonry.js',
array( 'jquery', 'masonry', 'imagesloaded' ),
COBLOCKS_VERSION,
true
);
}
Copy link
Member

Choose a reason for hiding this comment

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

I think we still need this because the v2 Masonry block is not compatible with WordPress version below 5.7.2. We allow users to use both versions of the block using a special wrapper and we need to keep the old logic around for that purpose.

Copy link
Member

Choose a reason for hiding this comment

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

No, we are good on this I suppose. Turns out the Masonry block broke with 5.6 somewhere along the way. Let us go ahead and get this in and then we will have to look at that Masonry block later.

@AnthonyLedesma
Copy link
Member

Please allow me to give this a good test with everything around the Masonry block and the v1-v2 wrapper that it uses before we merge this.

@godaddy-wordpress-bot
Copy link
Contributor

@godaddy-wordpress-bot
Copy link
Contributor

Code Coverage: 96.61% 💚

🗂 Folder Coverage
src/blocks/accordion/                          100.00% ✅
src/blocks/accordion/accordion-item/           100.00% ✅
src/blocks/alert/                              100.00% ✅
src/blocks/author/                             100.00% ✅
src/blocks/buttons/                            100.00% ✅
src/blocks/click-to-tweet/                     100.00% ✅
src/blocks/counter/                            100.00% ✅
src/blocks/dynamic-separator/                  100.00% ✅
src/blocks/events/                              96.43% 💚
src/blocks/events/event-item/                  100.00% ✅
src/blocks/faq/                                100.00% ✅
src/blocks/faq/faq-item/                       100.00% ✅
src/blocks/features/                           100.00% ✅
src/blocks/features/feature/                   100.00% ✅
src/blocks/food-and-drinks/                    100.00% ✅
src/blocks/food-and-drinks/food-item/          100.00% ✅
src/blocks/form/fields/checkbox/               100.00% ✅
src/blocks/form/fields/date/                   100.00% ✅
src/blocks/form/fields/hidden/                 100.00% ✅
src/blocks/form/fields/name/                   100.00% ✅
src/blocks/form/fields/phone/                  100.00% ✅
src/blocks/form/fields/radio/                  100.00% ✅
src/blocks/form/fields/select/                 100.00% ✅
src/blocks/form/fields/text/                   100.00% ✅
src/blocks/form/fields/textarea/               100.00% ✅
src/blocks/form/fields/website/                100.00% ✅
src/blocks/gallery-carousel/                    96.43% 💚
src/blocks/gallery-collage/                    100.00% ✅
src/blocks/gallery-masonry/                     79.77% 💛
src/blocks/gallery-offset/                     100.00% ✅
src/blocks/gallery-stacked/                    100.00% ✅
src/blocks/gif/                                100.00% ✅
src/blocks/gist/                               100.00% ✅
src/blocks/hero/                                92.56% 💚
src/blocks/highlight/                          100.00% ✅
src/blocks/logos/                              100.00% ✅
src/blocks/map/                                100.00% ✅
src/blocks/media-card/                         100.00% ✅
src/blocks/opentable/                          100.00% ✅
src/blocks/post-carousel/                      100.00% ✅
src/blocks/posts/                              100.00% ✅
src/blocks/pricing-table/                      100.00% ✅
src/blocks/pricing-table/pricing-table-item/   100.00% ✅
src/blocks/row/                                 94.43% 💚
src/blocks/row/column/                          88.54% 💚
src/blocks/services/                           100.00% ✅
src/blocks/services/service/                   100.00% ✅
src/blocks/shape-divider/                      100.00% ✅
src/blocks/share/                               81.25% 💚
src/blocks/social-profiles/                     79.64% 💛

From Circle CI build 45102

@godaddy-wordpress-bot
Copy link
Contributor

Performance Test Results:

index master clean-jquery change %
focus 120.18 115.85 -3.6%
inserterHover 38.88 34.91 -10.21%
inserterOpen 120.56 111.32 -7.66%
inserterSearch 95.5 81.46 -14.7%
load 23199 23019.5 -0.77%
maxFocus 176.01 136.3 -22.56%
maxInserterHover 50.41 39.11 -22.42%
maxInserterOpen 445.58 423.25 -5.01%
maxInserterSearch 182.7 176.07 -3.63%
maxType 79.42 80.68 1.59%
minFocus 97.74 98.69 0.97%
minInserterHover 33.71 32 -5.07%
minInserterOpen 71.34 69.64 -2.38%
minInserterSearch 55.26 46.55 -15.76%
minType 38.53 38.84 0.8%
type 48.11 47.58 -1.1%

@cypress
Copy link

cypress bot commented Feb 16, 2022



Test summary

398 0 2 0


Run details

Project CoBlocks
Status Passed
Commit 29f4b30
Started Feb 16, 2022 3:34 PM
Ended Feb 16, 2022 3:39 PM
Duration 04:48 💡
OS Linux Ubuntu - 20.04
Browser Multiple

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@AnthonyLedesma AnthonyLedesma merged commit db47118 into master Feb 16, 2022
@AnthonyLedesma AnthonyLedesma deleted the clean-jquery branch February 16, 2022 23:52
@olafleur-godaddy olafleur-godaddy added this to the Next Release milestone Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ISBAT use CoBlocks without jQuery
4 participants