These are chat archives for systemjs/systemjs

9th
Jun 2015
Rob Wormald
@robwormald
Jun 09 2015 01:39 UTC
@guybedford everything working beautifully, any way you could get v.17 up on the CDN if its not already? couldn't figure out a way to use it on plunker
carlosagsmendes
@carlosagsmendes
Jun 09 2015 13:05 UTC
When I try to exclude a bundle I get an error: Multiple defines for anonymous module
any suggestions on how to debug this?
Guy Bedford
@guybedford
Jun 09 2015 13:13 UTC
@carlosagsmendes this could be a bug, I've posted systemjs/builder#191.
carlosagsmendes
@carlosagsmendes
Jun 09 2015 13:13 UTC
thank you. I've just subscribed it
Also, I'm using babel-node to execute my build.js
but when I'm using files with es6 syntax I get some errors
'file:///D:/Repos/bundling/src/tests/a.js:1:1: Unexpected reserved word import',
'file:///D:/Repos/bundling/src/tests/a.js:1:8: Semi-colon expected',
'file:///D:/Repos/bundling/src/tests/a.js:1:13: Semi-colon expected' ]
here's the code from my a.js:
import from 'tests/b'; console.log('a');
I've installed babel locally
inside my build.js I'm using es6 code
so I don't understand why it fails when bundling code with es6
carlosagsmendes
@carlosagsmendes
Jun 09 2015 13:27 UTC
@guybedford how can I run the builder tests? Should I open the html files using a httpserver or execute them on the command line with node?
when I run npm testI get 2 tests failing
Mike Haas
@mikehaas763
Jun 09 2015 14:17 UTC
With the builder buildSFX, is it possibly to export a facade of some sort to a window global? I'm building a somewhat complex lib with many classes but I would like to "export" just a couple to window or something so that ES5 libs can use it
Guy Bedford
@guybedford
Jun 09 2015 14:18 UTC
@mikehaas763 we're working on this sort of a feature in systemjs/builder#176
Mike Haas
@mikehaas763
Jun 09 2015 14:19 UTC
hmm very cool
carlosagsmendes
@carlosagsmendes
Jun 09 2015 14:45 UTC
@guybedford can you please help finding out why I can't run the builder tests?
I'm using npm test
Guy Bedford
@guybedford
Jun 09 2015 14:46 UTC
@carlosagsmendes sure I'll look into it
carlosagsmendes
@carlosagsmendes
Jun 09 2015 14:46 UTC
thks
Guy Bedford
@guybedford
Jun 09 2015 14:59 UTC
@carlosagsmendes this seems to be a race condition in the tests themselves
running mocha test/arithmetic.js avoids it
(specifically on Windows)
carlosagsmendes
@carlosagsmendes
Jun 09 2015 15:03 UTC
thank you. using mocha makes it work (I'm using windows)
Mike Haas
@mikehaas763
Jun 09 2015 15:04 UTC
For some reason, when my Grid.js file imports a default exported class, the builder does not output a bundle file and there are no errors written to the console. Any idea why?
Here's my gulp task
Guy Bedford
@guybedford
Jun 09 2015 15:05 UTC
@mikehaas763 you probably want to add an error handler to the promise
Mike Haas
@mikehaas763
Jun 09 2015 15:09 UTC
@guybedford What returns a promise? All of the build methods?
Ah, a file extension is not added by default
Mike Haas
@mikehaas763
Jun 09 2015 15:37 UTC
Oh oh oh, so using the file extension explicitly is supposed to be the new norm?
Maeoll Kim
@abyss-outpost
Jun 09 2015 18:29 UTC
@robwormald in your plnkr here: http://plnkr.co/edit/3frLFocsEwxktbHwicy8?p=preview you used the operator "=>" . I tried googling what that operator is but nothing shows up.
Davis Kim
@davis
Jun 09 2015 18:30 UTC
fat arrow notation
Rob Wormald
@robwormald
Jun 09 2015 18:31 UTC
aka the best thing ever
Jami Pekkanen
@jampekka
Jun 09 2015 18:34 UTC
Hmm.. how difficult would it be to hack node.js style resolver to SystemJS?
Maeoll Kim
@abyss-outpost
Jun 09 2015 18:35 UTC
cool ty guys!
Jami Pekkanen
@jampekka
Jun 09 2015 18:36 UTC
Could I eg. just override the System.locate to open node_modules/<module>/package.json and find the .js file to import from there?
carlosagsmendes
@carlosagsmendes
Jun 09 2015 18:53 UTC
@guybedford in the builder documentation, about Common Bundles, can we discard bundles created in the command line? https://github.com/systemjs/builder#example---common-bundles
i.e., if I create a bundle with jspm bundle app/main build.js can I exclude the bundle when using the builder? builder.build('app/componentA.js - build.js', { minify: true, sourceMaps: true });
Guy Bedford
@guybedford
Jun 09 2015 20:56 UTC
@jampekka you would run this in normalize, by implementing the node resolution within that. It would be a useful custom build of systemjs
not that there is also https://www.npmjs.com/package/system-npm which may be worth looking into
@carlosagsmendes in theory that should work yes, but there may be bugs for amd as mentioned earlier
Jami Pekkanen
@jampekka
Jun 09 2015 20:56 UTC
@guybedford: Yeah, that's what I'm hacking ATM
I also tried out the system-npm, but I'd prefer the "lazy" approach
(Also I couldn't get system-npm working)
Guy Bedford
@guybedford
Jun 09 2015 20:58 UTC
sure it shouldn't be too difficult at all, and would be a nice project to play around with async require in node with es6
if you come up with anything do share it here too
Jami Pekkanen
@jampekka
Jun 09 2015 20:58 UTC
I guess the steal.js folks did it by parsing the package.json dependencies to avoid making extra ajax-calls, but I don't mind it for development
Sure
At least for now I'm overriding the normalization fully, ie that it will bypass the SystemJS configuration altogether
I was thinking of doing it as "failback", but I'm not sure how to implement it in the loading process
Because in the loader we'll know if the module was found only way after the normalize
Guy Bedford
@guybedford
Jun 09 2015 21:00 UTC
if you're running against 0.17 it can be worth setting up a custom build
Jami Pekkanen
@jampekka
Jun 09 2015 21:00 UTC
I am. But currently I'm just monkeypatching
Guy Bedford
@guybedford
Jun 09 2015 21:00 UTC
depending on the interface you need
basically swap out the pieces you need
normalization happens between core, map, paths and package
but certainly stick to a hook if that works for you
Jami Pekkanen
@jampekka
Jun 09 2015 21:02 UTC
I'll look into those after I get a proof-of-concept monkeypatch working
BTW, I think implementing the node resolution "perfectly" is impossible because we can't figure out whether a path is a directory or not with AJAX
But I guess it should work in vast majority of packages
Guy Bedford
@guybedford
Jun 09 2015 21:07 UTC
oh you're doing this in the browser, sorry I thought you were doing it for the server
since your use case is the same it may well be worth working with system-npm
or at least sharing your feedback with them
Jami Pekkanen
@jampekka
Jun 09 2015 21:08 UTC
Yeah
I did try to hack system-npm, but I find the approach quite cubersome
BTW, is the normalize-step supposed to give out an url already?
I couldn't make much of the es6 spec
Dan Connolly
@dckc
Jun 09 2015 22:08 UTC
I built something using jspm but I'm not sure how much stuff is needed at runtime. I'm getting ReferenceError: System is not defined
shouldn't System be defined after <script type="text/javascript" src="jspm_packages/system.js"></script> ?
ah... 404 @ es-module-loader.js
es6...