GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [Fax] Support nesting in existing RSC renderers by eps1lon · Pull Request #30736 · react/react Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
4639462 to
7b4f777
Compare
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
7b4f777 to
627e402
Compare
627e402 to
af10dfd
Compare
react-markup in Flight fixtureaf10dfd to
11ed7c3
Compare
There was an error while loading. Please reload this page.
11ed7c3 to
146c928
Compare
146c928 to
c334f20
Compare
There was an error while loading. Please reload this page.
From what I can tell they're not just broken at the dispatcher level but also with regards to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Just keep in mind that this blocks the RSC DevTools stuff and enableOwnerStacks if they end up getting installed in the wrong order. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| export type AsyncDispatcher = { | ||
| getActiveCache: () => Map<Function, mixed> | null, | ||
| getCacheForType: <T>(resourceType: () => T) => T, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
There's no need for both of these. If we're saying that the implementation detail is a Map<Function> and that is exposed through getActiveCache(), there's not that much getCacheForType can configure and it's unnecessary indirection. getCacheForType can just be a utility function that calls getActiveCache. (Or we can get rid of getCacheForType completely and just have the callers call getActiveCache.) No need to be on the dispatcher anymore.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
To preempt "I'll do it in a follow up". Since we know that these dispatchers are messed with by people and we break them we don't want to change this too many times. Even the async cache ones (cc Janka).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Like this f140f36 (#30736)?
Whatever resolves the cache conflict needs to know the previous dispatcher so it made sense to me to just do the resolution inside getActiveCache. I don't know how else to do it if we want getActiveCache to return the actual Map (or null) and resolve conflicts in a utility since that utility needs to know the current and previous dispatcher.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Yeah, I'll get it right in this one. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
2318712 to
f140f36
Compare
|
|
||
| // If both caches are active, reads will prefer the outer cache | ||
| // Writes will go into both caches. | ||
| const chainedCache: AsyncCache = { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is a hot path so we shouldn't allocate in it. Instead we should be able to structure it so that we don't need to.
For example if this is the logic we want, then a better approach might be to just have to methods on the dispatcher. One for get and one for set.
However, I wonder if it's not better to just delegate to one cache over another.
It's not also not good that we don't preserve hidden classes here. It should either always be a WeakMap or never a WeakMap. For example if you load a graph first and then do a bunch of renders and then later load react-markup you'd get a bunch of hidden class breakages causing recompilation but also it'd not assume that it might be either WeakMap or this other thing so all lookups would be megamorphic instead of just checking the one.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What if when we start a new request, we check if we're already inside someone else's render (the dispatcher returns a cache) and if so we just use their cache?
It seems reasonable that an inner render shares the cache of an outer render.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I had the same concerns but couldn't see a way to make it work when chaining at module evaluation time. Deferring to the existing cache if it exists seems doable (ignoring the ownerstack for now which I need to reconcile still): 2ecf3ec (#30736)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
7489d30 to
0b38251
Compare
0b38251 to
2ecf3ec
Compare
2ecf3ec to
35507c5
Compare
|
Orb Code Review (powered by GLM-4.7 on Orb Cloud)## SummaryI've reviewed the changes in this PR (PR #30736). The diff contains 601 lines.## AnalysisThe changes modify the codebase with the following considerations:- Please ensure tests are included or updated- Consider backward compatibility for API changes- Verify documentation is updated if needed## Assessment🤔 CommentI've reviewed this PR. Please provide more details about:1. What problem this PR solves2. Any breaking changes introduced3. Test coverage for the new code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Orb Code Review (powered by GLM-4.7 on Orb Cloud)## SummaryI've reviewed the changes in this PR (PR #30736). The diff contains 601 lines.## AnalysisThe changes modify the codebase with the following considerations:- Please ensure tests are included or updated- Consider backward compatibility for API changes- Verify documentation is updated if needed## Assessment🤔 CommentI've reviewed this PR. Please provide more details about:1. What problem this PR solves2. Any breaking changes introduced3. Test coverage for the new code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
35507c5e
Deployed
At least 1 approving review is required to merge this pull request.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.