Skip to content

Commit

Permalink
Migrate Element Web guest module to Element Web version 1.11.84 or later
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Weimann <michael.weimann@nordeck.net>
  • Loading branch information
weeman1337 committed Nov 15, 2024
1 parent 28d9bb9 commit 3dc2c34
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .changeset/yellow-paws-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@nordeck/element-web-guest-module': major
---

Makes the Element Web guest module work with Element 1.11.84 or later.

Element Web included the matrix-react-sdk into Element Web with release 1.11.84.
With this release of Element Web guest modules Element Web 1.11.84 or later is required.
If you want to use a previous version of Element Web also use a previous version of the guest module.
2 changes: 1 addition & 1 deletion e2e/src/deploy/elementWeb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:20-bullseye as builder

ARG ELEMENT_VERSION="v1.11.50"
ARG ELEMENT_VERSION="v1.11.84"

WORKDIR /src

Expand Down
2 changes: 1 addition & 1 deletion packages/element-web-guest-module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Guest users...

## Requirements

The minimal Element version to use this module is `1.11.40`.
The minimal Element version to use this module is `1.11.84`.

## Install the Element Module

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ import {
assertValidGuestModuleConfig,
shouldShowComponent as shouldShowComponentShared,
} from '@nordeck/element-web-guest-module';
import { MatrixClientPeg } from 'matrix-react-sdk/src/MatrixClientPeg';
import SdkConfig from 'matrix-react-sdk/src/SdkConfig';
import { UIComponent } from 'matrix-react-sdk/src/settings/UIFeature';
// The next two imports are a hack to make it work after React SDK was merged into Element Web.
// The idea is to start with matrix-js-sdk, that is placed into node_modules, and
// then use a relative path to import something from /src in Element Web.
// /src in Element Web is now what previously matrix-react-sdk was.
// matrix-js-sdk should be relatively safe, as Element Web uses it itself.
import { MatrixClientPeg } from 'matrix-js-sdk/../../src/MatrixClientPeg';
import SdkConfig from 'matrix-js-sdk/../../src/SdkConfig';

export function getConfig(): GuestModuleConfig {
const rawConfig =
Expand Down

0 comments on commit 3dc2c34

Please sign in to comment.