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

Improve treatment of jQuery as "special citizen" #71

Closed
PatTheMav opened this issue Oct 31, 2016 · 1 comment
Closed

Improve treatment of jQuery as "special citizen" #71

PatTheMav opened this issue Oct 31, 2016 · 1 comment

Comments

@PatTheMav
Copy link

PatTheMav commented Oct 31, 2016

Hey @futtta - we all know and love how jQuery needs to stay in the header to stay compatible with plugins, templates, etc.

Seeing that the optimised CSS and JS use deferred loading by default, I suggest recognising the special role jquery has by giving it it's own setting, e.g.:

  • Enable deferred jQuery in header, or
  • Exclude jQuery from Autoptimize and make it deferred instead

Which (if enabled) excludes it, but instead sets the "defer" attribute when found in the page.

I'm kind of hesitant on installing yet another plugin just to make one script deferred if Autoptimize is handling everything else without issue.

EDIT: Nevermind - upon further testing I haven't been able to make even a deferred jQuery behave properly with some Jetpack modules (InfiniteScroll adds inline code depending on jQuery being loaded without Autoptimize being able to grab it even with enabled aggregation of inline JS).

Consider this issue "invalid".

@futtta
Copy link
Owner

futtta commented Nov 1, 2016

indeed; asyncing jquery would indeed break lots of inline JS that requires jquery.

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

No branches or pull requests

2 participants