-
Notifications
You must be signed in to change notification settings - Fork 20
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: call createAppRouter
within App
component; implement shouldRevalidate
for rootLoader
sub-route navigation
#1256
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1256 +/- ##
==========================================
+ Coverage 89.25% 89.46% +0.21%
==========================================
Files 405 404 -1
Lines 8737 8735 -2
Branches 2064 2110 +46
==========================================
+ Hits 7798 7815 +17
+ Misses 903 884 -19
Partials 36 36 ☔ View full report in Codecov by Sentry. |
6646469
to
59cb844
Compare
createAppRouter
within App
component; implement shouldRevalidate
for rootLoader
sub-route navigation
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.
Great job with the ADR. I pulled it down locally to verify and everything seems to be moving alright. 👍🏽
@@ -8,7 +8,7 @@ import { getRoutes } from '../../../routes'; | |||
* @param {Object} queryClient React Query query client. | |||
* @returns {Object} React Router browser router. | |||
*/ | |||
export default function createAppRouter(queryClient: Types.QueryClient) { | |||
export default function createAppRouter(queryClient: Types.QueryClient): Types.Router { |
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 defines an expected output type I am guessing?
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.
Correct, the added : Types.Router
is telling TypeScript the createAppRouter
function returns a value with the type Types.Router
(which is technically a RemixRouter
, same type as returned by createBrowserRouter
and createMemoryRouter
).
AppProvider: ({ children }) => <div data-testid="app-provider">{children}</div>, | ||
})); | ||
|
||
describe('App', () => { |
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.
🥳
Description
ENT-9930
It was observed that when replicating an tangentially related issue, there was a brief usage of dispatching an error via
NewRelicLoggingService
before sending similar error via the expectedDatadogLoggingService
. This brief usage ofNewRelicLoggingService
may have caused errant reporting of some errors occurring within the React Router route loaders.This line was missed during the New Relic -> Datadog migration, and unfortunately
getConfig().loggingService
(representingDatadogLoggingService
) is not available here.This led to this PR removing the need to call
configureLogging
orconfigureAuth
for the purpose of the route loaders by moving creation of the aboveconst router = createAppRouter(queryClient)
into the rendering of theApp
, instead of at file import.The PR also removes a parent
Suspense
and its fallback componentAppSuspenseFallback
to make suspense issues more obvious at runtime during development.For all changes
Only if submitting a visual change