These are chat archives for systemjs/systemjs

3rd
Feb 2015
Cody Lundquist
@meenie
Feb 03 2015 02:39
Has anyone made plugin for scss?
Or is it even possible?
I’m trying to remove a lot of my grunt build by using jspm and systemjs
Doesn’t seem to be a registry for systemjs plugins
Aleksander Heintz
@Alxandr
Feb 03 2015 02:50
There is a jspm registry
Cody Lundquist
@meenie
Feb 03 2015 02:52
Right, forgot about that. Does that cover all known plugins?
In any case, do these plugins run on node?
Or within the browser?
If on node, then you could actually create a scss plugin
Aleksander Heintz
@Alxandr
Feb 03 2015 03:07
Both
Which is why you can't create plugins for everything
Cody Lundquist
@meenie
Feb 03 2015 03:12
Ahh, crap. Well, guess I’ll have to keep my grunt tasks a bit longer :)
Aleksander Heintz
@Alxandr
Feb 03 2015 03:12
Or switch to mimosa
xD
~0 config
You get watch for free
Cody Lundquist
@meenie
Feb 03 2015 04:20
I’ll have a look :)
Cody Lundquist
@meenie
Feb 03 2015 04:31
Ya, not going to work with our current environment.
Guy Bedford
@guybedford
Feb 03 2015 08:37
@meenie we're working on a plugin precompile server next month which would enable plugins which only run server-side
if you don't mind always doing a bundle you can be doing that today
Veaceslav Cotruta
@katrotz
Feb 03 2015 16:10
Hi,
Has anyone a solution for:
Importing CommonJS module with systemJS that depend on other CJS modules by relative path?
To be more explicit: I am trying to load the https://github.com/auth0/lock installed with jspm, but no luck
it looks like the module loader does not append the /index.js suffix for cjs requires
Beni Buess
@benib
Feb 03 2015 16:48
@katrotz not sure if this helps. but you can configure your paths in your systemjs config. you probably have something like this: "paths": {
"": ".js",
"github:": "lib/github/.js",
"npm:": "lib/npm/.js"
}
ok, the stars seem to have vanished here...
then again, setting "*": "index.js" probably doesn't just solve the problem...
Cody Lundquist
@meenie
Feb 03 2015 16:56
@guybedford What about having to re-run npm link everytime you make a change in your linked package?
Is there a solution coming down for that? BTW, I like the way that you copy it to a shared folder and then create a symlink to that from your main project.
If there is a way to programatically run the linking procedure without having to confirm that you’d like to overwrite what’s there, then I could use it with in a grunt/gulp watch task to do it anytime a file changes.
I wouldn’t mind that.
Veaceslav Cotruta
@katrotz
Feb 03 2015 17:36
@benib thanks, it would have worked, but auth0-lock uses node libs (is meant to be built with browserify, damn :fire: )
Cody Lundquist
@meenie
Feb 03 2015 18:39
If I do System.import('angular’), how can I make sure that it loads jquery before it loads angular? I’ve done System.config({shim: {angular: {deps: [“jquery”]}}}); but that is not working...
So I have to nest System.import() calls to first load jquery and then do a System.import() for angular.
Is that normal?
Veaceslav Cotruta
@katrotz
Feb 03 2015 19:04
@meenie I think it can be solved using Promise:
<script>
Promise.all(['jquery', 'angular']

                .map(function(module){
                    return System.import(module);
                }))

                .then(function(){
                    angular.bootstrap(document, ['my-shiny-app']);
                });
</script>
Cody Lundquist
@meenie
Feb 03 2015 19:05
That’s rather ugly… It should be able to done using configuration. In any case, I’m taking a slightly different direction.
Cody Lundquist
@meenie
Feb 03 2015 19:14
Also, whenever I run jspm install, it updates my config file and changes my paths. Is there a way to lock in those paths?
I’ve changed them to absolute rather than relative so that I can use HTML5 pushState routing.
Guy Bedford
@guybedford
Feb 03 2015 19:27
@meenie yeah a gulp task would be ideal for relinking
@katrots did you try installing directly from npm? jspm install npm:auth0-lock?
Cody Lundquist
@meenie
Feb 03 2015 19:29
I’ve found if I change my jspm.directories.packages to /jspm_packages it tries to create a directory at the top level of my file system heh.
I’m guessing that’s the reason it’s overwriting the config.js file.
Guy Bedford
@guybedford
Feb 03 2015 19:29
@meenie you should try not to use absolute paths
Cody Lundquist
@meenie
Feb 03 2015 19:29
(( sorry for all the questions ))
Guy Bedford
@guybedford
Feb 03 2015 19:29
because jspm needs to access them in both browser and server
so absolute paths mess with server use
Cody Lundquist
@meenie
Feb 03 2015 19:29
I have to use absolute because I’m doing a single page app with html5 routing.
Guy Bedford
@guybedford
Feb 03 2015 19:30
rather set System.baseURL in your config
this will then only apply in the client
Cody Lundquist
@meenie
Feb 03 2015 19:30
Oh?
Guy Bedford
@guybedford
Feb 03 2015 19:30
it's an undocument critical workflow thing
Cody Lundquist
@meenie
Feb 03 2015 19:30
awesome
Guy Bedford
@guybedford
Feb 03 2015 19:30
*undocumented
Cody Lundquist
@meenie
Feb 03 2015 19:30
hah, awesome
Guy Bedford
@guybedford
Feb 03 2015 19:30
working on docs, I might have mentioned already
Cody Lundquist
@meenie
Feb 03 2015 19:30
All good mate :)
I’m just working through all of it :)
Guy Bedford
@guybedford
Feb 03 2015 19:30
note that baseURL should end in /
and then the other paths are relative to baseURL
Cody Lundquist
@meenie
Feb 03 2015 19:30
okay cool
Can I just do System.baseURL(‘/‘)?
Guy Bedford
@guybedford
Feb 03 2015 19:31
yes
for loading jQuery before angular, I'd suggest doing a custom shim
that config won't get wiped out either
baseURL won't be changed or custom maps
@katrotz I just tried jspm install npm:auth0-lock and it's failing when trying to install dependency github:defunctzombie/stacktrace.js@07e7b95
Cody Lundquist
@meenie
Feb 03 2015 19:32
alright, I have to head out for a bit. Thanks for the answers!
Guy Bedford
@guybedford
Feb 03 2015 19:32
this is because commit references aren't supported in jspm (currently)
@meenie sure
@katrotz we can look at potentially supporting commit references, otherwise we can add a custom override to alter that dependency to point to a better reference
if you need help configuring that on jspm, just post a registry issue at https://github.com/jspm/registry/ and I'll help you get it figured out
Cody Lundquist
@meenie
Feb 03 2015 19:44
@guybedford: Should I not check in config.js or even touch it?
Guy Bedford
@guybedford
Feb 03 2015 19:46
you can alter it and add new properties (such as the baseURL mentioned above)
it should be checked in too
Cody Lundquist
@meenie
Feb 03 2015 19:46
Okay cool
Thanks again for your time.
I’ll try and repay by answering other peoples questions.
Guy Bedford
@guybedford
Feb 03 2015 19:48
sure, that would be really great, I don't expect less than repeating myself with inadequate docs on jspm though! For further questions on jspm, please post jspm in the jspm channel next time if you can.
Cody Lundquist
@meenie
Feb 03 2015 19:50
oops! I’m getting mixed up with what channel I’m in haha.
Petr Krebs
@petr-k
Feb 03 2015 22:09
Guys, could you please clarify one bit about SystemJS I do not quite understand? In what cases exactly does SystemJS use Traceur/6to5?