| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
| |
We can't do this in the renderer package, because we need to import MUI
files that are not exported (MUI v6 is not ESM yet).
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
| |
Run integration tests in an electron environment for the main process.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
| |
Since https://github.com/electron/electron/pull/33435 has landed in
electron 19 alpha, but not in 18, moving to 19 lets us remove the
workarounds for setBackgroundColor.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
| |
Embed the service-inject script into the service-preload script to avoid
having to load it manually and reduce IPC communication when a service
loads.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
| |
We need mui and mobx-react-like support before we can upgrade.
See https://github.com/mobxjs/mobx/issues/2526 for discussion about the
ramifications of concurrent rendering for mobx.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to `BrowserView.setBackgroundColor` not working under linux, we have
to inject styles to make sure our `BrowserView` is opaque.
We try to cover more edge cases to avoid the interference of the
injected style and the web site's own styles according to the CSS
specification:
https://www.w3.org/TR/css-backgrounds-3/#body-background
In particular, we avoid overwriting the styles for the `html` element
if `body` already has an opaque background so that the background of
`body` can extend to the whole canvas.
This might still interfere with the web site if it updates the
background color on the fly (dark mode), but a reload should solve
most of such issues.
Hopefully, after
https://github.com/electron/electron/issues/32898
is resolved, we can get rid of the hack entirely.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
| |
* Update the browser view size more quickly (negligible CPU usage
overhead)
* Style the body element by default instead of the html element for
better compatibility with website CSS.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
| |
Make sure that files have a default import with the same name as the
file whenever possible to reduce surprise.
Also shuffles around some file names for better legibility.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
loglevel wants to persist the current log level in localStorage, which
apparently crashes the network service. We'll need to find another way
to log in service preload scripts. The main window preload scripts seems
unaffected, even though we use loglevel (and hence localStorage) in both
the preload and the renderer script.
Maybe related: https://github.com/electron/electron/issues/31689
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
| |
|
| |
|
|
|
|
|
|
| |
This would run as part of gitlab SAST (if it didn't time out).
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
| |
eslint will also enforce prettier rules, so there is no need to call
prettier separately in CI.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
| |
See https://github.com/typescript-eslint/typescript-eslint/issues/3851
Also upgrades dependencies and simplifies eslint config (used during
debugging this issue to eliminate other possible sources of errors.)
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Changed jest to run from the root package and reference the packages
as projects. This required moving the base jest config file away from
the project root.
- Module isolation seems to prevent ts-jest from loading the shared
package, so we disabled it for now.
- To better facilitate mocking, services should be split into interfaces
and implementation
- Had to downgrade to chald 4.1.2 as per
https://github.com/chalk/chalk/releases/tag/v5.0.0 at least until
https://github.com/microsoft/TypeScript/issues/46452 is resolved.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now we can run with ESM at build and test time and transpile into
commonjs for electron. This greatly simplifies testing, since we treat
everything as ESM during build with esbuild anyways. Now the test
environment and the build scripts match the apparent (but not the actual
for the main, preload, and inject modules) runtime environment.
Caveats:
- We may use top-level async expressions in tests and script, but not in
code that gets transpiled into commonjs or scripts that get imported
by vite. The limitation w.r.t. commonjs seems fundamental.
- Jest only experimentally supports ESM and there are some limitations
with mocking. Most limitations (except the lack of automatic mocks)
can be worked around by async importing code that uses mocks.
- There are packages marked as modules (so that node reads any scripts
in them as ESM) that nevertheless get transpiled into commonjs
modules. However, these should be clearly marked by using a .cjs
extension as their bundle. The worst offender is the root package,
which has a .cjs as its main entry point that gets read by electron,
but is in fact marked as a module. This doesn't seem to bother electron
at all. The service-inject package is an IIFE with a .js extension,
but it outputs a fully self-contained bundle, so the choice of module
format should be irrelevant.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We will build all packages except the frontend (where vite remains in
use) with esbuild.
For some reason, the @yarnpkg/esbuild-plugin-pnp doesn't allow esbuild
to load esm modules and we fall back to commonjs for dependencies.
Hence we had to switch back to node_modules (but still rely on yarn
hardlinking for a more efficient install).
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Since we don't plan to shim any APIs that must be present immediately
when the service loads, we might as well switch to asynchronous IPC for
fetching the script to inject into the main world.
|
|
|
|
|
|
|
|
|
| |
Inject CSS and main world scripts synchronously to avoid race conditions
with page loading.
Don't try to miming userAgentData for now, since it won't bypass
google's checks. However, simply omitting chrome from the user agent
does bypass them, at least for now.
|
| |
|
| |
|
|
|