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

Inline props #486

Merged
merged 6 commits into from
Sep 19, 2022
Merged

Inline props #486

merged 6 commits into from
Sep 19, 2022

Conversation

lukechu10
Copy link
Member

This PR implements inline props. This makes it possible to create a component accepting props without creating an extra struct just for the props.

The adopted syntax is #[component(inline_props)].

See new section in book for more details.

@lukechu10 lukechu10 added A-components Area: components and UI abstraction A-ergonomics Area: API ergonomics labels Sep 19, 2022
@codecov
Copy link

codecov bot commented Sep 19, 2022

Codecov Report

Merging #486 (673964d) into master (e6cc745) will increase coverage by 0.39%.
The diff coverage is 96.22%.

@@            Coverage Diff             @@
##           master     #486      +/-   ##
==========================================
+ Coverage   64.48%   64.87%   +0.39%     
==========================================
  Files          52       52              
  Lines        8399     8481      +82     
==========================================
+ Hits         5416     5502      +86     
+ Misses       2983     2979       -4     
Impacted Files Coverage Δ
packages/sycamore-macro/src/component/mod.rs 96.42% <95.95%> (+0.46%) ⬆️
packages/sycamore-macro/src/lib.rs 86.20% <100.00%> (+21.69%) ⬆️
website/src/main.rs 0.54% <0.00%> (-0.01%) ⬇️
packages/sycamore-reactive/src/lib.rs 94.24% <0.00%> (+0.02%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@lukechu10 lukechu10 added performance Performance related and removed performance Performance related labels Sep 19, 2022
@github-actions
Copy link

github-actions bot commented Sep 19, 2022

Finished dev [unoptimized + debuginfo] target(s) in 0.04s
 Running `/home/runner/work/sycamore/sycamore/sycamore/target/debug/bench-diff ../../../../js-framework-benchmark/webdriver-ts/results.json`

Benchmark Report

  • wasm-bindgen: the performance goal
  • baseline: performance of sycamore-baseline (typically latest master)
  • update: performance of sycamore (typically recent changes)
  • diff: measures the improvement of update over the baseline
@@                           Performance Diff                           @@

##                          | wasm-bindgen | baseline |  update |  diff ##
##########################################################################
  01_run1k                  |       114.95 |     0.00 |    0.00 |     NaN%
  02_replace1k              |       119.60 |     0.00 |    0.00 |     NaN%
  03_update10th1k_x16       |       407.24 |     0.00 |    0.00 |     NaN%
  04_select1k               |        58.59 |     0.00 |    0.00 |     NaN%
  05_swap1k                 |        96.99 |     0.00 |    0.00 |     NaN%
  06_remove-one-1k          |        30.36 |     0.00 |    0.00 |     NaN%
  07_create10k              |      1224.32 |     0.00 |    0.00 |     NaN%
  08_create1k-after1k_x2    |       278.96 |     0.00 |    0.00 |     NaN%
  09_clear1k_x8             |        78.74 |     0.00 |    0.00 |     NaN%
  21_ready-memory           |         2.14 |     0.00 |    0.00 |     NaN%
  22_run-memory             |         3.52 |     0.00 |    0.00 |     NaN%
  23_update5-memory         |         3.62 |     0.00 |    0.00 |     NaN%
  25_run-clear-memory       |         2.19 |     0.00 |    0.00 |     NaN%
  26_run-10k-memory         |        17.06 |     0.00 |    0.00 |     NaN%
  31_startup-ci             |      1782.63 |     0.00 |    0.00 |     NaN%
  32_startup-bt             |         0.00 |     0.00 |    0.00 |     NaN%
  33_startup-mainthreadcost |        20.40 |     0.00 |    0.00 |     NaN%
  34_startup-totalbytes     |       189.33 |     0.00 |    0.00 |     NaN%

Workflow: 3082008700
Adding new commits will generate a new report

@lukechu10 lukechu10 merged commit b48d3f2 into master Sep 19, 2022
@lukechu10 lukechu10 deleted the inline-props branch September 19, 2022 14:42
@lukechu10 lukechu10 linked an issue Sep 19, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-components Area: components and UI abstraction A-ergonomics Area: API ergonomics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inline Props
1 participant