Skip to content
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

Feat: multi entry #223

Merged
merged 6 commits into from
Jan 19, 2024
Merged

Feat: multi entry #223

merged 6 commits into from
Jan 19, 2024

Conversation

rolznz
Copy link
Contributor

@rolznz rolznz commented Jan 18, 2024

#222 should be merged first.

This PR removes the app type conditional in the go app by adding two separate entrypoints powered by build tags.

Now the wails app also sets the react app type at build time, so no env variable / .env file is needed.

COOKIE_SECRET is now only checked in the HTTP entrypoint.

The default (HTTP) mode arguments do not change because it uses a NOT WAILS (!wails) build tag.

@bumi
Copy link
Contributor

bumi commented Jan 18, 2024

how about we do it as in lndhub and move the main* to a cmd folder?

cmd/http.go and cmd/wails.go etc.?

main.go Outdated
func main() {

// TODO: move to service.go
func NewService(wg *sync.WaitGroup) *Service {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • why do we need this WaitGroup passed in here. This feels a bit strange

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the service is run on a separate process. The go process exits before that process is gracefully shut down (e.g. disconnect from the relay). The app wasn't actually exiting gracefully though. I have fixed these now, maybe we can review it together?

@rolznz
Copy link
Contributor Author

rolznz commented Jan 19, 2024

how about we do it as in lndhub and move the main* to a cmd folder?

cmd/http.go and cmd/wails.go etc.?

I don't think we can fix this right now without a big app restructure: we need to move everything out of the main package.

Also, I could be wrong but I'm not sure the default Wails build command supports this: https://wails.io/docs/reference/cli#build - we might need to do a manual build.

It seems go build tags are more suited to this usecase (a slight variant of executing the same application).

If we decide to make this change I think it can be done in the future. The build commands will change but everything else should stay the same. Or do you see a problem here that we need to address now?

@rolznz rolznz merged commit 113dad0 into feat/wails-v2 Jan 19, 2024
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants