@tanstack/router-devtools 0.0.1-beta.174 → 0.0.1-beta.176

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tanstack/router-devtools",
3
3
  "author": "Tanner Linsley",
4
- "version": "0.0.1-beta.174",
4
+ "version": "0.0.1-beta.176",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://tanstack.com/router/",
@@ -12,7 +12,6 @@
12
12
  "keywords": [
13
13
  "react",
14
14
  "location",
15
- "@tanstack/router",
16
15
  "router",
17
16
  "routing",
18
17
  "async",
@@ -42,7 +41,7 @@
42
41
  "dependencies": {
43
42
  "@babel/runtime": "^7.16.7",
44
43
  "date-fns": "^2.29.1",
45
- "@tanstack/react-router": "0.0.1-beta.174"
44
+ "@tanstack/react-router": "0.0.1-beta.176"
46
45
  },
47
46
  "scripts": {
48
47
  "build": "rollup --config rollup.config.js"
package/src/devtools.tsx CHANGED
@@ -461,7 +461,7 @@ function RouteComp({
461
461
  fontWeight: 'bold',
462
462
  borderRadius: '100%',
463
463
  transition: 'all .2s ease-out',
464
- background: getRouteStatusColor(matches, route, theme, router),
464
+ background: getRouteStatusColor(matches, route, theme),
465
465
  opacity: match ? 1 : 0.3,
466
466
  }}
467
467
  />
@@ -563,13 +563,13 @@ export const TanStackRouterDevtoolsPanel = React.forwardRef<
563
563
  },
564
564
  )
565
565
 
566
- React.useEffect(() => {
567
- const interval = setInterval(() => {
568
- router.cleanMatches()
569
- }, 1000)
566
+ // React.useEffect(() => {
567
+ // const interval = setInterval(() => {
568
+ // router.cleanMatches()
569
+ // }, 1000)
570
570
 
571
- return () => clearInterval(interval)
572
- }, [router])
571
+ // return () => clearInterval(interval)
572
+ // }, [router])
573
573
 
574
574
  return (
575
575
  <ThemeProvider theme={theme}>
@@ -798,7 +798,7 @@ export const TanStackRouterDevtoolsPanel = React.forwardRef<
798
798
  width: '1.3rem',
799
799
  height: '1.3rem',
800
800
  marginLeft: '.25rem',
801
- background: getStatusColor(match, theme, router),
801
+ background: getStatusColor(match, theme),
802
802
  alignItems: 'center',
803
803
  justifyContent: 'center',
804
804
  fontWeight: 'bold',
@@ -871,7 +871,7 @@ export const TanStackRouterDevtoolsPanel = React.forwardRef<
871
871
  width: '1.3rem',
872
872
  height: '1.3rem',
873
873
  marginLeft: '.25rem',
874
- background: getStatusColor(match, theme, router),
874
+ background: getStatusColor(match, theme),
875
875
  alignItems: 'center',
876
876
  justifyContent: 'center',
877
877
  fontWeight: 'bold',
package/src/utils.ts CHANGED
@@ -4,6 +4,7 @@ import {
4
4
  AnyRoute,
5
5
  AnyRouteMatch,
6
6
  AnyRouter,
7
+ isMatchInvalid,
7
8
  } from '@tanstack/react-router'
8
9
 
9
10
  import { Theme, useTheme } from './theme'
@@ -30,16 +31,10 @@ type StyledComponent<T> = T extends 'button'
30
31
  ? React.HTMLAttributes<HTMLElementTagNameMap[T]>
31
32
  : never
32
33
 
33
- export function getStatusColor(
34
- match: AnyRouteMatch,
35
- theme: Theme,
36
- router: AnyRouter,
37
- ) {
34
+ export function getStatusColor(match: AnyRouteMatch, theme: Theme) {
38
35
  return match.status === 'pending' || match.isFetching
39
36
  ? theme.active
40
- : router.getIsInvalid({
41
- matchId: match.id,
42
- })
37
+ : isMatchInvalid(match)
43
38
  ? theme.warning
44
39
  : match.status === 'error'
45
40
  ? theme.danger
@@ -52,11 +47,10 @@ export function getRouteStatusColor(
52
47
  matches: AnyRouteMatch[],
53
48
  route: AnyRoute | AnyRootRoute,
54
49
  theme: Theme,
55
- router: AnyRouter,
56
50
  ) {
57
51
  const found = matches.find((d) => d.routeId === route.id)
58
52
  if (!found) return theme.gray
59
- return getStatusColor(found, theme, router)
53
+ return getStatusColor(found, theme)
60
54
  }
61
55
 
62
56
  type Styles =