Jaguar-dart / nuts

Nuts and bolts for building cross-platform UI (HTML, Flutter, CLI) using Dart. Also screw frameworks (React, Vue, Angular).
BSD 3-Clause "New" or "Revised" License
11 stars 0 forks source link

Flutter renderer #2

Open ghost opened 6 years ago

ghost commented 6 years ago

I see that the way you described Ribe a html offer tree feels very like flutter.

I was wondering is a html to flutter lib makes sense to build a flutter renderer. There is one on GitHub and it pulls Wikipedia html, parses it and renders flutter objects.

Food for thought ? It also is cool because you don't have to recompile

tejainece commented 6 years ago

I will take a look.

But we can do better. nuts is very abstracted from the widget library underneath. An implementation of Flutter renderer for ViewRenderer would suffice. Currently there is only implementation of HtmlRenderer. You can also do platform specific conditional rendering. For example, if platform is web, use this Component, elseif platform is Flutter, use this component, etc.

ghost commented 6 years ago

This is the one I was referring to. https://pub.dartlang.org/packages/flutter_html_view

I have found its parser to be very fragile. But its more of a reference to see approaches i feel.

Wow there is conditional ? Like Vuejs has a formal DSL ? Very nice approaches.

I presume your aiming for an agnostic layout so that the same layout works on web and flutter ?

On Mon, 10 Sep 2018, 15:48 Ravi Teja Gudapati, notifications@github.com wrote:

I will take a look.

But we can do better. nuts is very abstracted from the widget library underneath. An implementation of Flutter renderer for ViewRenderer would suffice. Currently there is only implementation of HtmlRenderer. You can also do platform specific conditional rendering. For example, if platform is web, use this Component, elseif platform is Flutter, use this component, etc.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Jaguar-dart/nuts/issues/2#issuecomment-419918382, or mute the thread https://github.com/notifications/unsubscribe-auth/ATuCwl_13YcQW4AB5BAm7wTVrRUprFASks5uZm3HgaJpZM4WhZiG .

tejainece commented 6 years ago

Wow there is conditional ? Like Vuejs has a formal DSL ?

Yes. With some cool rx sugar added. There will XML template engine as well later. But I am really hoping this gets accepted: https://github.com/dart-lang/sdk/issues/34362

I presume your aiming for an agnostic layout so that the same layout works on web and flutter ?

Yes. Same UI tree targets different rendering backends. Sometimes though, one Component cannot directly target all platforms. In this case, you have to use platform specific Components based on conditional rendering.

ghost commented 6 years ago

Can you add setup to the readme ? have not used webdev much for dart. Mostly only flutter.

EDIT: I just read your proposal. So for now this wont run without a custom build of dart ?

tejainece commented 6 years ago

Can you add setup to the readme ? have not used webdev much for dart. Mostly only flutter.

Sure. Will do this by tomorrow.

EDIT: I just read your proposal. So for now this wont run without a custom build of dart ?

What do you mean? This: https://github.com/dart-lang/sdk/issues/34362? No, That will make things cleaner to write. Has nothing directly to do with nuts.

ghost commented 6 years ago

Well the discussion in the main dart repo was talking about adding a new operator to the dart language. Its the link you added above.

Thanks again. This is a interesting spin of an approach. Great potential. I hope I can help.

On Mon, 10 Sep 2018, 18:58 Ravi Teja Gudapati, notifications@github.com wrote:

Can you add setup to the readme ? have not used webdev much for dart. Mostly only flutter.

Sure. Will do this by tomorrow.

EDIT: I just read your proposal. So for now this wont run without a custom build of dart ?

What do you mean?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Jaguar-dart/nuts/issues/2#issuecomment-419984933, or mute the thread https://github.com/notifications/unsubscribe-auth/ATuCwsXT-wePHRd4YKBpeuKI5Q7WaEAUks5uZpo5gaJpZM4WhZiG .

tejainece commented 6 years ago

Here is an example boilerplate repo: https://github.com/nutsdart/boilerplate

It is still early stage. Suggestions are welcome. PRs will be awesome!

ghost commented 6 years ago

ok thanks. Will check it out.