Comparing version 6.1.0 to 6.1.1
@@ -1,2 +0,6 @@ | ||
**SystemJS 6.1.0 (2019/09/11) - Minor Changes** | ||
SystemJS 6.1.1 (2019/09/13) | ||
* Fixes a bug where imports before the import map load might not apply the import map (https://github.com/systemjs/systemjs/issues/2024, @joeldenning) | ||
* Fixes the module-types extra output which was incorrectly referencing an import (https://github.com/systemjs/systemjs/issues/2027, @joeldenning) | ||
SystemJS 6.1.0 (2019/09/11) - Minor Changes | ||
* Add support for `<script type="systemjs-module" src="import:foo">` (https://github.com/systemjs/systemjs/pull/2015) | ||
@@ -3,0 +7,0 @@ |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ /* |
@@ -5,89 +5,92 @@ /* | ||
*/ | ||
import { systemJSPrototype } from '../system-core'; | ||
const instantiate = systemJSPrototype.instantiate; | ||
systemJSPrototype.instantiate = function (url, parent) { | ||
const loader = this; | ||
const ext = url.slice(url.lastIndexOf('.')); | ||
switch (ext) { | ||
case '.css': | ||
return loadDynamicModule(function (_export, source) { | ||
// Relies on a Constructable Stylesheet polyfill | ||
const stylesheet = new CSSStyleSheet(); | ||
stylesheet.replaceSync(source); | ||
_export('default', stylesheet); | ||
(function() { | ||
const systemPrototype = System.constructor.prototype; | ||
const instantiate = systemPrototype.instantiate; | ||
systemPrototype.instantiate = function (url, parent) { | ||
const loader = this; | ||
const ext = url.slice(url.lastIndexOf('.')); | ||
switch (ext) { | ||
case '.css': | ||
return loadDynamicModule(function (_export, source) { | ||
// Relies on a Constructable Stylesheet polyfill | ||
const stylesheet = new CSSStyleSheet(); | ||
stylesheet.replaceSync(source); | ||
_export('default', stylesheet); | ||
}); | ||
case '.html': | ||
return getSourceRes().then(function (res) { | ||
return maybeJSFallback(res) || loadError("'.html' modules not implemented"); | ||
}); | ||
case '.json': | ||
return loadDynamicModule(function (_export, source) { | ||
_export('default', JSON.parse(source)); | ||
}); | ||
case '.wasm': | ||
return getSourceRes().then(function (res) { | ||
return maybeJSFallback(res) || | ||
(WebAssembly.compileStreaming ? WebAssembly.compileStreaming(res) : res.arrayBuffer().then(WebAssembly.compile)); | ||
}) | ||
.then(function (module) { | ||
const deps = []; | ||
const setters = []; | ||
const importObj = {}; | ||
// we can only set imports if supported (eg early Safari doesnt support) | ||
if (WebAssembly.Module.imports) | ||
WebAssembly.Module.imports(module).forEach(function (impt) { | ||
const key = impt.module; | ||
if (deps.indexOf(key) === -1) { | ||
deps.push(key); | ||
setters.push(function (m) { | ||
importObj[key] = m; | ||
}); | ||
} | ||
}); | ||
return [deps, function (_export) { | ||
return { | ||
setters: setters, | ||
execute: function () { | ||
return WebAssembly.instantiate(module, importObj) | ||
.then(function (instance) { | ||
_export(instance.exports); | ||
}); | ||
} | ||
}; | ||
}]; | ||
}); | ||
} | ||
return instantiate.apply(this, arguments); | ||
function getSourceRes () { | ||
return fetch(url).then(function (res) { | ||
if (!res.ok) | ||
loadError(res.status + ' ' + res.statusText); | ||
return res; | ||
}); | ||
case '.html': | ||
} | ||
function maybeJSFallback (res) { | ||
const contentType = res.headers.get('content-type'); | ||
// if the resource is sent as application/javascript, support eval-based execution | ||
if (contentType && contentType.match(/^application\/javascript(;|$)/)) { | ||
return res.text().then(function (source) { | ||
(0, eval)(source); | ||
return loader.getRegister(); | ||
}); | ||
} | ||
} | ||
function loadDynamicModule (createExec) { | ||
return getSourceRes().then(function (res) { | ||
return maybeJSFallback(res) || loadError("'.html' modules not implemented"); | ||
return maybeJSFallback(res) || res.text().then(function (source) { | ||
return [[], function (_export) { | ||
return { execute: createExec(_export, source) }; | ||
}]; | ||
}); | ||
}); | ||
case '.json': | ||
return loadDynamicModule(function (_export, source) { | ||
_export('default', JSON.parse(source)); | ||
}); | ||
case '.wasm': | ||
return getSourceRes().then(function (res) { | ||
return maybeJSFallback(res) || | ||
(WebAssembly.compileStreaming ? WebAssembly.compileStreaming(res) : res.arrayBuffer().then(WebAssembly.compile)); | ||
}) | ||
.then(function (module) { | ||
const deps = []; | ||
const setters = []; | ||
const importObj = {}; | ||
// we can only set imports if supported (eg early Safari doesnt support) | ||
if (WebAssembly.Module.imports) | ||
WebAssembly.Module.imports(module).forEach(function (impt) { | ||
const key = impt.module; | ||
if (deps.indexOf(key) === -1) { | ||
deps.push(key); | ||
setters.push(function (m) { | ||
importObj[key] = m; | ||
}); | ||
} | ||
}); | ||
return [deps, function (_export) { | ||
return { | ||
setters: setters, | ||
execute: function () { | ||
return WebAssembly.instantiate(module, importObj) | ||
.then(function (instance) { | ||
_export(instance.exports); | ||
}); | ||
} | ||
}; | ||
}]; | ||
}); | ||
} | ||
return instantiate.apply(this, arguments); | ||
function getSourceRes () { | ||
return fetch(url).then(function (res) { | ||
if (!res.ok) | ||
loadError(res.status + ' ' + res.statusText); | ||
return res; | ||
}); | ||
} | ||
function maybeJSFallback (res) { | ||
const contentType = res.headers.get('content-type'); | ||
// if the resource is sent as application/javascript, support eval-based execution | ||
if (contentType && contentType.match(/^application\/javascript(;|$)/)) { | ||
return res.text().then(function (source) { | ||
(0, eval)(source); | ||
return loader.getRegister(); | ||
}); | ||
} | ||
} | ||
function loadDynamicModule (createExec) { | ||
return getSourceRes().then(function (res) { | ||
return maybeJSFallback(res) || res.text().then(function (source) { | ||
return [[], function (_export) { | ||
return { execute: createExec(_export, source) }; | ||
}]; | ||
}); | ||
}); | ||
} | ||
function loadError (msg) { | ||
throw Error(msg + ', loading ' + url + (parent ? ' from ' + parent : '')); | ||
} | ||
}; | ||
function loadError (msg) { | ||
throw Error(msg + ', loading ' + url + (parent ? ' from ' + parent : '')); | ||
} | ||
}; | ||
})(); |
@@ -1,1 +0,1 @@ | ||
import{systemJSPrototype}from"../system-core";const instantiate=systemJSPrototype.instantiate;systemJSPrototype.instantiate=function(t,e){const n=this;switch(t.slice(t.lastIndexOf("."))){case".css":return o(function(t,e){const n=new CSSStyleSheet;n.replaceSync(e),t("default",n)});case".html":return r().then(function(t){return s(t)||u("'.html' modules not implemented")});case".json":return o(function(t,e){t("default",JSON.parse(e))});case".wasm":return r().then(function(t){return s(t)||(WebAssembly.compileStreaming?WebAssembly.compileStreaming(t):t.arrayBuffer().then(WebAssembly.compile))}).then(function(t){const e=[],n=[],r={};return WebAssembly.Module.imports&&WebAssembly.Module.imports(t).forEach(function(t){const s=t.module;-1===e.indexOf(s)&&(e.push(s),n.push(function(t){r[s]=t}))}),[e,function(e){return{setters:n,execute:function(){return WebAssembly.instantiate(t,r).then(function(t){e(t.exports)})}}}]})}return instantiate.apply(this,arguments);function r(){return fetch(t).then(function(t){return t.ok||u(t.status+" "+t.statusText),t})}function s(t){const e=t.headers.get("content-type");if(e&&e.match(/^application\/javascript(;|$)/))return t.text().then(function(t){return(0,eval)(t),n.getRegister()})}function o(t){return r().then(function(e){return s(e)||e.text().then(function(e){return[[],function(n){return{execute:t(n,e)}}]})})}function u(n){throw Error(n+", loading "+t+(e?" from "+e:""))}}; | ||
!function(){const t=System.constructor.prototype,e=t.instantiate;t.instantiate=function(t,n){const r=this;switch(t.slice(t.lastIndexOf("."))){case".css":return o(function(t,e){const n=new CSSStyleSheet;n.replaceSync(e),t("default",n)});case".html":return u().then(function(t){return s(t)||c("'.html' modules not implemented")});case".json":return o(function(t,e){t("default",JSON.parse(e))});case".wasm":return u().then(function(t){return s(t)||(WebAssembly.compileStreaming?WebAssembly.compileStreaming(t):t.arrayBuffer().then(WebAssembly.compile))}).then(function(t){const e=[],n=[],r={};return WebAssembly.Module.imports&&WebAssembly.Module.imports(t).forEach(function(t){const u=t.module;-1===e.indexOf(u)&&(e.push(u),n.push(function(t){r[u]=t}))}),[e,function(e){return{setters:n,execute:function(){return WebAssembly.instantiate(t,r).then(function(t){e(t.exports)})}}}]})}return e.apply(this,arguments);function u(){return fetch(t).then(function(t){return t.ok||c(t.status+" "+t.statusText),t})}function s(t){const e=t.headers.get("content-type");if(e&&e.match(/^application\/javascript(;|$)/))return t.text().then(function(t){return(0,eval)(t),r.getRegister()})}function o(t){return u().then(function(e){return s(e)||e.text().then(function(e){return[[],function(n){return{execute:t(n,e)}}]})})}function c(e){throw Error(e+", loading "+t+(n?" from "+n:""))}}}(); |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ /* |
/* | ||
* SJS 6.1.0 | ||
* SJS 6.1.1 | ||
* Minimal SystemJS Build | ||
@@ -4,0 +4,0 @@ */ |
/* | ||
* SystemJS 6.1.0 | ||
* SystemJS 6.1.1 | ||
*/ | ||
@@ -484,2 +484,50 @@ (function () { | ||
/* | ||
* Import map support for SystemJS | ||
* | ||
* <script type="systemjs-importmap">{}</script> | ||
* OR | ||
* <script type="systemjs-importmap" src=package.json></script> | ||
* | ||
* Only those import maps available at the time of SystemJS initialization will be loaded | ||
* and they will be loaded in DOM order. | ||
* | ||
* There is no support for dynamic import maps injection currently. | ||
*/ | ||
let importMap = { imports: {}, scopes: {} }, importMapPromise; | ||
if (hasDocument) { | ||
Array.prototype.forEach.call(document.querySelectorAll('script[type="systemjs-importmap"][src]'), function (script) { | ||
script._j = fetch(script.src).then(function (res) { | ||
return res.json(); | ||
}); | ||
}); | ||
} | ||
systemJSPrototype.prepareImport = function () { | ||
if (!importMapPromise) { | ||
importMapPromise = Promise.resolve(); | ||
if (hasDocument) | ||
Array.prototype.forEach.call(document.querySelectorAll('script[type="systemjs-importmap"]'), function (script) { | ||
importMapPromise = importMapPromise.then(function () { | ||
return (script._j || script.src && fetch(script.src).then(function (resp) { return resp.json(); }) || Promise.resolve(JSON.parse(script.innerHTML))) | ||
.then(function (json) { | ||
importMap = resolveAndComposeImportMap(json, script.src || baseUrl, importMap); | ||
}); | ||
}); | ||
}); | ||
} | ||
return importMapPromise; | ||
}; | ||
systemJSPrototype.resolve = function (id, parentUrl) { | ||
parentUrl = parentUrl || baseUrl; | ||
return resolveImportMap(importMap, resolveIfNotPlainOrUrl(id, parentUrl) || id, parentUrl) || throwUnresolved(id, parentUrl); | ||
}; | ||
function throwUnresolved (id, parentUrl) { | ||
throw Error("Unable to resolve specifier '" + id + (parentUrl ? "' from " + parentUrl : "'")); | ||
} | ||
/* | ||
* Supports loading System.register via script tag injection | ||
@@ -650,138 +698,94 @@ */ | ||
*/ | ||
const instantiate = systemJSPrototype.instantiate; | ||
systemJSPrototype.instantiate = function (url, parent) { | ||
const loader = this; | ||
const ext = url.slice(url.lastIndexOf('.')); | ||
switch (ext) { | ||
case '.css': | ||
return loadDynamicModule(function (_export, source) { | ||
// Relies on a Constructable Stylesheet polyfill | ||
const stylesheet = new CSSStyleSheet(); | ||
stylesheet.replaceSync(source); | ||
_export('default', stylesheet); | ||
}); | ||
case '.html': | ||
return getSourceRes().then(function (res) { | ||
return maybeJSFallback(res) || loadError("'.html' modules not implemented"); | ||
}); | ||
case '.json': | ||
return loadDynamicModule(function (_export, source) { | ||
_export('default', JSON.parse(source)); | ||
}); | ||
case '.wasm': | ||
return getSourceRes().then(function (res) { | ||
return maybeJSFallback(res) || | ||
(WebAssembly.compileStreaming ? WebAssembly.compileStreaming(res) : res.arrayBuffer().then(WebAssembly.compile)); | ||
}) | ||
.then(function (module) { | ||
const deps = []; | ||
const setters = []; | ||
const importObj = {}; | ||
// we can only set imports if supported (eg early Safari doesnt support) | ||
if (WebAssembly.Module.imports) | ||
WebAssembly.Module.imports(module).forEach(function (impt) { | ||
const key = impt.module; | ||
if (deps.indexOf(key) === -1) { | ||
deps.push(key); | ||
setters.push(function (m) { | ||
importObj[key] = m; | ||
}); | ||
} | ||
}); | ||
return [deps, function (_export) { | ||
return { | ||
setters: setters, | ||
execute: function () { | ||
return WebAssembly.instantiate(module, importObj) | ||
.then(function (instance) { | ||
_export(instance.exports); | ||
}); | ||
} | ||
}; | ||
}]; | ||
}); | ||
} | ||
return instantiate.apply(this, arguments); | ||
(function() { | ||
const systemPrototype = System.constructor.prototype; | ||
const instantiate = systemPrototype.instantiate; | ||
function getSourceRes () { | ||
return fetch(url).then(function (res) { | ||
if (!res.ok) | ||
loadError(res.status + ' ' + res.statusText); | ||
return res; | ||
}); | ||
} | ||
function maybeJSFallback (res) { | ||
const contentType = res.headers.get('content-type'); | ||
// if the resource is sent as application/javascript, support eval-based execution | ||
if (contentType && contentType.match(/^application\/javascript(;|$)/)) { | ||
return res.text().then(function (source) { | ||
(0, eval)(source); | ||
return loader.getRegister(); | ||
systemPrototype.instantiate = function (url, parent) { | ||
const loader = this; | ||
const ext = url.slice(url.lastIndexOf('.')); | ||
switch (ext) { | ||
case '.css': | ||
return loadDynamicModule(function (_export, source) { | ||
// Relies on a Constructable Stylesheet polyfill | ||
const stylesheet = new CSSStyleSheet(); | ||
stylesheet.replaceSync(source); | ||
_export('default', stylesheet); | ||
}); | ||
case '.html': | ||
return getSourceRes().then(function (res) { | ||
return maybeJSFallback(res) || loadError("'.html' modules not implemented"); | ||
}); | ||
case '.json': | ||
return loadDynamicModule(function (_export, source) { | ||
_export('default', JSON.parse(source)); | ||
}); | ||
case '.wasm': | ||
return getSourceRes().then(function (res) { | ||
return maybeJSFallback(res) || | ||
(WebAssembly.compileStreaming ? WebAssembly.compileStreaming(res) : res.arrayBuffer().then(WebAssembly.compile)); | ||
}) | ||
.then(function (module) { | ||
const deps = []; | ||
const setters = []; | ||
const importObj = {}; | ||
// we can only set imports if supported (eg early Safari doesnt support) | ||
if (WebAssembly.Module.imports) | ||
WebAssembly.Module.imports(module).forEach(function (impt) { | ||
const key = impt.module; | ||
if (deps.indexOf(key) === -1) { | ||
deps.push(key); | ||
setters.push(function (m) { | ||
importObj[key] = m; | ||
}); | ||
} | ||
}); | ||
return [deps, function (_export) { | ||
return { | ||
setters: setters, | ||
execute: function () { | ||
return WebAssembly.instantiate(module, importObj) | ||
.then(function (instance) { | ||
_export(instance.exports); | ||
}); | ||
} | ||
}; | ||
}]; | ||
}); | ||
} | ||
return instantiate.apply(this, arguments); | ||
function getSourceRes () { | ||
return fetch(url).then(function (res) { | ||
if (!res.ok) | ||
loadError(res.status + ' ' + res.statusText); | ||
return res; | ||
}); | ||
} | ||
} | ||
function loadDynamicModule (createExec) { | ||
return getSourceRes().then(function (res) { | ||
return maybeJSFallback(res) || res.text().then(function (source) { | ||
return [[], function (_export) { | ||
return { execute: createExec(_export, source) }; | ||
}]; | ||
}); | ||
}); | ||
} | ||
function loadError (msg) { | ||
throw Error(msg + ', loading ' + url + (parent ? ' from ' + parent : '')); | ||
} | ||
}; | ||
/* | ||
* Import map support for SystemJS | ||
* | ||
* <script type="systemjs-importmap">{}</script> | ||
* OR | ||
* <script type="systemjs-importmap" src=package.json></script> | ||
* | ||
* Only those import maps available at the time of SystemJS initialization will be loaded | ||
* and they will be loaded in DOM order. | ||
* | ||
* There is no support for dynamic import maps injection currently. | ||
*/ | ||
let importMap = { imports: {}, scopes: {} }, importMapPromise; | ||
if (hasDocument) { | ||
Array.prototype.forEach.call(document.querySelectorAll('script[type="systemjs-importmap"][src]'), function (script) { | ||
script._j = fetch(script.src).then(function (res) { | ||
return res.json(); | ||
}); | ||
}); | ||
} | ||
systemJSPrototype.prepareImport = function () { | ||
if (!importMapPromise) { | ||
importMapPromise = Promise.resolve(); | ||
if (hasDocument) | ||
Array.prototype.forEach.call(document.querySelectorAll('script[type="systemjs-importmap"]'), function (script) { | ||
importMapPromise = importMapPromise.then(function () { | ||
return (script._j || script.src && fetch(script.src).then(function (resp) { return resp.json(); }) || Promise.resolve(JSON.parse(script.innerHTML))) | ||
.then(function (json) { | ||
importMap = resolveAndComposeImportMap(json, script.src || baseUrl, importMap); | ||
}); | ||
function maybeJSFallback (res) { | ||
const contentType = res.headers.get('content-type'); | ||
// if the resource is sent as application/javascript, support eval-based execution | ||
if (contentType && contentType.match(/^application\/javascript(;|$)/)) { | ||
return res.text().then(function (source) { | ||
(0, eval)(source); | ||
return loader.getRegister(); | ||
}); | ||
} | ||
} | ||
function loadDynamicModule (createExec) { | ||
return getSourceRes().then(function (res) { | ||
return maybeJSFallback(res) || res.text().then(function (source) { | ||
return [[], function (_export) { | ||
return { execute: createExec(_export, source) }; | ||
}]; | ||
}); | ||
}); | ||
} | ||
return importMapPromise; | ||
}; | ||
} | ||
function loadError (msg) { | ||
throw Error(msg + ', loading ' + url + (parent ? ' from ' + parent : '')); | ||
} | ||
}; | ||
})(); | ||
systemJSPrototype.resolve = function (id, parentUrl) { | ||
parentUrl = parentUrl || baseUrl; | ||
return resolveImportMap(importMap, resolveIfNotPlainOrUrl(id, parentUrl) || id, parentUrl) || throwUnresolved(id, parentUrl); | ||
}; | ||
function throwUnresolved (id, parentUrl) { | ||
throw Error("Unable to resolve specifier '" + id + (parentUrl ? "' from " + parentUrl : "'")); | ||
} | ||
const toStringTag$1 = typeof Symbol !== 'undefined' && Symbol.toStringTag; | ||
@@ -788,0 +792,0 @@ |
/* | ||
* SystemJS 6.1.0 | ||
* SystemJS 6.1.1 | ||
*/ | ||
!function(){const t="undefined"!=typeof self,e="undefined"!=typeof document,n=t?self:global;let r;if(e){const t=document.querySelector("base[href]");t&&(r=t.href)}if(!r&&"undefined"!=typeof location){const t=(r=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==t&&(r=r.slice(0,t+1))}const o=/\\/g;function i(t,e){if(-1!==t.indexOf("\\")&&(t=t.replace(o,"/")),"/"===t[0]&&"/"===t[1])return e.slice(0,e.indexOf(":")+1)+t;if("."===t[0]&&("/"===t[1]||"."===t[1]&&("/"===t[2]||2===t.length&&(t+="/"))||1===t.length&&(t+="/"))||"/"===t[0]){const n=e.slice(0,e.indexOf(":")+1);let r;if(r="/"===e[n.length+1]?"file:"!==n?(r=e.slice(n.length+2)).slice(r.indexOf("/")+1):e.slice(8):e.slice(n.length+("/"===e[n.length])),"/"===t[0])return e.slice(0,e.length-r.length-1)+t;const o=r.slice(0,r.lastIndexOf("/")+1)+t,i=[];let c=-1;for(let t=0;t<o.length;t++)-1!==c?"/"===o[t]&&(i.push(o.slice(c,t+1)),c=-1):"."===o[t]?"."!==o[t+1]||"/"!==o[t+2]&&t+2!==o.length?"/"===o[t+1]||t+1===o.length?t+=1:c=t:(i.pop(),t+=2):c=t;return-1!==c&&i.push(o.slice(c)),e.slice(0,e.length-r.length)+i.join("")}}function c(t,e){return i(t,e)||(-1!==t.indexOf(":")?t:i("./"+t,e))}function s(t,e){for(let n in e)t[n]=e[n];return t}function u(t,e,n,r,o){for(let c in t){const s=t[c];if("string"!=typeof s)continue;const u=d(r,i(s,n)||s,o);u?e[c]=u:a(c,s,"bare specifier did not resolve")}}function l(t,e){if(e[t])return t;let n=t.length;do{const r=t.slice(0,n+1);if(r in e)return r}while(-1!==(n=t.lastIndexOf("/",n-1)))}function f(t,e){const n=l(t,e);if(n){const r=e[n];if(null===r)return;if(!(t.length>n.length&&"/"!==r[r.length-1]))return r+t.slice(n.length);a(n,r,"should have a trailing '/'")}}function a(t,e,n){console.warn("Package target "+n+", resolving target '"+e+"' for "+t)}function d(t,e,n){let r=n&&l(n,t.scopes);for(;r;){const n=f(e,t.scopes[r]);if(n)return n;r=l(r.slice(0,r.lastIndexOf("/")),t.scopes)}return f(e,t.imports)||-1!==e.indexOf(":")&&e}const h="undefined"!=typeof Symbol,p=h&&Symbol.toStringTag,m=h?Symbol():"@";function g(){this[m]={}}const y=g.prototype;function v(t){return t.id}function b(t,e,n){if(t.onload(n,e.id,e.d&&e.d.map(v)),n)throw n}let E;y.prepareImport=function(){},y.import=function(t,e){const n=this;return Promise.resolve(n.prepareImport()).then(function(){return n.resolve(t,e)}).then(function(t){const e=function t(e,n,r){let o=e[m][n];if(o)return o;const i=[],c=Object.create(null);p&&Object.defineProperty(c,p,{value:"Module"});let s=Promise.resolve().then(function(){return e.instantiate(n,r)}).then(function(t){if(!t)throw Error("Module "+n+" did not instantiate");const r=t[1](function(t,e){o.h=!0;let n=!1;if("object"!=typeof t)t in c&&c[t]===e||(c[t]=e,n=!0);else for(let e in t){let r=t[e];e in c&&c[e]===r||(c[e]=r,n=!0)}if(n)for(let t=0;t<i.length;t++)i[t](c);return e},2===t[1].length?{import:function(t){return e.import(t,n)},meta:e.createContext(n)}:void 0);return o.e=r.execute||function(){},[t[0],r.setters||[]]});const u=(s=s.catch(function(t){b(e,o,t)})).then(function(r){return Promise.all(r[0].map(function(o,i){const c=r[1][i];return Promise.resolve(e.resolve(o,n)).then(function(r){const o=t(e,r,n);return Promise.resolve(o.I).then(function(){return c&&(o.i.push(c),!o.h&&o.I||c(o.n)),o})})})).then(function(t){o.d=t})});return u.catch(function(t){o.e=null,o.er=t}),o=e[m][n]={id:n,i:i,n:c,I:s,L:u,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}(n,t);return e.C||function(t,e){return e.C=function t(e,n,r){if(!r[n.id])return r[n.id]=!0,Promise.resolve(n.L).then(function(){return Promise.all(n.d.map(function(n){return t(e,n,r)}))})}(t,e,{}).then(function(){return function t(e,n,r){if(r[n.id])return;if(r[n.id]=!0,!n.e){if(n.er)throw n.er;return n.E?n.E:void 0}let o;return n.d.forEach(function(i){try{const c=t(e,i,r);c&&(c.catch(function(t){b(e,n,t)}),(o=o||[]).push(c))}catch(t){b(e,n,t)}}),o?Promise.all(o).then(i):i();function i(){try{let t=n.e.call(O);if(t)return t=t.then(function(){n.C=n.n,n.E=null,b(e,n,null)},function(t){b(e,n,t)}),n.E=n.E||t;n.C=n.n,b(e,n,null)}catch(t){throw b(e,n,t),n.er=t,t}finally{n.L=n.I=void 0,n.e=null}}}(t,e,{})}).then(function(){return e.n})}(n,e)})},y.createContext=function(t){return{url:t}},y.onload=function(){},y.register=function(t,e){E=[t,e]},y.getRegister=function(){const t=E;return E=void 0,t};const O=Object.freeze(Object.create(null));n.System=new g;const S=y.register;function w(){document.querySelectorAll("script[type=systemjs-module]").forEach(function(t){t.src&&System.import("import:"===t.src.slice(0,7)?t.src.slice(7):c(t.src,r))})}y.register=function(t,e){S.call(this,t,e)},y.instantiate=function(t,e){const n=this;return new Promise(function(r,o){let i;function c(e){e.filename===t&&(i=e.error)}window.addEventListener("error",c);const s=document.createElement("script");s.charset="utf-8",s.async=!0,s.crossOrigin="anonymous",s.addEventListener("error",function(){window.removeEventListener("error",c),o(Error("Error loading "+t+(e?" from "+e:"")))}),s.addEventListener("load",function(){window.removeEventListener("error",c),document.head.removeChild(s),i?o(i):r(n.getRegister())}),s.src=t,document.head.appendChild(s)})},e&&(window.addEventListener("DOMContentLoaded",w),w()),t&&"function"==typeof importScripts&&(y.instantiate=function(t){const e=this;return new Promise(function(n,r){try{importScripts(t)}catch(t){r(t)}n(e.getRegister())})}),function(t){const e=System.constructor.prototype;let n,r,o;const i=e.import;e.import=function(e,c){return function(){n=r=void 0;for(let e in t)!t.hasOwnProperty(e)||!isNaN(e)&&e<t.length||(n?r||(r=e):n=e,o=e)}(),i.call(this,e,c)};const c=[[],function(){return{}}],s=e.getRegister;e.getRegister=function(){const e=s.call(this);if(e)return e;const i=function(){let e,i=0;for(let o in t)if(!(!t.hasOwnProperty(o)||!isNaN(o)&&o<t.length)){if(0===i&&o!==n||1===i&&o!==r)return o;i++,e=o}if(e!==o)return e}();if(!i)return c;let u;try{u=t[i]}catch(t){return c}return[[],function(t){return{execute:function(){t({default:u,__useDefault:!0})}}}]}}("undefined"!=typeof self?self:global);const x=y.instantiate;y.instantiate=function(t,e){const n=this;switch(t.slice(t.lastIndexOf("."))){case".css":return i(function(t,e){const n=new CSSStyleSheet;n.replaceSync(e),t("default",n)});case".html":return r().then(function(t){return o(t)||c("'.html' modules not implemented")});case".json":return i(function(t,e){t("default",JSON.parse(e))});case".wasm":return r().then(function(t){return o(t)||(WebAssembly.compileStreaming?WebAssembly.compileStreaming(t):t.arrayBuffer().then(WebAssembly.compile))}).then(function(t){const e=[],n=[],r={};return WebAssembly.Module.imports&&WebAssembly.Module.imports(t).forEach(function(t){const o=t.module;-1===e.indexOf(o)&&(e.push(o),n.push(function(t){r[o]=t}))}),[e,function(e){return{setters:n,execute:function(){return WebAssembly.instantiate(t,r).then(function(t){e(t.exports)})}}}]})}return x.apply(this,arguments);function r(){return fetch(t).then(function(t){return t.ok||c(t.status+" "+t.statusText),t})}function o(t){const e=t.headers.get("content-type");if(e&&e.match(/^application\/javascript(;|$)/))return t.text().then(function(t){return(0,eval)(t),n.getRegister()})}function i(t){return r().then(function(e){return o(e)||e.text().then(function(e){return[[],function(n){return{execute:t(n,e)}}]})})}function c(n){throw Error(n+", loading "+t+(e?" from "+e:""))}};let j,P={imports:{},scopes:{}};e&&Array.prototype.forEach.call(document.querySelectorAll('script[type="systemjs-importmap"][src]'),function(t){t._j=fetch(t.src).then(function(t){return t.json()})}),y.prepareImport=function(){return j||(j=Promise.resolve(),e&&Array.prototype.forEach.call(document.querySelectorAll('script[type="systemjs-importmap"]'),function(t){j=j.then(function(){return(t._j||t.src&&fetch(t.src).then(function(t){return t.json()})||Promise.resolve(JSON.parse(t.innerHTML))).then(function(e){P=function(t,e,n){const r={imports:s({},n.imports),scopes:s({},n.scopes)};if(t.imports&&u(t.imports,r.imports,e,n,null),t.scopes)for(let o in t.scopes){const i=c(o,e);u(t.scopes[o],r.scopes[i]||(r.scopes[i]={}),e,n,i)}return r}(e,t.src||r,P)})})})),j},y.resolve=function(t,e){return d(P,i(t,e=e||r)||t,e)||function(t,e){throw Error("Unable to resolve specifier '"+t+(e?"' from "+e:"'"))}(t,e)};const I="undefined"!=typeof Symbol&&Symbol.toStringTag;y.get=function(t){const e=this[m][t];if(e&&null===e.e&&!e.E)return e.er?null:e.n},y.set=function(t,e){let n;I&&"Module"===e[I]?n=e:(n=Object.assign(Object.create(null),e),I&&Object.defineProperty(n,I,{value:"Module"}));const r=Promise.resolve(n);return this.delete(t),this[m][t]={id:t,i:[],n:n,I:r,L:r,h:!1,d:[],e:null,er:void 0,E:void 0,C:r},n},y.has=function(t){const e=this[m][t];return e&&null===e.e&&!e.E},y.delete=function(t){const e=this.get(t);return void 0!==e&&(e&&e.d&&e.d.forEach(function(t){const n=t.i.indexOf(e);-1!==n&&t.i.splice(n,1)}),delete this[m][t])};const C="undefined"!=typeof Symbol&&Symbol.iterator;y.entries=function(){const t=this,e=Object.keys(t[m]);let n,r,o=0;const i={next:function(){for(;void 0!==(r=e[o++])&&void 0===(n=t.get(r)););return{done:void 0===r,value:void 0!==r&&[r,n]}}};return i[C]=function(){return this},i}}(); | ||
!function(){const t="undefined"!=typeof self,e="undefined"!=typeof document,n=t?self:global;let r;if(e){const t=document.querySelector("base[href]");t&&(r=t.href)}if(!r&&"undefined"!=typeof location){const t=(r=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==t&&(r=r.slice(0,t+1))}const o=/\\/g;function i(t,e){if(-1!==t.indexOf("\\")&&(t=t.replace(o,"/")),"/"===t[0]&&"/"===t[1])return e.slice(0,e.indexOf(":")+1)+t;if("."===t[0]&&("/"===t[1]||"."===t[1]&&("/"===t[2]||2===t.length&&(t+="/"))||1===t.length&&(t+="/"))||"/"===t[0]){const n=e.slice(0,e.indexOf(":")+1);let r;if(r="/"===e[n.length+1]?"file:"!==n?(r=e.slice(n.length+2)).slice(r.indexOf("/")+1):e.slice(8):e.slice(n.length+("/"===e[n.length])),"/"===t[0])return e.slice(0,e.length-r.length-1)+t;const o=r.slice(0,r.lastIndexOf("/")+1)+t,i=[];let c=-1;for(let t=0;t<o.length;t++)-1!==c?"/"===o[t]&&(i.push(o.slice(c,t+1)),c=-1):"."===o[t]?"."!==o[t+1]||"/"!==o[t+2]&&t+2!==o.length?"/"===o[t+1]||t+1===o.length?t+=1:c=t:(i.pop(),t+=2):c=t;return-1!==c&&i.push(o.slice(c)),e.slice(0,e.length-r.length)+i.join("")}}function c(t,e){return i(t,e)||(-1!==t.indexOf(":")?t:i("./"+t,e))}function s(t,e){for(let n in e)t[n]=e[n];return t}function u(t,e,n,r,o){for(let c in t){const s=t[c];if("string"!=typeof s)continue;const u=d(r,i(s,n)||s,o);u?e[c]=u:a(c,s,"bare specifier did not resolve")}}function l(t,e){if(e[t])return t;let n=t.length;do{const r=t.slice(0,n+1);if(r in e)return r}while(-1!==(n=t.lastIndexOf("/",n-1)))}function f(t,e){const n=l(t,e);if(n){const r=e[n];if(null===r)return;if(!(t.length>n.length&&"/"!==r[r.length-1]))return r+t.slice(n.length);a(n,r,"should have a trailing '/'")}}function a(t,e,n){console.warn("Package target "+n+", resolving target '"+e+"' for "+t)}function d(t,e,n){let r=n&&l(n,t.scopes);for(;r;){const n=f(e,t.scopes[r]);if(n)return n;r=l(r.slice(0,r.lastIndexOf("/")),t.scopes)}return f(e,t.imports)||-1!==e.indexOf(":")&&e}const h="undefined"!=typeof Symbol,p=h&&Symbol.toStringTag,m=h?Symbol():"@";function y(){this[m]={}}const g=y.prototype;function v(t){return t.id}function b(t,e,n){if(t.onload(n,e.id,e.d&&e.d.map(v)),n)throw n}let S;g.prepareImport=function(){},g.import=function(t,e){const n=this;return Promise.resolve(n.prepareImport()).then(function(){return n.resolve(t,e)}).then(function(t){const e=function t(e,n,r){let o=e[m][n];if(o)return o;const i=[],c=Object.create(null);p&&Object.defineProperty(c,p,{value:"Module"});let s=Promise.resolve().then(function(){return e.instantiate(n,r)}).then(function(t){if(!t)throw Error("Module "+n+" did not instantiate");const r=t[1](function(t,e){o.h=!0;let n=!1;if("object"!=typeof t)t in c&&c[t]===e||(c[t]=e,n=!0);else for(let e in t){let r=t[e];e in c&&c[e]===r||(c[e]=r,n=!0)}if(n)for(let t=0;t<i.length;t++)i[t](c);return e},2===t[1].length?{import:function(t){return e.import(t,n)},meta:e.createContext(n)}:void 0);return o.e=r.execute||function(){},[t[0],r.setters||[]]});const u=(s=s.catch(function(t){b(e,o,t)})).then(function(r){return Promise.all(r[0].map(function(o,i){const c=r[1][i];return Promise.resolve(e.resolve(o,n)).then(function(r){const o=t(e,r,n);return Promise.resolve(o.I).then(function(){return c&&(o.i.push(c),!o.h&&o.I||c(o.n)),o})})})).then(function(t){o.d=t})});return u.catch(function(t){o.e=null,o.er=t}),o=e[m][n]={id:n,i:i,n:c,I:s,L:u,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}(n,t);return e.C||function(t,e){return e.C=function t(e,n,r){if(!r[n.id])return r[n.id]=!0,Promise.resolve(n.L).then(function(){return Promise.all(n.d.map(function(n){return t(e,n,r)}))})}(t,e,{}).then(function(){return function t(e,n,r){if(r[n.id])return;if(r[n.id]=!0,!n.e){if(n.er)throw n.er;return n.E?n.E:void 0}let o;return n.d.forEach(function(i){try{const c=t(e,i,r);c&&(c.catch(function(t){b(e,n,t)}),(o=o||[]).push(c))}catch(t){b(e,n,t)}}),o?Promise.all(o).then(i):i();function i(){try{let t=n.e.call(E);if(t)return t=t.then(function(){n.C=n.n,n.E=null,b(e,n,null)},function(t){b(e,n,t)}),n.E=n.E||t;n.C=n.n,b(e,n,null)}catch(t){throw b(e,n,t),n.er=t,t}finally{n.L=n.I=void 0,n.e=null}}}(t,e,{})}).then(function(){return e.n})}(n,e)})},g.createContext=function(t){return{url:t}},g.onload=function(){},g.register=function(t,e){S=[t,e]},g.getRegister=function(){const t=S;return S=void 0,t};const E=Object.freeze(Object.create(null));n.System=new y;let O,w={imports:{},scopes:{}};e&&Array.prototype.forEach.call(document.querySelectorAll('script[type="systemjs-importmap"][src]'),function(t){t._j=fetch(t.src).then(function(t){return t.json()})}),g.prepareImport=function(){return O||(O=Promise.resolve(),e&&Array.prototype.forEach.call(document.querySelectorAll('script[type="systemjs-importmap"]'),function(t){O=O.then(function(){return(t._j||t.src&&fetch(t.src).then(function(t){return t.json()})||Promise.resolve(JSON.parse(t.innerHTML))).then(function(e){w=function(t,e,n){const r={imports:s({},n.imports),scopes:s({},n.scopes)};if(t.imports&&u(t.imports,r.imports,e,n,null),t.scopes)for(let o in t.scopes){const i=c(o,e);u(t.scopes[o],r.scopes[i]||(r.scopes[i]={}),e,n,i)}return r}(e,t.src||r,w)})})})),O},g.resolve=function(t,e){return d(w,i(t,e=e||r)||t,e)||function(t,e){throw Error("Unable to resolve specifier '"+t+(e?"' from "+e:"'"))}(t,e)};const x=g.register;function j(){document.querySelectorAll("script[type=systemjs-module]").forEach(function(t){t.src&&System.import("import:"===t.src.slice(0,7)?t.src.slice(7):c(t.src,r))})}g.register=function(t,e){x.call(this,t,e)},g.instantiate=function(t,e){const n=this;return new Promise(function(r,o){let i;function c(e){e.filename===t&&(i=e.error)}window.addEventListener("error",c);const s=document.createElement("script");s.charset="utf-8",s.async=!0,s.crossOrigin="anonymous",s.addEventListener("error",function(){window.removeEventListener("error",c),o(Error("Error loading "+t+(e?" from "+e:"")))}),s.addEventListener("load",function(){window.removeEventListener("error",c),document.head.removeChild(s),i?o(i):r(n.getRegister())}),s.src=t,document.head.appendChild(s)})},e&&(window.addEventListener("DOMContentLoaded",j),j()),t&&"function"==typeof importScripts&&(g.instantiate=function(t){const e=this;return new Promise(function(n,r){try{importScripts(t)}catch(t){r(t)}n(e.getRegister())})}),function(t){const e=System.constructor.prototype;let n,r,o;const i=e.import;e.import=function(e,c){return function(){n=r=void 0;for(let e in t)!t.hasOwnProperty(e)||!isNaN(e)&&e<t.length||(n?r||(r=e):n=e,o=e)}(),i.call(this,e,c)};const c=[[],function(){return{}}],s=e.getRegister;e.getRegister=function(){const e=s.call(this);if(e)return e;const i=function(){let e,i=0;for(let o in t)if(!(!t.hasOwnProperty(o)||!isNaN(o)&&o<t.length)){if(0===i&&o!==n||1===i&&o!==r)return o;i++,e=o}if(e!==o)return e}();if(!i)return c;let u;try{u=t[i]}catch(t){return c}return[[],function(t){return{execute:function(){t({default:u,__useDefault:!0})}}}]}}("undefined"!=typeof self?self:global),function(){const t=System.constructor.prototype,e=t.instantiate;t.instantiate=function(t,n){const r=this;switch(t.slice(t.lastIndexOf("."))){case".css":return c(function(t,e){const n=new CSSStyleSheet;n.replaceSync(e),t("default",n)});case".html":return o().then(function(t){return i(t)||s("'.html' modules not implemented")});case".json":return c(function(t,e){t("default",JSON.parse(e))});case".wasm":return o().then(function(t){return i(t)||(WebAssembly.compileStreaming?WebAssembly.compileStreaming(t):t.arrayBuffer().then(WebAssembly.compile))}).then(function(t){const e=[],n=[],r={};return WebAssembly.Module.imports&&WebAssembly.Module.imports(t).forEach(function(t){const o=t.module;-1===e.indexOf(o)&&(e.push(o),n.push(function(t){r[o]=t}))}),[e,function(e){return{setters:n,execute:function(){return WebAssembly.instantiate(t,r).then(function(t){e(t.exports)})}}}]})}return e.apply(this,arguments);function o(){return fetch(t).then(function(t){return t.ok||s(t.status+" "+t.statusText),t})}function i(t){const e=t.headers.get("content-type");if(e&&e.match(/^application\/javascript(;|$)/))return t.text().then(function(t){return(0,eval)(t),r.getRegister()})}function c(t){return o().then(function(e){return i(e)||e.text().then(function(e){return[[],function(n){return{execute:t(n,e)}}]})})}function s(e){throw Error(e+", loading "+t+(n?" from "+n:""))}}}();const P="undefined"!=typeof Symbol&&Symbol.toStringTag;g.get=function(t){const e=this[m][t];if(e&&null===e.e&&!e.E)return e.er?null:e.n},g.set=function(t,e){let n;P&&"Module"===e[P]?n=e:(n=Object.assign(Object.create(null),e),P&&Object.defineProperty(n,P,{value:"Module"}));const r=Promise.resolve(n);return this.delete(t),this[m][t]={id:t,i:[],n:n,I:r,L:r,h:!1,d:[],e:null,er:void 0,E:void 0,C:r},n},g.has=function(t){const e=this[m][t];return e&&null===e.e&&!e.E},g.delete=function(t){const e=this.get(t);return void 0!==e&&(e&&e.d&&e.d.forEach(function(t){const n=t.i.indexOf(e);-1!==n&&t.i.splice(n,1)}),delete this[m][t])};const I="undefined"!=typeof Symbol&&Symbol.iterator;g.entries=function(){const t=this,e=Object.keys(t[m]);let n,r,o=0;const i={next:function(){for(;void 0!==(r=e[o++])&&void 0===(n=t.get(r)););return{done:void 0===r,value:void 0!==r&&[r,n]}}};return i[I]=function(){return this},i}}(); |
{ | ||
"name": "systemjs", | ||
"version": "6.1.0", | ||
"version": "6.1.1", | ||
"description": "Dynamic ES module loader", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -129,2 +129,3 @@ # SystemJS | ||
* [single-spa](https://single-spa.js.org/) - JavaScript framework for front-end microservices. | ||
* [systemjs-webpack-interop](https://github.com/joeldenning/systemjs-webpack-interop) - npm lib for setting webpack public path and creating webpack configs that work well with SystemJS. | ||
@@ -142,2 +143,4 @@ ## Loader Extensions | ||
[systemjs-webpack-interop](https://github.com/joeldenning/systemjs-webpack-interop) is a community-maintained npm library that might help you get webpack and systemjs working well together. | ||
As of webpack@4.30.0, it is now possible to compile webpack bundles to System.register format, by modifying your webpack config: | ||
@@ -144,0 +147,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
128950
1616
219
10