The File System Observer API, in origin trial from Chrome 129, changes that, and lets developers be alerted automatically when changes happen. This guide explains how it works and how to try the feature.
// Observe a file.
await observer.observe(fileHandle);
// Observe a directory.
await observer.observe(directoryHandle);
// Observe a directory recursively.
await observer.observe(directoryHandle, {recursive: true});
This could allow us to:
Get rid of the "Sync files" button when a local directory is mounted
Load balance over multiple PHP workers sharing the same OPFS directory
Let's explore how viable that is and, if there are rough edges, provide feedback to the team working on that feature. @tomayac, what would be the best way to share our feedback?
Chrome 129 introduces observable filesystem handles:
This could allow us to:
Let's explore how viable that is and, if there are rough edges, provide feedback to the team working on that feature. @tomayac, what would be the best way to share our feedback?