Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate and serve sourcemaps for javascript #2922

Open
thatbudakguy opened this issue Jul 19, 2022 · 4 comments
Open

Generate and serve sourcemaps for javascript #2922

thatbudakguy opened this issue Jul 19, 2022 · 4 comments
Assignees

Comments

@thatbudakguy
Copy link
Member

javascript errors reported to honeybadger are difficult to diagnose because the trace points into the minified version of the file, see e.g. #2654. some of these errors occur constantly and have gone unaddressed for a long time.

given that sprockets v4 supports sourcemaps and DHH expressed support for shipping them to production, not just development, it seems reasonable practice to generate and serve sourcemaps so that we can more accurately debug issues with minified/compiled assets in prod.

it's unclear if sprockets actually supports generating the sourcemaps in a helpful way. we might want to instead change the JS compressor to terser (which is more actively developed) and can generate sourcemaps on its own.

@thatbudakguy
Copy link
Member Author

@cbeer do you have thoughts/opinions on this? is this something we've tried on other apps?

@cbeer
Copy link
Member

cbeer commented Jul 20, 2022

👍 .

@thatbudakguy
Copy link
Member Author

waiting to try out a new approach on NTA, since it's a greenfield app. this solution and others using Uglifier don't seem to preserve file hierarchy in the sourcemap, which I think is important, and they also don't append the sourceMappingUrl= comment without some hacking, which is annoying.

@corylown
Copy link
Contributor

We should look at this when we're working on SearchWorks maintenance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants