4 पॉइंट द्वारा GN⁺ 2026-03-16 | 1 टिप्पणियां | WhatsApp पर शेयर करें
  • TikTok ने अपने ऐप्स में Lynx इंजन को production scale पर चलाने के लिए बनाए गए infrastructure layer को open source के रूप में जारी किया है। यह app scaffolding से लेकर build, native bridge और navigation तक एकीकृत रूप से प्रदान करता है
  • जैसे React Native के लिए Expo की ज़रूरत होती है, वैसे ही Lynx इंजन पर वास्तविक ऐप चलाने के लिए यह एक production infrastructure framework है
  • एक ही CLI command से Android/iOS native shell सहित पूरा Lynx app project तुरंत बनाया जा सकता है, और build→install→run एक साथ किया जा सकता है
  • केवल TypeScript declarations लिखने पर Kotlin/Swift code अपने-आप generate करने वाला Sparkling Method type-safe JS↔native bridge को लागू करता है
  • hybrid:// फ़ॉर्मेट की unified URL scheme navigation के ज़रिए Lynx pages और native screens के बीच routing को एक ही सिस्टम में संभाला जाता है

Sparkling की स्थिति: Lynx के साथ संबंध

  • Lynx TikTok द्वारा जारी किया गया एक cross-platform UI rendering engine है, जिसमें React जैसी शैली में code लिखने पर Android/iOS screens को native rendering से render किया जाता है
  • Lynx स्वयं एक "rendering engine" है, इसलिए वास्तविक ऐप संचालन के लिए build pipeline, native↔JS communication, page navigation, storage/media access जैसी अतिरिक्त infrastructure की ज़रूरत होती है
  • Sparkling इसी infrastructure layer की भूमिका निभाता है, और Lynx इंजन के ऊपर चलने वाला app framework है
  • जैसे सिर्फ React Native से ऐप बनाना कठिन होता है और Expo की ज़रूरत पड़ती है, वैसे ही केवल Lynx से बड़े पैमाने के ऐप चलाना कठिन है, और Sparkling इस gap को भरता है
  • यह फिलहाल public beta चरण में है, और API विस्तार व documentation सुधार जारी हैं

App scaffolding और build CLI

  • npm create sparkling-app@latest my-app की एक लाइन से Android/iOS native shell सहित पूरा project create किया जा सकता है
  • npx sparkling build से Lynx bundle build होता है, और npx sparkling run:android/run:ios से build→install→run एक साथ किया जा सकता है
  • npx sparkling dev से hot reload development server चलता है (default port 5969, जो फ़ोन keypad पर LYNX टाइप करने के अंकों के बराबर है)
  • npx sparkling doctor से Node.js, JDK, Android SDK, Xcode, CocoaPods आदि development environment का automatic diagnosis होता है
  • npx sparkling autolink से Sparkling Method modules की Gradle/Podfile dependencies auto-register होती हैं और native registry code generate होता है
  • npx sparkling copy-assets से compiled bundles को Android/iOS resource directories में copy किया जाता है

Sparkling Method — type-safe JS↔native bridge

  • TypeScript .d.ts फ़ाइल में सिर्फ function declarations लिखने पर, CLI(sparkling-method-cli codegen) Kotlin/Swift native code और TS implementation को auto-generate करता है
  • generated abstract classes को inherit करके सिर्फ native business logic implement करने पर उसे JS से सीधे call किया जा सकता है
  • built-in Methods के रूप में Navigation(router), Storage(key-value store), Media(camera/album/file) दिए जाते हैं
  • package name sparkling-<module> फ़ॉर्मेट में, और method name &lt;module&gt;.&lt;action&gt; (उदाहरण: router.open) convention का पालन करते हैं
  • npm पर publish करने के बाद सिर्फ npm install + npx sparkling autolink से consumer side integration पूरा हो जाता है

Scheme-आधारित unified navigation

  • hybrid://lynxview_page?bundle=main.lynx.bundle&title=Home जैसे unified URL scheme से Lynx pages और native screens को एक ही तरह route किया जा सकता है
  • हर page का अलग bundle entrypoint होने वाली multi-page structure बड़े पैमाने के ऐप्स के लिए उपयुक्त design है
  • navigate() function में pre-defined keys के अलावा custom parameters भी scheme URL में pass किए जा सकते हैं

मौजूदा ऐप्स में gradual integration (Brownfield)

  • नए ऐप्स के अलावा मौजूदा Android/iOS ऐप्स में Sparkling container embed करके इसे धीरे-धीरे अपनाया जा सकता है
  • Android: Maven artifact(com.tiktok.sparkling:sparkling:2.0.0) जोड़ने के बाद, HybridKit.init() initialization → Sparkling.build(context).navigate() से container खोलना
  • iOS: CocoaPods(pod 'Sparkling', '2.0.0') जोड़ने के बाद, SPKRouter.create(withURL:) से controller push या SPKContainerView से view embed
  • built .lynx.bundle फ़ाइल को native app assets में copy करें, और bundle= parameter से उस bundle को specify करें

Project structure

  • packages/sparkling-sdk: core Sparkling SDK
  • packages/sparkling-method: Sparkling Method SDK (JS↔native bridge)
  • packages/methods: built-in Sparkling methods package (Navigation, Storage, Media)
  • packages/sparkling-app-cli: Sparkling app build और run CLI
  • packages/create-sparkling-app: app scaffolding CLI
  • packages/sparkling-method-cli: Sparkling Method codegen tooling
  • packages/sparkling-types: GlobalProps type definitions को एक package में एकीकृत करता है
  • packages/playground: local development के लिए Playground app

Tech stack और environment

  • Node.js ^22 || ^24, pnpm v10.26.0 environment
  • Android: JDK 11 या उससे ऊपर, android-34 SDK आवश्यक
  • iOS: Xcode 16+, Ruby ≥2.7 <3.4, CocoaPods आवश्यक
  • TypeScript, Swift, Kotlin, JavaScript आदि multi-language configuration
  • Apache 2.0 license

1 टिप्पणियां

 
freedomzero 2026-03-16

Lynx - वेब टेक्नोलॉजी आधारित native app development टूल - GeekNews
https://hi.news.hada.io/topic?id=19688

साथ में पढ़ने लायक लेखों में यह नहीं दिख रहा है।