Implemented Conditionally load Pikaday

Kirby

Well-known member
As it is right now, Pikaday (date picker component) CSS & JS is included in XF core, eg. it is being loaded on every page.

But this component is rarely being used, as far as I can see only for
  • Advanced search form
  • Editing custom fields that have a date picker
  • Editing user bans
I did a quick check on one of our largest XenForo 2 forums and thouse pages seem to account for < 1% traffic.
So on most pages, this does add overhead for parsing CSS & JS although it is never being used.

I would be great if this could be changed so that Pikaday resources are conditionally loaded only when they are really required.
This would most likely increase the amount of JS included on affected pages by one, but that seems well worth it to me.
 
Upvote 10
This suggestion has been implemented. Votes are no longer accepted.
Hmm, I might be wrong but this doesn't seem to be fully implemented in 2.2.4?

As far as I can see, core.less still unconditionally includes core_pikaday.less which causes the approx. 3000 bytes Pikaday CSS to be included on every page.
 
Last edited:
Top Bottom