[OPEN-ILS-DEV] staff client prototype, feedback/1

schan at vcn.bc.ca schan at vcn.bc.ca
Tue Jan 21 17:13:20 EST 2014


I want to give a bit of feedback to the staff client prototype that was
recently released.

The home page shows a number of Javascript files being loaded within
<script> tags. See the source file
Open-ILS/src/templates/staff/t_base_js.tt2.[1] I see a couple of related
issues here.[2]

1. First-time download of the scripts will take a relatively long time,
because they will happen sequentially and synchronously.  An alternative
strategy is to combine ('link') the ones together that are not
angularjs-related into fewer files, which will lead to fewer downloads,
for example, adopting the strategy presented in a recent blog post[3] of
a UI developer who uses the angular framework, where he discusses the
combined use of requirejs and angularjs. In the comment section of the
blog post, there is a link to another related discussion worth reading.
requirejs.org is the canonical library to use to package Javascript
files into modules that can be linked together and downloaded on-demand.
requirejs supplies a linking tool that would be used during build time.

2. The Javascript files in the IDL/opensrf area are not defined within function
closures, which will expose internal variables and objects as globals.  Would
it be more useful to redefine the opensrf files into an angular network
service, or if not, then into requirejs modules?


[1] http://git.evergreen-ils.org/?p=working/Evergreen.git;a=blob_plain;f=Open-ILS/src/templates/staff/t_base_js.tt2;hb=f8e45ef3c8656430d78829914a9e5cfb5ab0d866

[2] The top of the file has a TODO saying, 'combine and minify JS',
which sort of acknowledges issue 1.

[3] http://solutionoptimist.com/2013/09/30/requirejs-angularjs-dependency-injection/

-- 
steven <steven.chan at bc.libraries.coop>
bc libraries cooperative/sitka


More information about the Open-ils-dev mailing list