Dioxus 0.5: signals का rewrite, lifetimes हटाना, CSS hot reloading आदि
- Dioxus Labs में एक अनौपचारिक नियम है कि साल में सिर्फ एक बार rewrite की अनुमति है.
- Dioxus, Rust में GUI बनाने के लिए एक लाइब्रेरी है, जिसकी शुरुआत मूल रूप से Yew के rewrite के रूप में हुई थी.
- Dioxus 0.5 को community की मांग के अनुसार अधिक सरल, मज़बूत और polished दिशा में बदला गया है.
नई सुविधाएँ
dioxus-core का पूरा rewrite, जिससे सभी unsafe code हटाए गए.
use_state और use_ref का उपयोग किए बिना clone-free Signal आधारित API में बदलाव.
- सभी lifetimes और
cx: Scope state हटाई गई.
- सभी platforms के लिए app start करने हेतु एक single
launch function जोड़ा गया.
- Tailwind और Vanilla CSS को support करने वाला asset hot reloading.
- event rewrite के ज़रिए हर platform के मूल
WebSys event types तक पहुँच संभव.
- component extension के माध्यम से element attributes जोड़ना (जैसे Link अब
<a/> के सभी attributes ले सकता है).
- integrated error boundaries और server futures के साथ Suspense integration.
- desktop diffing speed में 5x सुधार और byte streaming के लिए custom asset handlers.
- server function streaming और full-stack hot reloading.
- कई QoL सुधार, bug fixes आदि.
lifetime समस्या
- Dioxus को और सरल बनाने के लिए सभी lifetimes हटा दिए गए.
- lifetime समस्याएँ Rust beginners को आसानी से डरा देती हैं, और अनुभवी Rust developers को भी भ्रमित कर सकती हैं.
- Dioxus 0.5 lifetimes और
Scope को हटाकर Copy state management solution यानी signals को लाता है.
scope और lifetime हटाना
- नए version में scope और
'bump lifetime हटा दिए गए हैं.
- component declaration और component के अंदर runtime functions का उपयोग करना बहुत आसान हो गया है.
सभी unsafe code हटाए गए
'bump lifetime और scope हटाने से बहुत सा unsafe code हट गया.
- dioxus-core 0.5 में कोई unsafe code नहीं है.
signals
- components की core state primitive के रूप में signals जोड़े गए.
Signal<T>, अंदर T value न होने पर भी Copy है.
- signals अधिक smart subscriptions देते हैं, इसलिए केवल वे components re-render होते हैं जो signal को पढ़ते हैं.
CSS hot reloading
- CSS files के hot reloading support के साथ
dx CLI files को watch करता है और app में तुरंत updates stream करता है.
event system rewrite
- dioxus 0.5 हर platform के native event types को expose करता है, और platforms के बीच API देने वाला trait लाता है.
cross-platform launch
- नए cross-platform API के ज़रिए एक ही application से कई platforms को आसानी से target किया जा सकता है.
asset system beta
- नया asset system manganis, CLI के साथ integrate होकर application के assets को inspect, bundle और optimize करता है.
desktop rendering speed में 5x सुधार
- rendering speed बढ़ाने के लिए कई optimizations लागू किए गए.
attribute extension
- किसी विशेष element को अतिरिक्त functionality देने में उपयोगी.
attribute shorthand
- attributes को elements और components में pass करते समय attribute shorthand syntax का उपयोग किया जा सकता है.
multi-line attribute merging
- conditional attributes को आसानी से बनाने के लिए attribute merging feature जोड़ा गया.
server function streaming
- server functions अब client के साथ data stream कर सकते हैं.
full-stack CLI platform
dx command का उपयोग करके full-stack apps को serve किया जा सकता है.
liveview router support
- liveview apps में router सीधे काम करता है.
custom asset handlers
- desktop पर custom asset handlers support किए जाते हैं, जिससे browser तक data को कुशलता से stream किया जा सकता है.
native file handling
- desktop पर file drop को सही तरीके से support किया गया है.
error handling
- error boundaries और throw trait के उपयोग से apps में errors को आसानी से handle किया जा सकता है.
hot reloading by default और desktop के लिए "development" mode
- hot reloading को default रूप से enable किया गया है, और desktop app development experience को काफी बेहतर बनाया गया है.
dioxus template update
- नए core team member Miles ने documentation और templates का बड़े पैमाने पर पुनर्गठन किया है.
Dioxus-Community और Dioxus-std
- Dioxus Community ने महत्वपूर्ण ecosystem crates को 0.5 release के अनुरूप update किया है.
जल्द आने वाली सुविधाएँ
- asset system का stabilization और integration,
.wasm का bundle splitting, Islands और resumable interactivity, server components, बेहतर developer tools, mobile और full-stack overhaul आदि.
Dioxus-Blitz revival preview
- "Blitz 2.0" में Servo को integrate करके WGPU का उपयोग करते हुए Firefox को चलाने वाले उसी CSS engine से native rendering संभव होगी.
योगदान कैसे करें
- documentation translation, "good first issue" आज़माना, docs सुधारना, CLI में योगदान, Discord community के सवालों के जवाब देना आदि तरीकों से योगदान किया जा सकता है.
GN⁺ की राय
- Dioxus 0.5, Rust आधारित GUI development के लिए एक महत्वपूर्ण update है, जो developers को अधिक आसान और सुरक्षित development environment देता है.
- lifetimes और scope को हटाने से Rust development की जटिलता कम होती है, और Signal आधारित API state management को और सरल बनाती है.
- CSS hot reloading और event system में सुधार frontend development की productivity बढ़ाने में मदद करेंगे.
- hot reloading और cross-platform launch features developers को अलग-अलग platforms पर एक समान development experience देने में मदद करते हैं.
- इन बदलावों का Rust और web development community पर सकारात्मक प्रभाव पड़ने की उम्मीद है, खासकर उन लोगों के लिए जो Rust का उपयोग करके web और desktop applications बनाते हैं.
1 टिप्पणियां
Hacker News राय
Dioxus 0.5 वर्ज़न में हुए बदलावों पर पहले यूज़र का अनुभव
SVG सपोर्ट को लेकर सवाल
Rust प्रोग्रामिंग को लेकर जिज्ञासा और
generational-boxcrate के काम करने के तरीके पर सवालgenerational-boxcrate बिना copy किए values को कैसे बनाए रखता है, और क्या यह सुरक्षित है.Dioxus का इस्तेमाल करके Freenet होमपेज डेवलप करने का अनुभव
Dioxus में React की सफलता के तत्व और innovation को लेकर उत्साह
SwiftUI की तुलना में RSX पर राय
Dioxus में lifetimes हटाने को लेकर चिंता
web components के साथ integration को लेकर सवाल
native app rendering के तरीके पर सवाल