• Resolved bheching

    (@bheching)


    Hi there,

    While trying to remove jQuery on the front-end, I noticed that full-screen-mobile-menu.min.js (oceanwp-full-screen-mobile-menu) depends on jQuery, which complicates things a bit. I’m not an expert, but it seems to me this dependency is not necessary (any more).

    Would be awesome, if you could have a look and remove it if not needed. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Shahin

    (@skalanter)

    Hello @bheching,

    Thank you for reaching out,

    Please provide a live URL of the issue so we can investigate further.

    Currently, after several major updates, we no longer require jQuery and are fully utilizing vanilla JS in OceanWP.

    Please recheck your issue and keep us posted.

    Best Regards

    Thread Starter bheching

    (@bheching)

    Hi Shahin,

    thank you for getting back to me. Let me elaborate a bit. Functions.php of OceanWP 4.0.5 contains following lines:

    $main_script_dependencies = array( 'jquery' ); (line 517)
    ...
    wp_enqueue_script( 'oceanwp-full-screen-mobile-menu', $dir . 'full-screen-mobile-menu.min.js', $main_script_dependencies, $theme_version, true ); (line 583)

    I wonder why jQuery is set as a dependency for any of your scripts, if you are fully utilizing vanilla JS.

    I’m probably just missing something but I thought i’d ask, since I ran into problems unloading jQuery while keeping the “child” scripts loaded using Asset CleanUp in combination with Wp-Optimize’s Minification Feature. (a bit tricky to explain)

    Best regards and have a great day!

    Hello @bheching,

    Thank you for reaching out and thank you for your patience.

    We appreciate your feedback regarding the jQuery dependency in oceanwp-full-screen-mobile-menu. After reviewing the script, we’ve determined that jQuery is not necessary for this specific file. We will remove its dependency in an upcoming update(s) to ensure a more streamlined experience.

    However, please note that some other parts of the theme still rely on jQuery(the jQuery in WordPress core itself), so it cannot be removed entirely at the theme level.

    I hope it helps,
    Best Regards

    Thread Starter bheching

    (@bheching)

    Thank you, Shahin and team. Very much appreciated!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.