Wails General API #585
Replies: 1 comment 3 replies
-
Re: menus, your quandary reminds me so much of other frameworks and their design decisions, and I'm sorry but you'll have people liking both ways LOL. eg, people who LOVE JavaScript love React, because its "just JavaScript". On the converse, users of Vue appreciate the ease of development offered by the single file approach that merges HTML/CSS/JS (which drives purists crazy). Sometimes there is no good answer and you must use artistic license. Which method appeals to you? For me, I try to think things out until I find a clear winner, even if that win is marginal. In your case, if I understand your choices correctly, it seems like creating structs in the Your second question is what I was digging around for today. "How do I use Wails?" Answer: I don't, or rather I can't. I need Windows support, and your well documented MSHTML issue is blocking Wails development for now (I need to demo a working EXE to stakeholders to achieve buy-in). I am heartened to see that a Webview upgrade will solve this in v2. Are you able to predict which quarter of 2021 v2 might drop in? |
Beta Was this translation helpful? Give feedback.
-
Hi everyone!
When Wails was first created, there were a number of design decisions that were made based on speculation and assumption. Now we have a fair number of people using it, I was hoping for some feedback on the way it works from an API perspective. The main areas for discussion are:
WailsInit / WailsShutdown - These methods were added because the frontend gets created in an Asyncronous fashion, so there needs to be a hook back to your code. An alternative approach might be to have a method like
app.Ready(callback)
that is invoked when the frontend is ready to run.Menus - There's a lot of work in v2 that's been done around menus (application, context and system tray). Currently, these may be defined in the application config. The issue with this is how the callback mechanism should work. If there's a method on the menu items for the callback, then the code being executed is actually in the context of the application config, not any of your structs. This may be ok as you can create those structs in the
main()
function before the config and call on them. The alternative is that you define the callbacks in your structs using a runtime method, egruntime.Menu.On('menuid', callback)
. This then opens up the discussion around would menuids be unique globally or unique to the context they are made for (eg context menus).I'm keen to discuss anything related to this topic so feel free to raise further points! How do you use Wails? What could be better from an API/Workflow perspective? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions