Valdi – A cross-platform UI framework that delivers native performance

yehiaabdelm | 413 points

Working at a company that uses react-native I wish nothing more than for the end of app stores and differing platform languages.

We're heavily considering just having a website next year with a mobile app using webview, and then native code for the native notifications, GPS and healthkit / health connect.

I feel like AI is changing the equation, its nearly better to write your business UI 3 times one for each platform.

bearjaws | 16 hours ago

Looks in concept very similar to React Native. So now we have React Native, Lynx.js (ByteDance/Tiktok) and Valdi all based on React. I think competition is good for devs. But not sure if any of those will create ecosystem and community big enough and fast enough to React Native.

React Native grew a lot this year and a lot of things got or will be improved and copied from Lynx or Valid:

- 3 modes of compilation (AOT, JIT) from Valdi will be in static hermes (RN) in coming months.

- native binding generation -> RN already have such official generator and also nitro/nitrogen, they also working on Node-API

- executing animation and JS code in different thread (Lynx.js) -> worklet library in RN from swmansion

- tailwindcss support (Lynx) -> uniwind in RN land.

I think Lynx.js maybe have better shot at React Native since they want to support other frameworks instead of only React.

pzo | 6 hours ago

I was at Snap during this project’s early days (Screenshop!) and spent a bit of time debugging some stuff directly with Simon. He’s a wonderful engineer and I’m thrilled to see this project out in the open. Congratulations Snap team! Well deserved.

joenot443 | 17 hours ago

I cannot possibly think of something I would want to use less. A Snapchat-developed UI framework where communication is done via Discord sounds like something carefully designed to repulse me.

GaryBluto | 8 hours ago

I’m not sure I trust snap of all companies to make a good cross platform framework after how terrible their android app has been.

mholm | 17 hours ago

> Valdi is a cross-platform UI framework that delivers native performance without sacrificing developer velocity. Write your UI once in declarative TypeScript, and it compiles directly to native views on iOS, Android, and macOS—no web views, no JavaScript bridges.

digianarchist | 18 hours ago

I looked at the source code (as an amateur application developer) and boy, is it over-engineered and complex! Then I remember having built a complex Cordova app more than a decade ago, where I had to make C++, JNI and Javascript interop all play nice and this project feels a lot like that. Lots of moving parts. I suppose this is just the way things are when you are targetting such different ecosystems as Android and iOS _natively_, at the lowest level.

As a solo-dev, I realize well that this project isn't for me. This could be a great tool for experienced folks who know what they are doing. I will stick to Tauri and React Native, it does 80% of what I care about with 20% of the effort. Or until someone builds a nice wrapper around this to make it easy to use (and also add targets for x86_64/aarch64 builds).

sheepscreek | 3 hours ago

Unfortunately no Linux, Windows or even HTML targets?

a2800276 | 7 hours ago

If you are curious how components' state is handled, they employed the React class components method:

  // Import the StatefulComponent
  import { StatefulComponent } from 'valdi_core/src/Component';
  
  // ViewModel + State interfaces for component
  export interface TimerViewModel { loop: number }
  interface TimerState { elapsed: number }
  
  // Component class
  export class Timer extends StatefulComponent<TimerViewModel, TimerState> {
    // Initialize the state
    state = { elapsed: 0 };
    // When creating the component, start a periodic logic
    private interval?: number;
  
    // Initialize the setInterval that will update state once a second incrementing
    // the `elapsed` state value.
    onCreate() {
      this.interval = setInterval(() => {
        // Increment the state to trigger a re-render periodically
        const elapsed = this.state.elapsed;
        const loop = this.viewModel.loop;
        this.setState({ elapsed: (elapsed + 1) % loop });
      }, 1000);
    }
  
    // When component is removed, make sure to cleanup interval logic
    onDestroy() {
      if (this.interval) clearInterval(this.interval);
    }
  
    // Render visuals will depend both on the state and the view model
    onRender() {
      <view padding={30} backgroundColor='lightblue'>
        <label value={`Time Elapsed: ${this.state.elapsed} seconds`} />;
        <label value={`Time Looping every: ${this.viewModel.loop} seconds`} />;
      </view>;
    }
  }
https://github.com/Snapchat/Valdi/blob/main/docs/docs/core-s...
maxloh | 10 hours ago

What does using native view mean? Do they invoke native ui controls instead of drawing their own? Seems similar to boden - https://www.boden.io/

potato-peeler | 7 hours ago

Just write 2 native UIs in the 2 platform native languages and share a common core written in any language that offers a C like FFI.

How hard could it be?

JaggerJo | 7 hours ago

This looks promising. I would love to see more examples of what this can do along with screenshots. As is, there is a single Hello World and the components library is “coming soon”. But if it can deliver what it promises that would be pretty cool. React Native is I think the main popular framework in this space.

IgorPartola | 17 hours ago

This is so cool! I'm a React-Native developer, and I'm glad to see more options like this coming into existence.

topherPedersen | 14 hours ago

I often wonder how the economics are justified in making in house frameworks. What is it about Snapchat that requires a new framework but not other apps?

simianwords | 10 hours ago

I've worked and researched heavily in this field. If you want to write one codebase that hits all platforms with _actual native performance_ your only option at the moment is RN/Expo.

isaachinman | 3 hours ago

Is there an AI agent that excels that translating UI codes between SwiftUI, Jetpack Compose and web?

xngbuilds | 5 hours ago

I wish the native iOS part was written in Swift rather than Objective-C like RN.

instagary | 16 hours ago

So this is like all those other frameworks that compile to native components, except this one is natively Typescript?

I’ll take it

yieldcrv | 17 hours ago

Rename it Snapp

topherPedersen | 14 hours ago

So now I can finally implement the most god-awful, ugly, cumbersome and unintuitive GUI methodology ever to face a large population of users into my own apps? This abomination that started the whole user-experience decline by making this kind of yuck the gold standard for apps today is finally open source?

Color me yellow.

sans_souse | 16 hours ago

Ah yes, Snapchat, an app famous for its high performance, efficient apps, which definitely never made your phone hot and drained your battery.

Seriously, if there’s an app that sticks in my head for being noticeably laggy, you couldn’t pick a better example than Snapchat.

FridgeSeal | 7 hours ago
[deleted]
| 5 hours ago

> Valdi – A cross-platform UI framework

I presume this is a Text UI. How does it compares with ncurses and termcap ? /s

hulitu | 7 hours ago

Not related to this, but abandoning Key DB was the worst thing they could do.

sreekanth850 | 14 hours ago

Its hard to imagine not going fully native in the modern day with coding agents. Most of the code can just be clanked out.

skeptrune | 11 hours ago

Not to troll , Do you need such shims in the era of llm ?

maxdo | 17 hours ago