Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-5964

Render blocks before loading jQuery

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Released
    • Icon: Must have Must have
    • 2.50.1
    • None
    • 3
    • Performance, Technical Debt
    • Sprint #155
    • deimos

      Currently we load the blocks script as a dependency of the script of master theme, which in turn depends on jQuery. I did a quick test and it seems to not really depend on the master theme script, and it definitely doesn't depend on jQuery.

      I also noticed that, interestingly, we're currently loading WP's super old version of jQuery (1.X), even though we're registering it ourselves (3.X). It's solved by unregistering the 'jquery' handle first, though we need to double check if it causes any issues with other WP libs we load on the front end (didn't see any yet).

      https://github.com/greenpeace/planet4-master-theme/pull/1300

      https://github.com/greenpeace/planet4-plugin-gutenberg-blocks/pull/500 

            pvincent Pieter Vincent
            pvincent Pieter Vincent
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: