-
Notifications
You must be signed in to change notification settings - Fork 52
[CHORE] [V3] Refactor Initialization APIs #1089
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
base: feature/v3
Are you sure you want to change the base?
[CHORE] [V3] Refactor Initialization APIs #1089
Conversation
…ortingEnabled and useAccesibilityLabel to rumConfiguration
…roviderConfiguration
* Refactored configurations and split them in separate modules * Allow initialization of individual features with extra options * Added missing properties in FileBasedConfiguration * Implemented missing JSON converters in FileBasedConfiguration * Fixed missing properties in various setups * Added missing tests and adjusted behavior
packages/core/src/sdk/DatadogProvider/__tests__/initialization.test.tsx
Outdated
Show resolved
Hide resolved
…og/dd-sdk-reactnative into marcosaia/chore/refactor-init-apis
…og/dd-sdk-reactnative into marcosaia/chore/refactor-init-apis
| ...rest | ||
| } = jsonConfiguration; | ||
|
|
||
| // TODO: Handle undefined clientToken, env or trackingConsent |
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.
Should we handle this before merging ? Or is this something that can go afterwards ? If not we should at create a JIRA ticket for this and add the ticket id here.
| this.rumConfiguration.actionEventMapper = | ||
| params?.actionEventMapper ?? RUM_DEFAULTS.actionEventMapper; | ||
| } else { | ||
| console.warn( |
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.
This seems like it could go unnoticed quite easily, should we not throw an error here instead ?
| const nativeLongTaskThresholdMs = | ||
| configuration.rumConfiguration?.nativeLongTaskThresholdMs || | ||
| false; | ||
| rumConfiguration.nativeLongTaskThresholdMs = adaptLongTaskThreshold( | ||
| nativeLongTaskThresholdMs | ||
| ); |
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.
Why are we defaulting to false here ?
const nativeLongTaskThresholdMs =
configuration.rumConfiguration?.nativeLongTaskThresholdMs ||
false;Seems this should be a number only property from the get go, because on the line after we call this function: adaptLongTaskThreshold, which puts the value to 0 if nativeLongTaskThresholdMs is falsy.
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.
Also seems that RUM_DEFAULTS has:
{
...
nativeLongTaskThresholdMs: 200,
...
}So why are we defaulting to false which then gets translated to 0, if the default is 200 ?
cdn34dd
left a comment
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.
Overall this looks good, just left a couple of comments regarding some implementation details.
What does this PR do?
Refactored configurations into separate modules
Support for initializing individual features with extra options
Added missing properties in
FileBasedConfigurationandAutoInstrumentationConfigurationImplemented missing JSON converters in FileBasedConfiguration
Added missing tests and adjusted behavior
Removed unrelated cyclic dependency in network-instrumentation layer
Review checklist (to be filled by reviewers)