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

Use File System Access API if supported #254

Closed

Conversation

@sauerman
Copy link

@sauerman sauerman commented Jul 11, 2021

No description provided.

@gfwilliams
Copy link
Member

@gfwilliams gfwilliams commented Jul 28, 2021

Thanks! Sorry for the delay looking at this. I was on holiday.

Ideally I'd have liked to keep the IDE working the same for 'normal' users (eg, no extra clicks needed), and I'm trying to avoid async and destructuring in the codebase at the moment. However I took your code as a base and re-wrote the IDE side of things in 3970caa

It should now be live at https://espruino.github.io/EspruinoWebIDE if you want to give it a try.

Basically, you open a file (which is as normal), then click the down-arrow to choose what happens. If you choose the 'upload' option then every time the file changes, the editor contents will be reloaded and the file sent to the device - which should be great for integration with VSCode/etc.

Thanks!

Loading

@gfwilliams gfwilliams closed this Jul 28, 2021
@gniezen
Copy link

@gniezen gniezen commented Sep 3, 2021

If I understand correctly, this only handles the "Open file" side of things, but not the "Save file" part? I would imagine the File System Access API would be ideal to also save the file that's currently open?

Looking at 3970caa#diff-51d9f89cc909b0b11ec0534e24afded705617d1488ed4c49882aa8fab5352c16R215-R222 I should be seeing a "Save file.." dialog, but I'm not sure how to get this working?

Loading

@gfwilliams
Copy link
Member

@gfwilliams gfwilliams commented Sep 3, 2021

I'm not sure how to get this working?

You just click the 'save' button?

But yes, right now it puts up a dialog each time you press the save button. Ideally it'd remember the file and just write to it again. What stopped me was figuring out how to do that nicely via the UI. I'm thinking maybe a drop-down under 'save' like we have for open and upload...

So first time (unless you opened a file before, you get the dialog). Otherwise you only get the dialog if you use the drop-down and 'Save As'.

Loading

@gfwilliams gfwilliams reopened this Sep 3, 2021
@gniezen
Copy link

@gniezen gniezen commented Sep 3, 2021

right now it puts up a dialog each time you press the save button.

Hmm, that's not what happened for me. It just saved a new copy to my Downloads folder.

I'm thinking maybe a drop-down under 'save' like we have for open and upload...

Yes, I think that could work!

Loading

@gfwilliams
Copy link
Member

@gfwilliams gfwilliams commented Sep 3, 2021

Sorry - closing this again. I thought it was an issue rather than PR :)

It just saved a new copy to my Downloads folder.

Argh, that's not good. What OS/browser are you on?

Loading

@gfwilliams gfwilliams closed this Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants