-
Notifications
You must be signed in to change notification settings - Fork 135
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
feat(rum-react): use correct path when route is path array #800
feat(rum-react): use correct path when route is path array #800
Conversation
vigneshshanmugam
commented
May 27, 2020
- fix Support path array #702
- Uses the current path from router history if the path is provided as an array. Since the component is re rendered on other path mount, we wont create transaction as its the correct behaviour.
@@ -149,8 +149,8 @@ | |||
"puppeteer": "^1.20.0", | |||
"react": "^16.2.0", | |||
"react-dom": "^16.2.0", | |||
"react-router": "^4.2.0", | |||
"react-router-dom": "^4.2.2", | |||
"react-router": "^5.2.0", |
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.
path array is supported from version 5, so updated to latest to test. We dont use any breaking changes so should be good here.
💚 Build SucceededExpand to view the summary
Build stats
Test stats 🧪
Steps errorsExpand to view the steps failures
|
Codecov Report
@@ Coverage Diff @@
## master #800 +/- ##
==========================================
+ Coverage 92.26% 92.58% +0.31%
==========================================
Files 50 51 +1
Lines 2341 2535 +194
Branches 488 553 +65
==========================================
+ Hits 2160 2347 +187
- Misses 178 185 +7
Partials 3 3
|
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 feature seems very specific to ApmRoute
so I think it would be easier if getTransactionName
was implement in ApmRoute and send the correct name to withTransaction (would also avoid using getTransactionName
)
I also considered if this would be useful for withTransaction
alone, but I don't think there's a valid use-case for that. WDYT?
@jahtalab We will not be able to capture the current matched route in the So the only way I found was to compute the matched path inside our higher order component Hope this explains the reason for doing it inside
This is not the use case i was trying to address. So we can eliminate this requirement. |
Thanks for the background @vigneshshanmugam , My suggestion is to extend the functionality of
This has the added advantage that users can add keys from props to transaction labels if needed. |
Good suggestion. I like the approach, Let me change the PR to account for it. |
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.
@vigneshshanmugam, I had a quick look, generally looks good, just a few comments!
* upstream/master: (23 commits) feat(rum-core): capture XHR/Fetch spans using resource timing (elastic#825) docs: update set-up.asciidoc (elastic#814) chore: remove compressed size gh workflow (elastic#828) feat: use page visibilityState for browser responsiveness check (elastic#813) ci(jenkins): report bundlesize as a GitHub comment (elastic#826) docs: release notes for 5.2.1 (elastic#824) chore(release): publish fix(rum-core): protect aganist buggy navigation timing data (elastic#819) fix(rum-core): protect aganist buggy navigation timing data (elastic#819) chore(rum-core): use startTime for LCP marks (elastic#815) fix(rum-core): capture tbt after all task entries are observed (elastic#803) feat(rum-react): use correct path when route is path array (elastic#800) ci: enable benchmark on a PR basis (elastic#812) ci: use dockerLogs step (elastic#810) fix: env var invalid type (elastic#809) fix: workarount for elastic/beats#18858 (elastic#807) docs: add release notes for 5.2.0 (elastic#801) chore(release): publish fix(rum-core): consider user defined type of high precedence (elastic#798) fix(rum): use single instance of apm across all packages (elastic#796) ...
* feat(rum-react): use correct path when route is path array * feat: move logic in apmroute * chore: address review and add cb test * fix: change name only if defined