Skip to content

Commit

Permalink
6.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldenning committed Oct 18, 2021
1 parent fd49d01 commit d29783e
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 51 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
SystemJS 6.11.0
* Add the possibility to use an async createScript hook (https://github.com/systemjs/systemjs/pull/2362 @legarsjules)
* Use Promise.resolve in named-register. Resolves #2359. (https://github.com/systemjs/systemjs/pull/2363)

SystemJS 6.10.3
* Avoid double instantiation of named registers. (https://github.com/systemjs/systemjs/pull/2352)
* Always return the first named register from a file. (https://github.com/systemjs/systemjs/pull/2352)
Expand Down
2 changes: 1 addition & 1 deletion dist/extras/named-register.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
firstNamedDefine = define;
firstName = name;
}
setTimeout(function () {
Promise.resolve().then(function () {
firstNamedDefine = null;
firstName = null;
});
Expand Down
2 changes: 1 addition & 1 deletion dist/extras/named-register.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/extras/named-register.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 22 additions & 21 deletions dist/s.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SJS 6.10.3
* SJS 6.11.0
* Minimal SystemJS Build
*/
(function () {
Expand Down Expand Up @@ -628,27 +628,28 @@
return autoImportRegistration;
}
var loader = this;
return new Promise(function (resolve, reject) {
var script = systemJSPrototype.createScript(url);
script.addEventListener('error', function () {
reject(Error(errMsg(3, [url, firstParentUrl].join(', ') )));
});
script.addEventListener('load', function () {
document.head.removeChild(script);
// Note that if an error occurs that isn't caught by this if statement,
// that getRegister will return null and a "did not instantiate" error will be thrown.
if (lastWindowErrorUrl === url) {
reject(lastWindowError);
}
else {
var register = loader.getRegister(url);
// Clear any auto import registration for dynamic import scripts during load
if (register && register[0] === lastAutoImportDeps)
clearTimeout(lastAutoImportTimeout);
resolve(register);
}
return Promise.resolve(systemJSPrototype.createScript(url)).then(function (script) {
return new Promise(function (resolve, reject) {
script.addEventListener('error', function () {
reject(Error(errMsg(3, [url, firstParentUrl].join(', ') )));
});
script.addEventListener('load', function () {
document.head.removeChild(script);
// Note that if an error occurs that isn't caught by this if statement,
// that getRegister will return null and a "did not instantiate" error will be thrown.
if (lastWindowErrorUrl === url) {
reject(lastWindowError);
}
else {
var register = loader.getRegister(url);
// Clear any auto import registration for dynamic import scripts during load
if (register && register[0] === lastAutoImportDeps)
clearTimeout(lastAutoImportTimeout);
resolve(register);
}
});
document.head.appendChild(script);
});
document.head.appendChild(script);
});
};

Expand Down

0 comments on commit d29783e

Please sign in to comment.