These are chat archives for systemjs/systemjs

31st
May 2016
Hendrik Roth
@HendrikRoth
May 31 2016 09:27
hello guys, is there a way to inject js code in the browser? i would like to send a “component” via my express application. kinda like loading google maps. here the example: https://gist.github.com/HendrikRoth/480193d104bdc6590dfb9bb03d2154b9 …. the innerhtml part of the div#test is changed, but systemjs seams not to be runned. also not my console.log statement. any ideas?
Hendrik Roth
@HendrikRoth
May 31 2016 10:07
found a way
Sharon (Sean) Rolel
@Mosho1
May 31 2016 12:17
Do I have a way to know system loaded everything it was "supposed" to?
Patrick Surrey
@psurrey
May 31 2016 12:29
Hey guys, I want to consume a webpack bundle in my systemjs app, any ideas if that is possible?
Sharon (Sean) Rolel
@Mosho1
May 31 2016 12:35
of course
just do it ™
point a mapping in your config to the bundle's location
and then import it
and you're done
Patrick Surrey
@psurrey
May 31 2016 12:39
Ok if have tried that. I'm trying to import a webpack bundled react component into my angular 2 app. Using angular-cli it gets bundled up into one large main.js file. In that file I can see, that the webpack bundle is included wrapped in a function() {} but this destroys the "entry" of the current load in systemjs
which leads to the issue that the main bundle itself is never executed
I guess angular-cli uses systemjs builder under the hood
@Mosho1
Sharon (Sean) Rolel
@Mosho1
May 31 2016 12:41
can you show me the bundle
I cannot find the bundled version hosted somewhere, it is included in the npm package
Patrick Surrey
@psurrey
May 31 2016 12:48
Vineet Dev
@devin6391
May 31 2016 12:52
Hi
Hendrik Roth
@HendrikRoth
May 31 2016 12:54
@devin6391 is the option “defaultExtension” not called defaultJSExtension ?
Vineet Dev
@devin6391
May 31 2016 12:54
I haven't seen that anywhere..
defaultExtension could be .js or .ts
Vineet Dev
@devin6391
May 31 2016 12:59
@HendrikRoth - But the problem is not default extension I think. Also if I do that then my imports like "angular2/core" will always fail
System js bundles everything fine
no error thrown
But it just doesn't run
Patrick Surrey
@psurrey
May 31 2016 13:40
@Mosho1 Ok, I've seen that my depedency is built with webpack with libraryTarget set to "umd" (see https://webpack.github.io/docs/configuration.html#output-librarytarget) as I understand it they can detect which module system is used and proceed accordingly. But it seems as if systemjs builder can not handle "umd"?
Sharon (Sean) Rolel
@Mosho1
May 31 2016 14:18
sure it can
the point of umd is being universal
(it's the 'u' in 'umd')
@psurrey and if you look at line 5589 you'll see that the function starting at line 7 is an IIFE, it gets called immediately
Sharon (Sean) Rolel
@Mosho1
May 31 2016 14:24
@psurrey can you create a repo with the isolated problem for me to clone and run? I don't have a lot of time but if you do that I'll try and see what the problem is
Patrick Surrey
@psurrey
May 31 2016 14:27
@Mosho1 thanks I would appreciate that, I'll start right now doing that ;-)
Patrick Surrey
@psurrey
May 31 2016 16:13
Rob Walsh
@brombomb
May 31 2016 16:43
Can anyone give me a jumping off point for using systemjs to build a bundle for an angular2 project? I've looked at the angular2 starter project but since we didn't start from that seed it's hard to wrap my head around how to adapt it to my project
Jake Niemiec
@jakeNiemiec
May 31 2016 17:53
@brombomb Typescript or ES6?
Rob Walsh
@brombomb
May 31 2016 18:49
@jakeNiemiec Typescript
Jake Niemiec
@jakeNiemiec
May 31 2016 21:05
This message was deleted
@brombomb This may help.
Sharon (Sean) Rolel
@Mosho1
May 31 2016 21:50
@psurrey thanks, I'll try taking a look a bit later or tomorrow if I don't make it