Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Not applicable

Define a CDN in a Qlik Sense Extension

Hi,

Is it possible to reference a CDN (reference js or css via url) in the define statement of a Qlik Sense Extension?  I may have missed it, but I don't think I've seen a reference to a CDN.

If so, please provide an example for me to see how to do it.

From a best practice standpoint, what is your opinion of using a CDN in an extension?

1 Solution

Accepted Solutions
Employee
Employee

Re: Define a CDN in a Qlik Sense Extension

Hi Jeffrey,

Using a CDN is fine in an extension (see attached HCbasicLine.zip) a highchart.js extension example.

The tricky part is injecting CDN's that are dependent to each other, it's something that have to be tested.

aiham

5 Replies
Employee
Employee

Re: Define a CDN in a Qlik Sense Extension

Hi Jeffrey,

Using a CDN is fine in an extension (see attached HCbasicLine.zip) a highchart.js extension example.

The tricky part is injecting CDN's that are dependent to each other, it's something that have to be tested.

aiham

Not applicable

Re: Define a CDN in a Qlik Sense Extension

I'll mark the above correct, but please explain a situation where CDN files may have dependencies.

Employee
Employee

Re: Define a CDN in a Qlik Sense Extension

Let's say you have the main library of highchart.js and you need to get in also the Highchart 3D plugin like in this example: Edit fiddle - JSFiddle

You may go into trouble with the plugin loading faster than the library itself.

aiham

Employee
Employee

Re: Define a CDN in a Qlik Sense Extension

Great, didn't know that detail about RequireJS ...

Employee
Employee

Re: Define a CDN in a Qlik Sense Extension

Personal preference but I usually define it in the require config instead.
Benefit is that I can then shim modules if I need a specific load order.

require.config({

paths: {

   'somelibrary': 'https://somecdn.com/somelibrary

  }

})

define(['somelibrary'], function() { //extension code }));

Community Browser