These are chat archives for systemjs/systemjs

24th
Nov 2016
Gert Sønderby
@gertsonderby
Nov 24 2016 09:04
Relating to my previous misadventures mentioned above, I'm having trouble loading in a source file. Loding it with an ES6 import statement works fine (but doesn't use my mocked module), loading it with System.import() breaks with an error:
(SystemJS) Cannot read property 'loadPageDef' of undefined
'loadPageDef' is an exported function in the module. This happens even if I don't mock out the dependency. Anyone have an idea what can cause this?
Gert Sønderby
@gertsonderby
Nov 24 2016 09:22
(This is when running in node.js)
λex Vincent
@alexisvincent
Nov 24 2016 10:02
I'm not sure how system JS in node works
Gert Sønderby
@gertsonderby
Nov 24 2016 10:02
I figured it out. It was my own fault. Kids, don't do silly stuff like trying to reference variables before they're set.
Hendrik Roth
@HendrikRoth
Nov 24 2016 12:46
Does someone know how to make a progress bar for the systemjs.import ?
I don't see anything in the api which could give me a value of the process :(
Madara Uchiha
@MadaraUchiha
Nov 24 2016 13:40
hOi
I'm reading about SystemJS now and I have a few questions
So SystemJS working with ES6 modules means that it knows to unwrap the import statements?
It's my understanding that SystemJS uses Promises for loading modules
But import statements are seemingly sync (like await in async function is "seemingly" sync)
Does that mean that SystemJS does the same action?
Gert Sønderby
@gertsonderby
Nov 24 2016 13:53
@MadaraUchiha Yes, it does mean that you can use import statements as described in the ES2015 standard.
I import the app entry point with System.import(), and then generally use ESM style import statements from there.
Inside my app, I don't use System.import(), but for testing (and mocking modules) I do replace some import statements with Syatem.import() calls.
@HendrikRoth I don't think that's possible. SystemJS does not, to my knowledge, track the progress of importing. But what is your use case, maybe we can find an alternative?
Hendrik Roth
@HendrikRoth
Nov 24 2016 13:56
@gertsonderby Just wanted to show the progress for loading my app (which is kinda big).. otherwise i just use a infinitle loop animation
Gert Sønderby
@gertsonderby
Nov 24 2016 13:57
@HendrikRoth Hmm, yeah, you might be better off just showing a spinner or something. If you have a timeout for loading the app, you might use that to fake a progress bar.
(We do that for our installation process. :) )
Hendrik Roth
@HendrikRoth
Nov 24 2016 14:00
@gertsonderby yeah or a fake
Gert Sønderby
@gertsonderby
Nov 24 2016 14:01
IME, if a user sees something moving, they'll accept a waiting period. ;)
Hendrik Roth
@HendrikRoth
Nov 24 2016 14:01
yepp a proven design ;-)
Philip M. White
@philipmw
Nov 24 2016 20:30
Hello, all.
I have this:
System.register(["./MapLocation"], function ......
Then I am trying to provide a mapping for "./MapLocation".
So I am doing:
System.config({
  map: {
    "./MapLocation": "some-location-here"
  }
}
But system.js doesn't use that mapping.
Any idea what I'm doing wrong?
Philip M. White
@philipmw
Nov 24 2016 20:47
Ok, I fixed my problem by changing the relative name (./MapLocation) to an absolute (MapLocation).
happy thanksgiving, all!