resq icon indicating copy to clipboard operation
resq copied to clipboard

Add sourcemap support

Open christian-bromann opened this issue 5 years ago • 7 comments

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.

christian-bromann avatar Apr 01 '19 09:04 christian-bromann

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.

mvasin avatar Feb 19 '20 10:02 mvasin

any update on this ticket?

abhinaba-ghosh avatar Apr 17 '20 13:04 abhinaba-ghosh

@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 avatar Apr 17 '20 13:04 christian-bromann

@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 avatar Aug 24 '21 11:08 gabriel-kohen-by

@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.

christian-bromann avatar Aug 24 '21 12:08 christian-bromann

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: image 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: image 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!

gabriel-kohen-by avatar Aug 25 '21 10:08 gabriel-kohen-by

Hi, any updates on this?

TheBit avatar Feb 18 '24 18:02 TheBit