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

Extract sycamore crate into multiple crates #416

Merged
merged 30 commits into from
May 17, 2022
Merged

Extract sycamore crate into multiple crates #416

merged 30 commits into from
May 17, 2022

Conversation

lukechu10
Copy link
Member

@lukechu10 lukechu10 commented May 6, 2022

New crates include:

  • sycamore-core for core Sycamore functionality. This crate should provide backend-agnostic APIs. The web backend should also be included by default as that is by-far the most common use case for sycamore (at least for now).
  • sycamore-web that adds a few web specific APIs and the web backend.

The sycamore crate should always re-export sycamore-core and re-export sycamore-web when a "web" feature is enabled (should it be enabled by default?)

This also updates the builder API to use free functions (i.e. div() instead of h(div)) and decouples it from html backends.
The builder API is also included by default and the builder feature is removed.

@lukechu10 lukechu10 added the BREAKING CHANGE Breaking changes introduced in this PR label May 6, 2022
@lukechu10 lukechu10 marked this pull request as draft May 6, 2022 23:08
@codecov
Copy link

codecov bot commented May 6, 2022

Codecov Report

Merging #416 (56b66f1) into master (3b3e39e) will decrease coverage by 0.02%.
The diff coverage is 47.84%.

@@            Coverage Diff             @@
##           master     #416      +/-   ##
==========================================
- Coverage   64.97%   64.95%   -0.03%     
==========================================
  Files          49       52       +3     
  Lines        8080     8289     +209     
==========================================
+ Hits         5250     5384     +134     
- Misses       2830     2905      +75     
Impacted Files Coverage Δ
packages/sycamore-core/src/generic_node.rs 100.00% <ø> (ø)
packages/sycamore-core/src/view.rs 75.53% <ø> (ø)
packages/sycamore-macro/src/component/mod.rs 96.01% <ø> (ø)
packages/sycamore-macro/src/view/parse.rs 96.80% <ø> (ø)
packages/sycamore-reactive/src/lib.rs 96.40% <ø> (ø)
packages/sycamore-router-macro/src/route.rs 89.42% <ø> (ø)
packages/sycamore-router/src/lib.rs 96.77% <ø> (ø)
packages/sycamore-web/src/dom_node.rs 0.00% <0.00%> (ø)
packages/sycamore-web/src/hydrate.rs 0.00% <ø> (ø)
packages/sycamore-web/src/hydrate_node.rs 0.00% <ø> (ø)
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b3e39e...56b66f1. Read the comment docs.

@lukechu10 lukechu10 marked this pull request as ready for review May 14, 2022 18:04
@lukechu10 lukechu10 marked this pull request as draft May 14, 2022 18:04
@lukechu10 lukechu10 added performance Performance related and removed performance Performance related labels May 14, 2022
@github-actions

This comment was marked as resolved.

@lukechu10 lukechu10 mentioned this pull request May 16, 2022
@lukechu10 lukechu10 added performance Performance related and removed performance Performance related labels May 17, 2022
@github-actions

This comment was marked as resolved.

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

github-actions bot commented May 17, 2022

Finished dev [unoptimized + debuginfo] target(s) in 0.06s
 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                  |       164.34 |   217.27 |  209.24 |   -3.69%
+ 02_replace1k              |       174.51 |   229.27 |  221.38 |   -3.44%
+ 03_update10th1k_x16       |       410.64 |   446.42 |  401.27 |  -10.11%
  04_select1k               |        45.79 |    67.83 |   69.22 |   +2.04%
  05_swap1k                 |       101.45 |   101.10 |   99.51 |   -1.58%
  06_remove-one-1k          |        34.79 |    37.88 |   37.43 |   -1.17%
+ 07_create10k              |      2058.07 |  2971.82 | 2809.54 |   -5.46%
  08_create1k-after1k_x2    |       427.35 |   498.49 |  491.65 |   -1.37%
+ 09_clear1k_x8             |       111.90 |   152.18 |  139.93 |   -8.05%
  21_ready-memory           |         1.47 |     1.44 |    1.44 |   -0.05%
+ 22_run-memory             |         1.35 |     1.68 |    1.62 |   -3.67%
  23_update5-memory         |         1.35 |     1.65 |    1.64 |   -0.27%
  24_run5-memory            |         1.68 |     1.85 |    1.85 |   +0.11%
  25_run-clear-memory       |         1.41 |     1.28 |    1.27 |   -0.53%
  31_startup-ci             |      1862.63 |  2032.30 | 2032.73 |   +0.02%
  32_startup-bt             |        21.31 |    47.28 |   47.18 |   -0.23%
- 33_startup-mainthreadcost |       331.44 |   345.56 |  380.91 |  +10.23%
  34_startup-totalbytes     |       189.16 |   283.39 |  282.46 |   -0.33%

Workflow: 2335454036
Adding new commits will generate a new report

@lukechu10 lukechu10 marked this pull request as ready for review May 17, 2022 00:21
@lukechu10 lukechu10 merged commit 3293b1d into master May 17, 2022
@lukechu10 lukechu10 deleted the sycamore-core branch May 17, 2022 00:43
mc1098 pushed a commit to mc1098/sycamore that referenced this pull request May 22, 2022
The builder feature flag was removed in sycamore-rs#416 but the website still
contained a sentence about adding the feature flag before using the
builder syntax.
lukechu10 pushed a commit that referenced this pull request May 22, 2022
Remove builder feature doc on website

The builder feature flag was removed in #416 but the website still
contained a sentence about adding the feature flag before using the
builder syntax.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE Breaking changes introduced in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant