jarek-foksa / xel

Xel - Widget toolkit for building native-like Electron and Web apps
https://xel-toolkit.org
Other
689 stars 59 forks source link

[Feature request] Tauri support #114

Closed KaKi87 closed 1 year ago

KaKi87 commented 2 years ago

Hello,

Tauri is an Electron alternative that uses different engines depending on operating system :

Since it is lighter weight and less memory-consuming, it would be nice for Xel to support it.

Thanks !

Bellisario commented 2 years ago

@KaKi87 I think this is impossible for now by just reading the FAQ on documentation site, where are listed all platforms supported: WebKit isn't for now and you can currently use only with Windows (I don't know if WebKitGTK is supported, but I don't think since it's built on top of WebKit).

Anyway, maybe the Xel developer decide to bring it also on WebKit...

jarek-foksa commented 2 years ago

I would like to support WebKit at some point in future, currently there is at least one important API (Constructable Stylesheets) missing.

KaKi87 commented 2 years ago

That's only needed for the meta tags, right ?

jarek-foksa commented 2 years ago

Constructable Stylesheets and adoptedStyleSheets APIs are needed for dynamic theme switching, no matter whether you use meta tags or JS API.

KaKi87 commented 2 years ago

I didn't know there was a JS API, where did I miss it ?

But yes, I guessed that meta tags would be watched by JS to dynamically switch themes.

So, if dynamic switching is the only feature that require those APIs, everything else can still work using CSS imports, right ?

jarek-foksa commented 2 years ago

Actually, dynamic theme switching could be implemented without these APIs (as it was done in earlier versions of Xel), but it would be much slower.

jarek-foksa commented 2 years ago

The JS API for theme switching is not currently documented, you can use it like this:

import Xel from "/node_modules/xel/xel.js";
Xel.theme = "/themes/adwaita.css";
KaKi87 commented 2 years ago

What about allowing usage of Xel even when dynamic switching is unavailable ? Especially when using a JS framework, we don't necessarily need Xel to handle that. Most multi-theme CSS framework don't and it's fine.

jarek-foksa commented 2 years ago

It would still require many adjustments. I would rather prefer to wait for Apple to implement the missing APIs or write a polyfill for them.

KaKi87 commented 2 years ago

Alright, then I'll be waiting for either to happen, to release my Tauri app on Linux.

jarek-foksa commented 1 year ago

I added WebKit support in Xel version 0.20.0. Still, it's probably not a good idea to use it with Tauri as only the latest version of WebKit (605.1.15, same as Safari 16.4) is supported.