Skip to content

ref(types): Verbosify envelope types #4609

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

Merged
merged 3 commits into from
Feb 23, 2022
Merged

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Feb 18, 2022

This PR refactors our Envelope types, with the goal of both slightly simplifying the implementation and (primarily) moving from having values inlined to assigning them to variables, in order to make it easier to see how all of the parts fit together.

Notes:

  • In addition to the envelope types, there are two new types, UserFeedback and ClientReport, representing the payloads of their respective envelope types.
  • Both envelope and item headers base types are now objects containing all optional and required properties (as well as an index signature allowing them to be extended). This allows us to avoid having to perform type intersections in the item and envelope types, thus making them easier to parse.
  • All formerly inlined values are split out into variables, in order to be able to use naming as a way to show exactly what's in each successive wrapper type.
  • All of the base types are exported in order to allow them to be extended in other SDKs. Also exported, primarily for the purposes of type casting, are the various item and envelope types. Header types aren't exported because they're internal to items and envelopes, which are the only two units upon which outside code should be acting.

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2022

size-limit report

Path Base Size (86a526a) Current Size Change
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.7 KB 19.7 KB -0.01% 🔽
@sentry/browser - ES5 CDN Bundle (minified) 63.31 KB 63.31 KB 0%
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.37 KB 18.37 KB +0.02% 🔺
@sentry/browser - ES6 CDN Bundle (minified) 56.48 KB 56.48 KB 0%
@sentry/browser - Webpack (gzipped + minified) 22.16 KB 22.16 KB 0%
@sentry/browser - Webpack (minified) 76.18 KB 76.18 KB 0%
@sentry/react - Webpack (gzipped + minified) 22.19 KB 22.19 KB 0%
@sentry/nextjs Client - Webpack (gzipped + minified) 46.33 KB 46.33 KB 0%
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 27.16 KB 27.16 KB 0%

@AbhiPrasad AbhiPrasad enabled auto-merge (squash) February 23, 2022 13:57
@AbhiPrasad AbhiPrasad merged commit 8e4e671 into master Feb 23, 2022
@AbhiPrasad AbhiPrasad deleted the kmclb-verbosify-envelope-types branch February 23, 2022 14:10
@AbhiPrasad AbhiPrasad added this to the Pre 7.0.0 Work milestone Feb 23, 2022
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.

2 participants