-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(react): Add React Router Descendant Routes support. #14304
Conversation
5709dd9
to
d7e6a87
Compare
This comment was marked as outdated.
This comment was marked as outdated.
0dfe3a5
to
1d42620
Compare
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
84caae2
to
bcb1cc7
Compare
size-limit report 📦
|
586129a
to
fe0660b
Compare
fe0660b
to
89751f0
Compare
@@ -222,6 +227,7 @@ export function handleNavigation( | |||
version: V6CompatibleVersion, | |||
matches?: AgnosticDataRouteMatch, | |||
basename?: string, | |||
allRoutes?: RouteObject[], |
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.
M: I think it would make sense to pass the options as object because more than 3 options (and here we have 7) can get messy quickly. In the function usages in this PR undefined
has to be used a lot already and it's cleaner to just pass the params we need. Additionally, if we have to add required params in the future we have to update the usages of the function everywhere.
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.
Yes makes sense, updated 👍
function rebuildRoutePathFromAllRoutes(allRoutes: RouteObject[], location: Location): string { | ||
const matchedRoutes = _matchRoutes(allRoutes, location) as RouteMatch[]; | ||
|
||
if (matchedRoutes) { |
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.
L: we could do an early return here to reduce nesting. And it also makes the other return value more visible
if (matchedRoutes) { | |
if (!matchedRoutes?.length) { | |
return ''; | |
} |
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.
Updated 👍
return trimSlash( | ||
trimSlash(path || '') + | ||
prefixWithSlash( | ||
rebuildRoutePathFromAllRoutes( |
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.
How high is the possibility to run into performance issues here? As this runs recursively.
If we are just considering routes that have a usual, not to crazy length it should be fine though.
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.
I think it's very unlikely that the route definitions would get too deep, especially when the routes are descendant. We only run this when the route accessed falls inside a descendant route.
We noticed this in Sentry's `/issues/:groupId/` route, which uses SDK v8.43.0. The full route tree is complex, but the relevant parts are: ```js <Route path="/" element={<div>root</div>}> <Route path="/issues/:groupId/" element={<div>issues group</div>}> <Route index element={<div>index</div>} /> </Route> </Route> ``` If you navigate to e.g. `/issues/123` (no trailing slash), the recorded transaction name is `//issues/:groupId/` (notice the double slash). This looks messy but doesn't have too much of a consequence. The worse issue is when you navigate to e.g. `/issues/123/` (with trailing slash), the transaction name is `/issues/123/` - it is not parameterized. This breaks transaction grouping. On the `master` and `develop` branch of the SDK, the transaction name is recorded as `/`. This causes the transactions to be grouped incorrectly with the root, as well as any other routes nested under a route with `path="/"`. (Thanks @JoshFerge for noticing the bad data in Sentry! 🙌) --- Note that this commit effectively reverts a change from #14304 where ```js if (basename + branch.pathname === location.pathname) { ``` became ```js if (location.pathname.endsWith(basename + branch.pathname)) { ``` This is the change that caused the difference in results between SDK versions. This will always match when `basename` is empty, `branch.pathname` is `/`, and `location.pathname` ends with `/` - in other words, if you have a parent route with `path="/"`, every request ending in a slash will match it instead of the more specific child route. (Depending on how often this kind of `Route` nesting happens in the wild, this could be a wide regression in transaction names.) But, no tests failed from the removal of `endsWith`. @onurtemizkan, who wrote the change in question: > I'd expect this to break descendant routes. But in the final > implementation, descendant routes don't end up here. So, I > believe it's safe to revert.
We noticed this in Sentry's `/issues/:groupId/` route, which uses SDK v8.43.0. The full route tree is complex, but the relevant parts are: ```js <Route path="/" element={<div>root</div>}> <Route path="/issues/:groupId/" element={<div>issues group</div>}> <Route index element={<div>index</div>} /> </Route> </Route> ``` If you navigate to e.g. `/issues/123` (no trailing slash), the recorded transaction name is `//issues/:groupId/` (notice the double slash). This looks messy but doesn't have too much of a consequence. The worse issue is when you navigate to e.g. `/issues/123/` (with trailing slash), the transaction name is `/issues/123/` - it is not parameterized. This breaks transaction grouping. On the `master` and `develop` branch of the SDK, the transaction name is recorded as `/`. This causes the transactions to be grouped incorrectly with the root, as well as any other routes nested under a route with `path="/"`. (Thanks @JoshFerge for noticing the bad data in Sentry! 🙌) --- Note that this commit effectively reverts a change from #14304 where ```js if (basename + branch.pathname === location.pathname) { ``` became ```js if (location.pathname.endsWith(basename + branch.pathname)) { ``` This is the change that caused the difference in results between SDK versions. This will always match when `basename` is empty, `branch.pathname` is `/`, and `location.pathname` ends with `/` - in other words, if you have a parent route with `path="/"`, every request ending in a slash will match it instead of the more specific child route. (Depending on how often this kind of `Route` nesting happens in the wild, this could be a wide regression in transaction names.) But, no tests failed from the removal of `endsWith`. @onurtemizkan, who wrote the change in question: > I'd expect this to break descendant routes. But in the final > implementation, descendant routes don't end up here. So, I > believe it's safe to revert.
We noticed this in Sentry's `/issues/:groupId/` route, which uses SDK v8.43.0. The full route tree is complex, but the relevant parts are: ```js <Route path="/" element={<div>root</div>}> <Route path="/issues/:groupId/" element={<div>issues group</div>}> <Route index element={<div>index</div>} /> </Route> </Route> ``` If you navigate to e.g. `/issues/123` (no trailing slash), the recorded transaction name is `//issues/:groupId/` (notice the double slash). This looks messy but doesn't have too much of a consequence. The worse issue is when you navigate to e.g. `/issues/123/` (with trailing slash), the transaction name is `/issues/123/` - it is not parameterized. This breaks transaction grouping. On the `master` and `develop` branch of the SDK, the transaction name is recorded as `/`. This causes the transactions to be grouped incorrectly with the root, as well as any other routes nested under a route with `path="/"`. (Thanks @JoshFerge for noticing the bad data in Sentry! 🙌) --- Note that this commit effectively reverts a change from #14304 where ```js if (basename + branch.pathname === location.pathname) { ``` became ```js if (location.pathname.endsWith(basename + branch.pathname)) { ``` This is the change that caused the difference in results between SDK versions. This will always match when `basename` is empty, `branch.pathname` is `/`, and `location.pathname` ends with `/` - in other words, if you have a parent route with `path="/"`, every request ending in a slash will match it instead of the more specific child route. (Depending on how often this kind of `Route` nesting happens in the wild, this could be a wide regression in transaction names.) But, no tests failed from the removal of `endsWith`. @onurtemizkan, who wrote the change in question: > I'd expect this to break descendant routes. But in the final > implementation, descendant routes don't end up here. So, I > believe it's safe to revert.
 <h3>Snyk has created this PR to upgrade @sentry/profiling-node from 8.43.0 to 8.47.0.</h3> :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project. <hr/> - The recommended version is **5 versions** ahead of your current version. - The recommended version was released **a month ago**. <details> <summary><b>Release notes</b></summary> <br/> <details> <summary>Package name: <b>@sentry/profiling-node</b></summary> <ul> <li> <b>8.47.0</b> - <a href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/8.47.0">2024-12-18</a></br><ul> <li>feat(v8/core): Add <code>updateSpanName</code> helper function (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2742710163" data-permission-text="Title is private" data-url="getsentry/sentry-javascript#14736" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14736/hovercard" href="https://redirect.github.com/getsentry/sentry-javascript/pull/14736">#14736</a>)</li> <li>feat(v8/node): Do not overwrite prisma <code>db.system</code> in newer Prisma versions (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2747169540" data-permission-text="Title is private" data-url="getsentry/sentry-javascript#14772" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14772/hovercard" href="https://redirect.github.com/getsentry/sentry-javascript/pull/14772">#14772</a>)</li> <li>feat(v8/node/deps): Bump @ prisma/instrumentation from 5.19.1 to 5.22.0 (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2744850994" data-permission-text="Title is private" data-url="getsentry/sentry-javascript#14755" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14755/hovercard" href="https://redirect.github.com/getsentry/sentry-javascript/pull/14755">#14755</a>)</li> <li>feat(v8/replay): Mask srcdoc iframe contents per default (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2747500508" data-permission-text="Title is private" data-url="getsentry/sentry-javascript#14779" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14779/hovercard" href="https://redirect.github.com/getsentry/sentry-javascript/pull/14779">#14779</a>)</li> <li>ref(v8/nextjs): Fix typo in source maps deletion warning (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2747300057" data-permission-text="Title is private" data-url="getsentry/sentry-javascript#14776" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14776/hovercard" href="https://redirect.github.com/getsentry/sentry-javascript/pull/14776">#14776</a>)</li> </ul> <p>Work in this release was contributed by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/aloisklink/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://redirect.github.com/aloisklink">@ aloisklink</a> and <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/benjick/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://redirect.github.com/benjick">@ benjick</a>. Thank you for your contributions!</p> <h2>Bundle size 📦</h2> <table> <thead> <tr> <th>Path</th> <th>Size</th> </tr> </thead> <tbody> <tr> <td>@ sentry/browser</td> <td>23.29 KB</td> </tr> <tr> <td>@ sentry/browser - with treeshaking flags</td> <td>21.96 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing)</td> <td>35.81 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay)</td> <td>73.06 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking flags</td> <td>63.45 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td> <td>77.37 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td> <td>89.85 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Feedback)</td> <td>40.04 KB</td> </tr> <tr> <td>@ sentry/browser (incl. sendFeedback)</td> <td>27.89 KB</td> </tr> <tr> <td>@ sentry/browser (incl. FeedbackAsync)</td> <td>32.68 KB</td> </tr> <tr> <td>@ sentry/react</td> <td>25.96 KB</td> </tr> <tr> <td>@ sentry/react (incl. Tracing)</td> <td>38.64 KB</td> </tr> <tr> <td>@ sentry/vue</td> <td>27.52 KB</td> </tr> <tr> <td>@ sentry/vue (incl. Tracing)</td> <td>37.67 KB</td> </tr> <tr> <td>@ sentry/svelte</td> <td>23.45 KB</td> </tr> <tr> <td>CDN Bundle</td> <td>24.47 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing)</td> <td>37.51 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay)</td> <td>72.71 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay, Feedback)</td> <td>78.1 KB</td> </tr> <tr> <td>CDN Bundle - uncompressed</td> <td>71.85 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing) - uncompressed</td> <td>111.23 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td> <td>225.3 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td> <td>238.52 KB</td> </tr> <tr> <td>@ sentry/nextjs (client)</td> <td>38.9 KB</td> </tr> <tr> <td>@ sentry/sveltekit (client)</td> <td>36.32 KB</td> </tr> <tr> <td>@ sentry/node</td> <td>162.7 KB</td> </tr> <tr> <td>@ sentry/node - without tracing</td> <td>98.87 KB</td> </tr> <tr> <td>@ sentry/aws-serverless</td> <td>126.53 KB</td> </tr> </tbody> </table> </li> <li> <b>8.46.0</b> - <a href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/8.46.0">2024-12-17</a></br><ul> <li>feat: Allow capture of more than 1 ANR event [v8] (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14713" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14713/hovercard">#14713</a>)</li> <li>feat(node): Detect Railway release name [v8] (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14714" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14714/hovercard">#14714</a>)</li> <li>fix: Normalise ANR debug image file paths if appRoot was supplied [v8] (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14709" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14709/hovercard">#14709</a>)</li> <li>fix(nuxt): Remove build config from tsconfig (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14737" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14737/hovercard">#14737</a>)</li> </ul> <p>Work in this release was contributed by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/conor-ob/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://redirect.github.com/conor-ob">@ conor-ob</a>. Thank you for your contribution!</p> <h2>Bundle size 📦</h2> <table> <thead> <tr> <th>Path</th> <th>Size</th> </tr> </thead> <tbody> <tr> <td>@ sentry/browser</td> <td>23.29 KB</td> </tr> <tr> <td>@ sentry/browser - with treeshaking flags</td> <td>21.96 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing)</td> <td>35.79 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay)</td> <td>73.01 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking flags</td> <td>63.41 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td> <td>77.32 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td> <td>89.81 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Feedback)</td> <td>40.04 KB</td> </tr> <tr> <td>@ sentry/browser (incl. sendFeedback)</td> <td>27.89 KB</td> </tr> <tr> <td>@ sentry/browser (incl. FeedbackAsync)</td> <td>32.68 KB</td> </tr> <tr> <td>@ sentry/react</td> <td>25.96 KB</td> </tr> <tr> <td>@ sentry/react (incl. Tracing)</td> <td>38.6 KB</td> </tr> <tr> <td>@ sentry/vue</td> <td>27.49 KB</td> </tr> <tr> <td>@ sentry/vue (incl. Tracing)</td> <td>37.63 KB</td> </tr> <tr> <td>@ sentry/svelte</td> <td>23.45 KB</td> </tr> <tr> <td>CDN Bundle</td> <td>24.43 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing)</td> <td>37.46 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay)</td> <td>72.64 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay, Feedback)</td> <td>78.01 KB</td> </tr> <tr> <td>CDN Bundle - uncompressed</td> <td>71.74 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing) - uncompressed</td> <td>111.05 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td> <td>225.1 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td> <td>238.32 KB</td> </tr> <tr> <td>@ sentry/nextjs (client)</td> <td>38.88 KB</td> </tr> <tr> <td>@ sentry/sveltekit (client)</td> <td>36.29 KB</td> </tr> <tr> <td>@ sentry/node</td> <td>162.53 KB</td> </tr> <tr> <td>@ sentry/node - without tracing</td> <td>98.72 KB</td> </tr> <tr> <td>@ sentry/aws-serverless</td> <td>126.4 KB</td> </tr> </tbody> </table> </li> <li> <b>8.45.1</b> - <a href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/8.45.1">2024-12-16</a></br><ul> <li>fix(feedback): Return when the <code>sendFeedback</code> promise resolves (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14683" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14683/hovercard">#14683</a>)</li> </ul> <p>Work in this release was contributed by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/antonis/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://redirect.github.com/antonis">@ antonis</a>. Thank you for your contribution!</p> <h2>Bundle size 📦</h2> <table> <thead> <tr> <th>Path</th> <th>Size</th> </tr> </thead> <tbody> <tr> <td>@ sentry/browser</td> <td>23.29 KB</td> </tr> <tr> <td>@ sentry/browser - with treeshaking flags</td> <td>21.96 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing)</td> <td>35.79 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay)</td> <td>73.01 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking flags</td> <td>63.41 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td> <td>77.32 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td> <td>89.81 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Feedback)</td> <td>40.04 KB</td> </tr> <tr> <td>@ sentry/browser (incl. sendFeedback)</td> <td>27.89 KB</td> </tr> <tr> <td>@ sentry/browser (incl. FeedbackAsync)</td> <td>32.68 KB</td> </tr> <tr> <td>@ sentry/react</td> <td>25.96 KB</td> </tr> <tr> <td>@ sentry/react (incl. Tracing)</td> <td>38.6 KB</td> </tr> <tr> <td>@ sentry/vue</td> <td>27.49 KB</td> </tr> <tr> <td>@ sentry/vue (incl. Tracing)</td> <td>37.63 KB</td> </tr> <tr> <td>@ sentry/svelte</td> <td>23.45 KB</td> </tr> <tr> <td>CDN Bundle</td> <td>24.43 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing)</td> <td>37.46 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay)</td> <td>72.64 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay, Feedback)</td> <td>78.01 KB</td> </tr> <tr> <td>CDN Bundle - uncompressed</td> <td>71.74 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing) - uncompressed</td> <td>111.05 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td> <td>225.1 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td> <td>238.32 KB</td> </tr> <tr> <td>@ sentry/nextjs (client)</td> <td>38.88 KB</td> </tr> <tr> <td>@ sentry/sveltekit (client)</td> <td>36.29 KB</td> </tr> <tr> <td>@ sentry/node</td> <td>162.52 KB</td> </tr> <tr> <td>@ sentry/node - without tracing</td> <td>98.71 KB</td> </tr> <tr> <td>@ sentry/aws-serverless</td> <td>126.39 KB</td> </tr> </tbody> </table> </li> <li> <b>8.45.0</b> - <a href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/8.45.0">2024-12-13</a></br><ul> <li>feat(core): Add <code>handled</code> option to <code>captureConsoleIntegration</code> (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14664" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14664/hovercard">#14664</a>)</li> <li>feat(browser): Attach virtual stack traces to <code>HttpClient</code> events (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14515" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14515/hovercard">#14515</a>)</li> <li>feat(replay): Upgrade rrweb packages to 2.31.0 (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14689" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14689/hovercard">#14689</a>)</li> <li>fix(aws-serverless): Remove v8 layer as it overwrites the current layer for docs (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14679" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14679/hovercard">#14679</a>)</li> <li>fix(browser): Mark stack trace from <code>captureMessage</code> with <code>attachStacktrace: true</code> as synthetic (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14668" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14668/hovercard">#14668</a>)</li> <li>fix(core): Mark stack trace from <code>captureMessage</code> with <code>attatchStackTrace: true</code> as synthetic (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14670" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14670/hovercard">#14670</a>)</li> <li>fix(core): Set <code>level</code> in server runtime <code>captureException</code> (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/10587" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/10587/hovercard">#10587</a>)</li> <li>fix(profiling-node): Guard invocation of native profiling methods (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14676" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14676/hovercard">#14676</a>)</li> <li>fix(nuxt): Inline nitro-utils function (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14680" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14680/hovercard">#14680</a>)</li> <li>fix(profiling-node): Ensure profileId is added to transaction event (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14681" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14681/hovercard">#14681</a>)</li> <li>fix(react): Add React Router Descendant Routes support (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14304" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14304/hovercard">#14304</a>)</li> <li>fix: Disable ANR and Local Variables if debugger is enabled via CLI args (<a href="https://redirect.github.com/getsentry/sentry-javascript/pull/14643" data-hovercard-type="pull_request" data-hovercard-url="/getsentry/sentry-javascript/pull/14643/hovercard">#14643</a>)</li> </ul> <p>Work in this release was contributed by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/anonrig/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://redirect.github.com/anonrig">@ anonrig</a> and <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Zih0/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://redirect.github.com/Zih0">@ Zih0</a>. Thank you for your contributions!</p> <h2>Bundle size 📦</h2> <table> <thead> <tr> <th>Path</th> <th>Size</th> </tr> </thead> <tbody> <tr> <td>@ sentry/browser</td> <td>23.29 KB</td> </tr> <tr> <td>@ sentry/browser - with treeshaking flags</td> <td>21.96 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing)</td> <td>35.79 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay)</td> <td>73.01 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking flags</td> <td>63.41 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td> <td>77.32 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td> <td>89.81 KB</td> </tr> <tr> <td>@ sentry/browser (incl. Feedback)</td> <td>40.04 KB</td> </tr> <tr> <td>@ sentry/browser (incl. sendFeedback)</td> <td>27.89 KB</td> </tr> <tr> <td>@ sentry/browser (incl. FeedbackAsync)</td> <td>32.69 KB</td> </tr> <tr> <td>@ sentry/react</td> <td>25.96 KB</td> </tr> <tr> <td>@ sentry/react (incl. Tracing)</td> <td>38.6 KB</td> </tr> <tr> <td>@ sentry/vue</td> <td>27.49 KB</td> </tr> <tr> <td>@ sentry/vue (incl. Tracing)</td> <td>37.63 KB</td> </tr> <tr> <td>@ sentry/svelte</td> <td>23.45 KB</td> </tr> <tr> <td>CDN Bundle</td> <td>24.43 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing)</td> <td>37.46 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay)</td> <td>72.64 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay, Feedback)</td> <td>78.01 KB</td> </tr> <tr> <td>CDN Bundle - uncompressed</td> <td>71.74 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing) - uncompressed</td> <td>111.05 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td> <td>225.1 KB</td> </tr> <tr> <td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td> <td>238.32 KB</td> </tr> <tr> <td>@ sentry/nextjs (client)</td> <td>38.89 KB</td> </tr> <tr> <td>@ sentry/sveltekit (client)</td> <td>36.29 KB</td> </tr> <tr> <td>@ sentry/node</td> <td>162.52 KB</td> </tr> <tr> <td>@ sentry/node - without tracing</td> <td>98.71 KB</td> </tr> <tr> <td>@ sentry/aws-serverless</td> <td>126.38 KB</td> </tr> </tbody> </table> </li> <li> <b>8.44.0</b> - 2024-12-12 </li> <li> <b>8.43.0</b> - 2024-12-10 </li> </ul> from <a href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/profiling-node GitHub release notes</a> </details> </details> --- > [!IMPORTANT] > > - Check the changes in this PR to ensure they won't cause issues with your project. > - This PR was automatically created by Snyk using the credentials of a real user. --- **Note:** _You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs._ **For more information:** <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJkODM5YmMwYi00ZGY4LTQ5ZTctYjAyZS0wMjJmNTIxYjc2NGYiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImQ4MzliYzBiLTRkZjgtNDllNy1iMDJlLTAyMmY1MjFiNzY0ZiJ9fQ==" width="0" height="0"/> > - 🧐 [View latest project report](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr) > - 📜 [Customise PR templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template) > - 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr) > - 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?pkg=@sentry/profiling-node&utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr#auto-dep-upgrades) [//]: # 'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/profiling-node","from":"8.43.0","to":"8.47.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"d839bc0b-4df8-49e7-b02e-022f521b764f","prPublicId":"d839bc0b-4df8-49e7-b02e-022f521b764f","packageManager":"npm","priorityScoreList":[],"projectPublicId":"55e114f8-489e-4f14-b900-20574b041e59","projectUrl":"https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":5,"publishedDate":"2024-12-18T16:01:56.517Z"},"vulns":[]}' ## Podsumowanie przez Sourcery Aktualizacja @sentry/profiling-node z wersji 8.43.0 do 8.47.0. <details> <summary>Original summary in English</summary> ## Summary by Sourcery Upgrade @sentry/profiling-node from 8.43.0 to 8.47.0. </details>
Resolves: #5997
Adds support for Descendant Routes, where there are multiple
<Routes />
(wrapped usingSentry.withSentryReactRouterV6Routing
) oruseRoutes
(wrapped usingSentry.withUseRoutes
) are used inside routes declaration./*
, has an element (the inner routes declaration) and no children)This also updates how we check if the
useEffect
hook is triggered the first time in aRoutes
element. The new implementation switches toReact.useRef
, which should be available. We expect users to provideuseEffect
hook when initializing the integration. Maybe we can also make this optional and deprecate it over time.Also, this PR updates the
react-router-6
version used in the tests, to the latest, removing the6.4
tests (the same test set), which IMHO do not seem relevant anymore.