SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Maintaining SharePoint solutions without access to source code can be time consuming. Especially if you have to extract a .wsp from a farm, rename it to .cab and start looking into output files as XML feature definitions and ASPX pages.

With the evolution of SharePoint Framework, I wonder how I can maintain SPFx webparts without access to source code? Is it, or will it be possible to reverse engineer SPFx output to source code again? Preferably to TypeScript...

share|improve this question
1  
Waiting to see the obverse of this question: how do I prevent people reverse engineering my SPFx webparts ;-) – SPDoctor yesterday
    
@SPDoctor True! Don't put your wp publicly available;) – Benny Skogberg yesterday
up vote 4 down vote accepted

SPFx webparts are JavaScript so, yes, you can reverse engineer them. If you load a client-side webpart and use F12 browser tools you can see the code which is bundled into a big JavaScript file by webpack, but the webpart code is near the top and you can easily find it and breakpoint it if needed. At worst you might face minification and obfuscation.

Converting JavaScript back to TypeScript is going to be a problem, because JavaScript already is valid TypeScript. What you probably want is to get the types back and perhaps the class-like structure. For the former you are out of luck - the type information is gone. But for the latter, apparently there is a tool that semi-automates the task of getting TypeScript back from JavaScript, but I haven't tried it and I am a little sceptical about how useful it would be in practice.

share|improve this answer
1  
It would be nice to have such a tool which can convert JS to TS.. or atleast get it converted into a proper structure which we can enhance later – Amal Hashim yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.