titanium-sdk
titanium-sdk copied to clipboard
feat(all): remove debug/trace functions from production builds
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 seeINFO 1
andINFO 3
- build a store build
- run
adb logcat | grep -i tiapi
and launch your app - you should see
INFO 1
andINFO 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