Skip to content

ref(node): Make naming of http method wrappers clearer #2883

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

Conversation

lobsterkatie
Copy link
Member

This PR is purely cosmetic, but hopefully will make the code easier to read.

Two issues here:

  1. Typing a function which returns a function which takes a function and returns a function can get a little dizzying in TS, whether in the writing or the reading. Parentheses would help some, but Prettier removes them. Better to break up the endless chain of ( ): ( ) => ( ): ( ) => ( ): ( ) => ( ): ( ) => ( ): ( ) => ( ): ( ) => ( ): ( ) => ( ): ( ) => ( ) (I'm exaggerating, but you get the point) with some named types, both so it's clearer what belongs to what but also so it's more obvious what each bit is for.

  2. The word "wrapper" in English is ambiguous, in that it can mean either the entity doing the wrapping or the outer layer which said entity applies to the wrapped item. To add to the confusion, we (English speakers) sometimes employ a synecdoche and refer to to the wrapped item as a "wrapper," because even though both wrapper and wrappee are there, you can only see the wrapper. Mad props to anyone who has to learn our ridiculous tongue.

The end result here is a tiny bit awkward-sounding, but hopefully easier to parse and harder to get misled by.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2020

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 17.68 KB (0%)
@sentry/browser - Webpack 18.47 KB (0%)
@sentry/react - Webpack 18.47 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 22.79 KB (-0.01% 🔽)

@kamilogorek kamilogorek merged commit 4c8112f into master Sep 9, 2020
@kamilogorek kamilogorek deleted the kmclb-wrappers-making-wrappers-wrapping-handlers branch September 9, 2020 15:02
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