-
Notifications
You must be signed in to change notification settings - Fork 168
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 issue cloning objects when sending client payloads - attempt 2 #1488
Conversation
@@ -50,7 +50,9 @@ type Hook = { | |||
const DEVTOOLS_KEY = Symbol.for("apollo.devtools"); | |||
|
|||
const tab = createWindowActor(window); | |||
const messageAdapter = createWindowMessageAdapter(window); | |||
const messageAdapter = createWindowMessageAdapter(window, { | |||
jsonSerialize: true, |
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.
We only need to do this for the data sent from the client into the extension since we control the payloads from the extension to this script and can better guarantee we're always sending serializable values.
#815 Bundle Size — 1.51MiB (+0.01%).5bdbf5c(current) vs aca71ee main#814(baseline) Warning Bundle contains 13 duplicate packages – View duplicate packages Bundle metrics
Bundle size by type
Bundle analysis report Branch jerel/fix-json-serialize Project dashboard Generated by RelativeCI Documentation Report issue |
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.
Looks good to me - I'll get this merged and published asap :)
Fixes #1479
Attempt 2 at fixing the issue of sending data from the client into devtools. This solution opts to
JSON.parse(JSON.stringify(...))
every message sent from the injected script so that we don't forget to do this for additional payloads in the future.