-
Notifications
You must be signed in to change notification settings - Fork 18
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
Use-cases #143
Comments
Hey @cztomsik, I would like to build an RPI touchscreen client for octoprint/klipper. I'm also very interested in your hackable tv project |
hey, thanks for the feedback and good luck with the project - I think it's actually very cool idea. Feel free to reach me on discord if you're stuck with something :) |
All I want is to be able to put semantic graphics on screen easily, cheaply and flexibly. The current platform fragmentation is insane: browsers are everywhere and generally pleasant to develop for but are terrible resource hogs and a source of security vulnerabilities; while native toolkits are either too low-level or tend to have too many assumptions for me to work comfortably with. A non-browser-based, DOM-like thing would be a game-changer. |
@cztomsik Idk, but if you already have some topics in mind I could try and lend a hand with writing some tutorials? |
@egasimus I need to polish public API (window creation & context isolation) a bit first but then it would be really helpful. Some ideas:
I could even provide some PoCs of those so you wouldn't need to start from scratch. But it would be best to discuss it on discord. (join link is on the homepage) |
Discord is... suboptimal. In general, I prefer asynchronous conversations (like this one), but as far as modern collaboration tools go, why not give Riot a shot? :-) I have some neat ideas about audio library management in particular so I might go with that. Terminal multiplexing, desktop panels, and a discoverable systemd GUI are some other interesting problem spaces - a little more niche but fun and useful nonetheless. Feature-wise, if Graffiti supports a canvas-like component, or some sort of OpenGL/Vulkan rendering surface (does it? guess I should start reading the source huh), I'd build a trading chart visualizer. Or a music sequencer. Or an image editor of course. Actually for those first two I might be able to dig out some code based on canvas and/or SVG (and at least one demo with pure Rust+GLSL) that I could look into porting/rewriting for Graffiti. So yeah, what about people interested in porting their existing apps? Maybe if you had some sort of medium-sized React app that doesn't work in Graffiti out of the box but could be ported with a modicum of effort, I could do a writeup of the steps to get it running, maybe even do a comparative benchmark to measure exactly how much faster than a browser this is. Sounds like fun, I'm really glad to be discussing this :-) |
@egasimus np, we can stay here or you can mail me audio-project sounds very interesting but
Currently, the biggest limitation is the absence of global styles (only inline styles are supported). I'd like to avoid adding it because it would take months to make it work similarly - I'd rather like to add support for some utility-first CSS framework, like tailwind or tachyons - that could be done easily with plain react (custom
And I also think, CSS is fundamentally broken - it's so easy to get into collisions and what's worse, css rules are applied in the definition order (order of classes in Unfortunately, I was always working on intranet webapps so I don't have much to show/port except what I've already mentioned. Maybe one old (angular1) application for making invoices. |
I think there being no audio API is a feature rather than a shortcoming. In my opinion, it's crucial to confine the scope to just the GUI engine, rather than reimplement the whole browser. As a potential Graffiti app developer, I'd benefit from having to bring my own audio code - or better yet, delegate all that to a daemon via some form of IPC. A diversity of implementations is better than a diversity of hacky workarounds atop a default implementation. On the flip side, I think first-class support for hot module reloading is quite important - the more instant feedback when building a GUI, the better! I've seen HMR being done even in C++ with JUCE. I've done a few experiments with hot module reloading in Node; the most self-contained one so far is dothot, which does not attempt to do dependency tracking at all; it relies on calling For me, the important takeway here is that most HMR implementations target a frontend loaded over the network in a browser, and optimize for that use case (Webpack has "web" in its name, heh). This makes them leaky abstractions. I'd much rather see just the delivery method abstracted away, so that if I'm building a Graffiti app which is local-first, and only incidentally accessible remotely via browser, I would have an iteration speed of e.g. 100ms vs of 1s (90% of which due to traversing the network stack to localhost, tree-shaking, minification, all of which are irrelevant in that case). Yes, hardly anyone would say something about 100ms vs 1s feedback loop when coding a GUI, but I think it still makes a difference. I totally get you about always working on intranet webapps, I'm the same :-) Luckily I also have a big stash of unfinished side projects which I'll be more than happy to dust off once I've found a way around #152. Maybe once I have picked up some speed with Graffiti I could even record some live coding videos, been on my mind for a while. One last thing, have you seen Arcan? I see it as having some common ground with Graffiti, in terms of "indie project that attempts to get rid of all the accumulated cruft in the GUI stack". It has a bit more of a "kitchen sink" approach and "Unix greybeard" mentality I guess - which I totally admire, but I'm more comfortable with Rust, Node and the DOM as opposed to C, Lua and imperative drawing, which is one reason I find Graffiti so relevant. |
Agreed.
Yes, something very simple is already there - you can see it in hackable-tv
100% agree, that's why that naive But feel free to try it with your dothot (I'm not sure I was trying it)
This is great!
Never heard about it but I'll have a look, thanks :) |
I would like to run the React based GUI app on a cheap embedded device without the heavy of electron or chrome/webkit. |
64M storage should be fine but RAM might be tight depending on how big the screen is (framebuffer can take a lot) and how much mem pressure your js script is going to make. You will also need GPU with OpenGL 2.1 or GLES2 (at least for now) I got it running (~59-60fps) on raspi zero w but that's 512M. There's also $5 version without bluetooth if you need real lowcost. Stay tuned, new version is around the corner (with support for CSS-in-JS frameworks) |
Thank you @cztomsik ! I have a Allwinner ARM A7 SBC that has 128MB DDR, with GLES2, which I believe is easier to fit. Waiting forward to your project, well done! |
I'd like to build webapps that also run on desktop with Rust compiled to WASM and maybe vue.js client-side and preferably something like Rocket server-side. Would this be possible with graffiti? One idea for a project that I have in mind would be an creator/editor for application letters and curriculum vitae that then generates and outputs a PDF with different styles and layouts. |
Graffiti will always be just a subset of DOM/CSS so you'd need to only use what's supported but otherwise it should work. Currently, it's limited to inline styles only but it will eventually (life is sometimes hard & unexpected) support most of the CSS (probably excluding sibling selectors and some pseudo elements). PDF would be possible but it's currently out-of-scope (everything is rendered directly to OpenGL) If you need PDF, electron is still the best choice. |
@cztomsik What subset of HTML5 DOM API support is to be expected? Is there a foundational design document of some sort that determines the scope you are currently aiming to achieve? Can I embed a video? Render SVG? Do I have Canvas? I know that at least some of those browser features are implemented in pure JS in Node-land so that could become part of the core Graffiti as the Rust equivalents mature (and someone does the assumedly non-negligible integration work?) Can someone bolt a HTTP lib on to Graffiti, write a URL bar in HTML5 and make a browser? It runs WebRender under the hood, right - so can I just write in Never got beyond some hello world examples in a crazy Nix environment. But figured out that Nix the package manager (which you can get on any distro) has this crazy double |
Wow, that looks really great!
no feature matrix for now, sorry... it's a moving target but the scope is:
I'd like to do that eventually but it's rather going to be separate plugin
|
Hello, I saw a mention in the GUI thread for Deno, I decided to take a look. I would like to create a lightweight client for the Minecraft game with simple customization using a web technology stack. I'm currently focused on Electron, but looking for better alternatives. At the moment I am using Vue. And in principle it would be nice to have access to basic stuff. 😅 |
This is from-scratch HTML/CSS engine so no canvas (yet), but there's WebView (macos-only for now) so you could do that. You might also have a look at tauri - but that's a bit different approach. Graffiti is just nodejs/deno module so it's one |
ouch, I didn't put it right, I'm writing a launcher that launches the client in a separate process, in my case canvas is not required, at least for now)) |
oh, ok then that might be good fit for graffiti, you essentially just need to create the previous version should work fine but api was different and now we have much better support for standards - it's already passing fraction of WPT |
Yes, I tried to run graffiti, but I ran into the same error as here #157 |
I'd like to know what you want to build with this project.
It will help me with some future design decisions and it's also going to be very useful when writing documentation (better examples).
The text was updated successfully, but these errors were encountered: