fix: remote CSS does not get rebuilt properly#1618
fix: remote CSS does not get rebuilt properly#1618YunFeng0817 merged 4 commits intorrweb-io:masterfrom
Conversation
This fixes an issue where inlined CSS from a remotely loaded `<link>` does not get applied properly due to object reference mutation.
🦋 Changeset detectedLatest commit: f398551 The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
I can't make changes directly on this branch; Would you be able to
|
|
The Object.assign bit was introduced in #995 |
|
@billyvg The only difference is that Object.assign overwrites the attribute value in the mirror. Your change does not change the meta in the mirror. |
|
@YunFeng0817 Yeah so I'm not sure if we are relying on changing the meta in the mirror elsewhere. The reason for this change is as follows: |
|
@billyvg Thank you for the clean explanation. I now understand the cause of the issue. Can you add to the place after the newNode is created? This can keep the mirror sync with Dom status |
f398551 to
35b8eaf
Compare
|
@YunFeng0817 Updated! |
* fix: remote CSS does not get rebuilt properly This fixes an issue where inlined CSS from a remotely loaded `<link>` does not get applied properly due to object reference mutation. * add changeset * ci-cd on ubuntu-22.04 instead of latest * keep mirror meta synced
## Changes Adopts upstream rrweb [PR #1618](rrweb-io/rrweb#1618). When replaying attribute mutations on `<link>` elements with remote CSS, `buildNodeWithSN()` was called after `Object.assign()` mutated the mirror's attribute references in-place. This caused subsequent checks to fail because the mirror's metadata had been overwritten. Fix: call `buildNodeWithSN()` first with a spread copy of the attributes, then mutate `newSn.attributes` afterward to keep the mirror in sync without affecting the build step. Part of #147.
This fixes an issue where inlined CSS from a remotely loaded
<link>does not get applied properly due to object reference mutation.