Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:12
    msmolka edited #2056
  • 10:11
    msmolka edited #2056
  • 10:10
    msmolka opened #2056
  • Oct 17 22:42
    chase-moskal opened #2055
  • Oct 17 22:33
    rixo commented #2054
  • Oct 17 06:54
    dmail commented #2047
  • Oct 17 01:42
    guybedford closed #2045
  • Oct 17 01:42
    guybedford commented #2045
  • Oct 17 01:32
    frehner commented #2045
  • Oct 17 01:22
    guybedford commented #2045
  • Oct 17 00:44
    frehner commented #2045
  • Oct 17 00:43
    frehner commented #2045
  • Oct 17 00:33
    guybedford commented #2054
  • Oct 17 00:26
    guybedford commented #2047
  • Oct 17 00:24
    guybedford commented #2040
  • Oct 17 00:23
    guybedford commented #2045
  • Oct 16 22:39
    rixo opened #2054
  • Oct 15 21:35
    guybedford commented #2053
  • Oct 15 21:34
    frehner commented #2045
  • Oct 15 21:28
    sdegutis commented #2053
Guy Bedford
@guybedford
@kouts great work! Happy to do that.I believe you need to initiate the transfer your side from the repo settings, and then I can confirm it here.
kouts
@kouts
Ok @guybedford repo transfer request is now sent to you
Guy Bedford
@guybedford
@kouts many thanks, it's at https://github.com/systemjs/systemjs-css-extra now
you should still have full access to work on it and push changes
kouts
@kouts
Thank you
Apoorv Mishra
@apoorv-mishra
Hello, newbie to systemjs; How would I achieve https://gist.github.com/unicodeveloper/4926d1852811624a11cc270559ea0c25 in SystemJS 4.x, since now it's all deprecated?
kouts
@kouts
Another question, how can we achieve the same result as import-maps programmatically?
e.g <script type="systemjs-importmap">{"imports":{"main":"/dist/js/main.bundle.js"}}</script>
How can we use https://github.com/systemjs/systemjs/blob/master/docs/api.md#systemsetid-module---module ?
Bluejanis
@Bluejanis
Hello everyone. I just started using systemjs a few days ago, but I am stuck with configuration right now.
I using some libraries, some dependant on each other. So how do I configure systemjs to enforce the correct loading order of those libraries. Those libraries failed to configure their own dependencies I guess, but I cannot change that. I do have to load library 'l1' before library 'l2', because l2 uses l1.
Bluejanis
@Bluejanis
In the docs I found the paragraph about extras: https://github.com/systemjs/systemjs#extras
Global loading sounds like it could solve my problem. I would like to try that, the docs leave me clueless though. How do I do that?
kouts
@kouts
Hi @Bluejanis you can load one library after the other like this;
System.import('/js/library_1.js').then(function(){
    System.import('/js/library_2.js');
});
Bluejanis
@Bluejanis
Thanks @kouts for showing me the way to do it! Do you have any experience with trypescript? Is there a way to specify the imports so it transpiles it to code like this?
kouts
@kouts
I think you can use it exactly like this in Typescript too.
Bluejanis
@Bluejanis
Yea I only had to add the npm @types/systemjs
Otherwise Typescript wouldnt find system and refuse to transpile.
Now I have another question:
How can i export a module, which requires those two dependant libraries to be loaded before in correct order? Inside the System.import().then block it is not allowed to use the export modifier.
Bluejanis
@Bluejanis
I got my last question solved by introducing callbacks.
Adam Bouhenguel
@ajbouh
I'm trying to wrap my head around this error Uncaught [SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (2:0)]
I'm seeing when I do System.import(...)
Adam Bouhenguel
@ajbouh
So it makes me think that perhaps it's not properly using the polyfill?
Adam Bouhenguel
@ajbouh
And indeed, it was not :)
Guy Bedford
@guybedford
@ajbouh if you're looking to polyfill without transpilation see https://www.npmjs.com/package/es-module-shims rather
patrick
@patrickinminneapolis
mangle setting not working for me with systemjs-builder 0.16.13
the docs are pretty simple, anything obvious i'm missing
copied my example from 'minification options' section
i'm trying to mangle things to be clear
hachimi ahmed amine
@HACHIMIam
hello guys i m trying to do a middelware to check if the file exist before importing it if it doesn’t i want to look for it in and another directory following a directories path array keep looking up in order until find it is it possible with hooks ? or does anyone have a complex example of hooks can you please share it thank you so much
Micah Zoltu
@MicahZoltu
Can SystemJS not load ES6 modules?
// index.html
<script src='vendor/systemjs/system.js'></script>
<script>
System.import('/index.js')
</script>

//index.js
import 'knockout'
SyntaxError: import declarations may only appear at top level of a module
Micah Zoltu
@MicahZoltu
I would prefer to just use es-module-shims and I have a workflow for that in modern browsers that almost works. The problem I have is that sometimes I need to use a dependency that wasn't built targeting ES6. Does anyone know of a good "bundler" that will just convert a CommonJS module into an ES6 module? I don't want minification or anything, I just want ES6 modules instead of CommonJS modules so I can import the package via import { ... } from 'foo' (using es-module-shims for import maps).
Guy Bedford
@guybedford
@MicahZoltu we could very easily add an extra for ES module support in SystemJS
Did you want to create an issue to track that?
Micah Zoltu
@MicahZoltu
@guybedford Hmm, so right now SystemJS doesn't support ES modules?
Scott
@ProtonScott
@MicahZoltu try rollup with the rollup-plugin-cjs-es plugin enabled
If you haven’t used rollup before I suggest looking over the docs you may need a few plugins for resolution of modules
Micah Zoltu
@MicahZoltu
I tried rollup, it was choking pretty badly on some of the packages I'm depending on, because everything in the JavaScript ecosystem is terrible.
I'm not familiar with cjs-es plugin, I'll check it out.
dahuzix
@dahuzix
whats the difference between systemjs and requirejs ??
Peter Müller
@Munter
requirejs is quite a bit older and can only deal with AMD modules. Systemjs can handle commonjs, amd, es modules and probably more that I forget. Both have similarities in their runtime loading approach
Iain Maitland
@gl2748
I'm getting this error in my single-spa stack:
single-spa.min.js:1 Uncaught dev-applet: Application 'dev-applet' died in status LOADING_SOURCE_CODE: Unable to resolve bare specifier "assert"
it's happening because i'm importing axios into my front-end app...
which should just work ... maybe i'm missing something from my webpack config?
or i'm not understanding systemjs ...
is there any standard way to resolve these 'unable to resolve bare specifier' errors?
Arun Chaitanya
@chaitan64arun

Is there a document, explaining the upgrade of SystemJS from 0.21 to 2.0.0? I looked at https://guybedford.com/systemjs-2.0
I could gather that many features are deprecated. But I couldn't find how to replace them with the latest specifications.

How do I know what is the equivalent of meta in config-api ? eg: https://github.com/systemjs/systemjs/blob/0.21/docs/config-api.md
If there is a step by step guide, it would be awesome. But any guide is appreciated.

Carlos
@filoxo
Hopefully not a stupid question. I'm setting up a new importmap config, and struggling with an issue when importing lodash. I'm using the use-default extra, but it seems that the module isn't actually being unwrapped. When I log out what I get when importing it is a module that has {default: ƒ () __useDefault: true} but like, isn't that the whole point of the use-default extra? To return the default?
Carlos
@filoxo
Hmm. Digging into the extra, it looks like the module has no data, but once resolved in the App it has the needed properties
Guy Bedford
@guybedford
@filoxo the use-default extra only applies to System.import and not ES module syntax - because changing the way the syntax works would be breaking semantics
I appreciate it might be misleading though