-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Separate $$ref
from $$cache
#30
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love that you made the effort. Added some reviews. Will consider this soon.
My only concerns would be:
- Part of my decision on dropping useMemo is, as we know, how useMemo potentially resets state. Based on my observation, this doesn't seem to be the case for the production behavior, but more of the development behavior (related to react-refresh). So my concern still stands, as it affects the DX.
- Minor thing is that this only solves RSC concern. But that's just "minor".
@@ -73,6 +73,7 @@ export default class Optimizer { | |||
createMemo( | |||
current: t.Expression, | |||
dependencies?: t.Expression | (t.Expression | undefined)[] | boolean, | |||
isUseRef = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe instead of a boolean, you can just pass the union type? You had multiple ternaries after this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in ab18140
(#30).
The new React Doc has explained when And that's exactly why React expects React also expects The PR makes the
Solving RSC compatibility is just a bonus as React's expectations have been met. |
@lxsmnsyc Kindly request your attention with a friendly ping. I applied the fix to your requested changes 2 weeks ago. I would appreciate it if you could review it at your convenience and provide valuable feedback. |
@SukkaW Sorry I've been kinda busy recently. I'll give it a read tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a little bit of README adjustment is needed. All looks good to me.
Okay looks good. I'll release this some time this week. |
The PR does 2 things:
useRef
touseMemo
for cache$$ref
to merging refsThis re-enables RSC support after 0.6.0.