Skip to content

Starting tips for developpers

Marc edited this page Jul 25, 2024 · 11 revisions

To launch tchap-web-v4 the first time

  1. Create at the root of the repo a config.json file in which you add the content of config.dev.json.

  2. yarn start (a postinstall script will be launch and install matrix-react-sdk subtree dependencies)

I18n

Note : when editing this file, you need to relaunch yarn start

To create a patch or a customization

  • To modify the Element code, you can either choose to change an entire file, and if you do so, you will be doing a customisation, ou just part of a file, and that is a patch. Under is an explanation on how to use both.

--

A patch

Patches now are only used for matrix-js-sdk. We use a subtree structure (linked-dependencies/matrix-react-sdk) for direct customisation on the matrix-react-sdk

See readme here for more info on patches : https://github.com/tchapgouv/tchap-web-v4/blob/develop_tchap/patches/README.md

A customisation

EDIT : customisations now are deprecated on Element, do not use them anymore

  1. Create a new file (if possible with the same name and path as the original file in /yarn-linked-dependencies, except this time it will be located in /src)
  2. In customisations.json, add the new path for the original path, so that it is read instead of the original file. Ex: { "src/components/views/dialogs/LogoutDialog.tsx": "src/components/views/dialogs/TchapLogoutDialog.tsx", // ... }

Objectives for the repo

  1. We need to be able to update the forked libs (matrix react et matrix js + element web) and know what was modified and what might have been broken.
  2. We must remain independant and safe from too much maintenance.
  3. Write the least possible patches.