-
Notifications
You must be signed in to change notification settings - Fork 289
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
Add some more details about batch #592
Conversation
Run & review this pull request in StackBlitz Codeflow. |
✅ Deploy Preview for solid-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Please hold this PR we are still trying to clarify some points that may or may not lead to some small change. |
If it's not ready for review, please put it as a draft! |
e2507de
to
e132394
Compare
hey @titoBouzout , I lost track of this convo. What came out of it? |
…gnals in batch, and reference to batch from create-effect
e132394
to
de39208
Compare
Top level effects aren't batched, regular effects are batched. The idea was to batch them all to make them consistent. While the change is welcome solidjs/solid#2107 this probably will take effect on solid 2.0 to avoid unnecessary behavior changes, which sounds like a sensible option and this pr could probably be reviewed I guess |
Is this PR still valid? |
Looks like I dropped the ball on this one, I'll add the distinction between top level and component level and reopen it. |
Note that some of this is getting addressed in #982, so perhaps best to wait for that to land first. |
@edemaine sure. |
@mosheduminer I ended up having to fix some bugs in #982, so while I was at it, I tried to incorporate your changes into that PR (with commit coauthor credit). Do you want to take a look (last two commits) and confirm that it looks good to you? If so, I think we can merge that PR and close this PR. |
@edemaine thanks! Looks good, except the behavior (introduced in 1.4) of returning the non-stale value is true for both signals and memos (both used), but your edit only mentions memos. I think it might be worthwhile to document the behavior as introduced for signals well, mainly so people looking can see that prior to 1.4 the behavior of signals was different. |
Good idea! Done. |
This PR is the follow up from a conversation in the discord, where someone tested the behavior of
createEffect
and found it wasn'tbatch
ed. This PR addresses the confusion by documenting whencreateEffect
is automaticallybatch
ed, and when it isn't. It also adds another piece of information I felt was missing from thebatch
docs, namely the expected behavior when setting and then accessing a signal within abatch
. This behavior used to be different pre-v1.4 which makes it additionally useful as a documentation of a breaking change.In summary, this PR clarifies:
createEffect
is not batched outside root / at top level