This generator can be used to create a Lightstreamer JavaScript library that only includes the classes you use in your application.
To use it:
You have four options:
require
method.
Unfortunately, this approach will pollute the page with a number of define
calls using three or four letter module names (all of the names using a common "ls" prefix).
This is completely safe only if Lightstreamer is the only library using the AMD mechanism on the page. If you are including other libraries that use AMD, or your own code uses AMD to define its own modules,
you may need to choose the next option.
In all the cases, the Lightstreamer global is reserved and will be created on the page by the Lightstreamer library (including AMD cases).
Note that the example on the right will always reflect an example based on the selected options (but not the selected classes).
Choose whether to include the Promise polyfill or not:
the library internally uses the Promise class; if the polyfill is not included either supply one to the page/application yourself, or use the library on a browsers/environment having such class readily available.
In case you have chosen one of the AMD versions, you can optionally include a fake AMD loader; the fake AMD loader will expose the define
and require
methods but with limited capabilities:
<script>
tagsdefine
callsrequire
method can only be called if all the define
calls for the needed classes have already been executedIf you need a full fledged AMD loader, we suggest you to check out RequireJS.
Still having doubts? You can visit our forums to clear them out.