Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import maps don't use SystemJS fetch hook #2374

Closed
erikt9 opened this issue Nov 26, 2021 · 3 comments
Closed

Import maps don't use SystemJS fetch hook #2374

erikt9 opened this issue Nov 26, 2021 · 3 comments

Comments

@erikt9
Copy link
Contributor

erikt9 commented Nov 26, 2021

Import maps should use fetch hook to retrieve script source

The relevant code from import-maps.js:

if (script.type === 'systemjs-importmap') {
      script.sp = true;
      var fetchPromise = script.src ? fetch(script.src, { integrity: script.integrity }).then(function (res) {
        if (!res.ok)
          throw Error(process.env.SYSTEM_PRODUCTION ? res.status : 'Invalid status code: ' + res.status);
        return res.text();

Seems like the fetch here should be using the fetch hook instead of the global method? Would be nice for consistency if all fetches SystemJS performs go through the hook.

@joeldenning
Copy link
Collaborator

Agreed, I'll create a pull request to implement this.

@joeldenning
Copy link
Collaborator

I've implemented this in #2376

@joeldenning
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants