Skip to content

WIP: Taking jQuery UI off the critical path#2423

Closed
jdlrobson wants to merge 2 commits intointernetarchive:masterfrom
jdlrobson:2340
Closed

WIP: Taking jQuery UI off the critical path#2423
jdlrobson wants to merge 2 commits intointernetarchive:masterfrom
jdlrobson:2340

Conversation

@jdlrobson
Copy link
Collaborator

@jdlrobson jdlrobson commented Sep 27, 2019

Description

I'm working towards pulling jquery off the critical path. To make code review manageable I will be splitting off pieces of code review one by one.

See: #2421 for first code review.

Closes #2340

Technical

Testing

Evidence

@jdlrobson jdlrobson changed the title WIP: 2340 WIP: Taking jQuery UI off the critical path Sep 27, 2019
@jdlrobson jdlrobson mentioned this pull request Sep 27, 2019
@jdlrobson jdlrobson force-pushed the 2340 branch 2 times, most recently from 5e42689 to fdcc08d Compare September 28, 2019 23:40
@jdlrobson jdlrobson force-pushed the 2340 branch 2 times, most recently from 3ab7e81 to 3bbb438 Compare October 5, 2019 00:06
@cdrini cdrini added the State: Work In Progress This issue is being actively worked on. [managed] label Oct 7, 2019
@jdlrobson
Copy link
Collaborator Author

Once #2479 is merged I will drop the "WIP" label from this pull request and I will move 3182e5f into a separate pull request.

1) ol_confirm_dialog relates to dialogs so should be inside dialog.js as a new
function confirmDialog
The behaviour for ol_confirm_dialog is modified to only initialise the dialog
inside the click handler.

2) the code inside automatic initialises some tabs so should be
inside tabs

* tabs:not(.ui-tabs) selector is moved from automatic.js to call
to initTabs
* autohash logic is moved from automatic.js moved to tabs.js
($.support.opacity check is unnecessary as its always supported on our
browser matrix)
We use jQuery UI for a handful of things - changing covers, opening
dialogs and tabs. We don't have these on all pages, so this change
sets up temporary placeholders that load the additional code
only when needed.

Note the code will still load on the majority of pages, but in
a3757ee we will limit the loading of this library to user actions.
For instance dialogs, tabs are invoked on works page for cover management
when they only need to be loaded when the button is clicked.

Fixes: internetarchive#2340
@jdlrobson
Copy link
Collaborator Author

Blocked on #2697 - after which I can drop the WIP status and repost with testing instructions.

@jdlrobson
Copy link
Collaborator Author

Closing in favor of #2709 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

State: Work In Progress This issue is being actively worked on. [managed]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GOAL] Reduce JavaScript loaded on critical path to approx 50kb. (from 110kb)

2 participants