Nativescript has supported the web worker paradigm for multi-threading for a while now[0]. Also, I'd like to point that for a lot of applications (especially the ones that are basically informational without much interaction or client-side work, this actually isn't an issue early in the development process.
I've used Nativescript on client projects, and it is fantastic for prototyping, with well demarcated paths to performance optimization. Since you can easily use native screens/controllers/etc with it, at the very least you can use it for fast prototyping then drop all your custom code in.
Do you know of any hybrid frameworks that are not running JS code on the main thread by default? And by JS code I assume you mean display-related code, because Flutter suffers from this same issue, do too much hard work on the main thread and it stalls (as anything would). Even on android itself[1] you need to do some extra work to make sure your UI-related heavy lifting happens off the main thread:
> However, when the main thread’s messaging queue contains tasks that are either too numerous or too long for the main thread to complete the update fast enough, the app should move this work to a worker thread
I wouldn’t necessarily write this off. Doing UI-related work directly in the main thread has a lot of benefits -- your click listeners can take effect immediately and make all the necessary UI updates before the next event is processed. With event handling in a separate thread, it can be harder to make things robust (filtering out double taps, preventing flashes of unfinished/unstyled content, etc).
Of course you do need to make sure that everything that could be even slightly expensive is shipped out to a background thread. JS is weak in that respect.
Moving everything to a background thread does fix that problem, but I think it’s overkill. A lot of mobile apps would be faster and more responsive if they used the main thread more. You just have to use it right.
I've used Nativescript on client projects, and it is fantastic for prototyping, with well demarcated paths to performance optimization. Since you can easily use native screens/controllers/etc with it, at the very least you can use it for fast prototyping then drop all your custom code in.
Do you know of any hybrid frameworks that are not running JS code on the main thread by default? And by JS code I assume you mean display-related code, because Flutter suffers from this same issue, do too much hard work on the main thread and it stalls (as anything would). Even on android itself[1] you need to do some extra work to make sure your UI-related heavy lifting happens off the main thread:
> However, when the main thread’s messaging queue contains tasks that are either too numerous or too long for the main thread to complete the update fast enough, the app should move this work to a worker thread
[0]: https://docs.nativescript.org/core-concepts/multithreading-m...
[1]: https://developer.android.com/topic/performance/threads