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

Create a new nested scope if ctx is used within a dyn fragment #364

Merged
merged 7 commits into from Feb 17, 2022

Conversation

lukechu10
Copy link
Collaborator

If the identifier ctx is used inside a dynamic expression inside the view! macro, a new scoped effect will be automatically created instead. This prevents memory leaks when the effect reruns.

@lukechu10 lukechu10 added C-bug Category: bug, something isn't working A-macro Area: macros A-view Area: view! macro labels Feb 17, 2022
@codecov
Copy link

codecov bot commented Feb 17, 2022

Codecov Report

Merging #364 (6dfebab) into master (a71d31d) will increase coverage by 0.43%.
The diff coverage is 95.34%.

❗ Current head 6dfebab differs from pull request most recent head a75d805. Consider uploading reports for the commit a75d805 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #364      +/-   ##
==========================================
+ Coverage   63.10%   63.53%   +0.43%     
==========================================
  Files          48       48              
  Lines        7496     7569      +73     
==========================================
+ Hits         4730     4809      +79     
+ Misses       2766     2760       -6     
Impacted Files Coverage Δ
packages/sycamore/src/generic_node/ssr_node.rs 78.97% <ø> (ø)
packages/sycamore-macro/src/view/mod.rs 60.00% <50.00%> (-0.72%) ⬇️
packages/sycamore/src/view.rs 75.36% <94.44%> (+2.86%) ⬆️
packages/sycamore-macro/src/view/codegen.rs 95.94% <100.00%> (+0.04%) ⬆️
packages/sycamore-macro/src/view/ir.rs 100.00% <100.00%> (ø)
packages/sycamore-reactive/src/context.rs 100.00% <100.00%> (+17.18%) ⬆️
website/src/main.rs 0.58% <0.00%> (-0.02%) ⬇️

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 a71d31d...a75d805. Read the comment docs.

@lukechu10 lukechu10 merged commit 9b7ea15 into master Feb 17, 2022
@lukechu10 lukechu10 deleted the dyn-nested-ctx branch February 17, 2022 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macro Area: macros A-view Area: view! macro C-bug Category: bug, something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant