-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix #14 #15
Fix #14 #15
Conversation
5fd61cb
to
8f3e19f
Compare
I like it, but I have some new stuff being worked on in the next branch, might be good if you can rebase to that branch |
Sure! Won't be a problem for me. I will mark my PR to draft then. |
8f3e19f
to
de22afd
Compare
de22afd
to
dd5e7a9
Compare
I have rebased the PR based on the |
dd5e7a9
to
f12d131
Compare
Thanks! I can merge this right now however I still needed a way to so that it all works on all forms of expression, not just call expressions. |
Yeah, I just noticed that as well. And I have created a minimum reproduction: import { useA, useB, useC, useD, useE } from 'something';
function Example(props) {
return useA(useB(), [useC()], { d: useD() }, ...useE());
} |
ideally what we wanted here is to prevent generating/hoisting the dependencies but rather inlining it while partially memoizing the entire thing. In this case here it's not exactly memoizable because the rest doesn't have a constant part. |
Yeah. But not only nested hook calls: function Example(props) {
let a = null;
return { [useA()]: useB(), ...useC(), [\`testA\${useH()}testB\`]: useI() === useJ() }
} forgetti currently can not handle this as well. I am working on #15 to see if I am able to fix this. |
The PR fixes #14, and unblocks toeverything/AFFiNE#2257.
cc @himself65