-
Notifications
You must be signed in to change notification settings - Fork 142
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
💥 [RUMF-730] prefer object and type alias over enum in APIs #630
Conversation
3c1c9c4
to
48e3786
Compare
reasoning: make APIs easier to use with TypeScript by using directly constants instead of importing our enums
48e3786
to
32ddb6d
Compare
Codecov Report
@@ Coverage Diff @@
## bcaudan/v2 #630 +/- ##
==============================================
- Coverage 87.33% 87.25% -0.08%
==============================================
Files 54 54
Lines 2440 2425 -15
Branches 512 508 -4
==============================================
- Hits 2131 2116 -15
Misses 309 309
Continue to review full report at Codecov.
|
4d148fc
to
1980845
Compare
IMO it would be simpler to completely remove const SOURCE_AGENT = 'agent' as const This would result in a smaller code output, and avoid having two "types" for the same values (ex: WDYT? |
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.
LGTM!
Oh no why did you remove types? We need to duplicate type on our own now :( |
discussion moved to #654 |
Motivation
make APIs easier to use with TypeScript by avoiding to import our enums
before
after
Changes
replace enum usage in APIs by object and type alias
before
after
Testing
ci
I have gone over the contributing documentation.