-
Notifications
You must be signed in to change notification settings - Fork 186
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
assets: Emit source maps #11042
assets: Emit source maps #11042
Conversation
I think source maps are only relevant in development, so you shouldn't add them if |
It's mostly for development, but it doesn't hurt if it is in production. I guess we do need to have to change the deploy script to actual make it into production. My ruby is pretty weak, but I'm attempting to refactor out all the sourcemap building logic into a helper (which is probably a good idea anyways) and then it'll easier to wrap it with conditionals. |
2270a42
to
b2014dd
Compare
This isn't very well tested yet, but I'm not sure if I'll be able to get back to this for a few days. Just dropping in my most recent revision which does fix the double reading of builds and I think properly gates source map generation. My ruby is pretty weak and I'm not sure about the project conventions, so feel free to ask for fixes. |
I had to rename deps because there was a name collision where the file was written to twice once in compile_lib and another time in combine. This made it much easier to debug some issues.
I ran Then I ran When I looking at timings of individual files, it looks like it's very little overhead. |
I'd not come across source maps before. I've had a play around with the browser debugger with these maps added, and this does look like this is going to be very helpful. Trying to debug using the Opal-generated Javascript was borderline impossible, being able to set breakpoints and inspect values in the Ruby code is so much better. @PistonPercy you've tagged me to review this pull request, but I don't understand the build system well enough to be able to do that. I'm sure that when @michaeljb has some time he'll be able to assess the changes that you've made. One thing I don't follow is the different methods you've used for generating the source maps in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure that when @michaeljb has some time he'll be able to assess the changes that you've made.
@PistonPercy Sorry it took a while to find some time, but this looks good to me! Did a bit of local testing and it's really nice to debug Ruby directly the browser.
Thanks for getting this to work!
Before clicking "Create"
master
pins
orarchive_alpha_games
label if this change will break existing gamesdocker compose exec rack rubocop -a
docker compose exec rack rake
Implementation Notes
I had to rename deps because there was a name collision where the file was written to twice once in compile_lib and another time in combine and thus the corresponding source maps would get mangled.
Explanation of Change
This made it much easier to debug some issues. I was able to get ruby source code in the web inspector and see where exceptions where being thrown from.
Any Assumptions / Hacks