These are chat archives for systemjs/systemjs

29th
May 2015
Veaceslav Cotruta
@katrotz
May 29 2015 11:17
@davis check the jspm bundle for bundling your source code into a bundle
Anton Moiseev
@antonmoiseev
May 29 2015 14:48
Hi, guys. I'm just getting familiar with SystemJS and ES6 Module Loader. Could you help me with a quick questions. Am I right I can't use es6-module-loader alone (w/o SystemJS) for production (i.e. for ES5-compiled app) since it doesn't include System.register() implementation?
Guy Bedford
@guybedford
May 29 2015 15:02
@antonmoiseev you should be able to use the module loader on its own if you follow https://github.com/ModuleLoader/es6-module-loader/wiki/Production-Workflows, it needs to be extended with the register extension from systemjs first though
It's generally not advisable though, as SystemJS comes with lots of features which can be difficult to separate
Anton Moiseev
@antonmoiseev
May 29 2015 15:12
Thank you @guybedford. Are you still considering adding System.register to the es6-module-loader (https://github.com/ModuleLoader/es6-module-loader/issues/336)? As a newcomer I feel like es6-module-loader does exactly what I need, very thin layer between my app and future standards, and it's not perfectly clear why one would want to bring SystemJS into a project if it only uses ES6 modules.
Guy Bedford
@guybedford
May 29 2015 15:25
@antonmoiseev I wanted to include it, but it is not really part of the spec and starts to stop making sense
ultimately I think it could be its own project - say SystemJS/register on github
for the next release, SystemJS will come with a build that is just the register extension and the module loader, without in-browser transpilation at all
that will provide an absolute minimum spec loader that can be used on production
Anton Moiseev
@antonmoiseev
May 29 2015 15:33
awesome! thanks again.
Davis Kim
@davis
May 29 2015 18:37
ah thank you @katrotz
matthew harwood
@matthewharwood
May 29 2015 22:30
Hey guys anyone help me answer this question about an npm package that being used SystemJS's import feature? https://stackoverflow.com/questions/30539571/can-anyone-explain-what-es7-reflect-metadata-is-all-about
<script> System.import('reflect-metadata') .then(function() { return System.import('app/index'); }) .catch(console.log.bind(console)); </script>
Question What the hell does reflect-metadata do?
Rob Wormald
@robwormald
May 29 2015 22:46
@matthewharwood reflects metadata back :)
example:
angular2 uses type annotations for DI
so where in angualr1, you'd do app.service('Foo', ['$http', function($http) ...
in angular2, you can just do FooService { constructor(http:Http)
reflect-metadata can read the type assertion (:Http) and make it available on the class for DI
matthew harwood
@matthewharwood
May 29 2015 22:49
I see.. such magical
what defines something as metadata
Rob Wormald
@robwormald
May 29 2015 22:49
"not code"
matthew harwood
@matthewharwood
May 29 2015 22:50
sorry trying to crystalize. how is app.service "not code"
Rob Wormald
@robwormald
May 29 2015 22:50
yeah, i realize that's not exactly helpful :D
you've used angular 1 before?
matthew harwood
@matthewharwood
May 29 2015 22:50
yes a ton
Rob Wormald
@robwormald
May 29 2015 22:51
okay, so then you know about DI annotation - app.factory('Whatever', ['$http', function($http){ ... (as above)
matthew harwood
@matthewharwood
May 29 2015 22:51
ahh ['$http'] part
thats the annotation?
Rob Wormald
@robwormald
May 29 2015 22:51
['$http', <- that's metadata - its not code, its a 'hint'
matthew harwood
@matthewharwood
May 29 2015 22:51
YEahhh
I got it now
Rob Wormald
@robwormald
May 29 2015 22:52
so the equivalent w/ reflect-metadata in ng2 would be constructor(http:Http)
where Http is a class, and http is an injected instance of that class
matthew harwood
@matthewharwood
May 29 2015 22:54
And if we were not to include reflection-metadata into an angular 2 project what would the syntax be in angular2?
reflect*
Rob Wormald
@robwormald
May 29 2015 23:03
di.annotate(MyController, [Inject(Http) ])
or something along those lines
matthew harwood
@matthewharwood
May 29 2015 23:03
Ahh got it. Last question: does typescript do the reflect-metadata for you?
@robwormald Thanks btw this is really really helpful. That reflect-metadata is so fucking overmyhead. Angular2, ES6/7, Typescript, JSPM just so so much happening righ tnow. it's all so new
Rob Wormald
@robwormald
May 29 2015 23:06
typescript supports it, but you still need to include the reflect-metadata lib
matthew harwood
@matthewharwood
May 29 2015 23:07
Word. thanks man.