Repository navigation
v1.36.0
Addons can now be loaded as WebAssembly, sandboxed through WASI, by importing a package with the host attribute. For example, here is SQLite whose only access to the filesystem is the data directory:
wasi.js
const { DirectorySync } = require('bare-directory')
const { HostDirectory } = require('bare-wasi/host')
module.exports = (url) => ({
version: 'preview1',
preopens: {
'/': new HostDirectory(DirectorySync.open(__dirname + '/data'))
}
})app.js
const { DatabaseSync } = require('bare-sqlite', {
with: { host: 'wasi-wasm32', wasi: './wasi.js' }
})
const db = new DatabaseSync('/books.db')
db.exec(`
CREATE TABLE books (id INTEGER PRIMARY KEY, title TEXT);
INSERT INTO books (title) VALUES ('Dune'), ('Foundation');
`)
for (const row of db.prepare('SELECT id, title FROM books').iterate()) {
console.log(row)
}
db.close()What's Changed
- Clamp suspend linger and wakeup deadline by @ozanhonamlioglu in #250
- Fix possibly missed resumes and wakeups on explicit
Bare.idle()by @kasperisager in #251 - Deprecate thread callbacks by @kasperisager in #252
- Move IPC typings by @kasperisager in #253
- Fix wakeup deadline test by @kasperisager in #254
- Update dependencies by @kasperisager in #255
New Contributors
- @ozanhonamlioglu made their first contribution in #250
Full Changelog: v1.35.1...v1.36.0