How to load ag-grid-react from a CDN - ag-grid

Trying like this (full HTML file contents):
<script src="https://unpkg.com/react#16.5.2/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom#16.5.2/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/ag-grid-community#19.0.0/dist/ag-grid-community.min.js"></script>
<script src="https://unpkg.com/ag-grid-react#19.0.0/umd/ag-grid-react.min.js"></script>
But ag-grid-react doesn't load:
Uncaught TypeError: Cannot read property 'ColDefUtil' of undefined
ag-grid-community.min.js has created window.agGrid and there is ColDefUtil there, but ag-grid-react fails to find it.
Please advise.

I ended up dynamically loading (heavy) ag-grid from a CDN and compiling (light) ag-grid-react into one of app chunks and wiring them together via webpack externals.

Related

TypeError: L.TileLayer.sygicRestriction is not a function

I'm trying to add a truck restrictions layer to my map using Sygic's Leaflet 1.0.3, and their plugin 1.1.0 with an evaluation key. I'm receiving the following error in the FireFox JavaScript console:
TypeError: L.TileLayer.sygicRestriction is not a function
This makes me think that there's a new version of the plugin, but I don't know the URL since it's not in the documentation.
NOTE: It might be nice to always host the latest like:
https://maps.api.sygic.com/js/leaflet.sygic-latest.js
or just:
https://maps.api.sygic.com/js/leaflet.sygic.js
Here's an excerpt from my code, which is pretty much the same as the example in the online documentation:
<link rel="stylesheet" href="https://maps.api.sygic.com/js/leaflet/1.0.3/leaflet.css">
<link rel="stylesheet" href="https://maps.api.sygic.com/js/sygic/1.2.0/leaflet.sygic.css" />
<script src="https://maps.api.sygic.com/js/leaflet/1.0.3/leaflet.js"></script>
<!-- *** Is there a newer version of the sygic leaflet plugin? ** -->
<script src="https://maps.api.sygic.com/js/leaflet.sygic-1.1.0.js"></script>
...
var map = L.map('mapContainer');
L.TileLayer.sygic('***MY KEY ***',{poi:true,restriction:true}).addTo(map);
L.TileLayer.sygicRestriction('*** MY KEY ****', {categories: ['NoTruck', 'MaxHeight']}).addTo(map);
Any ideas?
I found the updated plugin URL in the examples posted to GitHub:
<script src="https://maps.api.sygic.com/js/sygic/1.3.0/leaflet.sygic.js"></script>

How to use Strophe.js in ionic 2 for chat with XMPP?

I want to create a chat module in ionic platform then i got example from here, but this solution looks older and its using ionic 1 , using $scope and and code is written in .js files which is including below mentioned files...
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/routes.js"></script>
<script src="js/services.js"></script>
<script src="js/directives.js"></script>
In my application .ts files are used and different methods for controlling and routing and this code is using different methods. and i'm unable to find example of using strophe.js with ionic 2 and typescript code. can anyone help me? by giving example, link or steps of using strophe.js in ionic 2 such as how to make connection, how to get archived messages, manage presense, get contact list etc.

SAPUI5 creating, but not running preload files

I have set up the following bootstap, with data-sap-ui-preload set to "auto"
<!-- Bootstrap the UI5 core library -->
<script id="sap-ui-bootstrap"
src="resources/sap-ui-core.js"
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-compatVersion="edge"
data-sap-ui-preload="auto"
data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-resourceroots='xxxxxxxxxxx'>
</script>
This creates a Component-preload.js file in all of my 3 separate apps.
Unfortunately, when I run it, the files aren't minified, and I can access the controller etc directly.
Has anyone else came across this issue?
if I understand correctly you are expecting that "data-sap-ui-preload" creates additional files and also minifies the code. Is that correct?
If i read the documentation correctly this is not what this parameter is used for.
If you are looking of ways on how to "minify" your could you should look into GruntJS. There is also a UI5 Grunt task runner that is used by SAP itself.

Is is possible to load .coffee script file to browser and execute?

I am trying to load coffee script inside a sample.coffee file along with the coffee-script.js file and perform some simple operations on the HTML. But i am not able to load the sample.coffee file.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="sample.coffee" type="text/coffeescript"></script>
<script src="coffee-script.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
Here is the coffeescript code inside sample.coffee
message = "Welcome to Coffeescript"
alert message
I referred the blog http://forgivingworm.wordpress.com/2010/09/27/running-coffeescript-in-browser/
I trying to run this in MVC4 project on .cshtml. So I am running under MS world.
I am not sure if this is possible or not? any insight into this would be greatly appreciated.
I am able to solve this issue by using the CoffeeSharp http://tomlokhorst.github.com/CoffeeSharp/ It gives handler for .coffee files also converts the coffeescript to javascript on the browser.
Also I am able to compile the coffeescript to javascript during the build event itself which solves deployment and performance related issues.
I dont think this will work like you tried it.
You will need something like requirejs and the coffeescript loader
at https://github.com/jrburke/require-cs.
However I would strongly discourage this and rather have it compiled before loading into the browser (require.js is encouraged though). You might find grunt.js helpful for "building" your app before deploying.
That html works fine for me. I used the coffee-script.js found here: https://cdn.rawgit.com/jashkenas/coffeescript/1.11.1/extras/coffee-script.js and my sample.coffee is:
x = ->
alert("hi")
x()
If you open the Javascript console, do you see any errors?

In Gwt where the path of script(appName.gwt.js) which loads gwt app comes from?

I have started Gwt last week. And I was trying to create application without using sample app. So initially i have typed following line in html file(Application Name-loginAppGwt, package- LoginAppGwt)
<script type="text/javascript" language="javascript" src="LoginAppGwt/LoginAppGwt.nocache.js"></script>
but it was not loading the gwt module. When i changed it to
<script type="text/javascript" language="javascript" src="loginAppGwt/loginAppGwt.nocache.js"></script>
It was working fine.
But in one of the application which i have created using sample application of gwt, there was written(application name- testingApp, packagename- test)
<script type="text/javascript" language="javascript" src="testingapp/testingapp.nocache.js"></script>
So , my doubt is where this name comes from like in my application loginAppGwt was correct but in sample application testingapp was correct??
Thanks in advance.
Module name can be manipulated via <module rename-to="newname">. Then the path would be newname/newname.nocache.js
Check if your example had something similar in it's module descriptor.
Update:
Loading of JS scripts is affected by filesystem case-sensitivity because scripts are loaded from files. However, GWT-RPC is handled by servlets and is always case sensitive. This is important because, GWT-RPC urls are prepended with package name which seems to be derived from first part of script name in a host file (I just tested this).
So while the main script would be loaded on case-insensitive filesystems regardless of the script name case, the GWT RPC would only work if package names are equal.