Skip to content

Conversation

@mauricedoepke
Copy link
Contributor

@mauricedoepke mauricedoepke commented Jun 25, 2019

I did a major overhaul of the code.

  • Updated javascript-obfuscator to 0.18.1
  • removed old unnecessary dependencies
  • included new typings for dependencies
  • rewrote the code with stricter typing (less use of any)
  • refactored the code to use new es6 features to make it more concise
  • split the code into smaller functions, for easier understanding
  • refactored it to use the new hooks api of webpack (fixes DeprecationWarning: Tapable.plugin is deprecated. Webpack 4 #38 )
  • removed the JSDoc comments. I don't think this is necessary as we have the type definitions. The JSDoc comments were also not represent in the transpiled js anyway and some were outdated.
  • added generation of a d.ts type description instead
  • switched from hooking in the webpack compilation stage into the emit stage. The emit stage is the very last stage before the webpack writes the files to the disk. This is necessary as the code can easily break when later called plugins edit the obfuscated code. Especially when the option selfDefending is active. This fixes Problem with react project #49 as this bug was caused because the obfuscated code was minified by webpack. This might also fix Doesn't work with Vue #36 Not working with Laravel Mix #40 Error with Aurelia/Webpack #41, but this is just a guess. The option transformObjectKeys still causes problems. I don't yet know why this is the case.
  • disables running the obfuscator from webpack-dev-server as the reloading scripts seem to interfere with the obfuscated code and tend to break it often
  • I introduced a travis build pipeline that automatically runs the tests and transpiles the typescript to javascript. This helps to keep both in sync. Currently, they are not. The javascript file has been modified instead of modifying the typescript file and transpiling it in the current master.
  • already includes solutions for Fix Typescript validation issues with --strictNullCheck #51 fix: typescript exports default #52, fix: typescript constructor optional arguments #53

As this is a major overhaul, I understand that you might not desire all of the changes I made, so please see this as a proposal and just tell me what you think about it.

@sanex3339
Copy link
Member

wow thank you

@sanex3339 sanex3339 merged commit 33778de into javascript-obfuscator:master Jun 25, 2019
@sanex3339
Copy link
Member

published to npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with react project DeprecationWarning: Tapable.plugin is deprecated. Webpack 4 Doesn't work with Vue

2 participants