Skip to content

Commit 7e141ea

Browse files
authored
Improved sourcemap support (#170)
* Improved sourcemap support * sourcemap potential fix
1 parent 36c5a1a commit 7e141ea

10 files changed

Lines changed: 225 additions & 142 deletions

.vscode/launch.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Attach by Process ID",
6+
"processId": "${command:PickProcess}",
7+
"request": "attach",
8+
"skipFiles": ["<node_internals>/**"],
9+
"type": "node"
10+
}
11+
]
12+
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/server/hof.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe("withLoaderWrapper", () => {
5050
const wrappedEnd = performance.now()
5151
const wrappedTime = wrappedEnd - wrappedStart
5252
// Allow for some variance in execution time
53-
expect(wrappedTime - originalTime).toBeLessThan(10)
53+
expect(wrappedTime - originalTime).toBeLessThan(30)
5454
})
5555

5656
it("should get the params and the request object passed down properly", async () => {
@@ -156,7 +156,7 @@ describe("withActionWrapper", () => {
156156
const wrappedEnd = performance.now()
157157
const wrappedTime = wrappedEnd - wrappedStart
158158
// Allow for some variance in execution time
159-
expect(wrappedTime - originalTime).toBeLessThan(10)
159+
expect(wrappedTime - originalTime).toBeLessThan(30)
160160
})
161161

162162
it("should get the params and the request object passed down properly", async () => {

src/vite/plugin.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const reactRouterDevTools: (args?: ReactRouterViteConfig) => Plugin[] = (
9696
const pluginNames = plugins.map((p) => p.name)
9797
const pluginImports = plugins.map((plugin) => `import { ${plugin.name} } from "${plugin.path}";`).join("\n")
9898
const config = `{ "config": ${JSON.stringify(clientConfig)}, "plugins": "[${pluginNames.join(",")}]" }`
99-
return injectRdtClient(code, config, pluginImports)
99+
return injectRdtClient(code, config, pluginImports, id)
100100
},
101101
},
102102
{
@@ -109,7 +109,7 @@ export const reactRouterDevTools: (args?: ReactRouterViteConfig) => Plugin[] = (
109109
if (!routeId) {
110110
return
111111
}
112-
const finalCode = injectContext(code, routeId)
112+
const finalCode = injectContext(code, routeId, id)
113113
return finalCode
114114
},
115115
},
@@ -123,7 +123,7 @@ export const reactRouterDevTools: (args?: ReactRouterViteConfig) => Plugin[] = (
123123
if (!routeId) {
124124
return
125125
}
126-
const finalCode = augmentDataFetchingFunctions(code, routeId)
126+
const finalCode = augmentDataFetchingFunctions(code, routeId, id)
127127
return finalCode
128128
},
129129
},

0 commit comments

Comments
 (0)