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

Conversation

@prajyot-porje
Copy link
Contributor

Fix: Proper Detection of ES Modules in Federated Extension Loader

🔧 Problem

The federated extension loader does not reliably detect when an extension is using ES modules.
Even when extensions output valid ESM bundles, the loader defaults to treating them as CommonJS,
which can cause load failures depending on how the extension was built.

✅ What This PR Does

This PR updatesdev_mode/bootstrap.js to improve ES module detection in federated extensions.

Key Improvements

  • Detects ESM based on.mjs file extension.
  • Checks page-config metadata (federated_extensions) foresModule: true.
  • Ensures correct script type is used during dynamic loading.

📁 Files Changed

  • dev_mode/bootstrap.js

🧪 Testing

I could not reproduce the module-format error locally, but the logic follows the expected behavior
and aligns with the discussion in the linked issue. Feedback from maintainers on validation
with real-world extension setups is appreciated.

📌 Related Issue

Fixes#17809

@jupyterlab-probot
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch onbinder, follow this link:Binder

@prajyot-porje
Copy link
ContributorAuthor

Hi@krassowski, could you please add the appropriate label to this PR?

The "Enforce PR label" check is failing, and as an external contributor I don’t have permission to apply labels myself. Once a label is added, the workflow should pass.

Thanks again for your guidance on this issue!

Copy link
Member

@Darshan808Darshan808 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Left some suggestions focused on reducing verbosity.

Co-authored-by: Darshan Poudel <pranishpoudel10@gmail.com>
@Darshan808
Copy link
Member

Lint job is still failing.

@prajyot-porje
Copy link
ContributorAuthor

Lint issues have been fixed manually usingnpx prettier --write.

Copy link
Member

@Darshan808Darshan808 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This looks good at a glance. I wasn’t able to test it on a federated extension using ES modules, though. Maybe@krassowski or@kkoster can help verify that part.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@Darshan808Darshan808Darshan808 left review comments

Assignees

@prajyot-porjeprajyot-porje

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

ES Modules for extension development

3 participants

@prajyot-porje@Darshan808@krassowski

[8]ページ先頭

©2009-2025 Movatter.jp