0

External JavaScript Files in Lotus Apps

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

16 comments

  • 0

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

  • 0

    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?

  • 0

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

  • 0

    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.

  • 0

    +1 on this request

  • 0

    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!)

  • 0

    +1

  • 0

    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.

  • 0

    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

  • 0

    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.

  • 0

    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

  • 0

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

  • 0

    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 :(

  • 0

    Hi Maxime,

    What is the current status on allowing the use of external JS libraries in public apps? Is this something that you guys are still considering, or is it a definitive and final "no go"? 

    Obviously the possibilities with apps would be greatly increased if we could use third-party libraries, but I also perfectly understand that this is an area where you want to move carefully. 

  • 0

    Hi Mick

    We have decided not to "natively" support external libraries in the Apps framework. Instead we are moving towards a more "iframe" based approach, where we will let you decide your technical stack, libraries etc... and iframe that "app" inside of Zendesk.

    That's the conceptual explanation. We'll reach out soon with more information

    Thanks

    Maxime

  • 0

    Hi Maxime,

    That makes a lot of sense, and I believe it's a good approach. 

    Will you continue to support the existing framework, or will it, somewhere down the road be an iframe-only solution, and no more support for "direct JavaScript"? Most of the private apps we are doing, is actually mostly for manipulating ticket and user data, and calls to the Zendesk API is very fast, as the call comes from "within" the system. I suspect that might change if we have to do the calls from an external server. And then there is of course the advantage of not having to run any external services for an app, when everything can be run directly on Zendesk. When I look at the amount of time we spend on support, it's dramatically higher on apps that rely on an external service to run, than it is for apps that just run on Zendesk. 

Please sign in to leave a comment.