Skip to content

Releases: RibirX/Ribir

ribir-v0.4.0-alpha.14

30 Oct 00:51
Compare
Choose a tag to compare
ribir-v0.4.0-alpha.14 Pre-release
Pre-release

Features

  • macros: Added the part_writer! macro to generate a partial writer from a mutable reference of a writer. (#642 @M-Adoo)

Fixed

  • core: Setting the theme before running the app results in the tree being constructed twice. (#637, @M-Adoo)
  • core: Resolve a crash occurring in a class implementation with multiple children. (#637 @M-Adoo)
  • core: Nodes created by a class implementation may not be disposed of when switching to another class. (#637 @M-Adoo)
  • core: When merge multiple MixBuiltin widgets, there may be a premature dropping of the outer MixBuiltin before it should occur. (#639 @M-Adoo)
  • core: watch! does not notify the initial value. (#640 @M-Adoo)
  • core: fix watch multi builtin events not work (#641 @wjian23)
  • core: fix widget layout when h_algin and v_align are embedded in each other (#641 @wjian23)
  • painter: fix elements may not be painted after window resize. (#644 @M-Adoo)

Breaking

  • macros: Using @ $w { ... } will no longer automatically wrap a FatObj for w. (#639 @M-Adoo)

ribir-v0.4.0-alpha.12

09 Oct 00:50
Compare
Choose a tag to compare
ribir-v0.4.0-alpha.12 Pre-release
Pre-release

Features

  • core: Added the built-in widget TextStyleWidgetWidget, allowing any widget to easily configure the text style within it using text_style. (#635, @M-Adoo)

Breaking

  • text: Removed the ribir_text crate and integrated it into the ribir_painter crate. (#635 @M-Adoo)

ribir-v0.4.0-alpha.11

02 Oct 00:51
Compare
Choose a tag to compare
ribir-v0.4.0-alpha.11 Pre-release
Pre-release

Features

  • core: Added the PaintingStyle built-in widget, enabling any widget to utilize painting_style to specify how shapes and paths should be painted within its descendants. (#633 @M-Adoo)

Changed

  • text: Merge the overflow field to the TexStyle structure. (#629 @M-Adoo)

Breaking

  • text: Enhance the typography APIs by eliminating FontSize, Pixel, and Em, and directly utilize only logical pixels represented by f32. (#629 @M-Adoo)

ribir-v0.4.0-alpha.10

25 Sep 00:51
Compare
Choose a tag to compare
ribir-v0.4.0-alpha.10 Pre-release
Pre-release

Features

  • core: Added WrapRender for a render widget that combines with its child as a single widget tree node. (#626 @M-Adoo)
  • core: Added StateWriter::into_render to covert writer to reader if no other writer exist. (#626 @M-Adoo)
  • core: Added the built-in widget Foreground, enabling any widget to directly utilize foreground for configuring the painter brush. (#628, @M-Adoo)
  • painter: Distinguishes between fill and stroke brushes, allowing the painter to have two default brushes. (#628, @M-Adoo)

Changed

  • core: Merged boolean status widgets into a single widget MixFlags, including HasFocus, MouseHover and PointerPressed. (#627 @M-Adoo)
  • core: Reimplemented HAlignWidget, VAlignWidget, RelativeAnchor, BoxDecoration, ConstrainedBox, IgnorePoint, Opacity, Padding, TransformWidget, and VisibilityRender as WrapRender. (#626 @M-Adoo)

Fixed

  • core: The SplitWriter and MapWriter of the render widget may not be flagged as dirty. (#626, @M-Adoo)

Breaking

  • painter: Removed Painter::get_brush and Painter::set_brush, now using get_fill_brush, get_stroke_brush, set_fill_brush, and set_stroke_brush methods instead. (#628 @M-Adoo)

ribir-v0.4.0-alpha.9

18 Sep 00:49
Compare
Choose a tag to compare
ribir-v0.4.0-alpha.9 Pre-release
Pre-release

Changed

  • core: Refactor the LayoutCtx to eliminate the need for performing layout based on children order. (#625 @M-Adoo)

Breaking

  • core: The Layouter has been removed, so the render widget needs to adjust the APIs used accordingly. (#625, @M-Adoo)

ribir-v0.4.0-alpha.8

11 Sep 00:49
Compare
Choose a tag to compare
ribir-v0.4.0-alpha.8 Pre-release
Pre-release

Features

  • core: The built-in widget Class has been added to enable the sharing of consistent styles across multiple elements and to allow widgets to have different actions and styles in different themes. (#624, @M-Adoo)
  • core: The widget ConstrainedBox has been added as a built-in widget; now clamp can be used as a built-in field. (#624 @M-Adoo)
  • core: Added WindowFlags to regulate the window behavior, with the option of utilizing WindowFlags::ANIMATIONS to toggle animations on or off. (#624 @M-Adoo)
  • theme/material: Define the constant variables of motion. (#624, @M-Adoo)
  • dev_helper: Refine the widget test macros. (#624, @M-Adoo)

Changed

  • widgets: Utilize Class to implement the Scrollbar. (#624, @M-Adoo)

Breaking

  • widgets: ConstrainedBox has been relocated to core. (#624, @M-Adoo)
  • widgets: Utilize Scrollbar instead of both HScrollbar, VScrollbar, and BothScrollbar. (#624, @M-Adoo)

Fixed

  • macros: Declaring the variable parent with built-in fields as immutable is incorrect if its child uses it as mutable. (#623 @M-Adoo)

ribir-v0.4.0-alpha.7

04 Sep 00:48
Compare
Choose a tag to compare
ribir-v0.4.0-alpha.7 Pre-release
Pre-release

Fixed

  • widgets: Flex may not decrease the gap for the second child during layout. (#622 @M-Adoo)

ribir-v0.3.0

26 Aug 10:51
Compare
Choose a tag to compare

We're thrilled to announce that Ribir now supports the Web platform! πŸŽ‰πŸŽ‰πŸŽ‰
Experience the power of compiling Rust code to wasm and rendering it with WebGPU or WebGL.
Check out our Wordle game demo, now running smoothly in your browser!
Wordle Game

Features

  • ribir: support stable Rust 1.77.0 (#552 @M-Adoo)

  • macros: Added a include_crate_svg! macro to include the svg relative to current crate. (#552, @M-Adoo)

  • ribir: Added a nightly feature to enable functionalities that require nightly Rust. (#552, @M-Adoo)

    • The include_crates_svg! macro can operate without the nightly feature.
    • The include_svg! macro requires the nightly feature to be enabled.
  • ribir: Introduced AppRunGuard to allow app and window configuration prior to app startup. (#565, @M-Adoo)
    Previously, to configure the app and window before startup, App::run couldn't be used:

    unsafe {
      AppCtx::set_app_theme(material::purple::light());
    }
    
    App::new_window(root, None).set_title("Counter");
    App::exec();

    Now, with AppRunGuard, you can use App::run and chain the configuration methods:

    App::run(root)
      .with_app_theme(material::purple::light())
      .with_title("Counter");
  • core: The split functions in StateReader::map_reader, StateWriter::map_writer, and StateWriter::split_writer no longer need to return a reference. (#568 @M-Adoo)

  • core: Introduced StateWatcher for watching state modifies, which was previously the responsibility of StateReader. This results in a cleaner and more compact StateReader implementation. (#556, @M-Adoo)

  • gpu: Introduced GPUBackendImpl::max_textures_per_draw to set a limit on textures per draw phase (#562 @M-Adoo)

  • gpu: Updated the wgpu implementation of the GPU backend to support WebGL. (#578, @M-Adoo)

  • ci: add wasm test (#583 @wjian23)

  • ci: wasm server watch file change (#586 @wjian23)

  • painter: Introduced support for Resource<Path> for drawing. This indicates that the Path may be shared with others, allowing the backend to cache it. (#589 @M-Adoo)

  • painter: Introduced support for bundled commands, enabling the backend to process these commands as a single entity and cache the resulting output. (#589 @M-Adoo)

Fixed

  • examples: fix crash issue in Storybook (#559 @M-Adoo)

  • ribir: Resolved the issue causing a black screen on the first frame. (#566, @M-Adoo)

  • gpu: Retrieve the texture limit size from the GPU instead of using a hardcoded value. (#578, @M-Adoo)

  • ribir: fixed the crash issue when the shell window is zero-sized at startup. (#582, @M-Adoo)

Changed

  • core: Enhanced panic location tracking during widget build (#559 @M-Adoo)

  • core: rename builtin field of delay_drop_until to keep_alive (#561 @wjian23)

  • macros: polish the compile error message of invalid filed in @$var {} (#556 @M-Adoo)

  • gpu: Removed dependency on the texture array feature of wgpu. (#562, @M-Adoo)

  • algo: removed Resource and rename ShareResource to Resource. (#564, @M-Adoo)

  • dev-helper: Support specific the comparison of image tests. (#573 @M-Adoo)

  • dev-helper: If test images differ, both actual and difference images are saved with the expected image. (#573 @M-Adoo)

  • painter: Removed the AntiAliasing feature from the painter package, This responsibility now lies with the painter backend. (#584 @M-Adoo)

  • gpu: The GPU backend no longer relies on MSAA, which is dependent on the graphics API. Instead, it uses the alpha atlas to provide a solution similar to SSAA.(#584, @M-Adoo)

  • example: run example in web wasm (#571 @wjian23)

  • gpu: The GPU backend now only caches the path command if it is a Resource. This change reduces GPU memory usage and accelerates cache detection. (#589 @M-Adoo)

  • text: Implemented caching of the glyph path as a Resource to improve performance. (#589 @M-Adoo)

Documented

  • core: Explained when to use unsubscribe with watch!. (#556, @M-Adoo)

Breaking

  • ribir: compile wasm (#543 @wjian23)

  • ribir: Updated App::new_window to accept WindowAttributes instead of size as the second parameter. (#565, #566, @M-Adoo)

  • ribir: The window creation APIs have been updated to use asynchronous methods, improving compatibility with browsers. (#565, @M-Adoo)

  • macros: removed map_writer! and split_writer! macros. (#568, @M-Adoo)

  • ribir: StateWriter::map_writer and StateWriter::split_writer now only require a writer split function, enhancing both reader and writer split operations. (#568, @M-Adoo)

  • core: The StateReader no longer supports watching its modifications. Use the StateWatcher trait instead for this functionality. (#556 @M-Adoo)

  • painter: Changes to BackendPainter APIs. This only affects you if you've implemented a custom painter. (#562 @M-Adoo)

ribir-v0.4.0-alpha.6

21 Aug 00:46
Compare
Choose a tag to compare
ribir-v0.4.0-alpha.6 Pre-release
Pre-release

Features

  • core: Support for modifying the theme at runtime. (#618 @M-Adoo)

    The code:

    use ribir::prelude::*;
    
    let w = fn_widget! {
      @Text {
        on_tap: |e| {
          // Query the `Palette` of the application theme.
          let mut p = Palette::write_of(e);
          if p.brightness == Brightness::Light {
            p.brightness = Brightness::Dark;
          } else {
            p.brightness = Brightness::Light;
          }
        },
        text : "Click me!"
      }
    };
    
    App::run(w);
  • core: Added Provider widget to share data between sub-tree. (#618 @M-Adoo)

    Provider::new(Box::new(State::value(0i32))).with_child(fn_widget! {
      @SizedBox {
        size: Size::new(1.,1.),
        on_tap: |e| {
          // Access the provider in a callback.
          let mut v = Provider::write_of::<i32>(e).unwrap();
          *v += 1;
        },
        @Text {
          text: {
            // Access the provider in any descendants
            let v = Provider::of::<Stateful<i32>>(ctx!());
            let v = v.unwrap().clone_writer();
            pipe!($v.to_string())
          }
        }
      }
    });
  • core: Added Overlay::of to allow querying the overlay in event callbacks. (#618 @M-Adoo)

  • core: Added WidgetCtx::query, WidgetCtx::query_write, WidgetCtx::query_of_widget and WidgetCtx::query_write_of_widget. (#618 @M-Adoo)

Breaking

  • core: Removed Overlay::new_with_handle and OverlayCloseHandle. (#618 @M-Adoo)
  • core: GenWidget::gen_widget no longer requires a &mut BuildCtx parameter. (#616 @M-Adoo)
  • core: Removed FullTheme and InheritTheme, now only using Theme. Any part of the theme, such as Palette, can be directly used to overwrite its corresponding theme component. (#618 @M-Adoo)

ribir-v0.4.0-alpha.5

14 Aug 00:46
Compare
Choose a tag to compare
ribir-v0.4.0-alpha.5 Pre-release
Pre-release

Features

  • core: PartData<T> now supports T: ?Sized, allowing us to separate trait objects from State.(#614 @M-Adoo)

Breaking

  • core: Removed unnecessary Writer since it has the same capabilities as Stateful. (#615 @M-Adoo)