2019-11-26 04:00:15 -05:00
|
|
|
# Native Node Modules
|
2019-11-21 04:56:25 -05:00
|
|
|
|
2019-11-26 04:03:45 -05:00
|
|
|
For some features, the desktop version of Riot can make use of native Node
|
|
|
|
modules. These allow Riot to integrate with the desktop in ways that a browser
|
|
|
|
cannot.
|
2019-11-21 04:56:25 -05:00
|
|
|
|
2019-11-26 04:13:38 -05:00
|
|
|
While native modules enable powerful new features, they must be complied for
|
|
|
|
each operating system. For official Riot releases, we will always build these
|
|
|
|
modules from source to ensure we can trust the compiled output. In the future,
|
|
|
|
we may offer a pre-compiled path for those who want to use these features in a
|
|
|
|
custom build of Riot without installing the various build tools required.
|
2019-11-21 04:56:25 -05:00
|
|
|
|
|
|
|
Do note that compiling a module for a particular operating system
|
2019-11-26 04:12:52 -05:00
|
|
|
(Linux/macOS/Windows) and will need to be done on that operating system.
|
|
|
|
Cross-compiling from a host OS for a different target OS may be possible, but
|
|
|
|
we don't support this flow with Riot dependencies at this time.
|
2019-11-21 04:56:25 -05:00
|
|
|
|
2019-11-26 04:19:15 -05:00
|
|
|
At the moment, we need to make some changes to the Riot release process before
|
|
|
|
we can support native Node modules at release time, so these features are
|
|
|
|
currently disabled by default until that is resolved. The following sections
|
|
|
|
explain the manual steps you can use with a custom build of Riot to enable
|
|
|
|
these features if you'd like to try them out.
|
|
|
|
|
2019-11-26 04:19:45 -05:00
|
|
|
## Adding Seshat for search in E2E encrypted rooms
|
2019-11-21 04:56:25 -05:00
|
|
|
|
2019-11-26 04:20:56 -05:00
|
|
|
Seshat is a native Node module that adds support for local event indexing and
|
2019-11-21 04:56:25 -05:00
|
|
|
full text search in E2E encrypted rooms.
|
|
|
|
|
|
|
|
Since Seshat is written in rust the rust compiler and cargo tool-chain need to be
|
|
|
|
installed before installing Seshat itself. After installing the compiler Seshat
|
|
|
|
support can be added using yarn inside the `electron_app/` directory:
|
|
|
|
|
|
|
|
yarn add matrix-seshat
|
|
|
|
|
2019-11-26 04:20:56 -05:00
|
|
|
After this is done the Electron version of Riot can be run from the main folder
|
2019-11-21 04:56:25 -05:00
|
|
|
as usual using:
|
|
|
|
|
|
|
|
yarn electron
|
|
|
|
|
|
|
|
If for some reason recompilation of Seshat is needed, e.g. when using a
|
|
|
|
development version of Seshat using `yarn link`, or if the initial compilation was
|
|
|
|
done for the wrong electron version, Seshat can be recompiled with the
|
|
|
|
`electron-build-env` tool. Again from the `electron_app/` directory:
|
|
|
|
|
|
|
|
yarn add electron-build-env
|
|
|
|
|
|
|
|
Recompiling Seshat itself can be done like so:
|
|
|
|
|
|
|
|
yarn run electron-build-env -- --electron 6.1.1 -- neon build matrix-seshat --release`
|
|
|
|
|
|
|
|
Please make sure to include all the `--` as well as the `--release` command line
|
|
|
|
switch at the end. Modify your electron version accordingly depending on the
|
|
|
|
version that is installed on your system.
|