devtools.fm: Developer Tools, Open Source, Software Development

Nathan Walker, Eduardo Speroni - NativeScript. Use Native API right in JS

Jul 29, 2024
Nathan Walker and Eduardo Speroni, key contributors to the NativeScript team, share their insights on harnessing native platform APIs within JavaScript. They delve into the evolution of NativeScript and its unique bridging capabilities that set it apart from other frameworks. Performance aspects on Android and iOS are contrasted, alongside a discussion on advancements in NativeScript engines. The potential for NativeScript to expand into desktop environments is explored, highlighting its adaptability and community-driven innovations.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ADVICE

Pre-Gencode Metadata For Performance

  • Generate platform metadata at build time to avoid runtime lookup costs and ship it with the app binary.
  • Use TypeScript-first typings to catch API mismatches at compile time instead of runtime.
INSIGHT

When Bridge Cost Matters

  • Bridge overhead exists (V8→C++ and JNI) and matters only when tiny native calls happen thousands of times per second.
  • For typical app code the cost is acceptable; critical hotspots can be moved to native wrappers if needed.
INSIGHT

Engine Flexibility And Alignment

  • NativeScript has moved from JavaScriptCore to V8 to align engines across iOS and Android and ease maintenance.
  • The project is experimenting with Hermes, QuickJS and other engines to decouple from V8 in future.
Get the Snipd Podcast app to discover more snips from this episode
Get the app