fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design

Home Page:https://fyne.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Fyne

pejman-hkh opened this issue · comments

Checklist

  • I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

I have an idea that I want to express here, and I have done a portion of it.

I only did the project for testing.

My idea was about ReactFyne just like ReactJs.

I Created something like Gox like Jsx and made some components for create Fyne elements.

Is it possible to construct a solution with the existing API?

No response

Describe the solution you'd like to see.

We can create a file like this, with .gox extension:

func render() any {
    return <Window>
        <Label name="label">Hello Fyne!</Label>
        <Button onClick="func() {}">Hi</Button>
        <Select>
            <Option>test</Option>
            <Option>test1</Option>
        </Select>
        <Checkbox></Checkbox>
    </Window>
}

And get this Golang:

func render() any {
    return react.Run("Window", map[string]string{}, []any{`
        `, react.Run("Label", map[string]string{`name` :`label`}, []any{`Hello Fyne!`}), `
        `, react.Run("Button", map[string]string{`onClick` :`func() {}`}, []any{`Hi`}), `
        `, react.Run("Select", map[string]string{}, []any{`
            `, react.Run("Option", map[string]string{}, []any{`test`}), `
            `, react.Run("Option", map[string]string{}, []any{`test1`}), `
        `}), `
        `, react.Run("Checkbox", map[string]string{}, []any{}), `
    `})
}

I shared my project in this link: https://github.com/pejman-hkh/reactfyne

It's great to see what you are working on - I hope the project goes well.
The official Fyne project isn't likely to include binding based API because we are focused on being idiomatic to Go.

Thanks for sharing, I'm not sure what we can do to help.

Thanks for your kindness.
Unfortunately, I don't have enough time and money to develop the project.
And I expressed this idea in order to develop it, if you wish.
The good thing about this project is that the final code is in Golang, and it does not affect the performance
But this idea may have fans who want to develop it in the future because of its speed of development.
Writing a native application with Golang similar to React Native can be an attractive topic.