Topic on Talk:ResourceLoader/Package files

Jump to navigation Jump to search
Vedmaka (talkcontribs)

Before we could use `?debug=true` to disable files concatenation and thus be able to debug JS code, now with packages there seems to be no way of doing this since all the packages are being jammed into single piece. Do we have a workaround (sourcemaps?) ?

Roan Kattouw (WMF) (talkcontribs)

?debug=true still disables minification, and disables concatenation of different modules (every module is a separate request), but it doesn't load individual files separately. Unfortunately I don't believe there's a way to do that without breaking require(). Debugging has worked pretty well for me despite that though.

cc @Krinkle for the source maps question, I don't know what the status of that is (if anything).

Vedmaka (talkcontribs)

It looks like concatenation is still there, modules being loaded in a bulk as a single item, either way - that's true that in that form it's possible to debug it using browser tools, but make it impossible to attach any external debuggers like PHPStorm since there is no file mappings and no sourcemaps.


added: actually debugging in browse is quite buggy too - it can't retain link to a script in most cases

Roan Kattouw (WMF) (talkcontribs)

For in-browser debugging, I've mostly used debugger; statements in the code, or used the console to access functions/methods by name and navigate to them. There's also a debugging trick specific to package modules that I'll add to this page. You're right that source maps would be a good thing to add though.

Reply to "What about debugging?"