Skip to content

Commit 757eb47

Browse files
committed
v3.2.1
1 parent 1ef7130 commit 757eb47

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
![npm](https://img.shields.io/npm/v/remix-development-tools?style=plastic)
99
![GitHub](https://img.shields.io/github/license/Code-Forge-Net/Remix-Dev-Tools?style=plastic)
1010
![npm](https://img.shields.io/npm/dy/remix-development-tools?style=plastic)
11+
![npm](https://img.shields.io/npm/dw/remix-development-tools?style=plastic)
1112
![GitHub top language](https://img.shields.io/github/languages/top/Code-Forge-Net/Remix-Dev-Tools?style=plastic)
1213

1314
Remix Development Tools is an open-source package designed to enhance your development workflow when working with Remix, a full-stack JavaScript framework for building web applications. This package provides a user-friendly interface consisting of three tabs, **Active Page**, **Terminal**, **Settings** and **Routes**, along with a side tab called **Timeline**. With Remix Development Tools, you can efficiently monitor and manage various aspects of your Remix projects, including page information, URL parameters, server responses, loader data, routes, and more.
@@ -26,6 +27,11 @@ Remix Development Tools is an open-source package designed to enhance your devel
2627
![route boundaries](./assets/boundaries.png)
2728
## What's new?
2829

30+
## v3.2.1
31+
32+
- View-source > you can CTRL + right-click any element in the browser to open it up in your VS code. This requires you to have VS code "code" executable set in your PATH which is an optional checkbox durring the installation process or you can add it yourself manually as a PATH variable
33+
- Open in VS code button on routes > you can open up route segments directly in vscode, the same is needed as above
34+
2935
## v3.1.0
3036

3137
- Cache information on the client side -> shows you how long and where each loader is cached for
@@ -79,6 +85,10 @@ Here are features offered on the server side of Remix Development Tools:
7985
More features are coming soon!
8086

8187
## Client
88+
89+
### View source
90+
91+
CTRL + Right-click any element in the browser to open it directly in your vscode instance!
8292
### Active Page Tab
8393

8494
The **Active Page** tab in Remix Development Tools allows you to gain insights into the current page you are working on. It provides valuable information and data that can assist you in debugging and understanding the behavior of your application.
@@ -148,7 +158,7 @@ npm install remix-development-tools -D
148158
+ import rdtStylesheet from "remix-development-tools/index.css";
149159
+ export const links: LinksFunction = () => [
150160
// export the stylesheet in development only
151-
+ process.env.NODE_ENV === "development" ? [{ rel: "stylesheet", href: rdtStylesheet }] : [],
161+
+ ...(process.env.NODE_ENV === "development" ? [{ rel: "stylesheet", href: rdtStylesheet }] : []),
152162
+ ]
153163

154164
+ let AppExport = App;

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22
"name": "remix-development-tools",
33
"description": "Remix development tools - a set of tools for developing/debugging Remix.run apps",
44
"author": "Alem Tuzlak",
5-
"version": "3.2.0",
5+
"version": "3.2.1",
66
"license": "MIT",
77
"keywords": [
88
"remix",
99
"remix-dev-tools",
1010
"remix-development-tools",
1111
"remix-debugger",
1212
"remix-debugger-ui",
13-
"remix-debugger-ui-react"
13+
"remix-debugger-ui-react",
14+
"view-source",
15+
"remix-logger",
16+
"remix-dev-server"
1417
],
1518
"private": false,
1619
"type": "module",

src/RemixDevTools/hooks/useBorderedRoutes.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export const ROUTE_CLASS = "rdt-outlet-route";
66
const isSourceElement = (fiberNode: any) => {
77
return (
88
fiberNode?.elementType &&
9-
fiberNode.stateNode &&
10-
fiberNode._debugSource &&
11-
!fiberNode.stateNode.getAttribute("data-rdt-source")
9+
fiberNode?.stateNode &&
10+
fiberNode?._debugSource &&
11+
!fiberNode?.stateNode?.getAttribute?.("data-rdt-source")
1212
);
1313
};
1414

@@ -48,8 +48,8 @@ export function useBorderedRoutes() {
4848
traverseComponentTree(rootFiber.current, (fiberNode: any) => {
4949
if (isSourceElement(fiberNode)) {
5050
const isJsx = isJsxFile(fiberNode);
51-
const line = fiberNode._debugSource.lineNumber;
52-
fiberNode.stateNode.setAttribute(
51+
const line = fiberNode?._debugSource?.lineNumber;
52+
fiberNode.stateNode?.setAttribute?.(
5353
"data-rdt-source",
5454
`${fiberNode._debugSource.fileName}:${isJsx ? line - 20 : line}` //
5555
);

src/RemixDevTools/hooks/useOpenElementSource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const useOpenElementSource = () => {
77
useEffect(() => {
88
const handleFocus = (e: any) => {
99
e.stopPropagation();
10-
if (!e.ctrlKey || !e.target?.getAttribute("data-rdt-source")) {
10+
if (!e.ctrlKey || !e.target?.getAttribute?.("data-rdt-source")) {
1111
return;
1212
}
1313

0 commit comments

Comments
 (0)