Skip to content

Commit

Permalink
Improved sourcemap support (#170)
Browse files Browse the repository at this point in the history
* Improved sourcemap support

* sourcemap potential fix
  • Loading branch information
AlemTuzlak authored Jan 9, 2025
1 parent 36c5a1a commit 7e141ea
Show file tree
Hide file tree
Showing 10 changed files with 225 additions and 142 deletions.
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach by Process ID",
"processId": "${command:PickProcess}",
"request": "attach",
"skipFiles": ["<node_internals>/**"],
"type": "node"
}
]
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/server/hof.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe("withLoaderWrapper", () => {
const wrappedEnd = performance.now()
const wrappedTime = wrappedEnd - wrappedStart
// Allow for some variance in execution time
expect(wrappedTime - originalTime).toBeLessThan(10)
expect(wrappedTime - originalTime).toBeLessThan(30)
})

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

it("should get the params and the request object passed down properly", async () => {
Expand Down
6 changes: 3 additions & 3 deletions src/vite/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const reactRouterDevTools: (args?: ReactRouterViteConfig) => Plugin[] = (
const pluginNames = plugins.map((p) => p.name)
const pluginImports = plugins.map((plugin) => `import { ${plugin.name} } from "${plugin.path}";`).join("\n")
const config = `{ "config": ${JSON.stringify(clientConfig)}, "plugins": "[${pluginNames.join(",")}]" }`
return injectRdtClient(code, config, pluginImports)
return injectRdtClient(code, config, pluginImports, id)
},
},
{
Expand All @@ -109,7 +109,7 @@ export const reactRouterDevTools: (args?: ReactRouterViteConfig) => Plugin[] = (
if (!routeId) {
return
}
const finalCode = injectContext(code, routeId)
const finalCode = injectContext(code, routeId, id)
return finalCode
},
},
Expand All @@ -123,7 +123,7 @@ export const reactRouterDevTools: (args?: ReactRouterViteConfig) => Plugin[] = (
if (!routeId) {
return
}
const finalCode = augmentDataFetchingFunctions(code, routeId)
const finalCode = augmentDataFetchingFunctions(code, routeId, id)
return finalCode
},
},
Expand Down
Loading

0 comments on commit 7e141ea

Please sign in to comment.