Why Does Jaspr Use a Different Syntax from Flutter? #161
Replies: 9 comments
-
Hey, I am working on trying to add this right now. Trying to make Jaspr more approachable for Flutter devs. I think the creator just meant for Jaspr to be able to use Dart to interact with the DOM and include SSR and SSG. I'm trying to build wrappers around Material UI with Jaspr right now for a UI Component Library: https://github.com/cybertheory/caspr/tree/main Fairly new project, would love some help getting it set up and developing! |
Beta Was this translation helpful? Give feedback.
-
Take a look at the UI library: https://github.com/schultek/jaspr/tree/main/packages/jaspr/lib/src/ui |
Beta Was this translation helpful? Give feedback.
-
Awesome! It's a good start! Is it based off material? |
Beta Was this translation helpful? Give feedback.
-
I don't think the components in the UI library have any styling attached to it, but you can build a material type UI library on top of the existing one. May save you some work. |
Beta Was this translation helpful? Give feedback.
-
Yup definetly 😀 |
Beta Was this translation helpful? Give feedback.
-
What exact syntax are you referring to? Jaspr is built to resemble Flutters syntax very closely. It has some differences (like
Manually sure, automatically probably not in the near future (its just not a priority right now). As others pointed out there will be (and already are in the works) more high level ui component libraries for jaspr, some of which might be designed to more closely resemble flutters standard widgets. But I don't have a specific timeline for this. |
Beta Was this translation helpful? Give feedback.
-
I was thinking about a mechanism with two options: one for compiling into HTML/CSS code and the other for a typical Canvas Kit compilation. The idea is to use the identical Flutter code, yet the output would vary based on the selected rendering method. |
Beta Was this translation helpful? Give feedback.
-
Seems nice to have in theory, but its not feasible in practice. I mean Flutter has the html renderer already you can use, but it does not produce nice html at all. But as I said compatibility with flutter is a non goal of jaspr. The compromises on quality and web best practices would be too great. |
Beta Was this translation helpful? Give feedback.
-
I think that's a good desicion! It gives Jaspr flexibility to become its own powerful framework. I have been using it on my personal site and it's surprising easy to pick up. I like how you can just transfer in your HTML/CSS know how and there's already a huge knowledge base for that. I think being compatible with Flutter should not be a goal, but Flutter interoperability on the client is definitely a cool feature! I think jaspr allows for this. Also the UI component libraries should completely remove the need for low level web design concepts. |
Beta Was this translation helpful? Give feedback.
-
I am curious about why Jaspr employs a distinct syntax compared to Flutter. For example, React Native for Web (https://necolas.github.io/react-native-web/docs/) uses React DOM and hence the HTML DOM for object manipulation, yet it does not introduce a separate syntax. Would it be feasible to directly translate standard Flutter code into HTML/CSS?
Beta Was this translation helpful? Give feedback.
All reactions