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

Xilem architecture prototype #2183

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open

Xilem architecture prototype #2183

wants to merge 29 commits into from

Commits on Apr 12, 2022

  1. Initial commit of idiopath experiment

    This is similar to lasagna but with strongly typed elements. Let's see how it goes.
    raphlinus committed Apr 12, 2022
    Configuration menu
    Copy the full SHA
    9f06dda View commit details
    Browse the repository at this point in the history
  2. Add AnyView

    Support for type erasure of views and widgets.
    raphlinus committed Apr 12, 2022
    Configuration menu
    Copy the full SHA
    1caa8ca View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2022

  1. Add more widget tuples

    Bring in more widget tuples with a macro.
    raphlinus committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    899feb2 View commit details
    Browse the repository at this point in the history
  2. Implement not very useful form of use_state

    Event propagation has no mutable access.
    raphlinus committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    fc142ea View commit details
    Browse the repository at this point in the history
  3. A slightly more useful version

    This passes the app state down through an Rc using a lens-like construction.
    
    I'm not sure this is the best construction. Perhaps it should be combined with adapt (the callback could take both mutable state references), but that's 3 callbacks.
    
    Also makes state mutable in event propagation, which seems useful.
    raphlinus committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    08afce9 View commit details
    Browse the repository at this point in the history
  4. Add README

    Also trying out a few more node types in the example.
    raphlinus committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    8a4b687 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2022

  1. Update README.md

    Fix very small typo
    richard-uk1 authored Apr 16, 2022
    Configuration menu
    Copy the full SHA
    f30b2bb View commit details
    Browse the repository at this point in the history

Commits on May 4, 2022

  1. Silence clippy. (#2169)

    jneem authored and raphlinus committed May 4, 2022
    Configuration menu
    Copy the full SHA
    52c29e8 View commit details
    Browse the repository at this point in the history
  2. X11 dialogs, take 2. (#2153)

    Use xdg-desktop-portal's dbus APIs for open/save dialogs on x11.
    jneem authored and raphlinus committed May 4, 2022
    Configuration menu
    Copy the full SHA
    677f13f View commit details
    Browse the repository at this point in the history
  3. Fixed readme.md links (#2167)

    dakata1337 authored and raphlinus committed May 4, 2022
    Configuration menu
    Copy the full SHA
    ecbcb0f View commit details
    Browse the repository at this point in the history
  4. Introduce Cx for reconciliation

    This commit was derived from the async experiment, which required adding a waker to the reconciliation context. We will definitely be adding more things to Cx so that should be the type of View methods, but also we'll iterate a while on the core architecture before re-introducing async.
    
    Note, it also bounds the element type for View to Widget, which is less flexible but more ergonomic.
    raphlinus committed May 4, 2022
    Configuration menu
    Copy the full SHA
    cfa7380 View commit details
    Browse the repository at this point in the history
  5. Minor ergonomic improvements

    Provide default (unit) action type for View. Add with_id and with_new_id methods to Cx which ensure proper nesting by construction.
    raphlinus committed May 4, 2022
    Configuration menu
    Copy the full SHA
    bb86d0f View commit details
    Browse the repository at this point in the history
  6. Return "changed" indication from rebuild

    Tweak signature of rebuild method to return a boolean indicating whether anything has been changed. This is not used yet, but will be for invalidation.
    raphlinus committed May 4, 2022
    Configuration menu
    Copy the full SHA
    c607825 View commit details
    Browse the repository at this point in the history
  7. Add EventResult

    Let event handlers do different things than return user-specified actions. This may not be used immediately but is important for implementing environment.
    raphlinus committed May 4, 2022
    Configuration menu
    Copy the full SHA
    a69bb1b View commit details
    Browse the repository at this point in the history

Commits on May 10, 2022

  1. Start implementing a widget hierarchy

    The prototype had an extremely skeletal implementation of the widget hierarchy, but with this commit we start building more of a real one. It's based to a large exttent on existing Druid widgets, but some parts may be done differently, in particular an exploration into layout more similar to SwiftUI.
    raphlinus committed May 10, 2022
    Configuration menu
    Copy the full SHA
    8682d90 View commit details
    Browse the repository at this point in the history

Commits on May 13, 2022

  1. Start implementing layout

    Add some layout methods. Rename Column to VStack. Put in alignment mechanisms.
    
    Much of the core layout protocol is implemented, but it's not exercised very deeply. A lot of view wrappers like "frame" in SwiftUI need to get implemented. I think I want to get the core widget trait more or less stable first (events need work in particular).
    raphlinus committed May 13, 2022
    Configuration menu
    Copy the full SHA
    a2acd92 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3e703fb View commit details
    Browse the repository at this point in the history

Commits on May 14, 2022

  1. Configuration menu
    Copy the full SHA
    163f756 View commit details
    Browse the repository at this point in the history
  2. Continued work on alignment

    Adds axis to SingleAlignment (renamed from OneAlignment).
    
    Incorporates layout offsets into alignment results.
    raphlinus committed May 14, 2022
    Configuration menu
    Copy the full SHA
    ebe51a6 View commit details
    Browse the repository at this point in the history
  3. Use single Center alignment for horiz and vert

    In SwiftUI, HorizontalAlignment.center and VerticalAlignment.center are two different structs, but in Rust it's just as convenient, if not more so, to let the same struct just impl the two different traits.
    raphlinus committed May 14, 2022
    Configuration menu
    Copy the full SHA
    064d639 View commit details
    Browse the repository at this point in the history
  4. Add context to event method

    This brings the event method in line with other widget methods, and also existing Druid.
    
    Also adds mutable access to the event queue to the base context state, so other contexts can add events. This will be useful for LayoutObserver (event generated from layout context).
    
    Actual event propagation is still very under-developed, but it should be possible to build that out without big signature changes.
    raphlinus committed May 14, 2022
    Configuration menu
    Copy the full SHA
    a1706b8 View commit details
    Browse the repository at this point in the history
  5. Implement layout observer

    Implement the "layout observer" concept which is very similar to GeometryReader in SwiftUI.
    
    Also fix some problems in vstack layout computation.
    raphlinus committed May 14, 2022
    Configuration menu
    Copy the full SHA
    e678cc4 View commit details
    Browse the repository at this point in the history

Commits on May 18, 2022

  1. Configuration menu
    Copy the full SHA
    c24b40c View commit details
    Browse the repository at this point in the history
  2. A bit of reorganization

    Move relevant bits into core and contexts files, mirroring the structure of existing Druid (which hopefully will make it easier to navigate when adapting existing Druid code to the new architecture).
    raphlinus committed May 18, 2022
    Configuration menu
    Copy the full SHA
    6c6b0f2 View commit details
    Browse the repository at this point in the history
  3. Make into library

    The widget set really should be structured as a library, and it will no doubt be useful to have multiple examples to exercise various aspects of that. This patch changes from a single main executable to a library with an examples dir.
    raphlinus committed May 18, 2022
    Configuration menu
    Copy the full SHA
    5aaec6d View commit details
    Browse the repository at this point in the history

Commits on May 19, 2022

  1. Rename to xilem

    I've decided on the name "xilem" rather than "idiopath," and this also matches the blog post (now linked from the README, though that is a bit stale).
    raphlinus committed May 19, 2022
    Configuration menu
    Copy the full SHA
    ab39d1f View commit details
    Browse the repository at this point in the history
  2. Start building event propagation

    Import some of the event dispatching logic from Druid. Still fairly minimal, not yet doing real hot/active logic on buttons yet (doing it the same way as Druid would depend on adding lifecycle to the Widget trait).
    raphlinus committed May 19, 2022
    Configuration menu
    Copy the full SHA
    c4171f5 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2022

  1. Add lifecycle method

    Add the lifecycle method to the Widget trait, matching existing Druid. I'm not at all convinced it's necessary - in original Druid, one of the main differences is that it doesn't have mutable access to app state, but that concern isn't really relevant. In any case, this minimizes divergence, and can possibly be cleaned up later.
    raphlinus committed May 20, 2022
    Configuration menu
    Copy the full SHA
    19aa2e6 View commit details
    Browse the repository at this point in the history
  2. Basic button functionality

    This commit implements the core functionality of button, including hot/active states, drawing of appearance, and reasonable layout.
    
    There are other changes in widget infrastructure to support this functionality.
    raphlinus committed May 20, 2022
    Configuration menu
    Copy the full SHA
    a6fb0b8 View commit details
    Browse the repository at this point in the history