React Native's JSI Explained · Part 2 · Setting up a JSI module

Поділитися
Вставка
  • Опубліковано 21 вер 2021
  • Welcome to React Native JSI explained, on this video we will start setting up an actual JSI module, today we will start with a old-bridge C++ library and then slowly migrate to a JSI implementation
    ADDITIONAL RESOURCES
    My personal website: ospfranco.com
    C++ Guide on UA-cam: • C++ For JavaScript Dev...
    JSI/C++ Guide written version: ospfranco.gumroad.com/l/IeeIvl
    Follow me on twitter: / ospfranco
  • Наука та технологія

КОМЕНТАРІ • 7

  • @manimohan8567
    @manimohan8567 2 роки тому +1

    Hi Oscar
    Great series! Thanks a lot!
    Kindly please explain various function definitions in SuperSqllite.mm file and why we need to write such functions and what is the purpose of each one ?
    Like why we do need to cast bridge ?
    What does installSequel does?

  • @mybuddy11
    @mybuddy11 2 роки тому +1

    thanks

  • @_Oskar_
    @_Oskar_ 2 роки тому

    Is codegen for typescript already stable enough?

    • @ospfranco
      @ospfranco  2 роки тому

      stable, don't think so, some libraries might be using it though

  • @gnidarada
    @gnidarada Рік тому

    This example and all similar "hello world" or "add a and b" examples install JSI functions from under setBridge. But that's pretty misleading. There is threading/race involved and there is no guarantee that cxxBridge.runtime will be there when setBridge is called. It never is for me.
    The most reliable way to make sure the runtime is there is to:
    1. store bridge in setBridge
    2. grab cxxBridge.runtime when RCTBridgeModule's startObserving is called. But that time you are guaranteed that native/JS bridge has been set up and the runtime was set.

    • @ospfranco
      @ospfranco  Рік тому

      You are right, but this video/tutorial is by now fairly outdated (at the time turbo modules where not even usable). The best way to do it IMO is to call a sync blocking method and call it whenever the library is imported. No need to mess around with more internal calls. My libraries are updated and you can take a look into the open source repos.

    • @gnidarada
      @gnidarada Рік тому

      @@ospfranco ahh, and that blocking code is executed when your .jsbundle is loaded? Brilliant, thanks!