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

Migrate to once_cell #2750

Merged
merged 3 commits into from Jun 24, 2022
Merged

Conversation

futursolo
Copy link
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

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

github-actions bot commented Jun 24, 2022

Size Comparison

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
Member

@hamza1311 hamza1311 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.

packages/yew-macro/src/props/element.rs Show resolved Hide resolved
packages/yew-macro/src/props/element.rs Show resolved Hide resolved
@futursolo
Copy link
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.

@hamza1311 hamza1311 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.

None yet

2 participants