Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented May 15, 2023

fixes #13837

Needs: tidev/node-titanium-sdk#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 m1ga mentioned this pull request May 15, 2023
1 task
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.

Optimize Ti.API.debug behaviour
1 participant