Conversation
Job #115: Bundle Size — 1.09MiB (-3.14%).Warning Bundle contains 5 duplicate packages – View duplicate packages Bundle metrics
Bundle size by type
View job #115 report View pr/hook-no-gql branch activity View project dashboard |
| export type JSONPrimitive = boolean | null | string | number; | ||
| export type JSONObject = { [key in string]?: JSONValue }; | ||
| export type JSONValue = JSONPrimitive | JSONValue[] | JSONObject; |
There was a problem hiding this comment.
There were two slightly different definitions of that in the codebase - I retired this one.
| name: "ExplorerRequest"; | ||
| operationId: string; | ||
| operation: string; | ||
| variables: JSONValue; |
There was a problem hiding this comment.
This is definitely never an array or a primitive value ;)
| panelWindow.send({ | ||
| type: "explorerRequest", | ||
| payload: { | ||
| operation: gql(operation), | ||
| operationName, | ||
| variables, | ||
| fetchPolicy, | ||
| }, |
There was a problem hiding this comment.
Actually, no need to stringify this one.
Everything here already came in from a postMessage, so it's transportable. The only possible exception would be the DocumentNode itself, but that seems to work nicely with structuredClone.
| operation: event.data.operation, | ||
| operationName: event.data.operationName, | ||
| variables: event.data.variables, | ||
| variables: event.data.variables ?? undefined, |
There was a problem hiding this comment.
replacing a potential null with undefined.
jerelmiller
left a comment
There was a problem hiding this comment.
Mind adding a changeset for this one? Otherwise this looks great! What a great size savings here. Simple change but super effective 🚀
This moves the usage of
gqlout of the injectedhook.jsinto the DevTools panel.That should significantly reduce the amount of injected code.
🎉