Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix: Proper Detection of ES Modules in Federated Extension Loader#18154

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
prajyot-porje wants to merge3 commits intojupyterlab:main
base:main
Choose a base branch
Loading
fromprajyot-porje:es-module-loader-fix
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletiondev_mode/bootstrap.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,14 +40,26 @@ function getOption(name) {
// eslint-disable-next-line no-undef
__webpack_public_path__ = getOption('fullStaticUrl') + '/';

function isESModule(url) {
if (url.endsWith('.mjs')) {
return true;
}
const extensionData = getOption('federated_extensions') || [];
const match = extensionData.find(ext => `${ext.name}/${ext.load}` === url);
return match?.esModule === true;
}

function loadScript(url) {
return new Promise((resolve, reject) => {
const newScript = document.createElement('script');
newScript.onerror = reject;
newScript.onload = resolve;
newScript.async = true;
document.head.appendChild(newScript);
if (isESModule(url)) {
newScript.type = 'module';
}
newScript.src = url;
document.head.appendChild(newScript);
});
}

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp