-
Notifications
You must be signed in to change notification settings - Fork 171
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
Fix subscribing mutation/resize observers during a build error #6344
Conversation
#14173 Bundle Size — 62.61MiB (~+0.01%).ee20966(current) vs 916e8b9 master#14171(baseline) Warning Bundle contains 70 duplicate packages – View duplicate packages Bundle metrics
|
Current #14173 |
Baseline #14171 |
|
---|---|---|
Initial JS | 45.74MiB (~+0.01% ) |
45.74MiB |
Initial CSS | 0B |
0B |
Cache Invalidation | 21.67% |
21.65% |
Chunks | 30 |
30 |
Assets | 33 |
33 |
Modules | 4385 |
4385 |
Duplicate Modules | 523 |
523 |
Duplicate Code | 31.65% |
31.65% |
Packages | 472 |
472 |
Duplicate Packages | 70 |
70 |
Bundle size by type 2 changes
1 regression
1 improvement
Current #14173 |
Baseline #14171 |
|
---|---|---|
JS | 62.6MiB (~+0.01% ) |
62.6MiB |
HTML | 11.12KiB (-0.32% ) |
11.16KiB |
Bundle analysis report Branch fix/observer-without-canvas-root Project dashboard
Generated by RelativeCI Documentation Report issue
windowToCanvasPosition: this.getPosition, | ||
cursor, | ||
}) | ||
const canvasControls = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I am only reading this code and haven't tried it yet, but doesn't this mean this will become another div that is mounted a bit higher in the tree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was always there. Balint has just updated this to use JSX syntax rather than React.createElement
**Problem:** Followup to #6326 In a Remix project it can happen that in the dispatch flow we don't have the results of the rendering in the dom yet. It can even happen, that after a build error is fixed, we still don't have the canvas root container in the dom. That is a critical issue, because we attach the mutation/resize observers to the canvas root container element, so when we don't have that we can subscribe them, so the dom sample is not going to run when the rendering is finished. **Fix:** I needed an element, which is an ancestor of the canvas root container and 1 is always rendered 2 does not contain canvas controls or other content I choose canvas-container-outer, but I needed to modify its ancestors so it is always rendered, even when there is a build error. To make sure we don't observe unnecessary elements, I filtered the query for the resize observer to only include elements with the `data-uid` attribute. I needed to update the tests to make sure the observers from the previous domwalkermutablestate don't continue to fire when there is a change, because the outer canvas container can stay persistent between test runs. **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 #6345
Problem:
Followup to #6326
In a Remix project it can happen that in the dispatch flow we don't have the results of the rendering in the dom yet. It can even happen, that after a build error is fixed, we still don't have the canvas root container in the dom.
That is a critical issue, because we attach the mutation/resize observers to the canvas root container element, so when we don't have that we can subscribe them, so the dom sample is not going to run when the rendering is finished.
Fix:
I needed an element, which is an ancestor of the canvas root container and
1 is always rendered
2 does not contain canvas controls or other content
I choose canvas-container-outer, but I needed to modify its ancestors so it is always rendered, even when there is a build error.
To make sure we don't observe unnecessary elements, I filtered the query for the resize observer to only include elements with the
data-uid
attribute.I needed to update the tests to make sure the observers from the previous domwalkermutablestate don't continue to fire when there is a change, because the outer canvas container can stay persistent between test runs.
Manual Tests:
I hereby swear that:
Fixes #6345