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

WPEX 1690 - refactor post carousel to remove JQuery #2235

Merged
merged 25 commits into from
Feb 8, 2022
Merged

Conversation

snovosel
Copy link
Contributor

Description

This PR removes jQuery from the post carousel block in an effort to remove jQuery from the coblocks project

Screenshots

Types of changes

refactor

How has this been tested?

visually, cypress

Checklist:

  • My code is tested
  • My code follows accessibility standards
  • My code has proper inline documentation
  • I've included any necessary tests
  • I've included developer documentation
  • I've added proper labels to this pull request

@cypress
Copy link

cypress bot commented Jan 25, 2022



Test summary

402 0 0 0


Run details

Project CoBlocks
Status Passed
Commit d508b6f
Started Feb 2, 2022 9:50 PM
Ended Feb 2, 2022 9:55 PM
Duration 04:57 💡
OS Linux Debian - 11.1
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

@godaddy-wordpress-bot
Copy link
Contributor

godaddy-wordpress-bot commented Jan 25, 2022

@godaddy-wordpress-bot
Copy link
Contributor

Code Coverage: 96.63% 💚

🗂 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/dynamic-separator/                  100.00% ✅
src/blocks/events/                             100.00% ✅
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 41237

@godaddy-wordpress-bot
Copy link
Contributor

Code Coverage: 96.63% 💚

🗂 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/dynamic-separator/                  100.00% ✅
src/blocks/events/                             100.00% ✅
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 41246

@godaddy-wordpress-bot
Copy link
Contributor

godaddy-wordpress-bot commented Jan 25, 2022

Performance Test Results:

index master WPEX-1690 change %
focus 164.47 132.25 -19.59%
inserterHover 44.61 38.12 -14.55%
inserterOpen 138.53 129.27 -6.68%
inserterSearch 75.21 63.04 -16.18%
load 27457.1 25601.3 -6.76%
maxFocus 210.57 220.17 4.56%
maxInserterHover 74.97 45.86 -38.83%
maxInserterOpen 561.4 512.5 -8.71%
maxInserterSearch 90.04 89.18 -0.96%
maxType 175.35 91.87 -47.61%
minFocus 138.01 105.6 -23.48%
minInserterHover 36.5 32.05 -12.19%
minInserterOpen 85.15 68.98 -18.99%
minInserterSearch 60.51 52.96 -12.48%
minType 42.74 38.98 -8.8%
type 61.33 53.11 -13.4%

@godaddy-wordpress-bot
Copy link
Contributor

Code Coverage: 96.63% 💚

🗂 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/dynamic-separator/                  100.00% ✅
src/blocks/events/                             100.00% ✅
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 41259

@godaddy-wordpress-bot
Copy link
Contributor

Code Coverage: 96.63% 💚

🗂 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/dynamic-separator/                  100.00% ✅
src/blocks/events/                             100.00% ✅
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 41273

@godaddy-wordpress-bot
Copy link
Contributor

Code Coverage: 96.63% 💚

🗂 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/dynamic-separator/                  100.00% ✅
src/blocks/events/                             100.00% ✅
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 41300

@snovosel snovosel self-assigned this Jan 25, 2022
} );

helpers.checkForBlockErrors( 'coblocks/post-carousel' );
// helpers.checkForBlockErrors( 'coblocks/post-carousel' );
Copy link
Member

Choose a reason for hiding this comment

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

commented out code?

@godaddy-wordpress-bot
Copy link
Contributor

Code Coverage: 96.66% 💚

🗂 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/                             100.00% ✅
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 42233

Copy link
Member

@olafleur-godaddy olafleur-godaddy left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@godaddy-wordpress-bot
Copy link
Contributor

Code Coverage: 96.66% 💚

🗂 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/                             100.00% ✅
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 42248

@AnthonyLedesma AnthonyLedesma modified the milestone: Next Release Jan 27, 2022
@godaddy-wordpress-bot
Copy link
Contributor

Code Coverage: 96.66% 💚

🗂 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/                             100.00% ✅
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 43180

Comment on lines +108 to +124
setTimeout( () => {
const postCarouselContainer = document.querySelector( `.wp-block-coblocks-post-carousel-external-container-${ carouselUuid }` );

// remove the swiper classes so that the external feed does not display within carousel in editor
const swiperWrapper = postCarouselContainer.querySelector( '.swiper-wrapper' );

if ( swiperWrapper ) {
swiperWrapper.classList.remove( 'swiper-wrapper' );
swiperWrapper.classList.add( 'swiper-wrapper-editor' );

const swiperBackButton = postCarouselContainer.querySelector( '#wp-coblocks-post-carousel-swiper-prev' );
const swiperNextButton = postCarouselContainer.querySelector( '#wp-coblocks-post-carousel-swiper-next' );

swiperBackButton.style.display = 'none';
swiperNextButton.style.display = 'none';
}
}, 1000 );
Copy link
Member

Choose a reason for hiding this comment

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

Why does this need a timeout? Could it instead be an async function where we await for the dom elemnts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is triggering specifically the SSR portion of this block, which renders the output. In this case, because the classnames in the editor conflict with the classnames on the front end script, we need to in some way remove the class so that the front end script (which will run regardless) does not invoke the TinySwiper package. I'm not sure what you mean by async function.

Copy link
Member

Choose a reason for hiding this comment

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

Ok so this is meant to prevent the Swiper script from initializing in the editor. I see also the src/js/coblocks-post-carousel.js script has a timeout. Is that related to this timeout for the same reason by chance? Or do you mind explaining the timeout there? I am curious if the timeout is needed because there might not be any elements available (like a race condition) also. I saw something similar with the Counter front-end script where the script could load before the related dom elements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

basically the issue was that when the script was run initially the elements that it is looking for were not rendered and not able to be queryable in order to do the necessary changes. I believe that this script runs before any other rendering and so waiting the timeout allowed the markup to mount to the DOM so that we can make any necessary changes

Comment on lines +98 to +106
export default compose( [
withSelect( ( select, { clientId } ) => {
const blockAttributes = select( 'core/block-editor' ).getBlockAttributes( clientId );

return {
attributes: blockAttributes,
};
} ),
] )( PostItem );
Copy link
Member

Choose a reason for hiding this comment

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

I am confused why this is necessary at all. We are making a store call here when this component has access to the execution context where the attributes exist. On line 183 or 159 of src/blocks/post-carousel/edit.js. Why not simply pass in the existing attributes? You can modify the PostItems like this:

<PostItem key={ i } post={ post } { ...{ ...props } } />

This change will give you full access to the existing props preventing the need for an extra compose and data-store call.

Copy link
Contributor Author

@snovosel snovosel Feb 1, 2022

Choose a reason for hiding this comment

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

Because the PostItem component is rendered dynamically via the Swiper component (through render-props https://reactjs.org/docs/render-props.html ) , the individual PostItem components are not triggered to re-render via the parent PostEdit. Instead, they are connected to the store and will re-render following any dynamic prop update to which they are listening. In the GalleryCarousel a similar pattern is used, though using the Context API.

This way, the Swiper component itself is not re-rendered following any attribute updates, and only the PostItem components are re-rendered specifically in order to minimize any unnecessary re-renders.

Copy link
Member

Choose a reason for hiding this comment

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

Minimization of excess renders sounds like a positive for sure. I suspect there is something I am missing still. I guess I am not clear about how if these attributes are already available in the parent and should not change dynamically why we would expect excess renders. When the attribute changes on the parent, the children would re-render as expected because the passed attribute and related useEffect function are watching.

Copy link
Member

Choose a reason for hiding this comment

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

I feel like I am about to learn something lol.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you look at the below function within the Swiper component,

const renderList = useMemo( () => {
		return list.map( ( item, index ) => (
			<div className={ `swiper-slide` } id={ index } key={ index }>
				{ children( {
					index,
					item,
				} ) }
			</div>
		) );
	}, [ isDraggable ] );

The Swiper component is invoked within the PostEdit and uses a single child which is a function :

{ ( { index: i, item: post } ) => {
    return (
	<PostItem clientId={ clientId } key={ i } post={ post } setAttributes={ setAttributes } />
    );
} }

The rendering order would be as follows --> PostEdit ---> Swiper --> PostItem. However, within the Swiper component function renderList, the function itself is only recalculated following the update of the isDraggable variable since the function is memoized. Therefore, the children function would only be updated if that variable is changed. This separates the concern of the Swiper and the child component that it is rendering and allows us to abstractly use the Swiper component without any information of what it is rendering, and when it should update. It would only update when Swiper specific props are changed. That being said, the children component will have the first render of the attributes if we pass it down as props, though when the attribute changes , the swiper component will not update itself with the updated attributes and so instead we can use redux to listen to any store updates , but within the component that needs that information instead of drilling props down through each level.

Copy link
Member

@AnthonyLedesma AnthonyLedesma Feb 2, 2022

Choose a reason for hiding this comment

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

I appreciate this explanation of why. This makes sense then to keep.

Comment on lines 179 to 183
<button className={ `nav-button__prev ${ navigation === false && 'no-navigation' }` } id={ `${ uuid }-prev` }>
<button className={ navigationClass ? `${ navigationClass }__prev` : `nav-button__prev ${ navigation === false && 'no-navigation' }` } id={ `${ uuid }-prev` }>
<svg className="icon" style={ { transform: 'rotate(180deg)' } } />
</button>
<button className={ `nav-button__next ${ navigation === false && 'no-navigation' }` } id={ `${ uuid }-next` }>
<button className={ navigationClass ? `${ navigationClass }__next` : `nav-button__next ${ navigation === false && 'no-navigation' }` } id={ `${ uuid }-next` }>
Copy link
Member

Choose a reason for hiding this comment

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

This is a little difficult to read now that we are nesting a tertiary as well here. How do you feel about moving this to use the classnames package? For the sake of posterity, I think it would help with understanding the conditional.

/**
 * External dependencies
 */
import classnames from 'classnames';

const buttonClasses = classnames( {
			[ `${ navigationClass }__next` ]: navigationClass,
			'nav-button__next': ! navigationClass,
			'no-navigation': navigation === false
		} );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated this in the newest commit

Copy link
Member

@AnthonyLedesma AnthonyLedesma left a comment

Choose a reason for hiding this comment

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

I am seeing overlapping styles in the editor as well as on the front end. Also on TT1 there is this weird border circle around the arrows.

image

image

@snovosel
Copy link
Contributor Author

snovosel commented Feb 1, 2022

I am seeing overlapping styles in the editor as well as on the front end. Also on TT1 there is this weird border circle around the arrows.

image

image

@AnthonyLedesma I just updated the space between for the slides on the post carousel. that should handle the style overlap

@godaddy-wordpress-bot
Copy link
Contributor

Code Coverage: 96.66% 💚

🗂 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/                             100.00% ✅
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 43352

@AnthonyLedesma
Copy link
Member

I pulled down those latest style changes and rebuilt them. I am still on TT1 here. I am still getting some alignment strangeness on other slides just not that first one now. Here is what I am seeing.
postCarouselSizingUpdated

postCarouselSizingUpdatedAlignment
Also it looks like when we are at full alignment the arrows are offscreen a bit. Maybe we can have styles for those arrows that are targeting the has-align-wide or whatever the applicable class is.

@AnthonyLedesma
Copy link
Member

The front-end seems to have some strangeness here too still. Still see an overlap in this Gif. Also, notice the time to load the Swiper carousel. I wonder if this is because there are 3 on one page. I reload twice in this image to show the time to load.

postCarouselLoadtimeAndSizing

@snovosel
Copy link
Contributor Author

snovosel commented Feb 2, 2022

@AnthonyLedesma I am still not seeing the issue you have in your video but it does not look like you have the updated changes. There would be spacing between the slides per the newest commit

Screen.Recording.2022-02-02.at.4.04.46.PM.mov

regarding the alignment, where in the block settings is this located? I don't see that option

@snovosel
Copy link
Contributor Author

snovosel commented Feb 2, 2022

Screen.Recording.2022-02-02.at.4.08.24.PM.mov

@AnthonyLedesma screen recording of the front end including the newest commit

@AnthonyLedesma
Copy link
Member

regarding the alignment, where in the block settings is this located? I don't see that option

That I show in the following video. It's in the block toolbar.

postCarouselSizingUpdatedAlignment Also it looks like when we are at full alignment the arrows are offscreen a bit. Maybe we can have styles for those arrows that are targeting the has-align-wide or whatever the applicable class is.

@snovosel
Copy link
Contributor Author

snovosel commented Feb 2, 2022

@AnthonyLedesma updated the styles in front end and editor to account for the full width and wide width

@godaddy-wordpress-bot
Copy link
Contributor

Code Coverage: 96.66% 💚

🗂 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/                             100.00% ✅
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 43408

@snovosel snovosel merged commit f5d9ff7 into master Feb 8, 2022
@snovosel snovosel deleted the WPEX-1690 branch February 8, 2022 22:42
@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.

None yet

4 participants