-
Notifications
You must be signed in to change notification settings - Fork 269
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
OPFS: Migrate to the latest spec #547
Conversation
const zipName = 'wordpress-playground.zip'; | ||
const zipPath = `/tmp/${zipName}`; |
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.
This is somewhat unrelated but I found Safari refused to download the exported file without this
Do we have a clear and easy reset button to click on to wipe out everything? |
Since #547 adds support for OPFS API, I just realized the same API can be used to read/write local files. This PR adds a local directory picker and a "refresh" button to bring the changes back into Playground's MEMFS. The Toolbar is getting really crowded, let's add a hamburger menu for now before merging this PR. In the future, let's find out a better UI solution than a hamburger menu.
Previous implementation of OPFS sync used deprecated webkitRequestFileSystem and only worked in Chrome-based browser. This commit migrates to the modern FileSystem API which means it can be also used on Safari, Firefox, and more: https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
…o switch to a temporary site or nuke everything if needed.
16ebe4d
to
1fa4f00
Compare
1fa4f00
to
bbda40c
Compare
b19c3a1
to
163afe7
Compare
@adamziel considering the "Install Plugins UI" makes me think about a ⚙️ settings icon in the top right. open that and you pick all these things. could be a good model for all these settings. |
@dmsnell we have this now – it should be a good platform for future iterations: I avoided a single unlabeled settings icon because:
|
Since #547 adds support for OPFS API, I just realized the same API can be used to read/write local files. This PR adds a local directory picker and a "Sync local files" button to bring the changes back into Playground's MEMFS.
Since WordPress/wordpress-playground#547 adds support for OPFS API, I just realized the same API can be used to read/write local files. This PR adds a local directory picker and a "Sync local files" button to bring the changes back into Playground's MEMFS.
Description
Previous implementation of OPFS sync used deprecated webkitRequestFileSystem and only worked in Chrome-based browser.
This commit migrates to the modern FileSystem API which means it can be also used on Safari, Firefox, and mobile:
https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
Testing Instructions
Select "Persistent site" in the mode picker and confirm your changes are preserved between page refreshes:
cc @dmsnell