-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Problem:** When you have a list which returns fragments, the fragments and their descendants don't have metadata (and they don't appear in the navigator): <img width="803" alt="image" src="https://github.com/user-attachments/assets/cf968e6a-592b-4bc6-b73a-78d623e1a66d"> **Fix:** The problem is that fragments can not appear in ElementsWithin: <img width="574" alt="image" src="https://github.com/user-attachments/assets/c879605f-8399-45f2-8785-7edf457e149f"> The fix is to change the type ElementsWithin to contain JSXElementLike values. **Notes:** We don't store the props of fragments, so all the data-uid processing parts don't work for fragments. Moreover, we actually lose any props provided to fragments, even though it is possible to give props to longform fragments. Potential followup tasks - [ ] Do we need to extend ElementsWithin to JSXElementChild? What I see e.g. is that embedded lists are merged into a single long list, which may be connected the incorrect elementsWithin of the outer list (because it should contain the inner list itself) <img width="736" alt="image" src="https://github.com/user-attachments/assets/1d3cabb8-8582-411e-9fa6-ffa3dd1b6786"> - [ ] Rethink the decision that JSXFragment is a separate type from JSXElement, or at least give longform JSXFragments props. With our current solution data-uid attribute of fragments can not work well. - [ ] There is another suspicious part that JSExpression-s can not be fragments neither. Check if this causes any problems or not - [ ] Render props can only be JSXElements too, extend that to JSXElementChild **Manual Tests:** I hereby swear that: - [x] I opened a hydrogen project and it loaded - [x] I could navigate to various routes in Preview mode Fixes #5763
- Loading branch information
Showing
14 changed files
with
257 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.