On a freshly install of the developer environment, the build:jitsi try
to create a file in ./webapp with the cURL command. However, ./webapp
folder doesn't exist and the build script crash. This patch makes sure
the appropriate folder is created if it doesn't already exist
Signed-off-by: Danny Colin <contact@dannycolin.com>
Includes: compilation, translations, IDE support (use .tsx not .ts), typings, and other build tools.
TypeScript component have to import PropTypes and React with `import * as React from 'react';`
This document is required for example for all Mozilla websites
and makes sense for Riot to also describe itself - see
https://www.contributejson.org/
Signed-off-by: Jason Robinson <jasonr@matrix.org>
We were checking out & installing the develop js-sdk explicitly
in cases where we didn't need it at all. We were babeling the src
folder many, many times over (in some cases twice in the same job)
and never using the output at all.
Fixes https://github.com/vector-im/riot-web/issues/11864
This uses an environment variable because the build script assumes you want a production build, but we don't for this particular script. To avoid having a mess of NPM scripts to worry about, we'll just pass a flag down.
There's a bunch of generated files that webpack relies on to work, and Karma works off webpack. To make both happy we've added
a new `build:genfiles` script which takes care of this for us. We also have to install and build our other layers to get the
same effect (like generating the react-sdk's component index, while we still have one).
This commit also fixes all the imports in the tests because they were just wrong. They should have been caught in the ES6ification
earlier, but were missed.
We have to convert *something* to TypeScript so it doesn't complain that there's nothing to compile, so this converts the easiest utility library.
Many of the scripts are copied from the react-sdk.
With a switch to Only One Webpack™ we need a way to help developers generate the component index without a concurrent watch task. The best way to do this is to have developers import their components, but how do they do that when we support skins? The answer in this commit is to change skinning.
Skinning now expects to receive your list of overrides instead of the react-sdk+branded components. For Riot this means we send over *only* the Vector components and not Vector+react-sdk.
Components can then be annotated with the `replaceComponent` decorator to have them be skinnable. The decorator must take a string with the dot path of the component because we can't reliably calculate it ourselves, sadly.
The decorator does a call to `getComponent` which is where the important part of the branded components not including the react-sdk is important: if the branded app includes the react-sdk then the decorator gets executed before the skin has finished loading, leading to all kinds of fun errors. This is also why the skinner lazily loads the react-sdk components to avoid importing them too early, breaking the app.
The decorator will end up receiving null for a component because of the getComponent loop mentioned: the require() call is still in progress when the decorator is called, therefore we can't error out. All usages of getComponent() within the app are safe to not need such an error (the return won't be null, and developers shouldn't use getComponent() after this commit anyways).
The AuthPage, being a prominent component, has been converted to demonstrate this working. Changes to riot-web are required to have this work.
The reskindex script has also been altered to reflect these skinning changes - it no longer should set the react-sdk as a parent. The eventual end goal is to get rid of `getComponent()` entirely as it'll be easily replaced by imports.
We can actually just supply a custom signing module here to do our
signing rather than manually signing things in the afterSign hook.
This means all 4 executable files get signed (the main exe, the
stub exe, Update.exe and the installer).
If you try to clone a repo that doesn't exist via `https`, `git` will prompt for
auth credentials and hang forever. Using `git` avoids this and fails immediately
instead, which is what we want for a missing repo.
Part of https://github.com/vector-im/riot-web/issues/9221
If you try to clone a repo that doesn't exist via `https`, `git` will prompt for
auth credentials and hang forever. Using `git` avoids this and fails immediately
instead, which is what we want for a missing repo.
Part of https://github.com/vector-im/riot-web/issues/9221
Currently, people with push access to the main Riot repos can push matching
branch names to Riot and the SDKs, and CI will test all the branches together.
This change allows contributors to access the same ability when submitting
several matching PRs from their fork of each repo.
Part of https://github.com/vector-im/riot-web/issues/9041
Currently, people with push access to the main Riot repos can push matching
branch names to Riot and the SDKs, and CI will test all the branches together.
This change allows contributors to access the same ability when submitting
several matching PRs from their fork of each repo.
Part of https://github.com/vector-im/riot-web/issues/9041
Most `npm` operations are replaced with `yarn`, which generally has better
behavior. However, steps like publish that write to the NPM registry are left to
`npm`, which currently handles these tasks best.
Take advantage of Yarn's preservation of links while installing and set up links
first and install second. This should result in a small speedup since we no
longer install the published SDKs just to replace them on the next line.
Most `npm` operations are replaced with `yarn`, which generally has better
behavior. However, steps like publish that write to the NPM registry are left to
`npm`, which currently handles these tasks best.
Hopefully this will end up simpler than having to figure out in
riot-web what the relative path is from react-sdk's
src/languageHandler.js to riot-web's webapp directory.
Jenkins seems to use a different layout of the repos than other environments.
The sub-projects are cloned inside of the `riot-web` workspace. To account for
this, we need to adjust the Riot language file path.
This commit detects if the macos-only utility `iconutil` is available in
the PATH, if it is, then the icns is built as usual. However if it
isn't (such as on a linux system), then it checks for `png2icns` and
uses it if possible.
Signed-off-by: Abel Luck <abel@guardianproject.info>
Attempt both the PR author's branch and the PR's target branch. This resolves
issues on experimental where we need matrix-react-sdk to also be experimental.
This adds a `file-loader` rule to the Webpack build so that any requests for
image resource will be output into the app's output directory, but with an extra
content has appended so that we can safely use a long cache lifetime.
The CSS and SCSS rules are also changed to use `css-loader` so that any `url`
inside is automatically processed by the new image rule above.
Now that Olm needs to be inited asynchronously anyway, we can just
pass the options to Olm.init(), and as long as we do that before we
start the js-sdk, we're all good.
This will means the olm js is now part of the main bundle but since
it's now just a wrapper around the wasm, this is probably faster.
Also add the directwatch flag to olm.wasm because otherwise it
doesn't seem to copy the file in watch mode...
* Olm no longer supports setting the stack/memory size at runtime,
so don't (they're now set to be that in the Olm build).
* Copy the wasm file from the Olm library (see multiple comments
about it being in the wrong place and webpack being awful).
If we don't block on SDK builds, then the riot-web build fails due to half-built dependencies. This needs to be done at two levels: the js-sdk because it is used by both the react-sdk and riot-web, and at the react-sdk because riot-web needs it. This means our build process is synchronous for js -> react -> riot, at least for the initial build.
This does increase the startup time, particularly because the file watch timer is at 5 seconds. The timer is used to detect a storm of file changes in the underlying SDKs and give the build process some room to compile larger files if needed.
The file watcher is accompanied by a "canary signal file" to prevent the build-blocking script from unblocking too early. Both the js and react SDKs build when `npm install` is run, so we ensure that we only listen for the `npm start` build for each SDK.
This is all done at the riot level instead of at the individual SDK levels (where we could use a canary file to signal up the stack) because:
* babel (used by the js-sdk) doesn't really provide an "end up build" signal
* webpack is a bit of a nightmare to get it to behave at times
* this blocking approach is really only applicable to riot-web, although may be useful to some other projects.
Hopefully that all makes sense.
A step towards a real solution for https://github.com/vector-im/riot-web/issues/7305
This approach makes use of `npm link` to remove the use of symlinks in the build process. The build process has also been altered to invoke the build process of each underlying SDK (react, js). This means that one can now `npm link` and `npm start` and have a working environment.
At the same time, parallelshell was dropped due to lack of maintenance from the maintainer.