tchapgouv / tchap-web-v4

A Matrix web client for Tchap
https://www.tchap.gouv.fr/
Apache License 2.0
12 stars 5 forks source link

Study : deprecaction of customisations and usage of module-api #646

Open estellecomment opened 1 year ago

estellecomment commented 1 year ago

Customisations is being deprecated in favor of Module API. https://github.com/vector-im/element-web/pull/25736 For now they're still there, with a deprecated warning message. We want to avoid a situation where we are blocked from upgrading element-web for more than a sprint because our customisations have become incompatible.

estellecomment commented 10 months ago

for what we can't move, can we support customisations ourselves, by editing the webpack config (with easy future maintenance as usual)

It's a cleanly separate block of code : https://github.com/tchapgouv/tchap-web-v4/blob/0a54d6f17a9b19de995a007b497ea70d2d6361c3/webpack.config.js#L61..L100 If it's removed we can add it back with a patch, or move it to a separate file and import it into the webpack config.

The module used, https://webpack.js.org/plugins/normal-module-replacement-plugin/, has a documented version for webpack 5 (element uses 4) and doesn't look like it's being deprecated.

So that looks straightforward, as a temporary measure.

MarcWadai commented 2 months ago

Comment ça marche

Le module api nous fourni un groupe d’outil permettant de créer des modules qui qui vont être appliquer à l’application durant la phase de compilation. Permettant ainsi d’override/catch certain components/evenemment du package matrix-react-sdk.

Ces modules peuvent être installé indépendamment du projet Tchap-web, dans leur prorpre repo github. Dans notre cas, pour plus de simplicité, nous allons directement l’installer dans le projet, ce qui a déjà été fait avec le module de traductions.

Avantages

Inconvénients


Module test simple pour les utilisateurs externes

When the external user click to add or explore a room :

Untitled

→ we just display a popup to indicate that he doesnt have the rights to add or explore new rooms without invitations

Steps

Développement local


Il y a 3 niveaux de code a modifier :


D’autre idées de POC

MarcWadai commented 2 months ago

PR dans tchap-web : https://github.com/tchapgouv/tchap-web-v4/pull/1058 PR dans le fork de module-api : https://github.com/tchapgouv/matrix-react-sdk-module-api/pull/3