[Resolved] Any chance to remove jQuery dependency?

Home Forums Support [Resolved] Any chance to remove jQuery dependency?

Home Forums Support Any chance to remove jQuery dependency?

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #1209400
    Chad

    The hamburger menu on mobile seems to be dependent on jQuery. Any chance this could be removed?

    This would give me the ability to block jQuery from enqueuing on pages where it isn’t needed and save payload size.

    Thank you.

    #1209424
    David
    Staff
    Customer Support

    Hi there,

    the only thing GP uses jQuery for is the Sticky Navigation. Disable that and if there are any requests for jQuery it will be from a plugin or custom function.

    #1296321
    Chad

    Got it. Thanks.

    #1296503
    David
    Staff
    Customer Support

    You’re welcome

    #1712359
    acela

    On another post, David wrote (January 9, 2021):

    yes the Sticky Nav is still using jQuery. It will be replaced very soon in an upcoming update with vanilla JS.

    Any hope for this soon? It seems everyone is ditching jQuery now (because they can):

    Dear WordPress Plugin/Theme Devs, You Don’t Need jQuery!

    Thanks!

    #1712462
    Leo
    Staff
    Customer Support

    We are still hoping to make this happen. The current issue is the transitional effects are tough to done with CSS only.

    Thanks for your patience!

    #1814241
    Prajwal

    Hi Team,

    Any progress on this one ?. I disabled the jQuery today and the hamburger menu on mobile doesn’t work.

    #1814252
    Elvin
    Staff
    Customer Support

    Hi Prajwal,

    We’re not fully there yet.

    While we’ve done this for the base GP theme scripts, GP Premium takes a lot of time as there are significantly more scripts in it.

    There’s no ETA yet as to when it’s going to be released, but it’s likely after GPP 2.1.

    #1814274
    Prajwal

    Ok so probably another year as I see GPP is still at 2.0.2.

    #1814460
    David
    Staff
    Customer Support

    Hi there,

    we removed most of the jQuery dependency in GP 2.0.
    GP now only loads jQuery for the Sticky Navigation and some Woocommerce functions ( which we won’t necessarily change as Woocommerce is jQuery dependent ).

    The mobile navigation has never required jQuery.
    If its breaking then its’s most likely another jQuery dependent script is at fault. One broken JS can stop the browser from executing other scripts.

    #1815859
    Prajwal

    Hi David, if i disable Jquery, the menu doesn’t drop-down when viewed from Mobile.

    #1815968
    David
    Staff
    Customer Support

    First make sure the Sticky Navigation ( Sticky Mobile Header ) is disabled. This will ensure the Theme is NOT loading jQuery.
    Then check to see if your site is loading jQuery. If it is then theres another plugin making that request. You will need to eliminate that plugin before you can disable jQuery.

    #1815975
    Prajwal

    Here is what i did. I first disabled all the plugins and I noticed that Jquery was still loading. But I did not disable sticky navigation and I am going to try it now.

    #1816054
    David
    Staff
    Customer Support

    Make sure you don’t have the a Sticky Mobile header enabled in Customizer > Layout > Header as well.

    #2102385
    Jaime Martinez

    Hi, everything good?

    Quaestion about the jquery dependency: Is writing a Vanilla Sticky Menu somewhere on the roadmap for GP-Premium? Everything else is already re-written to no-jquery.

    P.s. didn’t want to open a new ticket, because this relevant one was already there.

    Kinds regards,

    Jaime Martinez

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.