-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Viddy as an importable package. #77
Conversation
@gedw99 It is interesting that you are going to run it in WASM.
|
"github.com/gdamore/tcell/v2" | ||
"github.com/moby/term" | ||
"github.com/rivo/tview" | ||
"github.com/spf13/viper" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To reduce the dependency of the viddy lib, I think it will be great if we can remove dependency of the viper from lib.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on removing viper from the lib. assume it will stay in the TUI ... ?
Hey @anvial excellent questions and thanks for asking. Let me know if this explains things better ...
Service workers inside a browser are essentially http servers. You can write them in golang and compile them to wasm. So they are processes, just like you have processes on your laptop. I am building a quasi IDE in golang, and want to use viddy in exactly the same way. This quasi IDE is in golang, and compiled to run as a GUI. The same is also true on the server side. Checkout https://github.com/tetratelabs/wazero.
What i propose is to have viddy as a golang package. Then any GUI / TUI can import it and use it. I am using https://github.com/gioui to build the GUI that does what the current TUI does. |
@gedw99 Thank you. But currently, viddy depends on rivo/tview (TUI lib) heavily. If you want to remove rivo/tview from viddy lib. |
what is your feedback about current PR? What do you think about changing the structure? I also need your advice and suggestion on how to implement the |
@anvial About structure, please refer to my idea of importable package of viddy. About, version and help. |
https://github.com/sachaos/viddy/blob/feature/refactoring-viddy/pkg/viddy/viddy.go Your approach looks clean and smooth. I think this is the right way to implement it. How can we help the |
@anvial If you already have viddy on the juju side, making viddy importable may not be an urgent issue. In that case, I would appreciate it if you could wait for my work. If there are other requests and it should be importable, I think it is possible to imitate only the viddy interface of that branch and leave the content unrefactored on this PR. |
That's reasonable, Thx so much for your work! PS: Looking forward to switching the sachaos/viddy repo after the needed functionality is introduced. |
This PR should allow importing Viddy tool as a lib in other Golang projects.
Also, I've added the
PreconfiguredNewViddy
func to avoid additional dependencies in 3-party projects.I suppose this is a good structure to use both:
Ready for comments and discussions.