These are chat archives for systemjs/systemjs

18th
Nov 2016
Owen Densmore
@backspaces
Nov 18 2016 00:46
Here's a link to the most recent three.js post within the "modules issue".
https://github.com/mrdoob/three.js/issues/9562#issuecomment-261356738
λex Vincent
@alexisvincent
Nov 18 2016 11:26
Has anyone been able to get systemjs/plugin-babel to work if loaded from npm and not jspm?
Guy Bedford
@guybedford
Nov 18 2016 12:34
@alexisvincent you may need to check the jspmNodeConversion: false / jspmPackage: true flags which both allow opting out of the NodeJS conversion process and configuration generation, instead just using the package configuration directly from the package.json itself (map, defaultExtension, main and meta)
λex Vincent
@alexisvincent
Nov 18 2016 12:44

@guybedford both ways fail for me. And they seem to generate the same config:

        "node_modules/systemjs-plugin-babel": {
            "map": {
                "systemjs-babel-build": {
                    "node": "./systemjs-babel-node.js",
                    "browser": "./systemjs-babel-browser.js",
                    "default": "./systemjs-babel-browser.js"
                }
            }, "meta": {"./plugin-babel.js": {"format": "cjs"}}, "main": "plugin-babel.js", "format": "cjs"
        },

Thats what I use to load it.

when I try to load it from node_modules, I get the error: define is not a function thrown from the last line of systems-babel-browser.js.
λex Vincent
@alexisvincent
Nov 18 2016 12:52
Got it working :) removed the format: ‘cjs'
Axel Dolce
@dolchi21
Nov 18 2016 12:54
does anyone have an example of React+SVG+SystemJS? Does this work?
var SVG = require('image.svg')
var Component = React.createElement({
  render(){
    return <SVG fill="red"/>
  }
})
Guy Bedford
@guybedford
Nov 18 2016 14:07
@alexisvincent respecting jspmNodeConversion: false and jspmPackage: true as skipping the conversion process will bring you more luck here
λex Vincent
@alexisvincent
Nov 18 2016 14:12
@guybedford At the moment I’m loading the original package.json and then ‘augmenting’ it by running it through the conversion process. I think that code respects jspmNodeConversion: false. I then filter out the keys that I want. But I wasnt filtering out format. Hopefully that works now. Once the dust has settled maybe you wouldnt mind having a look at my config generation logic and see if it looks sound to you?
Guy Bedford
@guybedford
Nov 18 2016 14:59
@alexisvincent no that code doesn't respect it, it cuts out earlier
so it would be advisable to add it
λex Vincent
@alexisvincent
Nov 18 2016 15:00
Ok thanks. Will do :)
Nick George
@Izzmo
Nov 18 2016 15:13
Anyone ever taken the time to look at burdown performance graph of transpiling in-browser vs. bundling?
λex Vincent
@alexisvincent
Nov 18 2016 15:15
Its quite significant
Nick George
@Izzmo
Nov 18 2016 15:16
Indeed... pretty interesting to look at though. I wonder if there will ever be a day when you can transpile, in place, as production-ready code. (with the option to not transpile at all if a browser is fully compliant)
λex Vincent
@alexisvincent
Nov 18 2016 15:18
I really dont think we are far from this. :)
Izzmo @Izzmo crosses fingers
Nugzar Gaguliya
@NugzarGaguliya
Nov 18 2016 16:49
hello, I am new to SystemJS and have some qustions. In angular2 quick start guide we loading some modules with SystemJS, but some polyfils a loaded in html synchronously. Can we move this polyfils to SystemJS, load them all asynchronously, and then load our app?
λex Vincent
@alexisvincent
Nov 18 2016 17:14
@NugzarGaguliya I actually think SystemJS does this automatically. Are you using JSPM?
@all Released systemjs-config-builder, allows you to generate SystemJS config files from node_modules, for if you aren’t using JSPM
Juha Järvi
@jjrv
Nov 18 2016 17:18
And there's another tool https://github.com/charto/cbuild if you want to list only the client-side dependencies
It walks through imported files using systemjs-builder and so omits back-end packages, so the config.js distributed to end-users will only contain what's needed by the bundled app, whether you bundle or not.