resq
resq copied to clipboard
Add sourcemap support
This might be a bit tricky but definitely solve able. It would be cool if resq
could fetch the sourcemaps of the bundled react files and allow to fetch the original component names even though the code is minified.
At least it would be nice to add to readme the uglify-js
and/or terser
settings that would keep full component names but minify the rest of the code. I'm still figuring them out.
any update on this ticket?
@abhinaba-ghosh please see the "help wanted" label. If this is something you like to have please get involved and propose a PR for this. Thanks!
@christian-bromann can you give a bit guidance on how to go about this? This issue is preventing us from using Webdriver.IO with libraries built on popular npm packages such as Material UI.
@gabriel-kohen-by while there are no contributing docs I am sure you will be fine by aligning to the given code style of this project. Then you need to enable resq to pull the sourcemaps file and use it to parse original component names from the actual source. How to go about this in detail: I don't know. I would look into other sourcemap parsers.
Cheers @christian-bromann. Let me know if it's the best place to collaborate on this. Just a bit of a background, we are creating UIs on abstraction library on top of Material UI(React) and running test using Webdriver.IO and utilizing SauceLabs accounts to run these. All apps and libraries are built with Typescript.
I was looking at React Standalone tool(our apps run inside of iFrame so I cannot use the Chrome extension) and I see the columns in no names I could recognize:
I also tried running on iFrame, resq 1.10 and running commands in the console to see what it finds as names:
allElements=resq.resq$$('*',root)
Almost all the components have a composite name object which I'm not sure what to make of:
Finally on the Source Map approach, I understand we could potentially use a source map parser which will give us mapping between the transpiled code and the original (Typescript) code, but I'm not sure how would you start parsing the original code to map to what component tree resq find. I'm sure I'm missing something obvious here and it would be great if you can confirm the approach and suggest a way forward.
Thank you so much for your guidance!
Hi, any updates on this?