Skip to content
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

Find JSXElementChild in props #6019

Merged
merged 1 commit into from
Jun 21, 2024
Merged

Conversation

bkrmendy
Copy link
Contributor

@bkrmendy bkrmendy commented Jun 21, 2024

Specific bug:

We don't show the data reference section in the inspector when a literal-valued property is selected (like we do for literal-valued children)

Inspector with literal valued child, with data reference section:
image

Inspector with literal-valued property, without data reference section:
image

Cause/fix

findJSXElementChildAtPath, the utility function called when determining whether the data reference section should be shown for a specific selected element path, only returns a non-null JSXElementChild from props only if the prop is JSXElement-valued (even though the type would accomodate literal values too).

This PR removes the JSXElement restriction.

The result:

image

Manual tests

  • I swear that the Hydrogen store still loads and I can navigate

Copy link
Contributor

github-actions bot commented Jun 21, 2024

Try me

Copy link

relativeci bot commented Jun 21, 2024

#13197 Bundle Size — 62.26MiB (~+0.01%).

9437b4b(current) vs 6339ece master#13191(baseline)

Warning

Bundle contains 51 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#13197
     Baseline
#13191
Regression  Initial JS 45.33MiB(~+0.01%) 45.33MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 21.61% 21.58%
No change  Chunks 30 30
No change  Assets 33 33
No change  Modules 4305 4305
No change  Duplicate Modules 525 525
No change  Duplicate Code 31.84% 31.84%
No change  Packages 448 448
No change  Duplicate Packages 51 51
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
#13197
     Baseline
#13191
Regression  JS 62.25MiB (~+0.01%) 62.25MiB
Improvement  HTML 11.16KiB (-0.33%) 11.2KiB

Bundle analysis reportBranch fix/find-jsx-element-child-in-pr...Project dashboard

@bkrmendy bkrmendy marked this pull request as ready for review June 21, 2024 09:57
@bkrmendy bkrmendy merged commit 641ffc7 into master Jun 21, 2024
17 checks passed
@bkrmendy bkrmendy deleted the fix/find-jsx-element-child-in-prop branch June 21, 2024 10:11
liady pushed a commit that referenced this pull request Dec 13, 2024
## Specific bug:
We don't show the data reference section in the inspector when a
literal-valued property is selected (like we do for literal-valued
children)

Inspector with literal valued child, with data reference section:
<img width="1132" alt="image"
src="https://github.com/concrete-utopia/utopia/assets/16385508/9c0ac596-300a-4cbd-8591-a9e16ef04cbb">


Inspector with literal-valued property, without data reference section: 
<img width="1355" alt="image"
src="https://github.com/concrete-utopia/utopia/assets/16385508/7b4a4226-9cb2-415d-be05-f64c3922798a">

## Cause/fix
`findJSXElementChildAtPath`, the utility function called when
determining whether the data reference section should be shown for a
specific selected element path, only returns a non-null JSXElementChild
from props only if the prop is JSXElement-valued (even though the type
would accomodate literal values too).

This PR removes the JSXElement restriction.

The result:

<img width="1133" alt="image"
src="https://github.com/concrete-utopia/utopia/assets/16385508/f4d4c17a-0591-406b-ab0e-a25e5dd1d600">



### Manual tests
- [x] I swear that the Hydrogen store still loads and I can navigate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants