-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Switch to use browser-fs-access
npm module directly
#8673
base: master
Are you sure you want to change the base?
Conversation
@tomayac Hi. Thanks for the interest. Have you been able to QA what this is being used for? If we decide to go ahead with this, we'll probably ask for some QA since we don't have tests here @tiensonqin Thoughts on if this worth doing at this time? I see this is related to code introduced back in #724 |
This is barely a housekeeping PR that doesn’t introduce new functionality, but simply uses the |
This is what the web app uses to access the local filesystem. https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API I will build the web app from this branch and release it to the testing channel. I'll provide the link once it's done building. |
(FWIW, I successfully tested locally in the Web browser and in Electron.) |
Thank you. Its always good to have an extra pair of 👀 Docker image is building: https://github.com/logseq/logseq/actions/runs/4227294573/jobs/7341620379 once done it will be available via the testing channel: |
hmm something is wrong. I can't get the filesystem API to work.
Not sure if this issue was introduced by this PR. I remember someone reporting a similar issue on the forum or discord. More testing is needed. Anyone is able to test the docker image on MacOS? docker run -d --rm -p 3001:80 ghcr.io/logseq/logseq-webapp:testing then navigate to http://0.0.0.0:3001 to view the webapp. |
Tested and the issue also affects the latest release 🤦♂️ docker run -d --rm -p 3001:80 ghcr.io/logseq/logseq-webapp:latest |
Glad to learn that the breakage is unrelated to my PR, but curious to understand what caused it in the latest release. I’ll have a look. |
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.
src/main/frontend/fs/nfs.cljs is not touched.
So some file actions will fail.
@Bad3r To test the filesystem API, use either localhost or https access. |
UPDATE: won't introduce this for now. |
if (files.length && !(files[0] instanceof File)) { | ||
handle = files[0]; | ||
} else { | ||
handle = files[0].directoryHandle; |
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.
After looking into the implementation, this should be a buggy design decision.
The directoryHandle only binds to the containing directory, not the top directory.
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.
Good this got caught.
This PR switches logseq to use the
browser-fs-access
npm module directly. It was using code from the project already, and the mentioned babel transform issues have (hopefully) been fixed.