fix: a page in the dark color scheme, also one in an iframe, is no longer white while it loads, and test-container.mjs runs the checks with Docker.
Release / release (push) Successful in 25s
Release / release (push) Successful in 25s
This commit is contained in:
1 parent
5e62e143b6
commit
6d365cf529
8 files changed
+192
-8
No files matched your search
@@ -157,3 +157,39 @@ store is first used.
|
||||
Consequences: The schema of an instance's files is the schema of its newest revision; files
|
||||
imported without a schema, or written before revisions, have none until a configurator writes
|
||||
them. Revisions grow with every write; the README describes the SQL that removes them.
|
||||
|
||||
## ADR-8: A Vite plugin sets the color scheme before the first paint
|
||||
|
||||
Status: Accepted
|
||||
|
||||
Context: `appTheme` puts the class of the color scheme on `<html>` from React, after the scripts
|
||||
of the application have loaded. Until then a page in the dark scheme is white, which shows on
|
||||
every load, and on every opening of a page that embeds an application in an iframe.
|
||||
|
||||
Decision: The `colorScheme()` plugin adds an inline script and style to `index.html`, so the class
|
||||
is set and the dark background painted before the application loads. The script reads MUI's
|
||||
storage key `mui-mode` and follows `prefers-color-scheme` for the system mode, as MUI does, and
|
||||
the style uses MUI's default dark background, which `appTheme` keeps. The plugin is part of the
|
||||
Vite helpers, which every application already uses, so the applications need no code of their own
|
||||
in `index.html`.
|
||||
|
||||
Consequences: The storage key and the dark background are repeated in the plugin; a theme that
|
||||
changes either has to change the plugin too. An application of the toolkit adds `colorScheme()`
|
||||
to the plugins of its `vite.config.ts`.
|
||||
|
||||
## ADR-9: The checks run in a container built from the files git knows, with a scratch PostgreSQL
|
||||
|
||||
Status: Accepted
|
||||
|
||||
Context: The checks are faster on a remote Docker engine than on the developer's machine. The
|
||||
store's tests need a PostgreSQL server whose role creates databases, and a remote engine sees
|
||||
neither the checkout nor its `node_modules`.
|
||||
|
||||
Decision: `test-container.mjs` sends a tar archive of the files git tracks and the untracked files
|
||||
it does not ignore as the build context of `test.Dockerfile`, whose build runs the checks that need
|
||||
no server, and runs the tests in a container next to a PostgreSQL container on a network of their
|
||||
own, both removed afterwards. The image's `package` stage holds the packed toolkit, which the
|
||||
applications install to check against the checkout.
|
||||
|
||||
Consequences: The tests need no PostgreSQL server of the developer's. A file git ignores is not
|
||||
part of the checks. The checks run on Linux, whatever the developer's system.
|
||||
Reference in new issue
Block a user