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

Update 0.3.x for 0.3.11 #455

Merged
merged 50 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
acda630
Fix layout of direct flex children with `display:none` set (#380)
nicoburns Mar 7, 2023
93a7d38
Fix setting display:none on a grid child (#382)
nicoburns Mar 7, 2023
cab6b0b
Prepare for 0.3.5 release (#381)
nicoburns Mar 7, 2023
0dc80be
Ignore align_content in non-wrapping flexbox containers (#383)
nicoburns Mar 8, 2023
4314f56
Prepare for v0.3.6 release (#384)
nicoburns Mar 8, 2023
d1d283d
Use mutable slice rather mutable vec parameter
nicoburns Mar 9, 2023
6f4bb57
Merge pull request #385 from nicoburns/fix/clippy-2023-03-09
alice-i-cecile Mar 9, 2023
6be6a47
Reduce style accesses (#386)
nicoburns Mar 9, 2023
4825854
Add failing tests for borders flooring node size
nicoburns Feb 23, 2023
f6e4202
Add failing tests for padding flooring node size
nicoburns Mar 5, 2023
58ca322
Fix divide by zero in main size determination
nicoburns Mar 5, 2023
fbf950e
Add seperate leaf and flexbox tests for padding/border flooring node …
nicoburns Mar 5, 2023
bae7a8e
Fix padding/border flooring leaf node size
nicoburns Mar 5, 2023
86ba2ff
Fix flexbox children being floored by padding/border
nicoburns Mar 5, 2023
7a621e6
Combine padding and border tests + make edge dimensions uneven
nicoburns Mar 5, 2023
d521c1e
Add padding/border floor absolute child size
nicoburns Mar 5, 2023
2294aff
Add padding/border floor node size tests for grid
nicoburns Mar 5, 2023
6d7f9f1
Add grid container test for padding/border flooring node size
nicoburns Mar 5, 2023
cfa4fec
Fix padding/border flooring size of absolutely positioned children
nicoburns Mar 5, 2023
77b56d9
Rename grid padding/border tests so that they are all located together
nicoburns Mar 5, 2023
415959e
Make padding/border floor node size for grid children
nicoburns Mar 8, 2023
b44b345
Make padding/border floor node size for grid containers
nicoburns Mar 8, 2023
c372005
Apply aspect ratio to leaf nodes whose size is determined by padding/…
nicoburns Mar 8, 2023
b512668
Add test for padding/border not affecting flex basis
nicoburns Mar 9, 2023
171cdea
Convert flex basis determination to use break from block
nicoburns Mar 9, 2023
cb6c401
Add test for flex-basis 0 with flex grow
nicoburns Mar 9, 2023
39bf6ce
Floor flex-basis limits by preferred size style value when determinin…
nicoburns Mar 9, 2023
d1b0451
Floor outer flex-basis by padding_border sum (floors inner flex-basis…
nicoburns Mar 9, 2023
ef3774d
Remove commented out code
nicoburns Mar 9, 2023
aa251a1
Add missing 0
nicoburns Mar 9, 2023
c2f99bf
Merge pull request #372 from nicoburns/fix/border-floors-node-size
alice-i-cecile Mar 9, 2023
b09bfd9
Test cases for bevyengine/bevy#8017 and Taffy #387
nicoburns Mar 10, 2023
320256b
Prevent percentage sizes from contributing a flex item's min-content …
nicoburns Mar 10, 2023
99613cb
Merge pull request #388 from nicoburns/bevy/issue-8017
alice-i-cecile Mar 10, 2023
2274046
Prepare for 0.3.7 release (#389)
nicoburns Mar 10, 2023
87acbeb
Upgrade to better Github Actions for faster and better maintained CI …
nicoburns Mar 10, 2023
fb0bb3a
Add fully reduced test case for #387 (#391)
nicoburns Mar 10, 2023
328880b
Fix wrapping nodes generating an incorrect min-content size (#395)
nicoburns Mar 14, 2023
3248cfe
Prepare for 0.3.8 release (#396)
nicoburns Mar 14, 2023
4b19b7d
Don't allow cached results to be used for sizings with greater availa…
nicoburns Mar 20, 2023
2942c70
Prepare for 0.3.9 release (#398)
nicoburns Mar 20, 2023
08aa501
Tree creation benchmarks (#401)
nicoburns Mar 20, 2023
a8f6fb5
Update rstest requirement from 0.16.0 to 0.17.0 (#402)
dependabot[bot] Mar 21, 2023
ac79a00
Update syn requirement from 1.0.7 to 2.0.4 (#403)
dependabot[bot] Mar 21, 2023
0b736d4
Fix: available space in the presence of a min width (#407)
nicoburns Mar 30, 2023
50e6ff8
Prepare for 0.3.10 release (#411)
nicoburns Mar 30, 2023
e55c9a5
Fix import lints (#416)
Weibye Apr 8, 2023
7c2c778
Add caching to CI (#418)
TimJentzsch Apr 8, 2023
da796c6
Optimise flexbox layouts with min/max sizes (#413)
nicoburns Apr 9, 2023
83b9ac1
Prepare for 0.3.11 release (#419)
nicoburns Apr 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 33 additions & 100 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- main
- 0.2.x
- 0.3.x

name: Continuous integration

Expand All @@ -13,163 +14,95 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features
- uses: dtolnay/rust-toolchain@stable
- uses: Leafwing-Studios/cargo-cache@v1
- run: cargo build --no-default-features
- run: cargo test --no-default-features

test-features-default:
name: "Test Suite [Features: Default]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
- uses: actions-rs/cargo@v1
with:
command: test
- uses: dtolnay/rust-toolchain@stable
- run: cargo build
- run: cargo test

test-features-default-with-serde:
name: "Test Suite [Features: Default + serde]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --features serde
- uses: actions-rs/cargo@v1
with:
command: test
args: --features serde
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --features serde
- run: cargo test --features serde

test-features-alloc:
name: "Test Suite [Features: alloc]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --features alloc,grid
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features alloc,grid
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --no-default-features --features alloc,grid
- run: cargo test --no-default-features --features alloc,grid

test-features-alloc-no-grid:
name: "Test Suite [Features: alloc (no grid)]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --features alloc
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features alloc
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --no-default-features --features alloc
- run: cargo test --no-default-features --features alloc

test-features-default-no-grid:
name: "Test Suite [Features: std (no grid)]"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --features std
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features std
- uses: dtolnay/rust-toolchain@stable
- uses: Leafwing-Studios/cargo-cache@v1
- run: cargo build --no-default-features --features std
- run: cargo test --no-default-features --features std

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
components: rustfmt
- uses: Leafwing-Studios/cargo-cache@v1
- run: cargo fmt --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace -- -D warnings
components: clippy
- uses: Leafwing-Studios/cargo-cache@v1
- run: cargo +nightly clippy --workspace -- -D warnings

doc:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: doc
components: clippy
- uses: Leafwing-Studios/cargo-cache@v1
- run: cargo doc
env:
RUSTDOCFLAGS: "-D warnings"


markdownlint:
name: Markdown Lint
runs-on: ubuntu-latest
Expand Down
28 changes: 4 additions & 24 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-deny
run: cargo install cargo-deny
- uses: taiki-e/install-action@cargo-deny
- name: Check for security advisories and unmaintained crates
run: cargo deny check advisories

check-bans:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-deny
run: cargo install cargo-deny
- uses: taiki-e/install-action@cargo-deny
- name: Check for banned and duplicated dependencies
run: cargo deny check bans

check-licenses:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-deny
run: cargo install cargo-deny
- uses: taiki-e/install-action@cargo-deny
- name: Check for unauthorized licenses
run: cargo deny check licenses

check-sources:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-deny
run: cargo install cargo-deny
- uses: taiki-e/install-action@cargo-deny
- name: Checked for unauthorized crate sources
run: cargo deny check sources
11 changes: 8 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "taffy"
version = "0.3.4"
version = "0.3.11"
authors = [
"Alice Cecile <alice.i.cecile@gmail.com>",
"Johnathan Kelley <jkelleyrtp@gmail.com>",
]
edition = "2021"
include = ["src/**/*", "Cargo.toml", "README.md"]
description = "A flexible UI layout library"
description = "A flexible UI layout library "
repository = "https://github.com/DioxusLabs/taffy"
keywords = ["cross-platform", "layout", "flexbox", "css-grid", "grid"]
categories = ["gui"]
Expand All @@ -34,7 +34,7 @@ profile = []

[dev-dependencies]
criterion = "0.4"
rstest = "0.16.0"
rstest = "0.17.0"
rand = "0.8.5"
rand_chacha = "0.3.1"
yoga = "0.4.0"
Expand All @@ -48,6 +48,11 @@ taffy = { path = ".", features = ["random"] }
lto = true
panic = 'abort'

[[bench]]
name = "tree_creation"
path = "benches/tree_creation.rs"
harness = false

[[bench]]
name = "flexbox"
path = "benches/flexbox.rs"
Expand Down
44 changes: 44 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
# Release Notes

## 0.3.11

### Fixes

- Fix exponential blowup when laying out trees containing nodes with min and max sizes.

## 0.3.10

### Fixes

- Fix sizing of children when the available_space < min_size (#407)

## 0.3.9

### Fixes

- Fix caching bug where a cached result would sometimes be incorrectly used when the amount of available space increased (bevyengine/bevy#8111) and (bevyengine/bevy#8124)

## 0.3.8

### Fixes

- Fix incorrect min-content size for `flex-wrap: wrap` nodes (bevyengine/bevy#8082)

## 0.3.7

### Fixes

- Fix: Make `padding` and `border` floor node sizes (#372)
- Fix: Prevent percentages contributing to min-content sizes (#388) (also fixes bevyengine/bevy#8017)

## 0.3.6

### Fixes

- Fix: Ignore `align_content` when `flex_wrap` is set to `nowrap` (#383)

## 0.3.5

### Fixes

- Fix `display: none` when it is set on a flexbox child (#380)
- Fix `display: none` when it is set on a grid child (#381)

## 0.3.4

### Fixes
Expand Down
1 change: 1 addition & 0 deletions benches/helpers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pub mod yoga_helpers;

/// A helper function to recursively construct a deep tree
#[allow(dead_code)]
pub fn build_deep_tree<T, N>(
tree: &mut T,
max_nodes: u32,
Expand Down
12 changes: 12 additions & 0 deletions benches/helpers/yoga_helpers.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code)]
use slotmap::{DefaultKey, SlotMap};

pub mod yg {
Expand All @@ -12,6 +13,17 @@ mod tf {
pub use taffy::prelude::*;
}

pub fn new_default_style_with_children(
tree: &mut SlotMap<DefaultKey, yg::Node>,
children: Vec<DefaultKey>,
) -> DefaultKey {
let mut node = yg::Node::new();
for (i, child) in children.into_iter().enumerate() {
node.insert_child(&mut tree[child], i as u32);
}
tree.insert(node)
}

pub fn new_with_children(
tree: &mut SlotMap<DefaultKey, yg::Node>,
style: &tf::Style,
Expand Down
Loading