Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 17 17:05
    Jack-Works commented #2265
  • Oct 17 16:36
    guybedford closed #2265
  • Oct 17 16:36
    guybedford commented #2265
  • Oct 17 16:19
    Jack-Works commented #2265
  • Oct 17 14:50
    guybedford commented #2265
  • Oct 17 14:26
    Jack-Works commented #2265
  • Oct 12 17:42
    joeldenning commented #2250
  • Oct 12 10:34
    guybedford edited #2013
  • Oct 12 10:32

    guybedford on 6.7.1

    (compare)

  • Oct 12 10:32

    guybedford on master

    6.7.1 (compare)

  • Oct 12 10:30

    guybedford on autoimport-race

    (compare)

  • Oct 12 10:30

    guybedford on master

    autoimport race (#2266) (compare)

  • Oct 12 10:30
    guybedford closed #2266
  • Oct 11 20:17
    github-actions[bot] commented #2266
  • Oct 11 20:16
    guybedford synchronize #2266
  • Oct 11 20:16

    guybedford on autoimport-race

    autoimport race (compare)

  • Oct 11 20:16
    github-actions[bot] commented #2266
  • Oct 11 20:15
    guybedford commented #2266
  • Oct 11 20:15
    guybedford synchronize #2266
  • Oct 11 20:15

    guybedford on autoimport-race

    auto import race (compare)

rixo
@rixo
for the record, I used the Babel transform in my little experiment: https://github.com/rixo/experiment-snowpack-svelte-hmr
the result goes beyond my expectations... instant feedback on a 500+ files project
without your guidance, I think I'd still be evaluating the best way to integrate SystemJS, so thanks again :D
Guy Bedford
@guybedford
System modules are blazing fast :)
not a lot of people realise how optimal it can be
while supporting all modules semantics
better HMR tooling for SystemJS is a goal
there are likely utilities and core integrations that can be improved if driven by someone working on the problems
also see systemjs/systemjs#2014 which needs a bump too
Aparna Joshi
@hiaparna
Hi, I am using systemjs as per the single-spa example and have added this in the index.html. It works fine. However, I want to remove the script tags adding system.js. I have added npm package systemjs. If I remove the script tags, it does not work. Why adding systemjs package not working and I have add the script tags additionally ? Thankyou
image.png
Glen Huang
@hgl
is there a node example available somewhere? I tried compiling a ts script to systemjs, and then loaded it via a cjs script with const { System } = require("systemjs"); System.import("./cli.js"), it seemed to resolve cli.js from cwd, so couldn't find it. If I change the path to path.join(__dirname, "./cli.js"), it then complains about the bare specifier fs. I think my understanding of how systemjs works in node is utterly wrong, but the doc/nodejs.md doesn't talk about bare specifier etc. Is there a more comprehensive doc available?
yln99517
@yln99517
Hi I am getting below error with Typescript + SystemJS 6.x.x - TypeError: registration[1] is not a function - you can see the github page here -
https://yln99517.github.io/MyMathLib/.
Can you guys tell what I am doing wrong here
Luca Matteis
@lmatteis
hey all! is there a way to do semver in systemjs? for instance if i have a module published on http://foo.com/bar/2.3.5 i can maybe use client-side semver logic to import http://foo.com/bar/^2.0.0 and it will import the 2.3.5 (following semversioning)? or the only way to do this is server-side?
None
@b60413
I used the module in my testing, and I want to simulate it in UI(like HTML canvas), but I had no idea to did it, is there have easy to do?
I used the module in my testing, and I want to simulate it in UI(like HTML canvas), but I had no idea to did it, is there have easy to do?
vv7v7
@vv7v7

It loads modules. Kind of like a browser version of node require, except it follows the developing System standard from WHATWG.

@gertsonderby Thank you :)

illuminatux
@illuminatux
Hello, is it possible to load an import map in code, like the old System.config() function? Or any other kind of configuration in code?
Guy Bedford
@guybedford
@illuminatux no there isn't any code based config option, are you looking to dynamically populate the import map during runtime?
because SystemJS is trying to follow the spec - dynamic loading of import maps isn't currently supported in the spec itself
it's something we could support with mutation observers though, and a PR for an extra to do this in core would likely be accepted
let me know if that answers your question
illuminatux
@illuminatux
hello @guybedford , yes, this answers my question. i am now using a bundler (rollup) , it to be seems a better solution than dynamic module loading. i am working with a leagcy application, where i can only inject plain javascript files into a generated html page.
Steven Vachon
@stevenvachon
what does webpack's system option actually do?
Steven Vachon
@stevenvachon
what could cause this?:
system.js:683 Uncaught (in promise) TypeError: Cannot read property 'call' of undefined
    at push../node_modules/systemjs/dist/system.js.systemJSPrototype.import
1 reply
Frank Lemanschik
@frank-dspeed
Sorry for asking here but i am working at present on a rollup plugin to inline the SystemJS loader
and found out that it is not as easy as expected
<script>
System.register('mybundle', [], function () {
    'use strict';
    return {
        execute: function () {

            console.log('breave heart');

        }
    };
});
setTimeout(function(){
    System.import('mybundle').then(console.log).catch(console.log)  
}, 5000)
</script>
Does not give me the expected success also not with file extension added
when i read the code i think that has something to do with translating the specifier into a url
but i have no idea what exactly that would look like
Frank Lemanschik
@frank-dspeed
Frank Lemanschik
@frank-dspeed
Hahahaha lol you puted the function into a extra awsome found it after 4 hours :)
Edd Neal
@eddneal

Hi, I am experiencing an issue related to using a script tag with type=system-js-module. The system js module script has a dependency on another script that is loaded with a script tag using defer, and from reading MDN docs it is my understanding that...

"Scripts with the defer attribute will prevent the DOMContentLoaded event from firing until the script has loaded and finished evaluating."

However I am seeing errors thrown from the system js module telling me that the deferred script has not executed.

I thought that the type=system-js-module style of modules were not fired until DOMContentLoaded but when looking at the src it appears that straight after the event listener is attached the modules are loaded anyway.

if (hasDocument) {
  window.addEventListener('error', function (evt) {
    lastWindowErrorUrl = evt.filename;
    lastWindowError = evt.error;
  });

  window.addEventListener('DOMContentLoaded', loadScriptModules);
  loadScriptModules();
}


function loadScriptModules() {
  [].forEach.call(
    document.querySelectorAll('script[type=systemjs-module]'), function (script) {
      if (script.src) {
        System.import(script.src.slice(0, 7) === 'import:' ? script.src.slice(7) : resolveUrl(script.src, baseUrl));
      }
    });
}
Steven Vachon
@stevenvachon
can System.set() be called after the initial import map has been loaded? System.prepareImport() will only ever check the DOM once ... i'm writing unit tests
@guybedford ^^ ?
Frank Lemanschik
@frank-dspeed
System.set() can be called as often as you like
but the set will as you found out may or may not get uesed
depends on your code
Guy Bedford
@guybedford
@eddneal we do both because we want to ensure scripts are loaded as soon as possible. This does bring up an interesting feature idea though, if we should support eg defer on type=systemjs-module for your use case. I would in general think that this would be unadvisable though since any delay = direct performance issues for the user (especially since these scripts aren't preloaded by the browser preloader as it does not understnad them).
1 reply
Perhaps you could explain a little more about your use case why this is necessary
@stevenvachon System.set should be set with full URLs usually if you can. prepareImport is just for loading the import map initially. Updating the import map after that prepareImport is a use case we have yet to support, but are currently matching what browser import maps provide.
4 replies
Guy Bedford
@guybedford
Exactly - import maps spec is now frozen and doesn’t support updates
It does support dynamic injection before the first module load, but so does systemjs
After the first module load they are frozen
I’ve created http://github.com/guybedford/import-maps-extensions to get movement on new spec work for these sorts of cases
Will post to WICG when import maps unflag
Steven Vachon
@stevenvachon
oh
so, then you wouldn't be interested in a PR
@guybedford if you're aware of any hacks i can use (i'm using jest), please post them to the github issue i created
Akanksha Singh
@Flamingo09
Hello everyone. I need help. I'm using systemJS with import map inside my react application to load certain external modules (micro front end modules) . I have configured cors in my webpack-dev-server. Still it's throwing cors access not allowed error. Any idea, on how to fix it?