You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because lazy doesn't call the component function using JSX or createComponent it doesn't show up in the devtools properly.
This replaces the function call with devComponent if in dev mode.
Although it may be a bit odd, as devComponent is an internal-only api, and lazy should probably be fully implementable in userland, right?
Maybe there is a way to just use createComponent there, as the logic is very similar.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
My only concern with this is does this impact hydration.. like component counting mismatch. I haven't been able to verify but when we choose to create component vs not is usually very intentional for matching hydration IDs.
Thanks for the PR. The devtools issue is real: lazy currently bypasses the normal component creation path, so lazy-loaded components do not get the same dev metadata as regular JSX-created components.
I’m hesitant to merge this as-is for 1.x, though. lazy has always been a sensitive path for hydration, and switching from a direct component call to devComponent changes owner creation in dev mode. Hydration IDs/counting are very sensitive to where owners are created, so I’d want targeted SSR/hydration tests before making that change.
For Solid 2 this area has changed enough that this PR is stale it should be easy to implement because components no longer count towards ID. For 1.x, I think the issue is worth solving, but the fix needs to either prove hydration parity or use a metadata approach that does not alter the lazy component owner structure.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
lazydoesn't call the component function using JSX orcreateComponentit doesn't show up in the devtools properly.This replaces the function call with
devComponentif in dev mode.Although it may be a bit odd, as
devComponentis an internal-only api, andlazyshould probably be fully implementable in userland, right?Maybe there is a way to just use
createComponentthere, as the logic is very similar.