Closed Bug 781486 Opened 13 years ago Closed 8 years ago

Implement Jetpack file API on top of OS.File

Categories

(Add-on SDK Graveyard :: General, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: Yoric, Unassigned)

References

Details

(Keywords: main-thread-io, Whiteboard: [Async:ready])

Mozilla-central is getting a new low-level, asynchronous, high-performance, JavaScript file API. A higher-level Jetpack API should be designed and implemented to make this file API comfortable for end users.
I believe that this depends on the priorities. As far as I understand, we are not going to implement FileWriter in any foreseeable future and OS.File is bound to be more powerful than anything DOM-ish. But, of course, less standard.
Just casually looking at it, I think we'd need to depend on bug 820953 so we can get TextDecoder/TextEncoder to deal with string encoding, since they don't seem to be present in SDK addon's normal context, and I don't see any way to import them.
Depends on: 820953
We strongly need an off main thread file API for Jetpack, however it is implemented. Additionally, part of the feedback gathered during the Summit is that add-on developers need such a feature. Unless there are very good reasons to do otherwise, I suggest going ahead and publishing OS.File to Jetpack.
Keywords: main-thread-io
Whiteboard: [Async]
Whiteboard: [Async] → [Async:P1]
In today's roundtable, we agreed on changing the `io/fs` implementation to use OS.File where appropriate to take advantage of the off-main-thread IO
Whiteboard: [Async:P1] → [Async:ready]
Yeap here.
I am curious why OS.File doesn't support both async and sync mode, weird.
(In reply to Yonggang Luo from comment #9) > I am curious why OS.File doesn't support both async and sync mode, weird. Because sync I/O freezes the browser, so we want to make sure people never do any sync I/O.
:Yoric, that's not the point, in worker, we can use both sync and async APIs.
Yonggang Luo, ah, right, we could also have an async mode in workers. Well, anyway, looks like Jetpack is basically dead, so WONTFIX.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.