awrit icon indicating copy to clipboard operation
awrit copied to clipboard

Rewrite with Electron/Typescript

Open chase opened this issue 1 year ago • 5 comments

Why?

Problems?

This shouldn't be too difficult, but it does mean that there will be some performance regressions in frequently called, low-latency code that will require some native addons or extensions using WASM. First thing that comes to mind is converting the NativeImage of the painted area to the right format before blitting to Kitty.

chase avatar Apr 08 '24 06:04 chase

@GustavoJCL if you're still interested in contributing to the rewrite, I've started a fresh branch electron: https://github.com/chase/awrit/tree/electron

Mouse input needs to be fixed, so if you want to debug and tackle that, I'd appreciate it!

So far, the only thing implemented so far is the input test, which can be run with: npm run input-test (after installing the project with npm install of course)

chase avatar Jun 15 '24 18:06 chase

yes of course, I will try to fix it

gustavojoaquin avatar Jun 16 '24 05:06 gustavojoaquin

@GustavoJCL The code missing the DEC MODE character, adding that fixed it! https://github.com/chase/awrit/commit/09b5bec8ac0743f7f7bffa21bb6e15ea55e6d510

chase avatar Jun 23 '24 09:06 chase

Sorry, I didn't have much time that month. Now I can contribute more actively to rewriting it in Electron. What elements or modules need to be implemented?

gustavojoaquin avatar Aug 31 '24 23:08 gustavojoaquin

Sorry, I didn't have much time that month. Now I can contribute more actively to rewriting it in Electron. What elements or modules need to be implemented?

No problem at all, I've been quite busy myself.

Honestly, there's quite a bit to be done still. Electron's ecosystem is still quite frustrating to work with.

I guess the first few things to solve:

  • [x] Drop electron-vite, it doesn't work well with escape codes and there's no real way to get around that.
  • [x] Switch to tsx with watch mode for transpiling the CLI's TypeScript to JavaScript
  • [x] Switch to esbuild for the Electron scripts that are run via electron whatever.js
  • [x] Use the graphics test/demo I wrote as a reference and combine the frame compositor with the offscreen Electron window's frame and damaged area callbacks
    • This should get things rendering
  • [x] Use the input test as a reference and translate it to the input events that Electron understands to get input working

That should bring it almost to parity with the existing implementation.

chase avatar Sep 01 '24 21:09 chase