Architectural Idea / Question #2311
Replies: 4 comments
-
The potential for a "yew-native" so to speak :) I believe the way React accomplishes this is by maintaining separation between: The reconciler can then be replaced to be target-specific. React 16 actually exposes an API for you to make your own: Just sharing what I know from JS-land in case that's useful. |
Beta Was this translation helpful? Give feedback.
-
There’s a fairly close example implementation for this now in https://github.com/ivanceras/sauron-native by @ivanceras. |
Beta Was this translation helpful? Give feedback.
-
Actually we have few cross-platform libraries like React/React Native, IONIC/Angular. They are really nice but these libraries have their cons that are hard to solve. First, JS-based frameworks makes it hard to scale to large code bases and have less performance than Rust. TypeScript/Flow are nice but they fail in the practice because the type system is not present at runtime that sometimes leads to a wired behaviour at runtime, creating the “WTF” effect.
Also:
This makes Rust the perfect target to create a front-end framework that can rule the world. Market space: Yew + some backend tech, like actix, can create an ecosystem to build apps for all of the platforms and build its server side counterpart by using the same technology minimizing the production costs and increasing the productivity, covering more than the 90% of use-cases( Native-apps/Hybrid/PWA + website + backend). 1 language with just 2 frameworks. I think that small startups needs a single way to build their platform and make it bigger. Actually React/Angular + Express approach is nice but when the code-base starts to be bigger it can convert, easily, to a bunch of spaghetti-code. Then, the usage of TypeScript and Flow can help but is not perfect as a compiled language. On the server-side, NodeJS is nice but 99% of the libraries are a “wood-sword” to kill a “dragon”, like mentioned in the Toggle comic over Python. Some other libraries are made in C++/Rust/Go and then loaded by using Node FFI, the problem with these ones is that they can’t be debugged when something weird happens, and 0 support on the browser. Special things to take in count
Actions to perform: Actually I don’t have knowledge of all the Yew internals but in general I think:
Note: SRR can be a build target also. We should move the 1rst and 2nd points that will allow the community to work on the rest of the parts and the creation of a “How-to” page for the creation of platform-specific components or libraries to let the people know where to start with. In resume: Yew-native can be awesome if we can create some declarative experience html-based without the React Native problems and native performance similar to Flutter. |
Beta Was this translation helpful? Give feedback.
-
I found this looking for a "react native"-like yew implementation and finding this discussion very interesting... Rust is perfect for mobile development (or pretty much everything 😉). I compromise currently with native UIs + shared Rust binary but it would be great to be able able to write everything in Rust and yew is amazing to work with! |
Beta Was this translation helpful? Give feedback.
-
Forgive me if this is not the right place for this conversation. I didn't see much going on with Yew on StackOverflow. If somewhere else is better, please let me know and I'll remove it from here.
I've been thinking a bit about RUSTs role in UI development, and being able to make re-use of code between Web, Mobile, Desktop. I know that, for instance, you can develop all your front-end application logic in RUST for pretty much any UI -- Mobile, Web, Desktop. I know Yew itself is specific to web assembly, however, depending on framework layout of non-UI components, it may or may not be a challenge to share code between different types of front-ends
I haven't dug into the details of Yew yet. Just starting to look at it, but wondered if this concept of having application code fairly agnostic to particular UI implementation is part of Yew's goals. I'm not thinking in terms of anything UI specific -- but simply keep the implementation of non-UI stuff (network communication, thread-handling, etc) done as an abstraction that can be easily swapped out (configurable) so that application code itself wouldn't need to change when switching from a mobile UI to a web UI -- have a service layer that can be re-used "as-is" between a flutter app, and a Yew web-assembly app. And you could have a VSC workspace, for instance, that included flutter and yew projects side by side referencing the same rust library (for application code) - albeit in different ways (dynamic for flutter).
Beta Was this translation helpful? Give feedback.
All reactions