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

Unified API for Browser and Native ? #6

Open
gedw99 opened this issue Oct 5, 2021 · 10 comments
Open

Unified API for Browser and Native ? #6

gedw99 opened this issue Oct 5, 2021 · 10 comments

Comments

@gedw99
Copy link

gedw99 commented Oct 5, 2021

Wondering if this is designed to provide an unified API for both Browser and Native ( mobile and desktop).

I am attempting to use this with gioui.org.
https://github.com/gioui

I got some basic code working for Browser, but struggled to get it also working for Native.

@gedw99
Copy link
Author

gedw99 commented Oct 6, 2021

@JohnStarich ?

@JohnStarich
Copy link
Contributor

JohnStarich commented Oct 7, 2021 via email

@gedw99
Copy link
Author

gedw99 commented Oct 7, 2021

Sorry my Native I meant Desktop and Mobile.

i am planning to use it with gioui.

https://gioui.org/

https://github.com/gioui/gio

In terms of this project it would possible be interesting for you

@JohnStarich
Copy link
Contributor

JohnStarich commented Oct 7, 2021 via email

@gedw99
Copy link
Author

gedw99 commented Oct 7, 2021

Ok thanks. I think this is viable.

In relation to CGO, GIOUI has some fragmented support for Reading and Writing to the File System when selecting a File to Open or Save : https://github.com/gioui/gio-x/blob/main/explorer/README.md
No IOS of MAC support yet, but the others are done: https://github.com/gioui/gio-x/blob/main/explorer/explorer_unsupported.go

i started to make a GIOUI based example using Hack-pad. I got WASM working easily. But got stuck on Native ( Desktop and Mobile ). The reason i got stuck was that i found it hard to see how to do it in the API.

Is there any chance you could make a repo called "TestHarness" in Hack-pad that loads the required instance objects of the FS for WASM and Non Mobile, so i can get past this. Then I have a basis to keep working on getting things working with GIOUI.

My aim it to make a fully working example that combines the GIOUI Explorer, and a FS. This would provide a pretty stable basis for how devs can integrate FS aspects into their Apps. Eventually getting it upstreamed into GIOUI repo.

@JohnStarich
Copy link
Contributor

(I'm realizing now my email replies are quite poorly formatted, here's another attempt:)

In relation to CGO, GIOUI has some fragmented support for Reading and Writing to the File System when selecting a File to Open or Save : https://github.com/gioui/gio-x/blob/main/explorer/README.md https://github.com/gioui/gio-x/blob/main/explorer/README.md
No IOS of MAC support yet, the the others are done: https://github.com/gioui/gio-x/blob/main/explorer/explorer_unsupported.go https://github.com/gioui/gio-x/blob/main/explorer/explorer_unsupported.go

Very cool, thanks for sharing!

i sarted to make a GIO based example using Hack-pad. I got WASM working easily. But got stuck on Native ( Desktop and Mobile ). The reason i got stuck was that i found it hard to see how to do it in the API.

Theoretically, running natively should be as easy as using the os.FS on its own. I'm not very familiar with direct file system access on mobile devices, but it should behave correctly on macOS, Linux, and Windows.

Is there any chance you could make a repo called "TestHarness" in Hack-pad that loads the required instance objects of the FS for WASM and Non Mobile, so i can get past this. THen i have a basis to keep working on getting things working with GIO.

I do see what you mean, there's not many (or any?) examples using hackpadfs in our reference docs yet. I'll put some together to help make that clearer. 👍

@JohnStarich
Copy link
Contributor

@gedw99 I've opened a first draft for the new docs. Let me know if you have any feedback or further questions we could answer in there.

@gedw99
Copy link
Author

gedw99 commented Oct 14, 2021

Hey @JohnStarich

thanks for the docs. it's clear how to do it.

BTW thanks for responding to this so fast and making it happen !

But the docs looks pretty good. It's pretty much what i ended up doing in my code to kick the tires.
The interfaces are clean and its obvious. Just a matter of trying it out from GIO and see what things are hit.

I am adding @inkeliz and @whereswaldon as i think both may be interested to a degree in this, but can say for sure.
Also I have to take a break on coding for a while, as i pulled a back muscle when fixing my kids roof, so need to chill for a while.

inkeliz/giostorage#1

@JohnStarich
Copy link
Contributor

Merged! Thanks for taking a peek @gedw99.

Welcome all, let us know what's missing or not working for native mobile and we can work to close those gaps. I don't currently know a way to test mobile in CI, but maybe that can be done.

@JohnStarich
Copy link
Contributor

@gedw99 Also, hope you'll feel better soon ❤️ We'll be here when you're well again, too 🙂

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

No branches or pull requests

2 participants