react / built-in-macros
The @lynx-js/react package processes built-in macro definitions such as __BACKGROUND__ and __MAIN_THREAD__. During compilation, code blocks with false conditions are automatically removed.
__BACKGROUND__booleanHere's an example using the App component:
After compilation, this code is transformed into:
background.js in the compilation intermediate directory):main-thread.js in the compilation intermediate directory):Here's an example using the Conversations component:
After compilation, this code is transformed into:
background.js in the compilation intermediate directory):main-thread.js in the compilation intermediate directory):__MAIN_THREAD__booleanHere's an example using the App component:
After compilation, this code is transformed into:
background.js in the compilation intermediate directory):main-thread.js in the compilation intermediate directory):Here's an example using the Conversations component:
After compilation, this code is transformed into:
background.js in the compilation intermediate directory):main-thread.js in the compilation intermediate directory):