From 2ae2c217561b3ef28dc3d75a3df9f8535863bf97 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 17 Apr 2023 13:07:42 +0530 Subject: [PATCH 1/3] Export contents from ./feature --- src/lib.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.ts b/src/lib.ts index f5e16ecd..072d082d 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -22,6 +22,7 @@ export {Platform} from "./platform/web/Platform.js"; export {BlobHandle} from "./platform/web/dom/BlobHandle"; export {Client, LoadStatus} from "./matrix/Client.js"; export {RoomStatus} from "./matrix/room/common"; +export {FeatureSet, FeatureFlag} from "./features"; // export everything needed to observe state events on all rooms using session.observeRoomState export type {RoomStateHandler} from "./matrix/room/state/types"; export type {MemberChange} from "./matrix/room/members/RoomMember"; From 13d198d7bc065ab1146c7b1816a82b980ebaf422 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 17 Apr 2023 18:38:47 +0530 Subject: [PATCH 2/3] Update docs --- doc/SDK.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/SDK.md b/doc/SDK.md index ba021ad1..ec4f4113 100644 --- a/doc/SDK.md +++ b/doc/SDK.md @@ -32,7 +32,8 @@ import { createRouter, RoomViewModel, TimelineView, - viewClassForTile + viewClassForTile, + FeatureSet } from "hydrogen-view-sdk"; import downloadSandboxPath from 'hydrogen-view-sdk/download-sandbox.html?url'; import workerPath from 'hydrogen-view-sdk/main.js?url'; @@ -81,12 +82,14 @@ async function main() { const {session} = client; // looks for room corresponding to #element-dev:matrix.org, assuming it is already joined const room = session.rooms.get("!bEWtlqtDwCLFIAKAcv:matrix.org"); + const features = await FeatureSet.load(platform.settingsStorage); const vm = new RoomViewModel({ room, ownUserId: session.userId, platform, urlRouter: urlRouter, navigation, + features, }); await vm.load(); const view = new TimelineView(vm.timelineViewModel, viewClassForTile); From a35f6af7db1795e16822a088f129b43841856b80 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 17 Apr 2023 20:23:16 +0530 Subject: [PATCH 3/3] Add command to install olm as well --- doc/SDK.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/SDK.md b/doc/SDK.md index ec4f4113..77826253 100644 --- a/doc/SDK.md +++ b/doc/SDK.md @@ -15,6 +15,7 @@ yarn create vite cd yarn yarn add hydrogen-view-sdk +yarn add https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.14.tgz ``` You should see a `index.html` in the project root directory, containing an element with `id="app"`. Add the attribute `class="hydrogen"` to this element, as the CSS we'll include from the SDK assumes for now that the app is rendered in an element with this classname.