Migration
Migration guides for new versions of the ODD SDK
Migration from Webnative SDK to ODD SDK
With version 0.37.0 the Webnative SDK has been re-named to the 'ODD SDK', and it is published to npm as @oddjs/odd
.
If you install the SDK with a package manager, update your dependencies in package.json
.
Update imports in your code base from webnative
to @oddjs/odd
.
If you load the SDK from a CDN, update the source in the script tag.
ODD SDK
Some versions of ODD SDK require apps to migrate their codebase to address breaking changes. Versions with changes are listed below.
Version 0.37.0
File system event listeners have been moved onto the top-level program and renamed.
For example, the local-change
listener was previously accessible on program.fileSystem
.
In version 0.37, the local-change
event listener is accessible directly on the program.
Older Webnative versions
Some versions of Webnative require apps to migrate their codebase to address breaking changes. Versions with changes are listed below.
Version 0.36.0
This version of Webnative includes a few minor breaking changes.
In previous versions, you could call program.loadFileSystem()
to load the file system. In Webnative 0.36.0, call program.fileSystem.load()
instead.
The fs.cat
file system operation has been replaced by fs.read
, and the fs.add
operation has been replaced with fs.write
.
Version 0.35.0
This version of Webnative is a major rewrite. Most apps will only need to update their initialization, permission request, and registration code to use the new APIs.
In previous versions, Webnative was initialized using the initialise
or app
functions that returned a state
object:
In Webnative 0.35, Webnative is initialized by creating namespaced programs and creating sessions.
Initialize a program with permissions
when your app requests capability from the Fission Auth Lobby.
Apps with root authority initialize without permissions
and use authentication strategies to register users and create sessions:
In both cases, the program will have an authenticated session at initialization when a user returns for another visit.
See the Initialization, Session, Requesting Capabilities, and Authentication Strategies sections for more details on the new APIs.
Webnative 0.35 also updates the file system interface so that only Uint8Array
can be written to and read from WNFS. If you are storing strings or other types of data, you will need to convert them Uint8Array
before writes and convert them from Uint8Array
on reads.
For example, writing a string to a file and later reading it looks like this:
Please review the CHANGELOG for an overview of the other changes in this version.
Version 0.28.0
The publicReadKey
function in keystore-idb
was renamed topublicExchangeKey
.
Most users will not need to change anything for webnative 0.28.0, unless they are interacting directly with keystore-idb.
Version 0.27.0
The type of App
returned app.index
has changed. Previously, the return type was
In Webnative 0.27.0, the the return type is
The domain for the app is now in the domains
array.
Version 0.26.1
The URL for loading webnative from UNPKG has changed. In Webnative 0.26.0, Webnative was available as index.min.js
.
We found that some projects needed the UMD build and brought it back in Webnative 0.26.1. We have replaced index.min.js
with index.umd.min.js
.
Version 0.26.0
The URL for loading webnative from UNPKG has changed. In previous versions, Webnative was available as index.umd.js
.
In Webnative 0.26, Webnative is available as index.min.js
.
Version 0.24
The way paths are used throughout the Webnative and filesystem APIs has changed.
In earlier versions of Webnative, API calls expected UNIX style paths.
In Webnative 0.24, paths are created by path helper functions for files and directories.
The docs for the previous API remain available for reference.
Last updated