Skip to content

Commit c444a2f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into sandhose/oidc-login
2 parents ce3331e + a565d2a commit c444a2f

File tree

149 files changed

+4615
-748
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+4615
-748
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ lib
1010
*.tar.gz
1111
.eslintcache
1212
.tmp
13+
playwright/synapselogs

.ts-eslintrc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ module.exports = {
2020
rules: {
2121
"@typescript-eslint/no-floating-promises": 2,
2222
"@typescript-eslint/no-misused-promises": 2,
23-
"semi": ["error", "always"]
23+
"no-unused-vars": "off",
24+
"@typescript-eslint/no-unused-vars": ["warn"],
25+
"no-undef": "off",
26+
"semi": ["error", "always"],
27+
"@typescript-eslint/explicit-function-return-type": ["error"]
2428
}
2529
};

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ You can run Hydrogen locally by the following commands in the terminal:
3939

4040
Now point your browser to `http://localhost:3000`. If you prefer, you can also [use docker](doc/docker.md).
4141

42+
PS: You need nodejs, running yarn on top of any other js platform is not supported.
43+
4244
# FAQ
4345

4446
Some frequently asked questions are answered [here](doc/FAQ.md).

doc/CSS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ We could do top to bottom gradients in default avatars to make them look a bit c
66

77
Can take ideas/adopt from OOCSS and SMACSS.
88

9+
## Documentation
10+
11+
Whether we use OOCSS, SMACSS or BEM, we should write a tool that uses a JS parser (acorn?) to find all css classes used in the view code by looking for a `{className: "..."}` pattern. E.g. if using BEM, use all the found classes to construct a doc with a section for every block, with therein all elements and modifiers.
12+
913
### Root
1014
- maybe we should not assume `body` is the root, but rather a `.brawl` class. The root is where we'd set root level css variables, fonts?, etc. Should we scope all css to this root class? That could get painful with just vanilla css. We could use something like https://github.com/domwashburn/postcss-parent-selector to only do this at build time. Other useful plugin for postcss: https://github.com/postcss/postcss-selector-parser
1115

doc/FAQ.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ TorBrowser ships a crippled IndexedDB implementation and will not work. At some
1010

1111
It used work in pre-webkit Edge, to have it work on Windows Phone, but that support has probably bit-rotted as it isn't tested anymore.
1212

13+
The following browser extensions are known to break Hydrogen
14+
- uBlock Origin (seems to block the service worker script)
15+
1316
## Is there a way to run the app as a desktop app?
1417

1518
You can install Hydrogen as a PWA using Chrome/Chromium on any platform or Edge on Windows. Gnome Web/Ephiphany also allows to "Install site as web application". There is no Electron build of Hydrogen, and there will likely be none in the near future, as Electron complicates the release process considerably. Once Hydrogen is more mature and feature complete, we might reconsider and use [Tauri](https://tauri.studio) if there are compelling use cases not possible with PWAs. For now though, we want to keep development and releasing fast and nimble ;)

doc/SDK.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ async function main() {
8585
room,
8686
ownUserId: session.userId,
8787
platform,
88-
urlCreator: urlRouter,
88+
urlRouter: urlRouter,
8989
navigation,
9090
});
9191
await vm.load();

doc/THEMING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Currently supported operations are:
8080
| -------- | -------- | -------- |
8181
| darker | percentage | color |
8282
| lighter | percentage | color |
83+
| alpha | alpha percentage | color |
8384

8485
## Aliases
8586
It is possible give aliases to variables in the `theme.css` file:

doc/impl-thoughts/SSO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if (loginOptions.sso) {
3030
// store the homeserver for when we get redirected back after the sso flow
3131
platform.settingsStorage.setString("sso_homeserver", loginOptions.homeserver);
3232
// create the redirect url
33-
const callbackUrl = urlCreator.createSSOCallbackURL(); // will just return the document url without any fragment
33+
const callbackUrl = urlRouter.createSSOCallbackURL(); // will just return the document url without any fragment
3434
const redirectUrl = sso.createRedirectUrl(callbackUrl, provider);
3535
// and open it
3636
platform.openURL(redirectUrl);

doc/impl-thoughts/room-types.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
different room types create different kind of "sync listeners", who implement the sync lifecycle handlers
3+
4+
they would each have a factory,
5+
*/
6+
7+
interface IRoomSyncHandler {
8+
prepareSync()
9+
afterPrepareSync()
10+
writeSync()
11+
afterSync()
12+
afterSyncCompleted()
13+
}
14+
15+
interface IRoom extends IRoomSyncHandler {
16+
start(): void;
17+
load(): void;
18+
get id(): string;
19+
}
20+
21+
interface IRoomFactory<T extends IRoom> {
22+
createRoom(type, roomId, syncResponse): T
23+
createSchema(db, txn, oldVersion, version, log)
24+
get storesForSync(): string[];
25+
get rooms(): ObservableMap<string, T>
26+
}
27+
28+
class InstantMessageRoom implements IRoom {
29+
}
30+
31+
class InstantMessageRoomFactory implements IRoomFactory<InstantMessageRoom>{
32+
loadLastMessages(): Promise<void>
33+
/*
34+
get all room ids and sort them according to idb sorting order
35+
open cursor 'f' on `timelineFragments`
36+
open a cursor 'e' on `timelineEvents`
37+
for each room:
38+
with cursor 'f', go to last fragment id and go up from there to find live fragment
39+
with cursor 'e', go to last event index for fragment id and room id and go up until we have acceptable event type
40+
for encrypted rooms:
41+
decrypt message if needed (m.room.encrypted is likely something we want to display)
42+
*/
43+
}
44+
45+
class SpaceRoom implements IRoom {}
46+
47+
class SpaceRoomFactory implements IRoomFactory<SpaceRoom> {
48+
createRoom(type, roomId, syncResponse): IRoomSyncHandler
49+
}
50+
51+
class Session {
52+
constructor(roomFactoriesByType: Map<string, IRoomFactory>) {
53+
54+
}
55+
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hydrogen-web",
3-
"version": "0.3.0",
3+
"version": "0.3.6",
44
"description": "A javascript matrix client prototype, trying to minize RAM usage by offloading as much as possible to IndexedDB",
55
"directories": {
66
"doc": "doc"
@@ -18,7 +18,8 @@
1818
"start": "vite --port 3000",
1919
"build": "vite build && ./scripts/cleanup.sh",
2020
"build:sdk": "./scripts/sdk/build.sh",
21-
"watch:sdk": "./scripts/sdk/build.sh && yarn run vite build -c vite.sdk-lib-config.js --watch"
21+
"watch:sdk": "./scripts/sdk/build.sh && yarn run vite build -c vite.sdk-lib-config.js --watch",
22+
"test:app": "./scripts/test-app.sh"
2223
},
2324
"repository": {
2425
"type": "git",
@@ -31,6 +32,7 @@
3132
},
3233
"homepage": "https://github.com/vector-im/hydrogen-web/#readme",
3334
"devDependencies": {
35+
"@playwright/test": "^1.27.1",
3436
"@typescript-eslint/eslint-plugin": "^4.29.2",
3537
"@typescript-eslint/parser": "^4.29.2",
3638
"acorn": "^8.6.0",

0 commit comments

Comments
 (0)