Open JakeWharton opened 1 year ago
Filed https://issuetracker.google.com/issues/306428078 upstream since there seems to be some support for this being a first-party toggle of the Compose compiler itself.
Realizing that even with toggles this won't fully eliminate these calls since we don't control the flag value in libraries (such as the Compose runtime itself, where they're enabled). So still need to build a solution that also applies somehow to libraries, not just the code in the compilation unit.
We can do this during linking with a regular compiler plugin because linking sees all the IR, not just the compilation unit of the current module.
Might be worth stripping all calls functions in Preconditions.kt
since the nullability for our code is already enforced at compile time and those functions are called very frequently. This is already possible via compiler flag for the JVM and will eventually be supported for JS.
Things to do:
isTraceInProgress()
withfalse
sourceInformation
,sourceInformationMarkerStart
, andsourceInformationMarkerEnd
These functions are the source of a lot of bloat in the JS file and they are not needed in production. For native Redwood compilations to non-Android platforms, these calls add overhead that isn't needed.