pomatez icon indicating copy to clipboard operation
pomatez copied to clipboard

Framework migration

Open TishanV opened this issue 1 year ago • 9 comments

Is your feature request related to a problem? Please describe. As I know Electron is a great framework for cross-platform apps but it's downfall is that it uses Chromium which takes lot of RAM and app bundle size. Since Pomatez app is light unlike VSCode try considering migrate to other lightweight frameworks like Tauri or Neutralino.js.

TishanV avatar Jul 29 '22 08:07 TishanV

If you are okay with it assign me to this issue.

TishanV avatar Jul 29 '22 08:07 TishanV

If you are okay with it assign me to this issue.

Hi @TishanV , I'm good with that as long as the project will benefit from it.

What do you think @sekwah41 @gillisandrew?

roldanjr avatar Jul 29 '22 14:07 roldanjr

I'm quite open to looking into Tauri. I've actually been considering doing it for this app as a practice anyway.

As we have little to no direct desktop code other than revising and a few other things I don't believe this would be a major change and we can reuse most basically all the front-end stuff.

Only reason I've not looked before is being tied up with some other projects or my other projects would require a full redo of the code signing phase.

Only thing I think we'd need to look into is how to get Tauri apps on the snap store or automate that.

Also it would make other os specific bugs a little less friendly as e.g. Mac uses safari built in if I understand correctly.

Another part is Tauri is exploring allowing mobile apps too so we'd be able to publish an Android and iOS version in the future when the framework matures further if we so please.

sekwah41 avatar Jul 30 '22 21:07 sekwah41

Only part is the backend would be in rust which shouldn't be complex anyway as from what I've seen the framework is pretty clean and makes small bundles.

And while it would be a first for me in rust I've been looking into the language quite a bit and would be more than happy to use this project as an excuse to properly try to learn it even as a concept as I was considering doing it anyway.

sekwah41 avatar Jul 30 '22 21:07 sekwah41

I've also pinned this issue as it would be quite a major one that would render some of the backlog of bugs redundant.

sekwah41 avatar Jul 30 '22 22:07 sekwah41

In case anyone has not seen Tauri https://github.com/tauri-apps/tauri

And an example of how they are progressing, they have an experimental snapshot ready for ios https://github.com/tauri-apps/tauri/tree/feat/ios-build

sekwah41 avatar Jul 31 '22 11:07 sekwah41

In case anyone has not seen Tauri https://github.com/tauri-apps/tauri

And an example of how they are progressing, they have an experimental snapshot ready for ios https://github.com/tauri-apps/tauri/tree/feat/ios-build

This is awesome, I was thinking to learn Flutter before I saw this.

roldanjr avatar Aug 01 '22 02:08 roldanjr

If you are focusing on mobile first @roldanjr you may also be interested in react-native using expo (speeds up dev and is reccomended by the react site), flutter or ionic.

Also for now snap isnt supported by tauri though I will look into how to compile it for snap and either setup some stuff or try to work on adding support to tauri depending on the complexity >.> as there are already linux builders for AppImage and deb.

If this project https://www.npmjs.com/package/tauri-snap-packager or something else I find doesn't work.

sekwah41 avatar Aug 01 '22 20:08 sekwah41

Ok ive started looking into rust and honestly, I wish id tried it earlier, once I am happy enough with it ill move onto tauri and start trying a migration.

Seems like a pretty good clean language as well as some very powerful libraries e.g. tauri.

Luckily I have experience with a fair few languages that seem to structure in similar ways so its not fully jumping into the dark but when I can ill comment here with the branch I am working on in case anyone more experienced with rust would like to point me towards best practices or ways to improve :)

sekwah41 avatar Sep 04 '22 15:09 sekwah41

Are there any news on this? Excited to see it :)

q-wertz avatar Nov 11 '22 20:11 q-wertz

Are there any news on this? Excited to see it :)

@sekwah41 is trying to work on the Backend migrating it to Tauri while on my side, I'm trying to target Mobile, Web, and Desktop for the Frontend using React Native + Web. It will take a while before we release a new version of this app especially since we are just doing it in our own spare time but it's worth the effort.

roldanjr avatar Nov 12 '22 05:11 roldanjr

Thanks for the info :blush: Really like the app and the design. Take your time :)

q-wertz avatar Nov 12 '22 09:11 q-wertz

@roldanjr one thing you make like is tauri is aiming to allow iOS and android targets too.

They have some in dev branches but if u remember correctly it's getting there.

sekwah41 avatar Nov 21 '22 06:11 sekwah41

https://tauri.app/v1/guides/distribution/sign-linux one issue there will be of using tauri is that it doenst have the same amount of linux targets as electron builder.

at minimum id like to support AppImage which seems possible and Snap which I will need to also investigate.

I will take a look into how close the mobile version platforms of tauri are to being ready but I may delay this until I've made changes to the frontend to support it running on Ionic on mobile devices.

sekwah41 avatar Dec 21 '22 15:12 sekwah41

As long as the calls to the backend are non-implementation specific we can tinker with both at the same time even if it's just a testing branch or using it to cover the targets Tauri can atm. It's already a goal to target multiple backend systems because of the mobile goals.

sekwah41 avatar Dec 21 '22 15:12 sekwah41

Actually, because @roldanjr has used the default snap building mechanism rather than the electron builder output for snap solely hes actually possibly made it a lot easier to modify this to use Tauri for the snapcraft version.

sekwah41 avatar Dec 28 '22 05:12 sekwah41

Luckily it looks like you can also compile the windows binaries on on linux but itll probably be less fiddly to just compile on the correct platforms.

Just set up the base project today it seems to render fine at least. I will need to create a lost of all the features and issues that need to be implemented e.g. the fullscreen breaks or minimising to the tray.

While making these edits ill try to abstract it in some way so that the mobile version if we dont use Tauri also can hook into these same calls.

Though for the mobile version we will want flags to hide UI or alter it in ways.

sekwah41 avatar Dec 28 '22 06:12 sekwah41

image The renderer obviously works fine as you can even run it in chrome. Though there is an odd flickering issue on majaro at least which seems to be a problem with webkit (see https://github.com/tauri-apps/tauri/issues/4236)

sekwah41 avatar Dec 28 '22 06:12 sekwah41

Will need to update some of the postbuild scripts for stuff like the renderer to stop it from deleting files tauri wants. Also we should be copying from the other projects to here not the other way around.

sekwah41 avatar Dec 28 '22 06:12 sekwah41

Some of the tools only work on Ubuntu. I'll try to take a look at adding new targets for Tauri or adding to the project itself because id like to toy with more Linux things and expand my rust knowledge so once I have some other parts out of the way or hit a wall with this ill take a tinker with more underlying parts.

One user on that issue also reported that the compiled versions locally may not have that issue but inside app images it seems to be a problem.

sekwah41 avatar Dec 28 '22 07:12 sekwah41

I am temporarily disabling the main electron test build workflow while I test some tauri stuff just to avoid a lot of unneeded builds. I likely will fork it to my own one and disable it there instead tomorrow.

sekwah41 avatar Dec 29 '22 07:12 sekwah41

The flickering only seems to be in dev mode when resizing so feel free to ignore that on linux at least. The AppImage ive tested that it compiles seems to be fine.

sekwah41 avatar Dec 29 '22 17:12 sekwah41

So here are the tasks that still need to be done with the tauri version

  • [ ] List the functions that need remaking in Tauri
  • [ ] Connect the Frontend to the new rust backend calls
  • [ ] Snap file output

As long as we can get a snap version the windows portable would be the only one we'd lose.

sekwah41 avatar Dec 29 '22 17:12 sekwah41

I will check the ram usage, though image

Not only would we lose output targets we can use. The bundle size for AppImage is around about the same. Ill need to check Win and Mac but the deb files are about 6MB instead. So it can be significantly smaller.

sekwah41 avatar Dec 29 '22 17:12 sekwah41

At least in appimage mode it seems to use a bit less memory as Tauri vs Electron (rough look id estimate electron uses 50% more minimum?). As the platform matures itll gain a lot more benefits, it seems we are losing a lot of key targets for linux, as well as the portable mode on windows.

sekwah41 avatar Dec 29 '22 19:12 sekwah41

image The sizes are a lot better on other operating systems.

sekwah41 avatar Dec 29 '22 23:12 sekwah41

I am going to go ahead with making a Tauri version while maintaining the electron version for targets it doesn't currently support.

It would also be good to look into adding feature flags or settings for hiding or setting certain settings.

sekwah41 avatar Dec 29 '22 23:12 sekwah41

I will be continuing progress over here before cleaning up the commits https://github.com/sekwah41/pomatez-tauri

I've refactored the Electron context to allow a connector for us to properly talk to different platforms a bit easier.

Though I have some stuff to sort and new years plans so may not be touching this for a few days.

sekwah41 avatar Dec 30 '22 02:12 sekwah41

As I'm also looking at a mobile version there is even more reason for me to progress this now.

I have some base versions with tauri already but need to finish the implementations.

I've also raised some bugs I've found on linuxnwith tauri from doing this that seem to be fixed and merged too.

Mobile news for reference https://tauri.app/blog/2022/12/09/tauri-mobile-alpha/

sekwah41 avatar Feb 25 '23 12:02 sekwah41

I'm actively revamping the project, making it more maintainable and scalable. But in the meantime, I will still use Electron for packaging the app for the Desktop until all our target platforms are fully supported by Tauri or we can make a gradual transition after the whole revamp has been done.

For your reference, I'm working on this branch revamp

roldanjr avatar Feb 26 '23 10:02 roldanjr