lichess-org / lila

♞ lichess.org: the forever free, adless and open source chess server ♞
https://lichess.org
GNU Affero General Public License v3.0
15.52k stars 2.26k forks source link

Adding Source Maps #6774

Closed alexanderfletcher closed 1 year ago

alexanderfletcher commented 4 years ago

There doesn't appear to be source maps on the site, I think part of embracing open source would be to add source maps in so people could look at the code on the site easier.

Unsure if this should be an issue or if I should have asked somewhere else.

Thanks

niklasf commented 4 years ago

:+1:

The local development build has inline source maps, which is of course not acceptable for production. I seem to vaguely remember some technical issue that made it non-trivial to have seperate source maps.

The current pipeline looks like this: https://github.com/ornicar/lila/blob/master/ui/%40build/tsProject/index.js

alexanderfletcher commented 4 years ago

hmm, i might investigate and see if i can find what the issue could be, it just naively feels like it should be simple but I'll trust you if you say it isn't and try and come up with a way forward to determine feasibility. (unless it has already been extensively considered)

niklasf commented 4 years ago

Sounds good. It might just be that I misrembered.

Dboingue commented 4 years ago

There were 2 comments in the following pull request one was hopeful, but what about the second?
If I were to apply suggestion of first paragraph, would it still work, assuming that browserify would use the same fixed configuration at each update? Does the second comment mean that chessground does not have the equivalent, and is it in the plans?

Pull Request #5360 Improve typescript sourcemaps

Inline sources allows browserify to sourcemap back to original typescript. If you add the ui folder to chrome, you can then edit ts files and set ts breakpoints directly in the browser!

confirmed that does not affect chessground.min.js (minimizer strips sourcemap comments)

https://travis-ci.org/github/ornicar/lila/builds/566039218 https://github.com/isaacl/lila/tree/betterSourceMaps

Merge 25de98f into 874352b

niklasf commented 4 years ago

That was just about making sure that the .min.js file (for production) is not bloated by inline comments.

Dboingue commented 4 years ago

A precaution.  So the plan is to keep sourcemaps for all front-end, now UI, chessground would be front-end in my naive point of view, but not sure.  Thanks for your reply. I will try to put the UI folder somewhere in chrome (do you know where by the way, the storage space of browser for web site and pwa, is rather abstract for me compared to my OS file system).  I will figure it out, but if you know that you go faster.  Regards.

Le 09/06/2020 à 01:25, Niklas Fiekas a écrit :

That was just about making sure that the |.min.js| file (for production) is not bloated by inline comments.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ornicar/lila/issues/6774#issuecomment-641036729, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADNEZID7RXD3LIEH5H65WUTRVXBVNANCNFSM4NW2JSCA.