mifi/lossless-cut

Upgrade electron to newest

mifi opened this issue · 6 comments

mifi commented

This would give benefits:

  • Improved performance and bugfixes in chromium/electron
  • Fix crashes seen on Apple M1
  • can replace open with shell.showItemInFolder(fullPath) (Reveal converted file in finder/explorer) https://www.electronjs.org/docs/api/shell
  • replace trash with shell.trashItem(path) for (hopefully) better trash guarantee #537 (comment)
  • hopefully fixes: Release file handle when opening new file #272
  • Native h265/hevc support #88 (comment)

☑️ Upgrade was blocked by electron/electron#26143 and libuv/libuv#3050 - I tested upgrading but losslesscut becomes unbearably slow in newest versions of electron. Now fixed!

May have to look into https://github.com/vercel/hyper/pull/5803/files

TODO

CSP <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval';" />

app.on('ready', async () => {
  // https://github.com/electron/electron/issues/23757
  electron.protocol.registerFileProtocol('file', (request, callback) => {
    const pathname = decodeURIComponent(request.url.replace('file:///', ''));
    callback(pathname);
  });

update package.json browserlist electron version

electron-store,electron-builder,electron-builder-notarize versions have been pinned in package.json (not ^)

we are heavy on electron.remote so probably need to use https://www.npmjs.com/package/@electron/remote

test

  • test all native modules
  • test confirm close after upgrade to 12
  • test packed build and signed (MAS) npx react-scripts build && npx electron-builder --mac
  • ...

It might be worth noting that electron-8x is EOL so there are likely unpatched security issues, for example:

mifi commented

Yea. There's still a critical bug in MacOS/electron that is preventing me (and a lot of other electron apps) from upgrading to v12. Although I'd love to upgrade to 12, I'm not going to prioritise implementing a hack workaround in losslesscut until absolutely necessary.

The app is now no longer working on any recent linux distro without custom launch flags: ValveSoftware/steam-for-linux#8373 (comment)

You might want to mention this in the release notes or in the projects readme. ./LosslessCut.AppImage --no-sandbox works fine, for example. There's at least 2 other builtin flags that will also probably make it run, they're listed in the linked issue thread somewhere.

EDIT: Also see electron/electron#31091

mifi commented

There is already a line in the readme about no-sandbox: https://github.com/mifi/lossless-cut#troubleshooting--faq
Is there anything else needed to get it to run on linux now?

electron v20 is out 🚀

mifi commented

now upgraded to electrion 21