8000 GitHub - hedge-ops/gpui-tutorial: Tutorial for getting started with gpui a rust-driven UI framework with performance as a top priority, from the makers of zed
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tutorial for getting started with gpui a rust-driven UI framework with performance as a top priority, from the makers of zed

Notifications You must be signed in to change notification settings

hedge-ops/gpui-tutorial

Repository files navigation

gpui Tutorial

Summary

GPUI is a graphics processor accelerated user interface frameowork, created by the makers of Zed to make the fastest user interface possible, written in Rust. It's currently an internal project in the zed project, but will soon be its own crate. It's licensed under the Apache license, which makes it usable by commercial projects.

Currently there is not a lot of documentation, so this tutorial aims to take you through the basics of the framework to get started on your own project.

Sections

To understand the basic terms, see the dictionary. To read more on how I learned the framework, see resources.

Future Topics

  • Elements -> make button its own element and compose the three elements, add a click handler and disabled property
  • Conditional state -> make it so the button is disabled when reaching 10 likes.
  • Actions and keybindings -> add cmd+l as an action for like, and map the click event to that same action.
  • Menus -> define menus and map those to actions as well. Menu is disabled too when the action is not available.
  • App Icon -> add the application icon as an asset so we have a real app.
  • Shared state with Models -> add a dislike button (with cmd+d as keybinding), which is disabled when likes is 0.
  • Icons -> turn like and dislike into icon buttons (introducing the svg element)
  • Input Controls - give the user the opportunity to update the name
  • Avatar -> using the img element

Missing

  • RenderOnce vs Render - probably a part of the Elemnts tutorial
  • lists (and uniform list)
  • notify/observe with update from context
  • emit/event
  • async app context
  • testing
  • Window fit & feel -> see positioning, shadow examples
  • Animation -> TBD
  • CI -> build the thing
  • Anchored elements

Outstanding Questions

  • Is render once for sub-elements that are immutable? Asking...
  • If the SharedString is basically an Arc<String>, how does the framework avoid core contention when ensuring atomicity of the reference counter? This article makes a good case that Arc<string> can be slower in some multithreaded scenarios.

About

Tutorial for getting started with gpui a rust-driven UI framework with performance as a top priority, from the makers of zed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0