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

ESM Support #1466

Open
dsanders11 opened this issue Sep 22, 2023 · 2 comments
Open

ESM Support #1466

dsanders11 opened this issue Sep 22, 2023 · 2 comments
Labels
ESM ✨ enhancement New feature or request

Comments

@dsanders11
Copy link
Member

With ESM support coming to Electron 28, it would be nice to have support for main.mjs in Fiddle when that release happens. Rough sketch of what I think is necessary to support it.

  • Add support for .mjs as a file extension
  • Support either main.js or main.mjs for main process code
  • Smooth out the UX
    • Don't allow both main.js and main.mjs to exist in a Fiddle
    • Consider whichever is present to be the required file
    • Show a warning to the user if they're trying to use main.mjs in a version before 28

Bonus points UX: Add a "Convert to ESM" button to the context menu when you right click main.js

@dsanders11 dsanders11 added the ✨ enhancement New feature or request label Sep 22, 2023
@bnb
Copy link
Member

bnb commented Sep 25, 2023

Add support for .mjs as a file extension

is .cjs also already supported? Worth doing if not already.

@dsanders11
Copy link
Member Author

is .cjs also already supported? Worth doing if not already.

Fair point. It is not, at the moment only .js, .html, and .css extensions are supported. Shouldn't be much extra work to toss in .cjs when refactoring to support alternatives to main.js as the main entrypoint.

@dsanders11 dsanders11 added the ESM label Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ESM ✨ enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants