These are chat archives for systemjs/systemjs

28th
Nov 2016
nastakhov
@nastakhov
Nov 28 2016 13:32
Is it possible to run angular2 AoT build without rollup/webpack, just using systemjs ? Always got those strange traceur errors. Does anyone have example ?
Andrei Balmus
@abalmush
Nov 28 2016 14:16
Hi guys, How can I detect that all modules are loaded? I have robot tests and I need to know when all SystemJS modules are loaded. Onload event didnt help because SystemJS uses ajax to load modules.
Gert Sønderby
@gertsonderby
Nov 28 2016 14:19
Promise.all([
    System.import('onefile'),
    System.import('twofile'),
    System.import('threefile')
]).then(function(modules) {
    // your program code
});
@abalmush That there is how I do it.
More or less.
Andrei Balmus
@abalmush
Nov 28 2016 14:23
Hi @gertsonderby, yeah that migth work in case you work with JavaScript, but I use Robot Framework for functional testing, and I can’t use this approache unfortunatly
I can only subscribe to some events
or run some javascript before or after unload
Gert Sønderby
@gertsonderby
Nov 28 2016 14:25
Use that method to generate a hook or signal that Robot can handle, then? I've never used Robot. Don't much know what it can or can't do.
With Nightwatch (which we use), I tend to wait for particular elements to appear, driven by the JS code. Seems to me you ought to be able to do something of that ilk as well. Maybe not with DOM elements, but with some other means of sending an event to Robot.
If you have lazy-loading modules to deal with, you'll need to handle that as well, possibly by similar means.
Andrei Balmus
@abalmush
Nov 28 2016 14:29
yeah I will try to find out, I thought SystemJs already have some flag or event that all modules are loaded. Thanks a lot for your help @gertsonderby
Gert Sønderby
@gertsonderby
Nov 28 2016 14:29
YW, wasn't much help after all. :)
Andrei Balmus
@abalmush
Nov 28 2016 14:30
no worries mate, I was thinking about sending an event to robot, so I will try to do that
Sharon (Sean) Rolel
@Mosho1
Nov 28 2016 15:40
can I avoid transpilation altogether?
like, don't try to detect ES6
Nick George
@Izzmo
Nov 28 2016 16:59
Good question!
Yes.. if you don't need to support older browsers. You can actually get by a lot even in IE11.
with ES6
What you need transpilation for is the newer specification items.. like for..in, decorators, rest params, etc.
But.. if you don't care about older browsers, then you can get by for most of that stuff now.
@Mosho1
Sharon (Sean) Rolel
@Mosho1
Nov 28 2016 18:11
Yeah, but what I mean, if I omit transpiler then it tries to import traceur when it detects ES6
Josiah Haswell
@josiahhaswell
Nov 28 2016 20:54

Hi folks. I'm trying to import mxgraph, and I can't seem to get it to work. Here's the problem:
I installed mxgraph via jspm install mxgraph=github:jgraph/mxgraph-js, which added

    "mxgraph": "github:jgraph/mxgraph-js@master",

to my config.js

From there, I import it via

import {mxGraph} from 'mxgraph'

which gets transpiled into:

define(["require", "exports", 'mxgraph', "aurelia-fetch-client", 'aurelia-framework'], function (require, exports, mxgraph_1, aurelia_fetch_client_1, aurelia_framework_1) {
    "use strict";
    var Builder = (function () {
        function Builder() {
        }
        Builder.prototype.attached = function () {
            alert(mxgraph_1.default);
        };
        Builder = __decorate([
            aurelia_framework_1.inject(aurelia_fetch_client_1.HttpClient), 
            __metadata('design:paramtypes', [])
        ], Builder);
        return Builder;
    }());
    exports.Builder = Builder;
});
but mxgraph_1 is always undefined
mxgraph-js@master.js contains
module.exports = require("github:jgraph/mxgraph-js@master/javascript/mxClient.js");
and mxClient.js just contains standard declarations, like var mxClient = ...
Any help would be super appreciated