-
-
Notifications
You must be signed in to change notification settings - Fork 34
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 URLs instead of paths #86
Labels
Comments
github-actions
bot
added
👋 phase/new
Post is being triaged automatically
🤞 phase/open
Post is being triaged manually
and removed
👋 phase/new
Post is being triaged automatically
labels
Jun 21, 2023
Where exactly? This issue is created specifically on the For reading I think it’s best to follow Node.js logic: A string represents a path, file URLs are also allowed. I don’t think we need I’m all for being closer to the standard |
oh whoops was supposed to go in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Initial checklist
Problem
It would be nice to go all in on a format that is supported everywhere: URLs.
Instead of a platform dependent (unix vs windows) string.
However, URLS are broader than what we support, what should we do when URLs point to
data:
?https://
? Etc?We could change
to-vfile
->vfile-fs
and add avfile-fetch
too?Also, URLs as strings are problematic: passing
url.href
tofs.writeFile
will write afile/Users/User/whatever/
folder in CWD. This could be confusing to users.This means our API has to likely return URL objects instead of strings. But that has again the problem of being either slow or a reference.
It’s a bit harder with URLs to change folders or extensions. Our current getter/setters are a nice alternative.
We could drop those getters/setters, maybe go with some utilities exposed from here to get/set stuff?
Extensions are typically meaningless in URLs anyway. Perhaps we’d need to have mimetypes?
Maybe we could first inspire from, and later depend on / add onto https://developer.mozilla.org/en-US/docs/Web/API/File?
Solution
?
Alternatives
Many!
The text was updated successfully, but these errors were encountered: