Commit Graph

276 Commits (develop)

Author SHA1 Message Date
Michael Telatynski 9457af27f6
Improve bundle size and add webpack-bundle-analyzer (#25337) 2023-05-12 12:13:10 +01:00
Michael Telatynski afab95288e
Improve Content-Security-Policy (#25210) 2023-04-26 14:49:35 +01:00
Michael Telatynski 66c86a6397
Revert "Strip data-testid in production builds" (#25163
This reverts commit a0791ff48f.
2023-04-20 08:58:07 +01:00
Michael Telatynski a0791ff48f
Strip data-testid in production builds (#25152) 2023-04-19 16:30:41 +01:00
Michael Telatynski d42799dc62
Update webpack hash function for greater OSSL compat (#24584) 2023-02-20 10:59:44 +00:00
Andy Balaam 8d4215557a Specify the filename for worker-loader to avoid bundling workers 2023-01-04 13:36:18 +00:00
Andy Balaam 9aa23980ba Revert "Explicitly set worker-loader's publicPath to webapp"
This reverts commit f5fea0be04.
2023-01-04 11:17:16 +00:00
Andy Balaam f5fea0be04 Explicitly set worker-loader's publicPath to webapp 2023-01-04 10:42:19 +00:00
Michael Weimann 7921a6cbf8
Apply prettier formatting 2022-12-09 13:28:29 +01:00
Michael Telatynski 003fc7cdf4
Remove prop-types (#23881) 2022-12-01 11:35:19 +00:00
Michael Telatynski 3be527cac8
Deploy `develop` branch to Cloudflare Pages (#23454)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2022-11-08 13:27:20 +00:00
Richard van der Hoff 1b98601870
Constrain webpack config for `olm.wasm` (#23633)
I've been experimenting with loading WebAssembly into EW, for which I need to
use webpack's default wasm loader. Currently we're overriding that for *all*
files called `*.wasm`, which is too broad.

There are currently two `*.wasm` artifacts in EW: `decoderWorker.min.wasm`, and
`olm.wasm`. `decoderWorker` has its own rule, so the `*.wasm` rule is only used
for `olm.wasm`. So, let's tighten up the test for that rule so that it doesn't
catch other innocent `.wasm`s in the cross-fire.
2022-10-28 10:54:37 +01:00
Michael Telatynski 5d9eee8e4b
Stub out crypto imports in node (#23506) 2022-10-17 17:54:56 +01:00
Michael Telatynski 4b6d9a067b
Update deploy scripts for gha-webhook-listener compatibility (#23002)
* Soft fail Sentry uploads from Webpack

* Delete duplicated script

* Delint script

* Move symlink support from redeploy to deploy
2022-08-09 13:23:41 +01:00
Michael Weimann 4738dc9da2
Add webpack react-sdk resolve alias (#22947) 2022-07-29 11:11:11 +02:00
Germain 03cce754d4
Disallow invalid inline style comments in stylesheets (#22930) 2022-07-27 14:39:22 +01:00
Michael Telatynski 64ed6ebdad
Rename PostCSS files to `.pcss` (#22769)
* Rename PostCSS files to `.pcss`

* Make Stylelint happy

* Make Stylelint happy v2

* Update CompatibilityView.tsx

* Update res/css/structures/ErrorView.pcss

Co-authored-by: Michael Weimann <mail@michael-weimann.eu>

* Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/pcss

 Conflicts:
	package.json
	res/css/_components.scss
	res/css/structures/_NotificationPanel.pcss
	res/css/views/dialogs/_SpotlightDialog.pcss
	res/css/views/rooms/_EventTile.pcss
	res/css/views/rooms/_ReadReceiptGroup.pcss
	yarn.lock

* Only use CI_PACKAGE mode on develop, it skips minification which can find some errors

* Keep name to not break existing PRs

Co-authored-by: Michael Weimann <mail@michael-weimann.eu>
2022-07-15 14:53:21 +01:00
Michael Telatynski ca98529bd2
Improve code as per Sonar suggestions (#22224) 2022-05-16 16:47:12 +01:00
Travis Ralston f7dea9421f Merge branch 'develop' into travis/remove-skinning 2022-03-31 19:21:12 -06:00
Robin 5077157282
Remove React HMR (#21607) 2022-03-30 16:57:26 +01:00
Travis Ralston 5b592eca4f Step 10.3: Use module replacement to achieve component overrides
This is the same system as the customisations override, however deliberately using a different JSON file to avoid conflicts. 

Forks would be expected to use the customisations file, not the components file, to override/add components.
2022-03-28 13:02:50 -06:00
Travis Ralston 072f87a06a
Delete documentation relating to legacy communities (#21385)
* Remove deprecated feature_communities_v2_prototypes

* Fix typo

* Remove now-unused docs

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-03-22 16:48:26 -06:00
Kerry 30339bd9a3
fix webpack handling for svg imports (#21311) 2022-03-04 13:57:26 +01:00
Kerry 9a17a61809
add svgr loader for icons (#21248)
* add svgr loader for icons

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix config, move dep to dev

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add svg types

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add aria-hidden and role=img to svg

Signed-off-by: Kerry Archibald <kerrya@element.io>

* make svgProps explicitly overridable

Signed-off-by: Kerry Archibald <kerrya@element.io>

* role presentatino

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-02 09:14:30 +00:00
Travis Ralston 95de708f4e
Make customisations (and general file overrides) easier to specify (#21189)
Intended for customisation endpoints - see included docs.
2022-02-24 12:52:08 -07:00
Michael Telatynski 52c86264dc
Tweak webpack config around stubbing node modules (#21108) 2022-02-17 09:00:45 +00:00
J. Ryan Stinnett fa64d65e6e
Remove postcss-extend (#21046) 2022-02-11 14:22:56 +00:00
James Salter cb0f9022f9
Sentry sourcemaps without CI minification (#19602)
* Revert "Revert "Update minification and sourcemap settings on CI builds for sentry (#19583)" (#19601)"

This reverts commit 516e38c82d.

* Disable minification in CI as it exceeds memory limits for poor buildkite
2021-11-03 13:19:21 +00:00
James Salter 516e38c82d
Revert "Update minification and sourcemap settings on CI builds for sentry (#19583)" (#19601)
This reverts commit d9f72ec0b6.
2021-11-03 13:09:25 +00:00
James Salter d9f72ec0b6
Update minification and sourcemap settings on CI builds for sentry (#19583)
With previous settings, our JS files for develop are so large that sentry's webserver rejects the upload.

* re-enable minification to reduce the size of the files
* update the CI sourcemap setting from eval-source-map to source-map to move the embedded source out of the .js payload and into .js.map files
2021-11-03 09:55:28 +00:00
Travis Ralston 85b489b3a7
Artificially set a VERSION environment variable during build steps (#19518)
Fixes https://github.com/vector-im/element-web/issues/19485

The variable should be set when it needs to by CI, but in every other environment it's not important. Simply setting it to *something* makes EnvironmentPlugin happy. We print a warning just in case people expect it to be set, and use a clear value in case the environment variable doesn't get properly set.
2021-10-27 08:16:04 -06:00
Andy Balaam 0adad257c0
Build the high contrast theme into element-web (#19477) 2021-10-25 10:38:05 +01:00
James Salter f550d63198
Pass our VERSION to sentry plugin's release arg via env (#19474)
Use our existing VERSION, deduced by the packaging script, as the release for sentry sourcemaps.

This will be undefined for dev builds.
2021-10-22 15:06:14 +01:00
James Salter d24348de81
Upload sourcemaps to sentry during build (#19403) 2021-10-20 11:18:47 +01:00
Šimon Brandner 017e4bd84b
Convert index to TS
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-09-24 20:51:02 +02:00
Travis Ralston 219ea134ca Disable HMR error page by default
see diff
2021-08-25 09:57:46 -06:00
Travis Ralston 24a076a202
Merge pull request #18665 from psrpinto/fix/theme-hot-reload
Fix isues with CSS hot-reload
2021-08-24 09:55:23 -06:00
Dariusz Niemczyk 231ff3a73d
Fix CI having invalid node_env 2021-08-23 12:35:43 +02:00
Paulo Pinto f16f804637 Fix theme key
The key must match the theme name, otherwise the getThemesImports() function
will exit with an error.

Signed-off-by: Paulo Pinto <paulo.pinto@automattic.com>
2021-08-20 15:44:28 +01:00
Paulo Pinto 412a7554c7 Remove commented out code 2021-08-18 17:15:07 +01:00
Paulo Pinto c3c47f170c Improve phrasing 2021-08-18 17:12:36 +01:00
Paulo Pinto 0eb8d3f4d1 Make code consistent with the comment above 2021-08-18 17:11:12 +01:00
Dariusz Niemczyk 71dcb0dd0d
Fix wrong variables in webpack config 2021-08-12 18:32:13 +02:00
Dariusz Niemczyk f56e8d7489
Add full HMR that actually somehow works! 2021-08-08 20:40:01 +02:00
Travis Ralston d4fc3ed354 Properly handle react-sdk's recorder worklet
Fixes https://github.com/vector-im/element-web/issues/18393
2021-08-04 15:08:52 -06:00
Dariusz Niemczyk 06d536afbc
Revert nameModules in webpackConfig 2021-08-03 18:38:00 +02:00
Dariusz Niemczyk 10fb3859fa
Add better docs and iframe support 2021-08-02 22:46:16 +02:00
Dariusz Niemczyk 88df5c33a9
Update webpack.config.js
Co-authored-by: Germain <germain@souquet.com>
2021-08-02 14:38:25 +02:00
Dariusz Niemczyk da4a49fd31
Add a default theme for CI 2021-08-02 14:38:25 +02:00
Dariusz Niemczyk a9f3f873a5
Add a .env config and explanation how to use HMR 2021-08-02 14:38:25 +02:00
Dariusz Niemczyk b677edbc58
Make CSS Hot-reload work in a hacky way 2021-08-02 14:38:25 +02:00
Travis Ralston 5e6b791617 Update webpack path for new worker location 2021-07-22 09:26:53 -06:00
Michael Telatynski 66ada58101 Use webpack worker-loader to load the IndexedDB worker instead of homegrown hack 2021-07-12 18:43:21 +01:00
Šimon Brandner 2760a36f47
Convert a few files to TS
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-07-06 21:41:02 +02:00
Germain Souquet 72d762ea0d Deprecate postcss calc() 2021-06-30 17:17:27 +01:00
J. Ryan Stinnett a1c53e59fb Fix lint errors in Webpack config 2021-06-10 15:19:38 +01:00
J. Ryan Stinnett 8d05d8481a Preload only `woff2` fonts
All of our supported browsers understand `woff2`, so there's no need to make
everyone preload the older `woff` as well.
2021-06-10 13:02:21 +01:00
fooness 10194fe445
Prevent minification of `.html` files generated by new verison html-webpack-plugin
This described in https://github.com/vector-im/element-web/issues/17330#issuecomment-842530812, this should prevent the newly introduced version of `html-webpack-plugin` from minifying `.html` files, like e.g. `index.html`, `jitsi.html`, et cetera …

Quoting @jryans via: https://github.com/vector-im/element-web/issues/17330#issuecomment-842415694

> The content of the `index.html` file is not a supported API surface, so it might change at any time.
> 
> This document minification was not done on purpose, but instead it happened as a side effect of upgrading. We would happily accept a PR to fix this, but it is also not a priority for the core team.

Could please someone test and, hopefully, accept this change back to not minifying the `.html` files?
2021-05-18 12:35:51 +02:00
Travis Ralston 07a0af2aae Add required webpack config to load Safari support modules
See https://github.com/matrix-org/matrix-react-sdk/pull/5989
2021-05-06 21:51:03 -06:00
Travis Ralston 69b4296fa7 Merge branch 'develop' into travis/voice/event_type 2021-04-22 14:37:23 -06:00
Germain 8692d6fa89
Merge pull request #17039 from vector-im/gsouquet-preload-fonts 2021-04-22 17:15:06 +01:00
Germain Souquet 8abc7cd87c Only inject Inter fonts to HtmlWebpackPlugin 2021-04-22 14:31:06 +01:00
J. Ryan Stinnett 9cf35ab199 Disable `postcss-calc`'s noisy `warnWhenCannotResolve` option
While it sounds like a useful warning at first, it turns out the warnings it
prints are ones we're unlike to ever act on, such as adding percentages and
pixels, which seem fine to have. This resets to default behaviour, which leaves
the warning off.
2021-04-22 13:05:02 +01:00
Germain Souquet 87806b8a67 Remove overzealous linter fixes 2021-04-22 12:22:10 +01:00
Germain Souquet 417835fcca Preload Inter font to avoid FOIT on slow connections 2021-04-22 12:09:50 +01:00
Germain Souquet 708f6a26b1 Upgrade html-webpack-plugin to v4.5.2 2021-04-22 10:22:52 +01:00
Travis Ralston 9c3627dca9 Register RecorderWorklet from react-sdk 2021-04-19 21:51:25 -06:00
J. Ryan Stinnett 53f9895901 Set `NODE_ENV` in a different way
With the approach in https://github.com/vector-im/element-web/pull/16969,
Webpack seems to sometimes do what we want, sometimes not... I haven't quite
worked out why. Perhaps there's some conflict or race in Webpack's defaults...?

This new approach seems to work as expected when running
`./scripts/ci_package.sh`, which matches what development deployments are doing.
2021-04-19 15:52:24 +01:00
Germain Souquet 84d6dcf498 Revert overzealous ESLint updates 2021-04-16 09:18:32 +01:00
Germain Souquet 0532c9c37b Use React production for CI builds
When running Nightly build we want to benefit from the fast runtime that React production offers and get rid of the runtime overhead that comes with development.

We are setting NODE_ENV and not "webpack.mode" to not loose sourcemaps and have minified sources in that environment
2021-04-15 15:17:24 +01:00
Germain Souquet f06eb14c48 Linter recommendations 2021-04-15 15:15:48 +01:00
Travis Ralston 4eb7c1bc00 Add docs for where the worker comes from 2021-03-23 18:29:26 -06:00
Travis Ralston cd2dda268f Add webpack config for opus-recorder worker 2021-03-16 22:58:50 -06:00
Travis Ralston e2ce4239bd Improve docs for customisations
The new regex considers Windows as an OS, and the added array helps reduce merge conflicts for the future.
2021-03-09 14:17:51 -07:00
Michael Telatynski 97925a6ad9 Iterate SpacePanel, fix tooltips and give consistent expanded states 2021-01-29 09:16:55 +00:00
J. Ryan Stinnett c667473258 Improve asset path for KaTeX fonts
This adjusts our asset path handling to group KaTeX fonts in a more sensible way
alongside the other fonts we have. It also resolves production build issues on
Windows.

Fixes https://github.com/vector-im/element-web/issues/15911
2020-12-09 17:03:55 +00:00
J. Ryan Stinnett d8e0ea5791 Include KaTeX CSS as a dependency
This changes the KaTeX CSS inclusion to function just like the other bits of the
CSS that we import from dependencies.
2020-11-27 12:18:24 +00:00
J. Ryan Stinnett 301ea6a5f3
Merge pull request #15277 from akissinger/katex
added katex.min.css to webpack for math support (main PR in matrix-react-sdk)
2020-11-27 11:55:56 +00:00
Aleks Kissinger e743a12f30 matched setting name to PR in matrix-react-sdk 2020-11-26 17:40:14 +00:00
J. Ryan Stinnett f1e89bf833 Replace various instances of Riot with Element 2020-11-25 17:01:19 +00:00
Michael Telatynski cfee4c925a Revert "Attempt to fix tests some more"
This reverts commit c76a5f2c

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-01 14:05:07 +01:00
Michael Telatynski 1edbe36547 Revert "Tidy up Service Worker, only run Workbox in production"
This reverts commit c47532fe

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-01 14:04:32 +01:00
Michael Telatynski 87c42934ea Revert "Disable workbox when running in webpack dev server, not in dev mode"
This reverts commit 11e676ce

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-01 14:04:21 +01:00
Michael Telatynski 11e676cee0 Disable workbox when running in webpack dev server, not in dev mode
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-09-30 17:35:12 +01:00
Aleks Kissinger a40cc4fa3e added katex.min.css to webpack for math support 2020-09-24 18:27:57 +01:00
Michael Telatynski c47532fe2a Tidy up Service Worker, only run Workbox in production
Moves ServiceWorker load into Platform so its not done by Electron

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-09-24 13:01:34 +01:00
Michael Telatynski c76a5f2c52 Attempt to fix tests some more 2020-09-15 13:19:47 +01:00
J. Ryan Stinnett 3f0de699f0 Clean up comments around Webpack modes 2020-07-17 14:57:48 +01:00
J. Ryan Stinnett 8ae4298637 Webpack modes also manage NODE_ENV
We don't need to manually define `NODE_ENV` in the Webpack config, nor do we
need to set it outside Webpack with `cross-env` either, as Webpack's modes will
take care of this for us.
2020-07-17 14:18:08 +01:00
Bruno Windels 29a1862912 rename element theme to light/dark to apply old prefs 2020-07-14 18:40:57 +02:00
David Baker d0f81b26ad Change logos excluding vector-icons 2020-07-10 19:09:52 +01:00
Bruno Windels bc57e6fd70 dark theme 2020-07-09 14:47:42 +02:00
Bruno Windels c9c402310a element theme webpack config 2020-06-30 13:28:24 +02:00
Michael Telatynski 99df2d3126 Fix postcss order to allow mixin variables to work
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-05-14 18:46:16 +01:00
Zoe 22704382fe Merge branch 'develop' into foldleft/12014-big-previews-2 2020-05-11 10:19:09 +01:00
Zoe cbdb2ec9a6 import image to package for use 2020-05-07 10:39:02 +01:00
Zoe 5dd452bec0 use a different image in previews 2020-05-04 11:42:09 +01:00
Zoe 0e75b1b0db
Merge pull request #13357 from vector-im/foldleft/decoder-ring
Developer tool: convert rageshake error locations back to sourcecode locations
2020-05-01 09:37:51 +01:00
Zoe 3e77418fd7 Turn on source mapping, copy decoder-ring over to bundle 2020-04-23 17:55:21 +01:00
Michael Telatynski b7fa8a1f54 wire up the static fallback error pages
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-04-23 13:37:25 +01:00