Skip to content

Migrate to once_cell#2750

Merged
ranile merged 3 commits into
yewstack:masterfrom
futursolo:remove-lazy-static
Jun 24, 2022
Merged

Migrate to once_cell#2750
ranile merged 3 commits into
yewstack:masterfrom
futursolo:remove-lazy-static

Conversation

@futursolo
Copy link
Copy Markdown
Member

Description

once_cell has been accepted into the std. Migrating to once_cell would help us to eventually move to the std version.

rust-lang/rust#74465

This pull request migrates all lazy_static usage to once_cell.

Checklist

  • I have reviewed my own code
  • I have added tests

github-actions[bot]
github-actions Bot previously approved these changes Jun 24, 2022
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 24, 2022

Visit the preview URL for this PR (updated for commit 9449c35):

https://yew-rs-api--pr2750-remove-lazy-static-i7d49hz5.web.app

(expires Fri, 01 Jul 2022 14:30:29 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 24, 2022

Size Comparison

Details
examples master (KB) pull request (KB) diff (KB) diff (%)
boids 172.593 172.582 -0.011 -0.006%
contexts 109.620 109.624 +0.004 +0.004%
counter 86.550 86.551 +0.001 +0.001%
counter_functional 87.203 87.201 -0.002 -0.002%
dyn_create_destroy_apps 89.664 89.664 0 0.000%
file_upload 102.626 102.626 0 0.000%
function_memory_game 166.894 166.895 +0.001 +0.001%
function_router 351.666 352.024 +0.358 +0.102%
function_todomvc 161.561 161.558 -0.003 -0.002%
futures 226.233 226.235 +0.002 +0.001%
game_of_life 107.189 107.187 -0.003 -0.003%
inner_html 83.618 83.618 0 0.000%
js_callback 112.846 112.854 +0.009 +0.008%
keyed_list 195.105 195.107 +0.002 +0.001%
mount_point 86.180 86.181 +0.001 +0.001%
nested_list 115.688 115.688 -0.001 -0.001%
node_refs 93.597 93.599 +0.002 +0.002%
password_strength 1538.157 1538.156 -0.001 -0.000%
portals 97.225 97.224 -0.001 -0.001%
router 320.458 320.810 +0.352 +0.110%
simple_ssr 154.493 154.492 -0.001 -0.001%
ssr_router 398.062 398.411 +0.349 +0.088%
suspense 110.544 110.538 -0.006 -0.005%
timer 89.258 89.261 +0.003 +0.003%
todomvc 142.615 142.617 +0.002 +0.001%
two_apps 87.160 87.161 +0.001 +0.001%
web_worker_fib 153.406 153.408 +0.002 +0.001%
webgl 87.438 87.438 0 0.000%

✅ None of the examples has changed their size significantly.

Copy link
Copy Markdown
Member

@ranile ranile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once_cell has been accepted into the std. Migrating to once_cell would help us to eventually move to the std version.

If they have the same API, #2743 can also use std once_cell on nightly.

Comment thread packages/yew-macro/src/props/element.rs
Comment thread packages/yew-macro/src/props/element.rs
@futursolo
Copy link
Copy Markdown
Member Author

If they have the same API, #2743 can also use std once_cell on nightly.

once_cell has just changed from std::lazy to std::sync / std::cell last week.
I think we should wait until the naming / location to settle before migrating to std.

@ranile ranile merged commit 6b89e21 into yewstack:master Jun 24, 2022
@futursolo futursolo deleted the remove-lazy-static branch December 15, 2022 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants