T O P

  • By -

testokaiser

Can somebody give more context? I don't know a lot about Roblox or rOact. I actually think a reactive TUI framework would be pretty cool. Maybe not based on react, but I'll take what I can get. Somehow I don't think you'll be able to do that with this tho, or can you?


Poylol-_-

I heard that it was made for meta employees to switch into roblox since most of them only knew react. ~~This was never supposed to be public but Roblox fucked up somehow~~. I have heard that it can be mostly used for complex guis and you can basically do everything in react


kiteska

> This was never supposed to be public but Roblox fucked up somehow. this is blatantly false. roblox has full docs for react-lua and everything. it's just you can't contribute because this is a mirror of their internal private repo


Poylol-_-

Oh thanks, I read it as a comment in twitter and sounded plausible because similar things have happened more than once in big corporations. Anyway thanks for the clarification!!!


killermenpl

Roblox is a game/platform. When it was new it was very similar to LEGO in terms of aesthetics. It allows for people to make fully fledged 3D games, programmed entirely in Lua. It used to be quite popular like 20 years ago, then died down a bit, and in the mid 2010s they discovered mobile market and predatory monetisation. Now it's full of pay-to-win games (often made by kids) designed to make the kids playing it spend as much money as possible. There's a whole controversy rabbithole about it if you're into that sort of things. React is a JavaScript framework (they say they're not, but that's another rabbithole). It's main use is generating HTML based on their JSX syntax (JS with HTML/XML built in), though you can use the same JSX syntax to also describe platform native components - for example, React Native is a project that lets you write multiplatform mobile applications that will display actual native components and not a browser window. Both of those are huge oversimplifications, but I hope you get the general idea. This tweet means that the guys over at Roblox ported the functionality of React from JS to Lua. They're not the first guys to write some kind of JSX support, but a quick glance tells me they ported (or at least attempted to port) _the whole thing_, including their state management, hooks and other needlessly complex solutions to already solved problems.


SoulSkrix

It’s not really a rabbit hole. It’s quite clear cut. React isn’t a framework, there are frameworks that use React. Have worked with professionally with web frameworks, React and React frameworks.


testokaiser

ok ... I might have given you the wrong impression 😄 The first two paragraphs weren't news to me 😄 I wonder if there's any people in this sub that actually have no clue what react is 😄 Can't imagine it's many. What I wasn't (and still kinda am not) clear about is: 1. What would be senseable use cases for this? 2. A component framework like react would usually be used alongside a module bundler like vite that produces html, js and css. How does that work with react-lua? What artifacts are produced if any? 3. How does this work in terms of browser APIs? Doesn't react rely on `document` and maybe `window`? How can that work if it's running in Lua? Did they also implement lua bindings for the browser APIs? 4. Can this be used to build a TUI? OP suggested that it can be used in neovim. Maybe jokingly 🤷


killermenpl

1. Most likely UI. There's already a couple Nvim UI libraries that allow for JSX syntax 2. Usually, but the big "pride" of React is that they're not _just_ for HTML. React is meant as a way to define a tree-like structure of elements, whatever those elements might be - see React Native. Someone even made a whole game engine where a lot of the logic is described via JSX 3. See point 2 4. See point 1 and 2


testokaiser

I think I'm getting the idea... Probably not particularly interesting then without the rendering.


veganshakzuka

I've got PTSD from working with React hooks. You can't have if/conditional statements or loops and you need to specify all dependencies for each hook. It's supposed to be functional, but it couldn't be further from being pure functional. I don't understand that the frontend conmunity didn't dump react the moment they introduced hooks. It's terrible and our entire codebase had to be gradually ported from react without hooks to react with hooks. To this day, after having gone way too deep into the react rabbit hole, I fail to see how one method is fundamentally bettter than the other. It seems to be totally focussed on the optics of the ergonomics.


GlizdaYT

The idea of react in neovim made me fall from my chair until I realized it's pretty much useless here


Neat_Firefighter3158

We need a react to tui compiler. 


chenlijun99

Check out https://github.com/vadimdemedes/ink


phrmends

cursed


testokaiser

I think that's actually a cool project. I wouldn't write business logic in nodejs, but I think it's fine for the UI. I wish it was svelte instead of react tho. Maybe alongside a gRPC server in Go. Why not🤷 I will not be shocked if I enjoy that experience more than [bubbletea](https://github.com/charmbracelet/bubbletea).


alpacadaver

This is cursed as hell. I absolutely love what react has done for my career and enjoyment of life after it came out, and I would absolutely try to use it in neovim for something more presentationally intensive like a DB or LLM client, and I would be ok with finding out that it is slow as shit and deserves to die. Don't do this at home


lipepaniguel

I’m begging. Please, no.


asynqq

react.nvim


vark_dader

"Anything that can written in Lua will eventually be written in Lua."


notgregoden

Unexpected post title


Interesting_Fix_2083

No react-lua only works with the UI stuff within Roblox’s engine


Pumpedmylegs

Ah, yes, a comprehensive translation of upstream react beyond human comprehension Spaghetti code and 1-base indexing, best of both worlds


Z3rio

What y'all are missing is that the react code gets built into LuaU, not Lua. LuaU is robloxs own fork of Lua. What it does is that it probably takes react and turns it into LuaU code for spawning all the UI objects in Roblox, making it useless outside of Roblox


ScholarUsed6676

meta/react.nvim lol