The Future of React Native?

Поделиться
HTML-код
  • Опубликовано: 1 дек 2024

Комментарии • 31

  • @Baconbrix
    @Baconbrix 6 дней назад +21

    Great video! We'll continue to improve every aspect of these new tools.
    Every function exported from a file are React Server Functions, not a React Server Component. You can only use inline React Server Functions ("use server" in async functions) when those functions are defined in a react-server environment, but the app/functions.tsx file runs in the client environment. To get around this, you can define the function in a file and mark it with "use server" at the top. If you return JSX from a React Server Action, you can pass a function with "use server" inside of it to make an inline React Server Action.

  • @giacomogaravaglia6742
    @giacomogaravaglia6742 6 дней назад +14

    server side components/functions scares me a lot. They can be "packaged" but how distributed? With api you have much control over the tech stack and the infrastructure (load balancing, performance, etc), with this you have to add an additional component on the infrastructure, idk, i'm an old guy. Dom components, on the other hand, are amazing. Thanks for this

    • @Baconbrix
      @Baconbrix 6 дней назад +13

      Normally when you build the app, the bundler gathers all the modules into a giant JS bundle that is put in the client. With the Server Functions flag enabled, the bundler does the same, but it converts all "use server" modules into relative fetch requests to a server (/_flight/foobar.tsx). The bundler does another pass to make the Node.js server. It does this by bundling all the "use server" files as entry points. Finally, we add a virtual API route at `app/_flight/[...rsc]+api.ts` which redirects the generated requests to the associated server functions.
      There are a bunch of other minor things wrapping this system to enable serializing arguments, error handling, and streaming, but mostly the magic is just in this little bundling maneuver.
      The result is two JS dist folders (just like the web)-one for client, and another for the server. The bundling operation is actually identical across web and native (this was hard to do both worth it) so it's not especially more complicated than web dev-which is objectively the easiest way to build frontends.
      I'm confident that we can automate this so much that you don't even notice the server part. As I've been using it over the last year, my fear has shifted from servers/unknown to the idea of just how much code I was packaging offline and exposing to the client. It's freeing to just fetch data and authenticate with secrets without worrying about having to do crazy things like hiding secrets in secure store on-device or setup short-lived implicit auth to circumvent a proxy server. But a healthy amount of skepticism is encouraged, try it yourself before taking my word for it!

    • @kshitijkhot1401
      @kshitijkhot1401 4 дня назад

      @@Baconbrixnice

  • @JayeshSaini95
    @JayeshSaini95 6 дней назад +3

    If server components are not bundled in app package, this will be a game changer for securing API keys. Also the dom components are amazing 🤩

  • @andryniaina6903
    @andryniaina6903 5 дней назад +5

    Expo should focus on mobile. Mobile doesn't need Server Rendering at all. For web, Next is doing great.

  • @carlosricardoziegler2650
    @carlosricardoziegler2650 4 дня назад +2

    Nice, how is the process to deploy that ? With server functions and so on ?

  • @JoelPiccoli
    @JoelPiccoli 5 дней назад +1

    Mind-blowing! Do you know what the PHP community has in common with React Native's? We love to improve and contribute! Expo is just what React Native always needed!

    • @matheusaraujo8617
      @matheusaraujo8617 4 дня назад

      i saw PHP and i thought you were about to make a joke, glad to be wrong lol

  • @madmaxdev
    @madmaxdev 5 дней назад +1

    The client, server, dom folders inside the components folder makes sense.

  • @OBLIVIOUSKARI
    @OBLIVIOUSKARI 5 дней назад +5

    This is amazing but I have a question, where in the world is the server? Isn’t this a mobile device? Are we calling back to an expo cloud server?

    • @sanketgawande3667
      @sanketgawande3667 5 дней назад +2

      Exactly, I've the same question. Is it like a full stack thing like Nextjs does on top of react?

    • @OBLIVIOUSKARI
      @OBLIVIOUSKARI 5 дней назад

      @@sanketgawande3667word. I’ll have to take some time to read about this. It makes sense with nextjs since you are pushing up a whole server to run the app. This is a mobile app so I don’t get it. Is the mobile device the server? Loo

  • @matheussousa2548
    @matheussousa2548 5 дней назад +2

    Where does it get hosted at? I can't understand where is the "server"

    • @ChihabOtmani
      @ChihabOtmani 5 дней назад +1

      You can read Evan Bacon's explanation in the comments but ultimately the server files generated (in a dedicated folder) can be hosted on any backend platform or infrastructure that supports Node.js.
      I guess that if the code is updated, both the application (client) and server components would need to be updated to remain in sync, otherwise the client may make requests to server functions (/_flight/foobar.tsx) that no longer exist or behave differently, leading to errors.

  • @Flash136
    @Flash136 5 дней назад

    Interested to see how Expo will deal with the hosting side of things. It would be nice to see this better integrated with Vercel, in the same way Next.js is: just a single click, and you have everything hosted for your web/mobile app.

  • @dondragon2
    @dondragon2 5 часов назад

    Where is the server hosted?

  • @matheusaraujo8617
    @matheusaraujo8617 4 дня назад

    so all this stuff is used just in a web app created using react-native, if im just building a mobile application only, i dont need to use those features, am i right?

  • @NotEsc_
    @NotEsc_ 4 дня назад

    what's the name of theme you use on VS-code?

  • @dglalperen
    @dglalperen 5 дней назад

    So if i understood correctly, i could have a node backend which is hosted separately and provides react native UI. Lets say we have an endpoint /products/xyz. On the Mobile Side of things we could just call the endpoint and the server (my hosted backend) would give me the UI.
    so whenever i want to change the UI i could just update the backend endpoint styling for example and it would be instantly rolled out ?

  • @lourencorosado9097
    @lourencorosado9097 5 дней назад +1

    What about using something as prisma or drizzle? Would that be possible?

  • @jisonsoft4810
    @jisonsoft4810 5 дней назад

    now if we generate for example an apk, how the server component will be compiled, or the SRCs will be extracted how a bakend which must be hosted separately please,

  • @Hari-o4h
    @Hari-o4h 4 дня назад

    Can anyone explain me in simple terms, what is the use of server components in expo?

  • @ullaba_id
    @ullaba_id 5 дней назад

    Is expo good for production in play store or use RN ???

  • @emmsdan
    @emmsdan 5 дней назад

    Can expo just stick to Mobile?

  • @nithish8111
    @nithish8111 День назад

    Day 1 asking for how to create an npm package for Expo, test it locally, and then publish it on npm?

  • @Hukumsa_official
    @Hukumsa_official 6 дней назад

    Can we update app from server

    • @Seanmclem
      @Seanmclem 6 дней назад

      It’s called expo-updates and yes. But with RSC you can do that without any real update process

  • @ViewingVibes-bm3nq
    @ViewingVibes-bm3nq 5 дней назад

    Is it works in web

  • @nickv.v
    @nickv.v 5 дней назад

    hey, is this guy who was taking he was not a huge fun of react native?)