ISBAT use coblocks without jQuery being required by default. (Events block issue) #1361
Labels
[Priority] High
This issue/pull request needs resolving before the next release
[Type] Bug
Something that is not working as expected
Milestone
Describe the bug:
Hi,
I updated coblocks to the latest version (1.21.0) and I noticed that now jQuery appears in the source even when no blocks are being used. Using the previous version that we were using (1.15.0) this was not the case.
I narrowed down the issue to Events block enqueuing 'coblock-slick' (https://github.com/godaddy-wordpress/coblocks/blob/master/src/blocks/events/index.php#L139).
If we compare this to the Posts Carousel block (https://github.com/godaddy-wordpress/coblocks/blob/master/src/blocks/post-carousel/index.php#L322) which also uses Slick, it instead uses 'wp_register_script' and 'editor_script' so it is only included for the editor.
Interestingly in the class-coblocks.block.assets.php it seems it looks for the events block and enqueues the scripts.
To reproduce:
Install coblocks 1.21.0.
View source on page not using any blocks.
jQuery is being included.
Expected behavior:
Install coblocks 1.21.0.
View source on page not using any blocks.
jQuery is not being included.
The text was updated successfully, but these errors were encountered: