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

REPLACE_JSX_ELEMENT to preserve UID of element-to-be-replaced #5976

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

balazsbajorics
Copy link
Contributor

Problem:
When we Replace This or Replace Everything a selected element, the selection is lost.

Fix:
Turns out the code was straight up cleaning selected views to [].

Commit Details:

  • REPLACE_JSX_ELEMENT no longer changes EditorState.selectedViews
  • REPLACE_JSX_ELEMENT now takes the UID of the old element, and sets it as the UID of the new element

Copy link
Contributor

github-actions bot commented Jun 17, 2024

Try me

Copy link

relativeci bot commented Jun 17, 2024

#13105 Bundle Size — 62.23MiB (~+0.01%).

d73bdc5(current) vs 6339ece master#13104(baseline)

Warning

Bundle contains 51 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#13105
     Baseline
#13104
Regression  Initial JS 45.3MiB(~+0.01%) 45.3MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 21.58% 0%
No change  Chunks 30 30
No change  Assets 33 33
No change  Modules 4302 4302
No change  Duplicate Modules 523 523
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
#13105
     Baseline
#13104
Regression  JS 62.22MiB (~+0.01%) 62.22MiB
Improvement  HTML 11.16KiB (-0.33%) 11.2KiB

Bundle analysis reportBranch fix/replace-element-uid-lossProject dashboard

@balazsbajorics balazsbajorics linked an issue Jun 17, 2024 that may be closed by this pull request
@balazsbajorics balazsbajorics merged commit 0e67d44 into master Jun 17, 2024
16 checks passed
@balazsbajorics balazsbajorics deleted the fix/replace-element-uid-loss branch June 17, 2024 21:14
liady pushed a commit that referenced this pull request Dec 13, 2024
**Problem:**
When we Replace This or Replace Everything a selected element, the
selection is lost.

**Fix:**
Turns out the code was straight up cleaning selected views to [].

**Commit Details:** 
- REPLACE_JSX_ELEMENT no longer changes EditorState.selectedViews
- REPLACE_JSX_ELEMENT now takes the UID of the old element, and sets it
as the UID of the new element
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.

After replacing an element selection is lost
3 participants