Google Books Preview should not require Dojo or any other framework
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
* Evergreen 3.0
In solidarity with bugs such as #946110 ("Our aging version of Dojo threatens Chrome support") and #1411699 ("TPAC: Don't load dojo widgets unless we actually need them (for autocomplete)"), we should remove our dependence on Dojo or any other JavaScript library meant to provide cross-browser support, as modern browsers (Firefox, Chrome, IE 11, Edge, Safari, Opera) provide consistent enough DOM and JavaScript support that we can relatively easily provide cross-browser support with vanilla JavaScript.
Loading Dojo (or most other cross-browser libraries) requires many more network requests and parsing and rendering of JavaScript and CSS, which slows down the perceived responsiveness of each page--particularly on machines that our users are likely to use, rather than on the normally high-end phones and computers that developers get to use.
Changed in evergreen: | |
status: | Triaged → Confirmed |
Changed in evergreen: | |
assignee: | nobody → Galen Charlton (gmc) |
tags: | removed: needsreleasenote performance |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
See http:// git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ dbs/lp1685840_ dojoless_ google_ books for a series of patches that:
a) reworks the core JavaScript to require only vanilla JavaScript, and to avoid polluting the global namespace in the process
b) uses EventListeners instead of href=javascript: links
c) avoids loading the Google Books preview JSAPI unless a matching ISBN is found in the Google Books volume API
d) modifies display style directly rather than abstracting it behind hideMe()/unHideMe()
e) uses the viewport's actual dimensions as reported by the browser rather than hardcoding a 600x800 view of the book
f) uses JavaScript to determine the language in which the preview should be displayed rather than having TT2 have to process the script
g) includes the script externally (enabling caching - note that we will want to add this to #1681095 "cache-busting" if that enhancement ends up getting merged) rather than inlining it into each /eg/opac/record page