Skip to content
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

Merged
merged 6 commits into from
Aug 27, 2024

Conversation

jerelmiller
Copy link
Member

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.

@jerelmiller jerelmiller requested a review from a team as a code owner August 26, 2024 20:35
@@ -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,
Copy link
Member Author

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.

Copy link

relativeci bot commented Aug 26, 2024

#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  Change 3 changes Regression 1 regression
                 Current
#815
     Baseline
#814
Regression  Initial JS 1.47MiB(+0.01%) 1.47MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 95.38% 0%
No change  Chunks 5 5
No change  Assets 12 12
No change  Modules 1218 1218
No change  Duplicate Modules 45 45
Change  Duplicate Code 3.12%(+1.96%) 3.06%
No change  Packages 183 183
No change  Duplicate Packages 10 10
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#815
     Baseline
#814
Regression  JS 1.47MiB (+0.01%) 1.47MiB
No change  IMG 35.85KiB 35.85KiB
No change  HTML 810B 810B
No change  Other 778B 778B

Bundle analysis reportBranch jerel/fix-json-serializeProject dashboard


Generated by RelativeCIDocumentationReport issue

Copy link
Member

@phryneas phryneas left a 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 :)

@phryneas phryneas merged commit 3a26412 into main Aug 27, 2024
9 checks passed
@phryneas phryneas deleted the jerel/fix-json-serialize branch August 27, 2024 08:19
@github-actions github-actions bot mentioned this pull request Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in the queries tab in apollo dev tools [Vue Application]
2 participants