PoC: Introduce File System Access API Helper / Adapter #3307
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It is work in progress.
I'll propose unified FS APIs. I'm trying implementing.
Motivation
JavaScript runtimes have different APIs to access file system. So Hono has wrapper in
serveStatic
and SSG Helper. They should be merged I think. Therefore I'll propose it.Hono is just Web application framework but I'm sure that middleware creators can create more powerful middleware.
Web Standard
Hono follows Web Standard APIs. This PR will use WHATWG File System Access API (Spec, MDN).
However File System API is formulated for browsers, features for using local filesystem is sometimes missing. (e.g., Get absolute path from entry) So I'm going to extend API interface.
API Plans/Ideas
Open dir/file:
Serve static:
SSG:
Progress
Currently it's almost an idea.
Runtimes
Features
I want forward compatibility.
The author should do the following, if applicable
bun run format:fix && bun run lint:fix
to format the code