Replies: 2 comments 4 replies
-
I'm definitely open to ideas here. This is tricky because you don't want to limit the sourcemaps to people who have a specific role or anything because maybe the thing you're debugging is only available when you're not authenticated. So we need to think of a way to validate that the user should have access to the source maps. |
Beta Was this translation helpful? Give feedback.
-
One way to do this, could be to create a route that matches all source map files, then authorize the request somehow (maybe a cookie you can set manually in your browser?) and finally return the actual source map from the file system. |
Beta Was this translation helpful? Give feedback.
-
In recent changes, sourcemaps were no longer shipped in the production static assets.
This means it's pretty hard to debug code on production even if Sentry helps to some extent since sourcemaps are uploaded there.
It would be nice to introduce back sourcemaps in production (off by default to keep the current behavior) in a way that is restrictive.
Here are some possible improvements based on these Discord messages:
As I understand it middlewares would only work at the route level (and not for static assets) so this would require support from the Remix team?
.js.map
conditionally (e.g. by reading cookies and returning a boolean)This middleware could then be used inside the Remix server and one of the parameters exposed could look like this:
Currently each js file seems to have its own sourcemap so it might be tedious to add hundreds of sourcemap files. A change to have a single sourcemap for all files would be needed in the esbuild config
Let me know what you think about the idea and the proposed improvements!
Beta Was this translation helpful? Give feedback.
All reactions