These are chat archives for systemjs/systemjs

12th
Jun 2015
Maeoll Kim
@abyss-outpost
Jun 12 2015 00:15
systemjs provides cjs as well as es6 so why not account for both? that’s what I’m doing with angular
so i got the configuration part down, thank you @robwormald but now I’m getting a vague error loading this next section:

define([
  'angular'
], function(angular) {
  'use strict';

  Scape = angular.module('requireapp', []);
  Scape.bootstrap(document,['requireapp']);
})
ok i changed Scape = to return and now its working again nm guys haha
Rob Wormald
@robwormald
Jun 12 2015 00:18
@abyss-outpost thing is most angular devs dont use a module system (outside of angular's)
so you (or i dont, anyway) want to require them to use one
SFX works really well for this
bower consumers get sfx, npm consumers get cjs, jspm consumers get es6, AMD users get stuffed.
Austin
@amcdnl
Jun 12 2015 01:12
interesting ...
i hate angular's module system
it should die before 2.x
Rob Wormald
@robwormald
Jun 12 2015 02:02
probably not going to happen, hence 2.x
Maeoll Kim
@abyss-outpost
Jun 12 2015 02:40

ok, so i’ve managed to get to this point

require(['launchrequire.js']);

but then i’m trying to load this and getting an error:

define([
  'angular',
  './requireapp'
], function(angular) {
  'use strict';

  angular.bootstrap(document,['requireapp']);
  console.log(angular);
})
error here: "Error loading "~/scripts/configuration/confangularbyrequire" at http://localhost:3000/scripts/configuration/confangularbyrequire.js
Error evaluating http://localhost:3000/scripts/configuration/confangularbyrequire.js
Script error."
Debjit Biswas
@debjitbis08
Jun 12 2015 05:07
I was just asked by a colleague if transpiling in the browser would scale to large number of files. Do we have a higher limit on how much we can transpile in browser with reasonable performance?
Rob Wormald
@robwormald
Jun 12 2015 05:10
@debjitbis08 its not a good idea for production
great for dev, but not really for prod
Debjit Biswas
@debjitbis08
Jun 12 2015 05:10
Ya he was concerned about dev env
Rob Wormald
@robwormald
Jun 12 2015 05:11
what i do is build a couple of bundles for all my deps
load them with script tags
and then i'm only transpiling app code (which works fine)
Debjit Biswas
@debjitbis08
Jun 12 2015 05:12
Ok, that makes sense, but have you tried with large number files?
Rob Wormald
@robwormald
Jun 12 2015 05:13
loading the angular2 codebase (from source) takes a few seconds, and its the biggest JS lib i've seen
Debjit Biswas
@debjitbis08
Jun 12 2015 05:15
Also do you think there will be any benefits of not transpiling in browser, such as maybe we enable caching etc.?
Rob Wormald
@robwormald
Jun 12 2015 05:16
it really just depends on the situation. i guess my point would be its relatively easy to "tune" your setup, and do transpilation on other side of the wire where its appropriate
*either side
it doesn't make a whole lot of sense to repeatedly reload and transpile the 90% of your code that's proabbly not changing each reload
which is why i bundle, which takes a few extra seconds but its rare i do that more than a few times a project
builder.build('app/**/* - [app/**/*]', 'lib.js')
builds everything BUT whats in the app folder
so then i include lib.js, and when the app code loads, it'll pull stuff from the bundle vs fetching it and transpiling it
so if app/main asks for angular2/angular2, it'll grab it from the (already laoded) bundle
Debjit Biswas
@debjitbis08
Jun 12 2015 05:23
ok, I would check if we can make can pre-bundle some of our modules.
Rob Wormald
@robwormald
Jun 12 2015 05:31
angular2 there is a bundle (generated by systemjs-builder) - so the only thing being dynamically transpiled is the app
Debjit Biswas
@debjitbis08
Jun 12 2015 06:46
All my code is part of the app only, so I would need to think of some other way to bundle.
Jami Pekkanen
@jampekka
Jun 12 2015 14:32
Hmm.. I have an amd module that's 'require'd, but never gets evaluated
Or it goes through the SystemJS's "define", but never seems to end up getting called by registerDynamic
I admit I don't fully understand the flow on how the amd modules are handled
Jami Pekkanen
@jampekka
Jun 12 2015 14:38
Especially how the anon modules are handled. It seems that the anon modules are registered only after there's a next named module, but for some reason for this module it will not get called
Hmm.. actually it's not that
Jonathan Liuti
@johnraz
Jun 12 2015 15:22
@geelen are you by any chance around ?
or maybe someone is familiar with jspm-server ?
I’m trying to get how the customized jsx plugin is loaded
Jonathan Liuti
@johnraz
Jun 12 2015 16:47
Ok I got it working by putting it next to the index.html but I’m still curious on how this one gets loaded :)
Daniel Dunderfelt
@danieldunderfelt
Jun 12 2015 17:28
ha I'm also wondering about jspm-server :D
over in #jspm
Maeoll Kim
@abyss-outpost
Jun 12 2015 18:21
@jampekka are you using System.load to laod the require file at all?
Jami Pekkanen
@jampekka
Jun 12 2015 18:21
@abyss-outpost Not at least explicitly
It seems that it may be a circular dependency
Maeoll Kim
@abyss-outpost
Jun 12 2015 18:24
how about using System.config {meta:…} to declare the format?
Jami Pekkanen
@jampekka
Jun 12 2015 18:26
It is detected correctly as AMD I think
In fact it ends up in linkModuleDynamic, but linkModuleDynamic thinks it's been already evaluated because the entry.module is set somewhere already
Jami Pekkanen
@jampekka
Jun 12 2015 19:18
Seems to work if I disable the SystemJS amd handling and let the system-map use the amdefine module
Glen Maddern
@geelen
Jun 12 2015 23:14
@johnraz @danieldunderfelt sorry! Proper release of jspm-server coming in a couple of days
Eric Eastwood
@MadLittleMods
Jun 12 2015 23:19
@geelen regarding geelen/jspm-server#4: I am not sure on how to do the SSL HTTP2 stuff. I tried playing with http2 and pem but ran into an molnarg/node-http2#100 which hinders any progress on that.
Glen Maddern
@geelen
Jun 12 2015 23:20
yeah I have noooo idea
tbh though, there's not too much logic in jspm-server that couldn't live elsewhere
as in, we could take the jspm-specific logic out of jspm-server and add it to a HTTP2 server
if we find one with an API we like
i picked live-server because it was pretty simple