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

Reworked custom measurements #198

Closed
wants to merge 469 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
469 commits
Select commit Hold shift + click to select a range
fb6fcd0
Give up on running android in circleci
Apr 23, 2019
57f7eff
Merge pull request #24 from vislyhq/kotlin-bindings
emilsjolander Apr 23, 2019
40d32f4
Add bintray config
Apr 23, 2019
313f291
Hold weak reference from rust to measure func
Apr 23, 2019
409cdc4
Basic swift / cocoapods project setup
Apr 23, 2019
7764f7d
Basic working version of bindings
Apr 24, 2019
651299d
make API more swifty
Apr 25, 2019
549d74a
setup circleci
Apr 25, 2019
176a0b8
Add test to scheme
Apr 25, 2019
6dccd83
Fix circleci
Apr 25, 2019
8a9bdcd
Fix circleci
Apr 25, 2019
b4997bf
Fix circleci
Apr 25, 2019
ad06e26
Fix circleci
Apr 25, 2019
27d0aeb
Fix circleci
Apr 25, 2019
f3206bf
Merge pull request #26 from vislyhq/swift-bindings
Apr 26, 2019
a33184b
Implement js bindings
Apr 28, 2019
6051e2d
fix circleci
Apr 28, 2019
97049ea
fix clippy and fmt
Apr 28, 2019
b0ae50b
fix circleci
Apr 28, 2019
8a057b5
fix circleci
Apr 28, 2019
1a66123
Merge pull request #27 from vislyhq/js-bindings
Apr 28, 2019
c855a48
publish to npm
Apr 28, 2019
ec2360c
Add badges to readme
Apr 28, 2019
b5029ac
Update README.md
Apr 28, 2019
7f040bc
Update README.md
Apr 28, 2019
efaad5d
Port closed-source landing page over to gatsby + github pages
Apr 28, 2019
452b6de
Basic docs setup
Apr 28, 2019
24057fa
Rust docs
Apr 29, 2019
6a60a7d
Finish rust docs
Apr 29, 2019
1272c7a
Add docs to circleci
Apr 29, 2019
1aab843
Fix circle config
Apr 29, 2019
9348214
Fix circle config
Apr 29, 2019
5fd124c
Fix circle config
Apr 29, 2019
2620fa5
Fix circle config
Apr 29, 2019
3c83806
Update banner
Apr 29, 2019
47d456c
Update README.md
Apr 29, 2019
1f4481a
Kotlin docs
Apr 29, 2019
82cf59a
Swift docs
Apr 29, 2019
369f81b
JS docs
Apr 29, 2019
d1fbffb
Merge pull request #28 from vislyhq/docs
Apr 29, 2019
5ef3875
css fix
Apr 29, 2019
7b9db8d
fix typos in README.md
seeekr Apr 29, 2019
12644a6
Merge pull request #29 from seeekr/patch-1
Apr 30, 2019
0d03cc0
fix js setup
Apr 30, 2019
cfa9e40
Merge branch 'master' of https://github.com/vislyhq/stretch
Apr 30, 2019
9cdb10b
Update README.md
0xflotus Apr 30, 2019
cc26342
Merge pull request #33 from 0xflotus/patch-2
Apr 30, 2019
943b719
Replace refcounted nodes with index tree
msiglreith May 3, 2019
d4ef0a2
Prepare algo for transition towards index based API
msiglreith May 3, 2019
fca3077
Port algorithm to node based Id
msiglreith May 3, 2019
10729ae
Port generated tests to index based api
msiglreith May 3, 2019
1d04852
Remove reference to undefined binding
jugglinmike May 4, 2019
9585cb6
Correct typos
jugglinmike May 4, 2019
da2def7
Merge pull request #39 from bocoup/docs-fix-typos
May 4, 2019
32dba81
Merge pull request #38 from bocoup/docs-remove-ctor-reference
May 4, 2019
16451af
Expand circle tests
May 4, 2019
a2a631e
Fix working directory usage
May 4, 2019
64663fb
Fix anroid tests
May 4, 2019
5fec64f
Merge pull request #40 from vislyhq/android-test-ci
May 4, 2019
5f570a0
Rename NodeId to Node and use newtype
msiglreith May 4, 2019
d76d61f
Add node id allocator
msiglreith May 6, 2019
09eca73
Improve error handling for index based API
msiglreith May 6, 2019
15f70d4
Update dependencies
msiglreith May 8, 2019
e76767e
index: Implement remaining functions on Stretch
msiglreith May 10, 2019
48c6919
index: update tests to API changes
msiglreith May 11, 2019
9f42ca4
Update benches to API changes
msiglreith May 11, 2019
ba89776
bench: collect more metrics for complex sample
msiglreith May 11, 2019
8c6cf5a
Update basic example to new API
msiglreith May 11, 2019
cd191ea
Update handwritten tests to API changes
msiglreith May 12, 2019
74b59e7
Fix a typo in Swift docs
noahsark769 May 30, 2019
44b040c
Merge pull request #41 from noahsark769/patch-1
May 30, 2019
0e29662
Fix another typo in the Swift docs
noahsark769 May 31, 2019
e7a4475
Merge pull request #42 from noahsark769/patch-2
May 31, 2019
17acee6
Add a lower level node forest structure and adjust data layout
msiglreith Jun 2, 2019
390ae69
index: move forest into separate module
msiglreith Jun 14, 2019
96bbe03
index: Implement node removal
msiglreith Jun 14, 2019
ef85ea9
index: fix formatting and warnings
msiglreith Jun 16, 2019
a149c6b
Merge pull request #37 from msiglreith/index
Jul 4, 2019
bce89b1
Implement new rust API for bindings and release v0.3
Jul 4, 2019
c20c849
Merge pull request #44 from vislyhq/v0.3
Jul 5, 2019
20e0748
fix docs
Jul 5, 2019
8e33969
update homepage url
Jul 5, 2019
82d5dfb
update landing page
Jul 5, 2019
a7e2c07
update landing page
Jul 5, 2019
3b12bc3
Add support for optional serialization/deserialization of Style with …
yawor Aug 31, 2019
ab57208
Merge pull request #49 from yawor/serde
Sep 3, 2019
0ef8963
Fix node remove logic
yawor Sep 5, 2019
02aaeee
Conditional serde rename support
yawor Sep 9, 2019
80d832d
Enable compilation of crate for no_std again.
dflemstr Sep 14, 2019
a07ce7b
fix percent dimension values in JS bindings
zamotany Sep 16, 2019
0a74d95
Merge pull request #55 from zamotany/master
Nov 8, 2019
72e5dfe
Merge pull request #54 from dflemstr/no-std
Nov 8, 2019
05e7f99
Merge pull request #53 from yawor/serde_extended
Nov 8, 2019
6f1b3a0
Merge pull request #52 from yawor/fix_node_remove
Nov 8, 2019
d6cf756
Update deps and rust
Nov 8, 2019
523ef1c
Fix warning on unused resolt
Nov 8, 2019
b2526d2
Make Style derive PartialEq
dflemstr Dec 13, 2019
4acf6e9
Add ability to access child node by index
dflemstr Dec 13, 2019
ffb470a
Break out a sys module that encapsulates target-specific APIs
dflemstr Dec 16, 2019
ff34f0b
Make the core algorithms be allocation free
dflemstr Dec 16, 2019
6409b8f
Switch to ID generation using a single increasing u64
dflemstr Dec 16, 2019
88792ca
Update all benchmarks to use the new API
dflemstr Dec 16, 2019
d6e5ba1
Update all tests to use the new API
dflemstr Dec 16, 2019
9f3dd03
Update the basic example to use the new API
dflemstr Dec 16, 2019
e7ae3b0
Run tests for all supported feature combinations
dflemstr Dec 16, 2019
1b40f4a
Fix js bindings
dflemstr Dec 16, 2019
6f19615
Fix kotlin bindings
dflemstr Dec 16, 2019
76649a5
Fix swift bindings
dflemstr Dec 16, 2019
983fb67
Remove unused dependency
dflemstr Dec 16, 2019
e77578c
No longer depend on lazy_static
dflemstr Dec 17, 2019
619b2b1
Disable arrayvec std feature by default
dflemstr Dec 17, 2019
12ef285
Drop in support for no_std float operations
dflemstr Dec 17, 2019
abf1707
default size dimensions to auto rather than undefined
heswell Jan 26, 2020
edcf797
remove launch.json vs code settings
heswell Jan 26, 2020
f411677
fix formatting
heswell Jan 26, 2020
5142f56
fix: Generating node trees frequently, crashes due to GC
biezhihua Mar 24, 2020
7eeda45
Merge pull request #67 from biezhihua/master
Apr 17, 2020
6734408
Merge pull request #60 from dflemstr/heapless
Apr 17, 2020
28e0047
Merge pull request #62 from heswell/stretch-sizing-js
Apr 17, 2020
703e96f
refactoring
adamnemecek May 16, 2020
c377d5f
cargo fmt
adamnemecek May 16, 2020
dfdb5a2
added prelude + some refactoring
adamnemecek May 16, 2020
4740fe4
cargo fmt
adamnemecek May 16, 2020
54496e7
refactoring
adamnemecek May 16, 2020
11d8bb3
more refactoring
adamnemecek May 16, 2020
d1d9828
removed the ToNumber trait, use std::convert::From instead
adamnemecek May 16, 2020
055dedf
refactoring
adamnemecek May 16, 2020
8176636
minor fix
adamnemecek May 16, 2020
4f98102
cargo fmt
adamnemecek May 16, 2020
6f9d8f7
minor refactoring
adamnemecek May 16, 2020
06110e5
cargo fmt
adamnemecek May 16, 2020
6879b9a
Merge pull request #70 from adamnemecek/pr3
May 22, 2020
f388c84
Fix performance issue with deep nesting
Davier Jan 6, 2021
b128701
Fix Percent height values, which were using parent width.
HackerFoo Jun 26, 2021
41fed10
cargo fmt
HackerFoo Jul 16, 2021
875cc5f
Revert changes to margin, padding, and border.
HackerFoo Jul 17, 2021
13d0f75
README.md and crate rename
elbaro Dec 27, 2021
1116caa
Merge #88
elbaro Dec 27, 2021
99945cf
rename stretch to stretch2
elbaro Dec 27, 2021
f333a9b
Merge upstream #81
elbaro Dec 28, 2021
7330008
Fix broken test by upstream #81
elbaro Dec 28, 2021
e26d74c
Fix formatting
elbaro Dec 28, 2021
0647145
Fix formatting
elbaro Dec 28, 2021
a649111
Update deps
elbaro Dec 28, 2021
8b5773c
Fix incorrect renaming
elbaro Dec 28, 2021
e9c3fcb
clippy fix
elbaro Dec 28, 2021
5d91ad0
Fix remaning rename error
elbaro Dec 28, 2021
d476ced
fix: nested nodes have type preventing proper nesting
jkelleyrtp Jan 1, 2022
5b0290a
cleanup: remove comments
jkelleyrtp Jan 1, 2022
9223803
Merge pull request #1 from jkelleyrtp/jk/nested_fix
jkelleyrtp Jan 4, 2022
f4b815e
Update README.md
jkelleyrtp Jan 4, 2022
1f12fb8
wip: bump cargo and readme
jkelleyrtp Mar 10, 2022
b5db37a
fix re-computing layout moves children of non-zero positioned parent
ealmloff Mar 19, 2022
ab443fa
Merge pull request #2 from Demonthos/master
jkelleyrtp Apr 4, 2022
c18d617
publish: bump version
jkelleyrtp May 3, 2022
02033c0
Merge branch 'master' of https://github.com/dioxuslabs/stretch
jkelleyrtp May 3, 2022
5a68ad7
remove round_layout changes
mockersf May 10, 2022
3a413ef
add doc
mockersf May 10, 2022
070c383
add test
mockersf May 10, 2022
b734676
Merge pull request #6 from mockersf/remove_round_layout_changes
ealmloff May 10, 2022
72bb512
Setup basic ci (#7)
mockersf May 11, 2022
60c0860
Remove license from README (#14)
alice-i-cecile May 11, 2022
e5287c0
fixed swift bindings (#4)
dprophete May 11, 2022
ebba24c
Remove badges section in Cargo.toml (#19)
TimJentzsch May 11, 2022
5a82234
Update repository link in Cargo.toml to https://github.com/DioxusLabs…
TimJentzsch May 11, 2022
c267e62
Update README badges (#20)
TimJentzsch May 11, 2022
55302f3
Forbid unsafe code (#34)
TimJentzsch May 11, 2022
b41c537
Add markdownlint to CI action (#33)
TimJentzsch May 11, 2022
a50a456
Add pull request template (#37)
TimJentzsch May 11, 2022
9eb3469
Add CI jobs for checking and testing with no default features (#36)
TimJentzsch May 13, 2022
a3b89df
Fix Markdown linting in CI (#35)
alice-i-cecile May 13, 2022
4219049
Add CONTRIBUTING.md (#15)
alice-i-cecile May 14, 2022
0030950
Add issue templates (#41)
chiehw May 15, 2022
080ae2a
Add release notes (#48)
alice-i-cecile May 20, 2022
2dc69ed
Fix license information (#49)
alice-i-cecile May 20, 2022
1af4023
Bump crate version number to 0.4.3 (#50)
alice-i-cecile May 20, 2022
5bdf7c0
Note deprecation in README (#51)
alice-i-cecile May 20, 2022
a7fc331
Update authors (#52)
alice-i-cecile May 20, 2022
38382a6
Improve PR template (#55)
alice-i-cecile May 20, 2022
b7ee900
Make PR template clearer and shorter (#58)
alice-i-cecile May 23, 2022
7e84a46
Prepare for release of new sprawl crate (#53)
alice-i-cecile May 23, 2022
10780bd
Bump version numbers of dependencies (#61)
alice-i-cecile May 24, 2022
fe2e679
Create dependabot.yml (#67)
Weibye May 27, 2022
4c1ef19
Update fantoccini requirement from 0.11.9 to 0.19.0 (#70)
dependabot[bot] May 27, 2022
06d7516
Update env_logger requirement from 0.7.1 to 0.9.0 (#69)
dependabot[bot] May 27, 2022
8e9d3c4
Update indicatif requirement from 0.13.0 to 0.16.2 (#71)
dependabot[bot] May 27, 2022
545b076
Update tokio requirement from 0.1 to 1.18 (#72)
dependabot[bot] May 27, 2022
3805d48
Update futures requirement from 0.1 to 0.3 (#73)
dependabot[bot] May 27, 2022
cef2c1f
Bump actions/checkout from 2 to 3 (#68)
dependabot[bot] May 27, 2022
d52ae98
Add .vscode folder to gitignore (#76)
Weibye May 27, 2022
7b4a101
Encourage contributors to use latest stable via `rust-toolchain.toml`…
CobaltCause May 27, 2022
a86dcfa
Cleanup imports (#75)
Weibye Jun 1, 2022
7c32598
Rename `sprawl::node::Stretch` -> `sprawl::node::Sprawl` (#79)
Weibye Jun 1, 2022
78c5e05
Rename generated files (#80)
Weibye Jun 1, 2022
5dde45d
Remove serde_camel_case and serde_kebab_case features (#84)
alice-i-cecile Jun 8, 2022
52ef801
Remove migration guide from PR template (#87)
alice-i-cecile Jun 8, 2022
7d9382a
Make alloc and std compatible features (#86)
alice-i-cecile Jun 8, 2022
1ea60b5
Refactor flexbox algorithm into smaller parts (#88)
alice-i-cecile Jun 8, 2022
0a2c9df
Lint and build crate on nightly in CI (#90)
alice-i-cecile Jun 8, 2022
a1e9174
Make order field of `Layout` pub (#94)
alice-i-cecile Jun 8, 2022
8f72a70
Rename modules (#95)
alice-i-cecile Jun 8, 2022
fbc09ab
Remove Allocator::free (#105)
alice-i-cecile Jun 8, 2022
f644639
Refactor Forest::mark_dirty for clarity (#107)
alice-i-cecile Jun 9, 2022
724e286
Remove dead Direction type (#111)
alice-i-cecile Jun 9, 2022
7e3abab
Remove dead Overflow type (#112)
alice-i-cecile Jun 9, 2022
11701ee
Vendor indexmap from heapless crate (#108)
colepoirier Jun 9, 2022
f69b53b
Cleanup arguments (#116)
Weibye Jun 9, 2022
e7aa349
Add `#[must_use]` to all static methods (#125)
Weibye Jun 10, 2022
b8fd0de
Clippy attribute is dead_code (#126)
alice-i-cecile Jun 10, 2022
0d46716
Use consistent import style in flexbox.rs (#127)
alice-i-cecile Jun 10, 2022
de9123e
Document entire crate (#96)
alice-i-cecile Jun 10, 2022
8936790
Rename sprawl to taffy (#134)
alice-i-cecile Jun 10, 2022
b7a47a6
Bump releases to `0.2.0` (#135)
Weibye Jun 10, 2022
6213542
Stop leaking internal types in public interface (#137)
alice-i-cecile Jun 10, 2022
f909532
Rename `taffy::style::Style` -> `taffy::style::FlexboxLayout`, take 2…
Weibye Jun 10, 2022
2281228
Remove gen-test script (#141)
alice-i-cecile Jun 10, 2022
55cd70b
Remove `ComputeResult` type (#139)
alice-i-cecile Jun 10, 2022
d960ac1
Rename `new_node` to `new_with_children` (#142)
Weibye Jun 10, 2022
59a8e27
Add allow(unused_code) annotations to methods in indexmap (#143)
alice-i-cecile Jun 10, 2022
b2d8bda
Restore and fix gentest (#145)
mockersf Jun 11, 2022
d58313d
Return a Result from Taffy::remove (#106)
sixfold-origami Jun 11, 2022
3ab6814
Mark generated files as lunguist-generated (#149)
TimJentzsch Jun 11, 2022
999f893
Replace `#[allow(unused_code)]` with `#[allow(dead_code]` (#150)
Weibye Jun 11, 2022
a53872d
Minor docs fix in `flexbox.rs` (#151)
Weibye Jun 11, 2022
f324ad8
Improve error message when missing chromedriver (#147)
Weibye Jun 11, 2022
a5f9a8b
Remove serde renames from Display (#153)
jshrake Jun 11, 2022
712df30
Improve Errors (#152)
TheDestroyer19 Jun 11, 2022
7283137
Replace Number type with a simpler Option<f32> (#144)
alice-i-cecile Jun 11, 2022
a2eff07
Fix Todo note (#156)
Weibye Jun 12, 2022
34d2258
Make `MeasureFunc` Send and Sync (#157)
alice-i-cecile Jun 12, 2022
0061666
Correctly test that MeasureFunc is Send and Sync (#159)
alice-i-cecile Jun 12, 2022
ed3749c
Fix typos (#164)
mcrvaz Jun 14, 2022
0d2d0e1
Add unit tests for `MaybeMath` (#162)
TimJentzsch Jun 15, 2022
e75a55f
Remove manual map implementation in maybe math (#161)
TimJentzsch Jun 16, 2022
2402403
Check for duplicate dependencies in CI (#172)
Weibye Jun 17, 2022
12d44d5
Add unit-tests to `resolve` (#173)
Weibye Jun 17, 2022
9255915
Derive Eq (#175)
Weibye Jun 18, 2022
943cd89
Add and cleanup new leaf-nodes methods (#181)
Weibye Jun 19, 2022
e8a32c5
Add unit-tests to `node::Taffy` (#178)
Weibye Jun 19, 2022
31c22f8
Additional tests for FlexboxLayout and FlexDirection (#174)
mcrvaz Jun 19, 2022
f52f652
Added unreachable macro to alleged unreachable code rather than using…
Sheepyhead Jun 20, 2022
68a7408
Add guideline to write tests (#185)
Weibye Jun 20, 2022
4299cd4
Update rstest requirement from 0.13.0 to 0.14.0 (#186)
dependabot[bot] Jun 20, 2022
b298fd6
Unit test `compute_constants()` (#184)
Weibye Jun 23, 2022
83a815b
Cleanup `new_with_children()` uses (#194)
Weibye Jun 26, 2022
5178ebd
Update rstest requirement from 0.14.0 to 0.15.0 (#195)
dependabot[bot] Jun 27, 2022
560e849
Forest unit tests (#193)
mcrvaz Jun 29, 2022
b553bbd
Use slotmap instead of bespoke arena, limiting to one parent only (#196)
jkelleyrtp Jul 1, 2022
42aa7ed
Reworked custom measurements
twop Jul 10, 2022
6e4391a
Experiment with no stored data
twop Jul 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/tests/generated/** linguist-generated=true
/benches/generated/** linguist-generated=true
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug Report
about: Report a bug to help us improve!
title: ''
labels: bug
assignees: ''
---

## `taffy` version

The release number or commit hash of the version you're using.

## Platform

What platform are you using `taffy` on? e.g. Rust, Android, IOS, JavaScript/TypeScript

## What you did

The steps you took to uncover this bug.

Please provide a runnable code snippet or link to an example that demonstrates the problem if you can.

## What went wrong

If it's not clear:

- what were you expecting?
- what actually happened?

## Additional information

Other information that can be used to further reproduce or isolate the problem.
This commonly includes:

- screenshots
- logs
- theories about what might be going wrong
- workarounds that you used
- links to related bugs, PRs or discussions
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature Request
about: Propose a new feature!
title: ''
labels: enhancement
assignees: ''
---

## What problem does this solve or what need does it fill?

A description of why this particular feature should be added.

## What solution would you like?

The solution you propose for the problem presented.

## What alternative(s) have you considered?

Other solutions to solve and/or work around the problem presented.

## Additional context

Any other information you would like to add such as related previous work,
screenshots, benchmarks, etc.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: weekly
labels:
- "dependencies"
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
labels:
- "dependencies"
29 changes: 29 additions & 0 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
###########################
###########################
## Markdown Linter rules ##
###########################
###########################

# Linter rules doc:
# - https://github.com/DavidAnson/markdownlint
#
# Note:
# To comment out a single error:
# <!-- markdownlint-disable -->
# any violations you want
# <!-- markdownlint-restore -->
#

###############
# Rules by id #
###############
# MD013:
# line_length: 120

#################
# Rules by tags #
#################
# blank_lines: false # Error on blank lines
line_length: false # Ignore excessively long lines
no-duplicate-heading: false # This is useful in RELEASES.md
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Objective

Why did you make this PR?

If you're fixing a specific issue, say "Fixes #X" and the linked issue will be automatically closed when this PR is merged.
If it's not obvious, describe how this changes made addressed the objectives.

**Changes that will affect external library users must update RELEASES.md before they will be merged.**

## Context

Discuss any context that may be needed for reviewers to understand the changes you've made.
This may include related issues, previous discussion, or links to documentation or code.

## Feedback wanted

> This section is optional. If there are no particularly tricky or controversial changes, you can delete this section.

Which parts of this PR were you unsure about? Which parts were particularly tricky?

If you're stuck on part of the changes or want feedback early, open a draft PR and list the items that need to be completed here using a [checklist](https://github.blog/2014-04-28-task-lists-in-all-markdown-documents/).
95 changes: 95 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
on: [push, pull_request]

name: Continuous integration

jobs:
test-features-none:
name: "Test Suite [Features: None]"
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: test
args: --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: test

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: test
args: --no-default-features --features alloc

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

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

markdownlint:
name: Markdown Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Run Markdown Lint
uses: docker://ghcr.io/github/super-linter:slim-v4
env:
VALIDATE_ALL_CODEBASE: true
VALIDATE_MARKDOWN: true
DEFAULT_BRANCH: master
71 changes: 71 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Dependencies

on:
pull_request:
paths:
- '**/Cargo.toml'
- 'deny.toml'
push:
paths:
- '**/Cargo.toml'
- 'deny.toml'
branches-ignore:
- 'dependabot/**'
# schedule:
# - cron: "0 0 * * 0"

env:
CARGO_TERM_COLOR: always

jobs:
check-advisories:
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
- 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
- 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
- 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
- name: Checked for unauthorized crate sources
run: cargo deny check sources
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/target
/scripts/gentest/target

**/*.rs.bk
Cargo.lock
.DS_Store

.vscode
82 changes: 82 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Contributing

This is a cross-team project, aiming to build solid foundations for Rust UI libraries of all sorts.
New contributions are extremely welcome!

The basic process is simple:

1. Pick an [issue](https://github.com/DioxusLabs/taffy/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22), or [file a new one](https://github.com/DioxusLabs/taffy/issues/new).
2. Comment in the issue that you plan to tackle it, and the team will assign the task to you.
3. Submit a PR.
4. Respond to feedback from reviewers and make sure CI passes.

The PR review process is completely open: help us by commenting on, testing and approving PRs.

If you'd like to help on a consistent basis or are interested in project management, create a Discussions post, and we'll be happy to hand out triage rights.

## Testing

### Running tests

Flexbox layouts are tested by validating that layouts written in this crate perform the same as in Chrome.
This is done by rendering an equivalent layout in HTML and then generating a Rust test case which asserts that the resulting layout is the same when run through our layout engine.

You can run these tests without setting up a webdriver environment but if you are looking to add any test case you will need to install [chromedriver](http://chromedriver.chromium.org) and [Chrome](https://www.google.com/chrome/).
If you are developing on macOS this is easy to do through brew.

```bash
brew install chromedriver
```

Once you have chromedriver installed and available in `PATH` you can re-generate all tests by running `cargo run --package gentest`. You should not manually update the tests in `tests/generated`. Instead, fix the script in `scripts/gentest/` and re-generate them. This can happen after a refactor. It can be helpful to commit the updated tests in a dedicated commit so that they can be easier to ignore during review.

To add a new test case add another HTML file to `/test_fixtures` following the current tests as a template for new tests.

### Writing tests

1. All tests should be wrapped in a module called `tests` gated by the standard `test` feature flag, to ensure they are not compiled unless tests are being run.

```rs
#[cfg(test)]
mod tests {
// Place tests here
}
```

2. For unit-testing this should be placed in the same file as the code they are testing
1. If files become extremely long (more than a couple thousand lines of code), tests should be split out into its own file under the same module

```rs
// file: ./src/my_struct.rs
struct MyStruct;

impl MyStruct {
fn some_method() { .. }
}

#[cfg(test)]
mod tests {
#[test]
fn test_of_some_method() { .. }
}
```

3. For integration tests this should be placed within the `./tests` folder

```rs
// file: ./tests/my_integration_test.rs
#[test]
fn integration_test_one() { .. }
#[test]
fn integration_test_two() { .. }
```

4. Each test should have a clear intent
1. It should be evident what is being tested (naming, code, comments)
2. When this test fails, it should be easy to understand what went wrong
3. Fixture-based tests (`#[rstest]`) can help improve clarity when many related scenarios need to be checked

## Benchmarking

Benchmarks build on the same infrastructure as testing, and actually benchmarks are automatically generated from test fixtures just like tests.
Run `cargo bench` to run benchmarks locally.
Loading