Release 0.35.0
Full rewrite of webnative. 🎉
Components
We've moved to a component system to make webnative more customizable and indepent of Fission infrastructure. The system removes all global state, avoiding bundler issues. We previously had dependency injection; this is basically more of the same without global state.
The documentation should give you some information on how the various components fit together. If you want to write implementations for a component, see the directories in src/components
(or the lib folder). All existing components have been expanded and refactored, and we've introduced the following:
- Introduction of a
depot
component: All IPFS functionality has been moved into here. Can now be swapped out with something else. Note that webnative still uses CIDs & IPLD. - Introduction of a
reference
component: Data root lookups & updating, DID root lookups, DNS and various repositories (cid log & UCANs) have been moved in here. - Introduction of a
manners
component: Debug functionality has moved to here. - Introduction of a
capabilities
components: Responsible for accepting UCANs and filesystem secrets from external sources (eg. Fission Lobby)
Improvements
- The
program
function now serves as the single entrypoint. You can customise all components and configuration via this function. It'll give you aProgram
with possibly aSession
(and many other things) instead of theState
we had before. Basically, when you get a session you're "logged in", otherwise you're not. - Webnative can now have many apps run on the same domain without any conflicts. This should help a lot when developing apps on the same localhost port. All storage and filesystems are namespaced by default.
- When loading a filesystem the data root is tried multiple times (to get around the DNS issue)
- Multiple filesystems can be loaded at the same time (conflicts with identifiers have been resolved), which allows for a temporary filesystem (progressive login).
(Re)moved
- Removal of various confusing filesystem parameters, all data and read keys are
Uint8Array
s now. - Removal of the
webnative.initialise
,app
andpermissionedApp
functions. These have been replaced by theprogram
function mentioned above. - Removal of the
fs.appPath
function, replaced with theappData
function located in the path module. - Removal of the
fs.addPublicExchangeKey
andfs.hasPublicExchangeKey
functions, replaced with non-class-instance functions located infs/data.js
.