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

Fill out layoutSystemForChildren in fixSpyOnlyMetadata #4374

Merged
merged 6 commits into from
Oct 17, 2023

Conversation

bkrmendy
Copy link
Contributor

@bkrmendy bkrmendy commented Oct 16, 2023

Problem

Pasting an element into an empty conditional inside a flex container pastes the element as absolute in an awkward place

Cause & fix

layoutSystemForChildren is not fixed up for conditionals, so the pasting logic thinks that it's a flow container with no global frame, so it bails out with a fallback and places the pasted element to top: 0, left: 0.

This is fixed by actually filling in layoutSystemForChildren for conditionals based on their ancestors (this is what fillLayoutSystemForChildrenFromAncestors does). This PR also changes the type of SpecialSizeMeasurements.layoutSystemForChildren to DetectedLayoutSystem | null.

Before vs after: https://screenshot.click/16-57-e1kpo-gh6fw.mp4

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2023

Try me

@relativeci
Copy link

relativeci bot commented Oct 16, 2023

Job #8685: Bundle Size — 63.28MiB (~+0.01%).

25ee7a1(current) vs 5957b21 master#8667(baseline)

Warning

Bundle contains 64 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
Job #8685
     Baseline
Job #8667
Regression  Initial JS 35.56MiB(~+0.01%) 35.56MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 18.9% 19.83%
No change  Chunks 28 28
No change  Assets 32 32
No change  Modules 4014 4014
No change  Duplicate Modules 455 455
No change  Duplicate Code 31.36% 31.36%
No change  Packages 409 409
No change  Duplicate Packages 64 64
Bundle size by type  Change 1 change Regression 1 regression
                 Current
Job #8685
     Baseline
Job #8667
Regression  JS 63.27MiB (~+0.01%) 63.27MiB
Not changed  HTML 11.54KiB 11.54KiB

View job #8685 reportView fix/conditionals-layout-system-f... branch activity

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2023

Performance test results:
(Chart1)
(Chart2)

@bkrmendy bkrmendy changed the title Fill out layoutSystemForChildren for conditionals Fill out layoutSystemForChildren in fixSpyOnlyMetadata Oct 16, 2023
@bkrmendy bkrmendy merged commit 6e179e2 into master Oct 17, 2023
@bkrmendy bkrmendy deleted the fix/conditionals-layout-system-for-children branch October 17, 2023 09:23
Copy link
Contributor

@Rheeseyb Rheeseyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

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.

4 participants