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

Bill Erickson berick at esilibrary.com
Tue Jan 21 18:18:32 EST 2014


On Tue, Jan 21, 2014 at 5:13 PM, <schan at vcn.bc.ca> wrote:

> 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.
>

Indeed, we will want to combine and minify the JS files.  I address this
briefly in my dev log:

http://yeti.esilibrary.com/dev/pub/web-staff-log.html#_2013_12_16_js_minification

We can go all the way to a single, minified JS file if we want to take it
that far.


> 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?
>

Agreed that rearranging the OpenSRF JS libs to use function closures would
be a good thing.  I'm not keen on requiring 3rd-party JS for OpenSRF,
though, since it's a small bit of code and not everyone using OpenSRF JS
will want to use Angular, etc., but I could be crazy.

Thanks for reviewing the code, Steven!

-b

-- 
Bill Erickson
| Senior Software Developer
| phone: 877-OPEN-ILS (673-6457)
| email: berick at esilibrary.com
| web: http://esilibrary.com
| Equinox Software, Inc. / The Open Source Experts
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20140121/5ad2173b/attachment.htm>


More information about the Open-ils-dev mailing list