-
Notifications
You must be signed in to change notification settings - Fork 6
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
Use non-forked rrweb #34
Conversation
d1f4b0d
to
2c9503f
Compare
012ea55
to
486d853
Compare
486d853
to
c2038b3
Compare
"@segment/analytics-node": "^1.1.0", | ||
"fs-extra": "^11.1.1", | ||
"mime": "^3.0.0", | ||
"rrweb-snapshot": "^2.0.0-alpha.4", |
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.
rrweb is up to like alpha.11
, but alpha.4
is the one published as latest
.
@@ -30,8 +30,7 @@ export class ArchiveFile { | |||
} | |||
|
|||
originalSrc() { | |||
// Assets that we capture will be stripped of the domain in the source | |||
return `${this.url.pathname}${this.url.search}`; | |||
return this.url.toString(); |
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 is the main change required after all of the previous asset mapping work. We're now expecting all asset paths to be full URLs since that's what rrweb does, so we don't strip off the protocol and origin here anymore.
}, | ||
}, | ||
{ | ||
type: NodeType.Element, | ||
attributes: { | ||
src: '/img?src=some-path', | ||
src: 'http://localhost:3000/img?src=some-path', |
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.
Do we save the URLs like this in the archives or as relative paths? If we save as absolutes, that would be a non-starter.
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.
The asset archive is built by watching network requests, so they are always the full URL there. This change makes it easier to match the assets from the archive with the attributes in the DOM since both sides will be full URLs now.
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.
Let me rephrase my question.
What happens when you render in the Capture Cloud? Do the archives try to pull from a relative path or http://localhost:3000? The localhost lookup will not work in the capture cloud so those need to be replaced by relative paths
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.
Ah yeah, they are relative in the archive storybook so that they load from the capture cloud. Otherwise all the images in the build would be broken!
@@ -18,6 +18,7 @@ | |||
<div><img src="/img?url=fixtures/pink.png"/></div> | |||
<div><img src="/img"/></div> | |||
<div><img src="/img/another"/></div> | |||
<div><img src="relative/purple.png"/></div> |
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.
@thafryer added that relative path test for AP-3789
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.
LGTM!
🚀 PR was released in |
Issue: CAP-1192
What Changed
Use standard, non-forked rrweb.
How to test
Change Type
maintenance
documentation
patch
minor
major
📦 Published PR as canary version:
0.0.38--canary.34.22b8530.0
✨ Test out this PR locally via: