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

Remove Electron (!) via Tauri #336

Draft
wants to merge 69 commits into
base: master
Choose a base branch
from
Draft

Conversation

smolck
Copy link
Owner

@smolck smolck commented Aug 2, 2021

Uses Tauri to get rid of Electron. Semi-hesitant to open this just in case I abandon it, but the UI is actually fairly far along at this point:

webview-tauri-so-far

Some notes so far:

  • Startup is quicker than master I think, although it's slowed down since I timed it last (perhaps due to loading canvaskit?). Overall I don't feel any performance regressions from master, so that's good, and almost surprising given how unoptimized the Rust code feels to me.
  • Dead keys are broken again I think, which is probably due to a not-quite-the-same implementation of src/main/core/input.ts in the new Rust version (found in src-tauri/src/neovim_handler.rs).
  • Text rendering is still an issue (as you can maybe tell in the screenshot above), even more so with this branch than master; see this commit message for my plan on how to fix that (hopefully enough to where I can leave it alone for a while and do anything else lol).
  • Still need to port the UI components, the git part of the statusline, the tabline, etc., and overall just get [the new backend] to feature-parity with master.
  • I may have underestimated how horribly convoluted uivonim's codebase is. The backend is already much nicer to deal with now that it's all rewritten from scratch in Rust, but the frontend is still terribly messy. Hopefully I can fix that with the WebGL -> CanvasKit refactor and maybe some additional refactors as necessary, but it really needs work. Perhaps it'd be a good idea to start using classes instead of the whole module mess that is currently used? Idk, we'll see.
  • How to shutdown cleanly on :q? For some reason I'm not getting rpcnotify(0, ...) events on the Rust side, so doing a VimLeave autocmd isn't working/won't work unless I can figure that out. Maybe need to connect to neovim with another thread like on master? In any case, if you :qa! etc. to quit right now, it kind of freezes the UI and then shuts down after another key press. It's not great. (Maybe see how Neovide deals with it?)

Overall, I don't have any real major issues with Tauri so far, it's pretty nice/easy to use once you get used to it. And since uivonim no longer uses remote thanks to #191, it's fairly plug-and-play discounting the fact everything backend-wise has to be rewritten in Rust.

Draft PR since this is still a ways off from being ready for merge, especially since the CanvasKit rewrite could take a while, and that's once I even get to that point.

smolck added 28 commits July 30, 2021 10:05
Supposed to be a *working* rewrite of the font-texture-atlas stuff
to use canvaskit so I can make fonts work (have to load from
binary font data gotten from the rust backend, which I can only seem to
do w/canvaskit & not the builtin canvas), but . . . this is just broken on my
1080p monitor (although it looks fine on my MBA's screen), and the code
is just horrifically ugly, messy, convoluted, etc.

The *real* solution here is to just use canvaskit for all (text) rendering
instead of webgl; done right, should be just as fast (canvaskit can use
the GPU), but actually work well for most/all monitors.

In addition, using canvaskit for rendering over the current setup should
allow for adding extra eyecandy/niceties, e.g. Neovide's animated
cursor.

It's probably not gonna be a quick port from webgl -> canvaskit though
(could require a rewrite of both the window-manager etc. code *and*
the rendering code), so I'll just leave it for now until I get the rest
of the UI working as it did pre-port (or about as it did).

So TL;DR plan is leave this broken mess as-is until I get the rest of
the backend ported (w/signature-help etc.), and then refactor/rewrite
the frontend to use canvaskit instead of webgl for rendering, hopefully
cleaning up the terrible mess that currently is src/renderer in the
process.
@smolck smolck added neovim Bugs or enhancements related to neovim integration refactor labels Aug 2, 2021
@smolck smolck force-pushed the remove-electron-via-tauri branch from d3de5a8 to bfb4dd4 Compare September 4, 2021 19:12
@smolck smolck force-pushed the remove-electron-via-tauri branch from 5d0c3ef to 0577d46 Compare November 20, 2022 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend relating to the backend (src/main etc.) frontend pertaining to the frontend (src/renderer) neovim Bugs or enhancements related to neovim integration refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant