titanium-sdk icon indicating copy to clipboard operation
titanium-sdk copied to clipboard

feat(all): remove debug/trace functions from production builds

Open m1ga opened this issue 1 year ago • 0 comments

fixes #13837

Needs: https://github.com/tidev/node-titanium-sdk/pull/651

Instead of just hiding the debug/trace Ti.API calls in a production build it will NULL them and not execute the parameters! More info in the issue ticket.

let i = 0;
let c = 0;
Ti.API.info(`-------------INFO: ${++i}`);
Ti.API.debug(`-------------DEBUG: ${++i}`);
Ti.API.info(`-------------INFO: ${++i}`);

Test:

  • create a dev build
  • build with -l info and you should see INFO 1 and INFO 3
  • build a store build
  • run adb logcat | grep -i tiapi and launch your app
  • you should see INFO 1 and INFO 2

TODO:

  • Currently only a draft to see if it is useful or should be like this.
  • either do the same for console.debug or add the existing babel remover for that

m1ga avatar May 15 '23 21:05 m1ga