@modern-js/devtools-client 2.35.1 → 2.36.0

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.
Files changed (38) hide show
  1. package/.turbo/turbo-build.log +44 -46
  2. package/CHANGELOG.md +2 -0
  3. package/dist/html/main/index.html +3 -3
  4. package/dist/modern.config.json +10 -35
  5. package/dist/nestedRoutes.json +1 -1
  6. package/dist/routes-manifest.json +64 -73
  7. package/dist/static/js/182.82afa1da.js +1 -0
  8. package/dist/static/js/182.82afa1da.js.LICENSE.txt +24 -0
  9. package/dist/static/js/182.82afa1da.js.map +1 -0
  10. package/dist/static/js/async/overview/{page.1d1e2eae.js → page.520a58d3.js} +1 -1
  11. package/dist/static/js/async/overview/page.520a58d3.js.map +1 -0
  12. package/dist/static/js/async/pages/page.5bbff940.js +1 -0
  13. package/dist/static/js/async/pages/page.5bbff940.js.map +1 -0
  14. package/dist/static/js/{lib-polyfill.6e913595.js → lib-polyfill.e0b54064.js} +1 -1
  15. package/dist/static/js/{198.9a4a2f6b.js.LICENSE.txt → lib-polyfill.e0b54064.js.LICENSE.txt} +1 -26
  16. package/dist/static/js/lib-polyfill.e0b54064.js.map +1 -0
  17. package/dist/static/js/main.8dfd903e.js +1 -0
  18. package/dist/static/js/main.8dfd903e.js.map +1 -0
  19. package/modern.config.ts +6 -48
  20. package/package.json +12 -15
  21. package/src/routes/RootTabs.tsx +2 -11
  22. package/src/routes/overview/page.tsx +7 -1
  23. package/src/routes/pages/EntryRoute/ClientRouteStats/RemixRoute.tsx +4 -6
  24. package/src/routes/pages/EntryRoute/ClientRouteStats/RemixRouteStats.tsx +3 -2
  25. package/src/routes/pages/EntryRoute/EntryRoute.tsx +4 -2
  26. package/src/routes/pages/page.tsx +14 -6
  27. package/dist/static/js/198.9a4a2f6b.js +0 -1
  28. package/dist/static/js/198.9a4a2f6b.js.map +0 -1
  29. package/dist/static/js/async/overview/page.1d1e2eae.js.map +0 -1
  30. package/dist/static/js/async/pages/layout.27df0fc6.js +0 -1
  31. package/dist/static/js/async/pages/layout.27df0fc6.js.map +0 -1
  32. package/dist/static/js/async/pages/page.d8425bcf.js +0 -1
  33. package/dist/static/js/async/pages/page.d8425bcf.js.map +0 -1
  34. package/dist/static/js/lib-polyfill.6e913595.js.map +0 -1
  35. package/dist/static/js/main.7e1a3442.js +0 -1
  36. package/dist/static/js/main.7e1a3442.js.map +0 -1
  37. package/src/routes/pages/layout.tsx +0 -13
  38. /package/dist/static/css/{198.76c8c1d9.css → 182.76c8c1d9.css} +0 -0
@@ -34,7 +34,7 @@ const Page: React.FC = () => {
34
34
  return (
35
35
  <Flex direction="column" align="center">
36
36
  <Flex gap="2">
37
- <img src={store.assets.logo} />
37
+ <LogoImage src={store.assets.logo} />
38
38
  <LogoHeading src={srcHeading} />
39
39
  </Flex>
40
40
  <Description>
@@ -120,3 +120,9 @@ const Description = styled(Text)({
120
120
  const LogoHeading = styled.img({
121
121
  width: '10rem',
122
122
  });
123
+
124
+ const LogoImage = styled.img({
125
+ width: '2rem',
126
+ height: '2rem',
127
+ objectFit: 'contain',
128
+ });
@@ -3,7 +3,7 @@ import { RouteObject } from '@modern-js/runtime/router';
3
3
  import { Box, Flex, Link, Code } from '@radix-ui/themes';
4
4
  import styled from '@emotion/styled';
5
5
  import _ from 'lodash';
6
- import { withoutTrailingSlash } from 'ufo';
6
+ import { resolveURL } from 'ufo';
7
7
  import { useHoverDirty } from 'react-use';
8
8
  import { MatchRemixRouteContext } from '../MatchRemixRouteContext';
9
9
 
@@ -18,10 +18,8 @@ export const RemixRoute: React.FC<RemixRouteProps> = ({ route }) => {
18
18
  '_component' in curr && _.isString(curr._component)
19
19
  ? curr._component
20
20
  : null;
21
- const displayPath = routes
22
- .map(r => r.path && withoutTrailingSlash(r.path))
23
- .filter(_.isString)
24
- .join('/');
21
+ const displayPath =
22
+ resolveURL('/', ...routes.map(r => r.path).filter(_.isString)) || '/';
25
23
  const isIndex = curr.index ?? false;
26
24
  const isRoot = displayPath === '/';
27
25
  const matched = useContext(MatchRemixRouteContext);
@@ -35,7 +33,7 @@ export const RemixRoute: React.FC<RemixRouteProps> = ({ route }) => {
35
33
  <Box ref={ref}>
36
34
  <Flex gap="2" align="center" mb={curr.children && '1'}>
37
35
  <EndpointContainer data-miss-matched={isMatching && !isMatched}>
38
- {!isRoot && (
36
+ {(isIndex && isRoot) || (
39
37
  <EndpointTag data-compose={isIndex && 'head'}>
40
38
  {displayPath}
41
39
  </EndpointTag>
@@ -6,6 +6,7 @@ import {
6
6
  import type { ServerRoute } from '@modern-js/types';
7
7
  import { Flex } from '@radix-ui/themes';
8
8
  import React, { useContext, useMemo } from 'react';
9
+ import { resolveURL, cleanDoubleSlashes } from 'ufo';
9
10
  import { MatchUrlContext } from '../../MatchUrl';
10
11
  import { MatchRemixRouteContext } from '../MatchRemixRouteContext';
11
12
  import { RemixRoute } from './RemixRoute';
@@ -22,7 +23,7 @@ export const RemixRouteStats: React.FC<RemixRouteStatsProps> = ({
22
23
  const testingUrl = useContext(MatchUrlContext);
23
24
  const matchedRoutes = useMemo(() => {
24
25
  if (!testingUrl || !remixRoutes) return [];
25
- const location = testingUrl.replace(route.urlPath, '');
26
+ const location = cleanDoubleSlashes(testingUrl.replace(route.urlPath, '/'));
26
27
  const matched = matchRemixRoutes(remixRoutes, location) ?? [];
27
28
  return matched as RouteMatch<string, RouteObject>[];
28
29
  }, [remixRoutes, testingUrl]);
@@ -35,7 +36,7 @@ export const RemixRouteStats: React.FC<RemixRouteStatsProps> = ({
35
36
  {remixRoutes.map(r => (
36
37
  <RemixRoute
37
38
  key={r.id}
38
- route={{ ...r, path: route.urlPath + (r.path ?? '') }}
39
+ route={{ ...r, path: resolveURL(route.urlPath, r.path ?? '') }}
39
40
  />
40
41
  ))}
41
42
  </Flex>
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Badge, Flex } from '@radix-ui/themes';
2
+ import { Badge, Flex, Box } from '@radix-ui/themes';
3
3
  import { ServerRoute } from '@modern-js/types';
4
4
  import { BaseRoute } from '../BaseRoute';
5
5
  import { EntryStats } from './EntryStats';
@@ -14,7 +14,9 @@ const EntryRoute: React.FC<EntryRouteProps> = ({ route }) => {
14
14
  <BaseRoute badge={badge} route={route} title={route.urlPath}>
15
15
  <Flex direction="column" gap="2">
16
16
  <EntryStats route={route} />
17
- <ClientRouteStats route={route} />
17
+ <Box style={{ overflow: 'scroll hidden' }}>
18
+ <ClientRouteStats route={route} />
19
+ </Box>
18
20
  </Flex>
19
21
  </BaseRoute>
20
22
  );
@@ -32,11 +32,13 @@ const Page: React.FC = () => {
32
32
  </TextField.Root>
33
33
  </Box>
34
34
  <Box height="2" />
35
- <RoutesContainer>
36
- {serverRoutes.map(route => (
37
- <ServerRoute key={route.entryPath} route={route} />
38
- ))}
39
- </RoutesContainer>
35
+ <Box style={{ overflow: 'hidden scroll' }}>
36
+ <RoutesContainer>
37
+ {serverRoutes.map(route => (
38
+ <ServerRoute key={route.entryPath} route={route} />
39
+ ))}
40
+ </RoutesContainer>
41
+ </Box>
40
42
  </Container>
41
43
  </MatchUrlContext.Provider>
42
44
  );
@@ -44,11 +46,17 @@ const Page: React.FC = () => {
44
46
 
45
47
  export default Page;
46
48
 
47
- const Container = styled(Box)({});
49
+ const Container = styled(Box)({
50
+ display: 'flex',
51
+ flexDirection: 'column',
52
+ height: '100%',
53
+ });
48
54
 
49
55
  const RoutesContainer = styled(Box)({
50
56
  display: 'flex',
57
+ flex: '0',
51
58
  flexDirection: 'column',
59
+ alignItems: 'stretch',
52
60
  gap: 'var(--space-2)',
53
61
  justifyContent: 'space-between',
54
62
  });