-
Notifications
You must be signed in to change notification settings - Fork 131
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
⚗️✨ [RUM-4469] introduce an experimental React integration #2824
Conversation
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
import { appendElement } from '../../rum-core/test' | ||
import { registerCleanupTask } from '../../core/test' | ||
|
||
export function appendComponent(component: React.ReactNode) { |
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.
👏 praise: Very nice way to test React components!
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! I tested it on a custom test app that I created for the occasion and everything seems to work as expected!
I just realised that in my test app I'm getting a type error: error TS2345: Argument of type 'import("/Users/nazim.saouli/test-react-app/node_modules/@remix-run/router/dist/router").Router' is not assignable to parameter of type 'import("/Users/nazim.saouli/go/src/github.com/DataDog/browser-sdk/node_modules/@remix-run/router/dist/router").Router'.
Types of property '_internalActiveDeferreds' are incompatible.
Type 'Map<string, import("/Users/nazim.saouli/test-react-app/node_modules/@remix-run/router/dist/utils").DeferredData>' is not assignable to type 'Map<string, import("/Users/nazim.saouli/go/src/github.com/DataDog/browser-sdk/node_modules/@remix-run/router/dist/utils").DeferredData>'.
Type 'import("/Users/nazim.saouli/test-react-app/node_modules/@remix-run/router/dist/utils").DeferredData' is not assignable to type 'import("/Users/nazim.saouli/go/src/github.com/DataDog/browser-sdk/node_modules/@remix-run/router/dist/utils").DeferredData'.
Types have separate declarations of a private property 'pendingKeysSet'.
13 registerRouter(router);
~~~~~~ EDIT: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2824 +/- ##
==========================================
+ Coverage 93.10% 93.20% +0.09%
==========================================
Files 248 258 +10
Lines 7242 7353 +111
Branches 1624 1645 +21
==========================================
+ Hits 6743 6853 +110
- Misses 499 500 +1 ☔ View full report in Codecov by Sentry. |
For consistency with `useRoutes` and `Routes`, let's expose pre-wrapped functions to create routers. It's a bit easier to use, and we'll see if we need to expose the "registerRouter" capability in the future.
a756b49
to
b6bb516
Compare
c25a0c2
to
6be99ea
Compare
6be99ea
to
f842c5b
Compare
Action not found: staging If you need support, contact us on Slack #devflow! |
/to-staging |
🚂 Branch Integration: starting soon, median merge time is 0s Commit b228575b7c will soon be integrated into staging-26. Use |
Integrated commit sha: b228575 Co-authored-by: Benoît Zugmeyer <benoit.zugmeyer@datadoghq.com>
🚂 Branch Integration: This commit was successfully integrated Commit b228575b7c has been merged into staging-26 in merge commit d7bd0cffcd. Check out the triggered pipeline on Gitlab 🦊 |
Motivation
Easily instrument a React application with the RUM SDK.
Changes
This PR introduce a new
@datadog/browser-rum-react
package, with error tracking and react-router integration capabilities. More to come in the future.Please review commit by commit.
Testing
I have gone over the contributing documentation.