tezvyn:

How do Fabric, TurboModules, and JSI fix bridge limits?

AI-drafted, machine-checkedSource: interviewadvanced
WHAT IT TESTS

deep knowledge of the new architecture.

OUTLINE

JSI lets JS hold C++ host objects and call native synchronously without JSON serialization; Fabric renders concurrently and TurboModules lazy-load.

WHAT THIS TESTS: Whether you grasp that the new architecture removes the bridge entirely rather than optimizing it, and how JSI underpins everything.

A GOOD ANSWER COVERS: JSI is a slim, engine-agnostic C++ layer that gives JavaScript direct references to native objects, called host objects, so JS can invoke native methods synchronously without serializing arguments to JSON and without an async message queue. This removes the legacy bridge's two costs: serialization and async batching. Built on JSI, TurboModules are native modules that load lazily on first use and are accessed through JSI, cutting startup cost. Fabric is the new rendering system that builds an immutable shadow tree in C++, supports concurrent React features, and allows synchronous measurement of layout, so the renderer and JS stay in sync.

COMMON WRONG ANSWERS: Describing JSI as a faster or optimized bridge; it replaces the bridge concept. Saying data is still serialized to JSON. Treating Fabric and TurboModules as the same thing rather than rendering versus native modules. Claiming everything becomes synchronous; expensive work should still be deliberate.

LIKELY FOLLOW-UPS: How CodeGen generates type-safe bindings, what host objects and host functions are, how synchronous access can be dangerous if it blocks the JS thread, and migration steps for an existing app.

ONE CONCRETE EXAMPLE: A module returning device battery level under the legacy bridge required an async callback because the value crossed the serialized queue. As a TurboModule over JSI, JS calls the C++ method directly and gets the value back synchronously as a plain number, with no JSON round trip, enabling faster and simpler call sites.

Read the original → github.com

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.