Valdi  by Snapchat

Build native cross-platform UIs with TypeScript

Created 5 months ago
16,384 stars

Top 3.1% on SourcePulse

GitHubView on GitHub
Project Summary

Valdi is a cross-platform UI framework that compiles declarative TypeScript (TSX) directly to native views for iOS, Android, and macOS. It aims to deliver native performance without sacrificing developer velocity, targeting developers building cross-platform applications who require both high performance and rapid iteration cycles. The framework has been battle-tested internally at Snap for eight years.

How It Works

Valdi's core approach bypasses web views and JavaScript bridges by compiling TSX components into platform-native views. This ensures true native performance. Further optimizations include automatic view recycling via a global pooling system, independent component re-rendering to prevent parent re-renders, an efficient C++ layout engine, and viewport-aware inflation for performant scrolling.

Quick Start & Requirements

  • Prerequisites: Xcode (macOS only).
  • Installation: npm install -g @snap/valdi, followed by valdi dev_setup.
  • Project Setup: valdi bootstrap, then valdi install ios or valdi install android.
  • Resources: Getting Started Guide, Documentation, Codelabs, API Reference, FAQ, Component Library, Example Apps.

Highlighted Details

  • True Native Performance: Achieved by compiling directly to native views, avoiding bridges. Features automatic view recycling, optimized component rendering, a C++ layout engine, and viewport-aware inflation.
  • Developer Experience: Provides instant hot reload (milliseconds), full VSCode debugging capabilities, and a familiar TSX/TypeScript syntax for type safety.
  • Flexible Adoption: Integrates into existing apps by embedding Valdi components or native views. Supports polyglot modules for performance-critical code in C++, Swift, Kotlin, or Objective-C.
  • Proven at Scale: Powers critical features in production Snap applications, supporting advanced animations, real-time rendering, and complex gesture systems.

Maintenance & Community

Community support is available via GitHub Discussions and Discord. A roadmap and example applications are also provided.

Licensing & Compatibility

Valdi is released under the permissive MIT License, generally compatible with commercial use and closed-source linking.

Limitations & Caveats

The project is currently in beta, with tools and documentation undergoing further refinement for open-source use. It will exit beta once the developer experience meets the project's standards.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
2
Star History
154 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.