These are chat archives for systemjs/systemjs

15th
Sep 2015
Domenico Matteo
@dmatteo
Sep 15 2015 09:01
Has anyone ever successfully loaded SystemJS in a jsdom instance?
Simon Hampton
@simonh1000
Sep 15 2015 10:03

Not getting any transpiling.

 System.config({
    baseURL: "angular",
    defaultJSExtensions: true,
    transpiler: "babel",
    babelOptions: {
    "optional": [
      "runtime",
      "optimisation.modules.system"
    ]
  },

and building with gulp

  gulp.task('systemjsbundle', function () {
    builder.reset();

    return builder.loadConfig('./angular/config.js')
    .then(function() {
        var options = {
            sourceMaps: true
        };
        return builder.build('./angular/app.js', 'dist/build.js', options);
        // return builder.buildSFX('./angular/app.js', 'dist/scripts/build.js');
    })
    .catch( console.error );
  });

Have I gone mad?

i.e. my build.js is full of arrow functions that are not working in e.g. safari
Simon Hampton
@simonh1000
Sep 15 2015 10:10
systemjs-builder "0.13.6"
Guy Bedford
@guybedford
Sep 15 2015 12:19
@simonh1000 only modules with import and export syntax are transpiled by default
you need to add meta configuration to set the format as es modules otherwise
ǝlzlǝoq lǝᴉuɐp
@dbo
Sep 15 2015 12:21
@dmatteo document.write has its issues in jsdom -- preload the system-polyfills.js is the cure
Domenico Matteo
@dmatteo
Sep 15 2015 12:23
@dbo thx, I'm gonna try that
Simon Hampton
@simonh1000
Sep 15 2015 12:27
@guybedford can you be more specific - id that an option you are referring to?
ǝlzlǝoq lǝᴉuɐp
@dbo
Sep 15 2015 12:27
@guybedford It seems that if my module A has a failing indirect dependency on e.g. F, I get a proper error when trying to import it. However, loading another module which has a similar indirect dependency on F, I don't get an error, but of course execution fails.
Simon Hampton
@simonh1000
Sep 15 2015 12:29
I'm using Angular - the controllers are in Classes and imported by name, but that does not work for Directives. For those I just create functions, import the file as is and then use the directive variable names in the angular setup commands
OK, forget - I see what I have to do
Simon Hampton
@simonh1000
Sep 15 2015 12:44
Thanks @guybedford
Simon Hampton
@simonh1000
Sep 15 2015 12:51
As with my previous app, I needed to build as a SFX to get it to load in Safari. (I can't understand why others don't report similar issues as I'm not doing anything very bespoke)
Guy Bedford
@guybedford
Sep 15 2015 13:51
@dbo is the failure an execution error or loading error?
it's certainly an issue if you're not getting an error
Peter Müller
@Munter
Sep 15 2015 18:47
Is System.fetch a proper fetch polyfill?