Forums/Community/Zendesk Apps

External JavaScript Files in Lotus Apps

Jeff Tanner
posted this on August 29, 2012 09:49

Hi

It is not clear from the documentation if I can extend a Lotus App with JavaScript code within an external *.js file.

Is this functionality possible, and if so then how should it be referenced from within app.js ?

Thank you,

Jeff in Seattle

 

Comments

User photo
Jake Holman
Product Manager

Hi Jeff, the app framework does not currently support the loading of external JavaScript libraries.

August 29, 2012 09:50
User photo
Alan Byrne

This is quite a big limitiation.  We have been using external JS libraries for many purposes with the classic app.  This will severely limit our ability to port many of our widgets to lotus.  Are there plans to support this and when cna we expect this functionality?

September 18, 2012 02:18
User photo
Jake Holman
Product Manager

At the moment we have no plans to support external libraries. We may open this up to a select few in the future.

September 18, 2012 08:21
User photo
Jeff Tanner
tangocard

If not a way to provide external libraries, provide support for internal libraries (in other words, not put all the code within app.js).

My app.js is getting quite large.

September 18, 2012 11:35
User photo
Denis Manente
novatrend

+1 on this request

October 11, 2012 05:01
User photo
James Rosen
Zendesk

You could always compile your JavaScript before zipping with something like GlueJS. We're working on build tools and we'll make sure to take into consideration the case where you would want to break up your own app into multiple files. (This is a good programming practice, so we certainly don't want to discourage it!)

October 13, 2012 09:53
User photo
Alexander

+1

October 23, 2012 13:53
User photo
John Banks
ANCILE Solutions, Inc.

I agree this is quite a bit limitation.  Has Zendesk reconsidered this feature or are there still no plans on addressing this in the future.

March 05, 2014 04:08
User photo
Maxime
Product Manager

Hi John

We're still actively investigating it, the truth is that we all really want to do it! We would use it in our own Apps a lot.

However we want to make sure we do this right, and there is quite a fair bit of risk in enabling third party developers to use external javascript files

I'll keep you posted at the end of the month when we have a clearer idea of what can and can't be done

Thanks!

Max

March 05, 2014 09:46
User photo
Manohar Chapalamadugu

Hi Max - I am very surprised by this move and I do not understand why third party js files cannot be downloaded. 

I am not sure why enabling third part scripts can be risky. Please shed light. Even Google Apps allows this in their Gadgets API. 

On a side note, can't I bundle headjs or yepnope and download the files on the fly?

Thanks.

March 20, 2014 08:06
User photo
Maxime
Product Manager

Hi Manor

I understand your surprise. The main reason is a risk for our application in terms of performance. You could have multiple Apps using the same libraries, loading it multiple times, loading it for no reasons etc... All those reasons make it tricky from a performance standpoint. 

That' the reason why we are moving slowly on this, we want to make sure we do things right. I'm sure you can understand that.

As for your side note nothing prevents you from doing that in your private App but if you ever want to pass public validation you'll need to follow this document:

https://github.com/zendesk/demo_apps/blob/master/Bestpractices.md

Thanks!

Maxime

March 20, 2014 18:23
User photo
Praveen Kumar

How do I include a library js (third party) within the app? Do I need to attach to head in the app.js init?

March 27, 2014 04:17
User photo
Praveen Kumar

Also, can I use jquery click $j.click and getJSON instead of using Zendesk events and ajax ways? The app is fairly very big and I do not want to keep changing them all :(

March 27, 2014 04:23