|
| 1 | +--- |
| 2 | +title: "Active Page Tab" |
| 3 | +description: "Detailed overview of all features on the active page tab." |
| 4 | +--- |
| 5 | + |
| 6 | +import Info from "./info.tsx"; |
| 7 | + |
| 8 | +The Active Page tab is the first tab that appears when you open up the dev tools panel. It contains an overview of all active loaders |
| 9 | +on the current page and detailed information about each loader. |
| 10 | + |
| 11 | +## Route boundaries |
| 12 | + |
| 13 | +The first feature we will go over is the route boundaries. This feature shows you the current route boundaries on the actual page. |
| 14 | +This is useful for debugging and testing purposes. It finds the `<Outlet />` component in the route and highlights it with a |
| 15 | +gradient background that can be set in the settings. |
| 16 | + |
| 17 | +<Info> |
| 18 | + This feature is only available in the development mode because it used react dev tools to find the `<Outlet />` component. |
| 19 | + |
| 20 | + If you want to try it open up the dev tools right now nad hover over `/docs/main` in the panel. |
| 21 | + |
| 22 | + You can also change the gradient background color in the settings. |
| 23 | +</Info> |
| 24 | + |
| 25 | +## Loader list |
| 26 | + |
| 27 | +The loader list is a list of all active loaders on the current page. It shows the url segment of the loader, |
| 28 | +the loader type and the loader file. |
| 29 | + |
| 30 | +<Info> |
| 31 | + The loader type is determined by the routing convention. |
| 32 | + - `purple` - represents the root.tsx file |
| 33 | + - `blue` - represents a pathless layout file |
| 34 | + - `green` - represents a normal route file, whether index or not |
| 35 | +</Info> |
| 36 | + |
| 37 | +### Open in VS code |
| 38 | + |
| 39 | +Each segment has an **open in VS code** button that opens the loader file in VS code. |
| 40 | +This is useful for quick navigation to the loader file. |
| 41 | + |
| 42 | +<Info title="Caveat!"> |
| 43 | +This only works if you have the `code` command installed in your terminal. If you don't have it installed you can |
| 44 | + install it by following the instructions [here](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line). |
| 45 | +</Info> |
| 46 | + |
| 47 | +### Loader data |
| 48 | + |
| 49 | +Each segment has a loader data **JSON** object that contains all the information returned by the loader of that segment. |
| 50 | + |
| 51 | +If you open the dev tools on this page and look at the `/docs/main` segment you will see the **loader data object** which contains |
| 52 | +`metadata`, `tag`, `serverData`, `deferredServerData` and `key` properties. |
| 53 | + |
| 54 | +This part will contain everything returned from the server and it will be **hot swapped** if the data changes. |
| 55 | + |
| 56 | +<Info> |
| 57 | + When keys are deferred on the server, the data will hot swap when the key is resolved on the client. |
| 58 | + |
| 59 | +</Info> |
| 60 | + |
| 61 | +### Route params |
| 62 | + |
| 63 | +The route params section contains all the route params for the current segment. |
| 64 | + |
| 65 | +This will contain all the **wildcard** params currently available on this route. |
| 66 | + |
| 67 | +If you open up the dev tools, you will be able to see that `tag` and `slug` are both in |
| 68 | +the route params. |
| 69 | + |
| 70 | +### Server info |
| 71 | + |
| 72 | +The server info section contains all the server information for the current segment, including: |
| 73 | +- `loaderTriggerCount` - the number of times the loader has been triggered (updates in real-time) |
| 74 | +- `actionTriggerCount` - the number of times the action has been triggered (updates in real-time) |
| 75 | +- `lowestExecutionTime` - the lowest execution time of the loader (updates in real-time) |
| 76 | +- `highestExecutionTime` - the highest execution time of the loader (updates in real-time) |
| 77 | +- `averageExecutionTime` - the average execution time of the loader (updates in real-time) |
| 78 | +- `lastLoaderInfo` - the last loader info object (updates in real-time), includes execution time, request headers and response headers. |
| 79 | +- `lastActionInfo` - the last action info object (updates in real-time), includes execution time, request headers and response headers. |
| 80 | +- `loaderCalls` - an array of loaderInfo objects ordered from most recent to least recent (updates in real-time) |
| 81 | +- `actionCalls` - an array of actionInfo objects ordered from most recent to least recent (updates in real-time) |
| 82 | + |
| 83 | +### handles |
| 84 | + |
| 85 | +The handles section contains all the handles for the current segment. |
| 86 | + |
| 87 | +This will contain all the **handles** currently available on this route. |
| 88 | + |
| 89 | +Remix allows you to export a custom **handle** export which can be anything, it will be shown here if it is exported. |
| 90 | + |
| 91 | +## Revalidation |
| 92 | + |
| 93 | +There is a **Revalidate** button that allows you to revalidate all the loaders on the page. |
| 94 | + |
| 95 | + |
| 96 | +## Timeline |
| 97 | + |
| 98 | +The timeline section on the right contains useful information on navigation and submission events in your application. |
| 99 | + |
| 100 | +Every time there is a navigation or submission event, a new entry will be added to the timeline on the top. |
| 101 | + |
| 102 | +It is limited to 50 entries and will remove the oldest entry when the limit is reached. |
| 103 | + |
| 104 | +The timeline will contain the following information for each event: |
| 105 | +- `type` - the type of event (navigation or submission, fetcher or normal) |
| 106 | +- `method` - the method of the event (GET, POST, PUT, DELETE) |
| 107 | +- `url` - the url of the event |
| 108 | +- `data sent` - the data sent in the event |
| 109 | +- `response` - the response of the event |
| 110 | + |
| 111 | +<Info> |
| 112 | +This only happens for events that change the state of the app, if there is a client-side navigation to a |
| 113 | +new location that has no loaders nothing will happen because the state has remained idle. |
| 114 | +</Info> |
| 115 | + |
| 116 | +### Clearing the timeline |
| 117 | + |
| 118 | +You can clear the timeline by clicking the **clear** button at the top right of the timeline. |
0 commit comments