Skip to content

chore: migrate to ESM - #1824

Draft
ShGKme wants to merge 10 commits into
mainfrom
chore/deps-update
Draft

chore: migrate to ESM#1824
ShGKme wants to merge 10 commits into
mainfrom
chore/deps-update

Conversation

@ShGKme

@ShGKme ShGKme commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

☑️ Resolves

Migrate to ESM

  • Update package.json/type and package.json/main
  • Rename .mjs to .js
  • (AI-assisted) Migrate general CJS require to ESM imports
  • Migrate asset imports and dynamic requires to new URL('...', import.meta.url)
  • And some more...

Remove @vercel/webpack-asset-relocator-loader for .node loading

  • It was as asset loading for .node modules
  • It is not completely compatible with ESM. It uses URL path handling, with URL encoding (Nextcloud Talk becomes Nextcloud%20Talk, breaking loading)
  • For a simple .node file, we can load it manually with 2 lines of code

Patch @electron-forge/plugin-webpack for ESm support

Unfortunately, the plugin isn't ready for ESM support yet.
Adding a small patch with patch-package.

AI (if applicable)

  • The content of this PR was partly or fully generated using AI
    • Used to migrate CJS require to ESM import

ShGKme added 10 commits July 23, 2026 16:29
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Assisted-by: ClaudeCode:claude-opus-4-8
Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Currently, this plugin is not completely compatible with ESM.
It uses new URL for paths and replaces space with %20.
It breaks accessing Windows Registry if installation path has spaces.
For example, `Nextcloud Talk`.

Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
@ShGKme ShGKme self-assigned this Jul 23, 2026
@ShGKme ShGKme added technical debt Maintenance and refactoring AI assisted This PR contains AI-assisted commits labels Jul 23, 2026

@Antreesy Antreesy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code-wise looks OK, smoke-tested windows build, see no issues so far

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

Labels

AI assisted This PR contains AI-assisted commits technical debt Maintenance and refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants