-
Notifications
You must be signed in to change notification settings - Fork 531
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(bindEvent): escape payload correctly #4670
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 3f29d79:
|
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.
reasonable fix!
You also think the |
it's probably not really an issue IMO, although a subset was already set with objectIDs, which you said was insufficient for segment |
What I meant by a subset was to pass an object made from It could bloat the html size and might be an issue in case of SSR. Even if so, they can omit some properties to avoid the issue. |
Summary
This PR updates the way we serialize & deserialize payloads for
bindEvent
. It's internal and users never got to deserialize by themselves, so it's not a breaking change.Details
Since "add hits and attributes to InsightsEvent" PR,
bindEvent
method now serializeshits
as well. Andhits
can contain special characters unlike the payloads that we used to have in insights middleware.For example,
but
A minor concern
It's actually not about this PR, but about the previous "add hits and attributes to InsightsEvent" PR.
Now that we expose
hits
toInsightsEvent
, its payload is much bigger than before. It's going to bloat the DOM output.When they have templates like
If they don't pass the whole
hit
object, and pass only a subset of it, it will reduce the size. What do you think?