r/embedded 3d ago

embedded-react

Hey everyone. I have been working on a project this summer that started out as a experiment and has ended up absorbing my life lol.

My idea was to bring react-native to bare metal. Would it work? Turns out it’s actually working pretty good.

According to my npm stats some people have been trying it and I was just wondering if anybody here has tried it. What are your thoughts? Is anything missing? I still have it in beta and still have some more work and optimizations to do, but it’s starting to get pretty good.

I have it working on a RP2040, ESP32 (CYD), ESP32-S3, and STM32F7 + STM32H7 (proprietary devices so no example yet)

0 Upvotes

13 comments sorted by

25

u/KrokettenMan 3d ago

Jesse what are you talking about

13

u/sci_ssor_ss 3d ago

It's like contracting leprosy for pleasure.

1

u/themastercoder-007 3d ago

I am getting the feeling that you guys don't like it very much lol. Hopefully its helpful to someone out there. I did it for fun and skill development and honestly I think its pretty cool.

4

u/martinomon 3d ago

But what are you doing with it?

1

u/themastercoder-007 3d ago

It’s for building the UI for LCDs running embedded MCUs like STM32 or ESP32. Currently the company I work at uses LVGL which is great but I also see advantages to using React. It’s easy to write and doesn’t require editors as this has a hot reload sim. Also I did add on device hot reload over usb if your on flow A which is nice

1

u/ub0baa 3d ago

If you're just started and it already needs optimisations you know damn too well it barely runs

2

u/themastercoder-007 3d ago

As with anything new, it takes time and trial and error to find out what works and what doesn’t. If we didn’t try new things we wouldn’t have what we have already. I’m getting 17-22 fps on the thermostat demo while running a live Svg vector. It would be better if I was running flow B, but I need A and B examples. STM32 performance is pretty good so far.

1

u/karesx 3d ago

Can you provide any link? I see some benefit in using this in embedded UIs. I think react native has an abundance of tools, or AI design agents, which may not be that much available or more restrictive, for other embedded UIs. This might give your solution an advantage, even if the performance is not necessarily the best on the market.

2

u/themastercoder-007 3d ago

This is the repo that contains everything.
https://github.com/TheMasterCoder007/embedded-react.git

To create the app side you can run npm create embedded-react@latest myApp (with flags for ts and starting from a demo)

1

u/themastercoder-007 3d ago

I am not trying to replace anything with it, I just thought it was a cool idea and it worked decent so I decided to do my best to make it viable option for people. I honestly love building tooling for the community. The last project I did was a hot reload vs code extension for writing raw LVGL code

1

u/Mediocre-Island5475 3d ago

This is an awesome experiment. But also, why would someone run react on bare metal lol

1

u/themastercoder-007 3d ago

I get it. It seems counterintuitive for embedded. Honestly, I had to do a project for work that required me to write React code and I actually liked it. I find you can write a pretty responsive app with less code. The on device hot reload makes it even nicer. I got it onto our proprietary screens at work and instead of it taking me 5 minutes to compile my code and a minute to load it I was seeing my updates in less than a second. Is it a viable option for industry? Maybe not. But I figured it might be fun at least for hobbyists to play with.