Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
41 changes: 36 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and run yarn project
name: Lint, Build, Smoketest Run

on:
push:
Expand All @@ -8,10 +8,15 @@ on:
branches:
- "*"

# Auto-abort duplicate jobs (e.g. job being triggered again on push to open PR)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-run:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -25,8 +30,34 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Prettier check
run: yarn add --dev --exact prettier && yarn exec prettier . --write
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.13"

- name: Install pre-commit
run: |
python -m pip install --upgrade pip
pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files

build-and-run:
name: Build and Run
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "yarn"

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build project
run: yarn build
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

*:Zone.Identifier
*:Zone.Identifier
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.45.0
hooks:
- id: markdownlint
args: [--config=.markdownlint.json]

- repo: local
hooks:
- id: prettier
name: prettier
entry: yarn prettier
language: node
types_or: [markdown, mdx]
pass_filenames: true
args: [--write]
additional_dependencies:
- [email protected]
6 changes: 4 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"useTabs": false,
"semi": false,
"singleQuote": false,
"endOfLine": "lf"
}
"endOfLine": "lf",
"printWidth": 100,
"proseWrap": "always"
}
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"languageToolLinter.languageTool.ignoredWordsInWorkspace": [
"hkdf",
"hpke",
"megolm",
"polyproto-auth",
"polyproto-chat",
"polyproto-core",
"polyproto-mls"
]
],
"languageToolLinter.languageTool.disabledRules": "UPPERCASE_SENTENCE_START"
}
66 changes: 46 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,67 @@
[![FAQ-shield]][FAQ]

# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation
## Installation

```
$ yarn
```bash
yarn
```

### Local Development
### Pre-commit Hooks

```
$ yarn start
```
This project uses pre-commit hooks to ensure code quality and uniform formatting. To set up
pre-commit hooks:

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1. Install pre-commit:

### Build
```bash
pip install pre-commit
```

```
$ yarn build
```
2. Install prettier and dev-dependencies:

This command generates static content into the `build` directory and can be served using any static contents hosting service.
```bash
yarn install
```

### Deployment
3. Install the git hooks:

Using SSH:
```bash
pre-commit install
```

```
$ USE_SSH=true yarn deploy
The pre-commit hooks will automatically:

- Format Markdown and MDX files using Prettier
- Lint Markdown files using markdownlint
- Check for common issues like trailing whitespace and file endings

You can manually run the checks on all files:

```bash
pre-commit run --all-files
```

Not using SSH:
### Local Development

```bash
yarn start
```
$ GIT_USER=<Your GitHub username> yarn deploy

This command starts a local development server and opens up a browser window. Most changes are
reflected live without having to restart the server.

### Build

```bash
yarn build
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
This command generates static content into the `build` directory and can be served using any static
contents hosting service.

[FAQ-shield]: https://img.shields.io/badge/Frequently_Asked_Questions_(FAQ)-ff62bd
[FAQ]: https://github.com/polyphony-chat/.github/blob/main/FAQ.md
50 changes: 36 additions & 14 deletions blog/2023-08-17-self-updating-structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,63 @@
draft: false
date: 2023-08-17
categories:
- chorus
- updates
- chorus
- updates
authors:
- bitfl0wer
- bitfl0wer
---

# Self-updating structs, moving blog posts to GitHub, and more!
# Self-updating structs, moving blog posts to GitHub, and more

Introducing self-updating structs, explaining how they work, and what they are good for. Also, moving blog posts to GitHub, and other improvements.
Introducing self-updating structs, explaining how they work, and what they are good for. Also,
moving blog posts to GitHub, and other improvements.

{/* truncate */}
{/_ truncate _/}

It has been a while since the last update post - 1 month to be precise! I haven't gotten around to writing one of these, mostly because of personal time- and energy constraints. However, now that these resources are finally replenishing again, I figured that it is once again time!
It has been a while since the last update post - 1 month to be precise! I haven't gotten around to
writing one of these, mostly because of personal time- and energy constraints. However, now that
these resources are finally replenishing again, I figured that it is once again time!

## Moving Blog Posts to GitHub

This is a pretty self-explanatory point. I thought, that opencollective would find more use by me and other polyphony-curious folk, however, this didn't go as planned. Also, opencollective made their Discord embeds really poopy, which is why I am moving all the blog posts over to GitHub.
This is a pretty self-explanatory point. I thought, that opencollective would find more use by me
and other polyphony-curious folk, however, this didn't go as planned. Also, opencollective made
their Discord embeds really poopy, which is why I am moving all the blog posts over to GitHub.

## A big one: Self-updating structs

Ideally, you want entities like Channels, Guilds, or Users to react to Gateway events. A Gateway event is basically a message from Spacebar/Discord to you, which says: "Hey, User `x` has changed their name to `y`!". If you can reflect those changes immediately within your code, you save yourself from having to make a lot of requests and potentially getting rate-limited.
Ideally, you want entities like Channels, Guilds, or Users to react to Gateway events. A Gateway
event is basically a message from Spacebar/Discord to you, which says: "Hey, User `x` has changed
their name to `y`!". If you can reflect those changes immediately within your code, you save
yourself from having to make a lot of requests and potentially getting rate-limited.

This is exactly what Self-updating structs set out to solve. The first implementation was done by @SpecificProtagonist and me (thank you a lot again, btw) on the 21st of July. However: This implementation, being in its' infancy, has had some design flaws, which to me made pretty clear, that this whole thing needed to be thought through a little better.
This is exactly what Self-updating structs set out to solve. The first implementation was done by
@SpecificProtagonist and me (thank you a lot again, btw) on the 21st of July. However: This
implementation, being in its' infancy, has had some design flaws, which to me made pretty clear,
that this whole thing needed to be thought through a little better.

The second iteration of these Self-updating structs was finished... today, actually, by me. It saves memory compared to the first iteration by storing unique objects only once, instead of `n = how many times they are being referenced`-times. While this way of doing things is really efficient, it also has been a pain in the ass to make, which is precisely the reason why this took me so long. I've learned a lot along the way though.
The second iteration of these Self-updating structs was finished... today, actually, by me. It saves
memory compared to the first iteration by storing unique objects only once, instead of
`n = how many times they are being referenced`-times. While this way of doing things is really
efficient, it also has been a pain in the ass to make, which is precisely the reason why this took
me so long. I've learned a lot along the way though.

The public API has also gotten a *lot* better in "v2". This is mostly because I am a big believer in writing tests for your code, and through writing what are essentialy real-world-simulation-examples, I noticed how repetitive or stupid some things were, and thus could improve upon them.
The public API has also gotten a _lot_ better in "v2". This is mostly because I am a big believer in
writing tests for your code, and through writing what are essentialy real-world-simulation-examples,
I noticed how repetitive or stupid some things were, and thus could improve upon them.

Having this whole thing finished is a big relief. This self-updating thing is an essential feature for any Discord/Spacebar compatible library, and I think that we implemented it very nicely.
Having this whole thing finished is a big relief. This self-updating thing is an essential feature
for any Discord/Spacebar compatible library, and I think that we implemented it very nicely.

## Documentation and other improvements

@kozabrada123 took it upon himself to re-write a lot of the codes' Documentation. Thanks for that! This will massively improve the ease of use of this library - both when developing *for* and *with* it. koza also improved our CI/CT pipeline by incorporating build-caching into it, which speeds up builds.
@kozabrada123 took it upon himself to re-write a lot of the codes' Documentation. Thanks for that!
This will massively improve the ease of use of this library - both when developing _for_ and _with_
it. koza also improved our CI/CT pipeline by incorporating build-caching into it, which speeds up
builds.

This has been the last month of Polyphony. In the coming weeks, I will be working on

- Implementing self-updating-struct behavior for every struct which needs it
- Fixing bugs
- Adding more features, like emojis, 2FA, Guild Settings, etc.!
Expand Down
33 changes: 22 additions & 11 deletions blog/2023-08-29-chorus-alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,40 @@
draft: false
date: 2023-08-29
categories:
- chorus
- updates
- chorus
- updates
authors:
- bitfl0wer
- bitfl0wer
---

# chorus Alpha 0.1.0

We are alpha now! As of 2 days ago, the first Alpha of Chorus, Version 0.1.0, has been released for everyone to look at and use on crates.io!
We are alpha now! As of 2 days ago, the first Alpha of Chorus, Version 0.1.0, has been released for
everyone to look at and use on crates.io!

{/* truncate */}
{/_ truncate _/}

So, is the library complete now? No. And yes! It's, well, complicated... Let me explain!

Chorus is at a point where I can comfortably say that, if you take voice-support out of the calculation for a bit, the foundation feels rock-solid, easy to work with and easily expandable. However, to stay with our house/building metaphor for a bit, the walls aren't painted yet, there's barely any furniture and not all of the electrical outlets have been installed yet.
Chorus is at a point where I can comfortably say that, if you take voice-support out of the
calculation for a bit, the foundation feels rock-solid, easy to work with and easily expandable.
However, to stay with our house/building metaphor for a bit, the walls aren't painted yet, there's
barely any furniture and not all of the electrical outlets have been installed yet.

Okay, enough with this bad metaphor; What I meant to convey is, that a lot of the API endpoints have not yet been implemented, and there are at least a few points we haven't addressed yet - like Gateway Error Handling, to name an example.
Okay, enough with this bad metaphor; What I meant to convey is, that a lot of the API endpoints have
not yet been implemented, and there are at least a few points we haven't addressed yet - like
Gateway Error Handling, to name an example.

But for an early Alpha, this, in my opinion, is absolutely acceptable. Implementing API endpoints is something that probably someone who is entirely new to Rust could do, given that we've streamlined the procedure so much, and the other stuff can comfortably be fixed without having to do any major changes to the internals.
But for an early Alpha, this, in my opinion, is absolutely acceptable. Implementing API endpoints is
something that probably someone who is entirely new to Rust could do, given that we've streamlined
the procedure so much, and the other stuff can comfortably be fixed without having to do any major
changes to the internals.

I, for one, am currently experimenting around with the Polyphony Client, which, by the way, will likely be written with Iced as a GUI Framework, not GTK. I have no prior experience in GUI/Desktop Application development, but I am feeling more confident than ever and I'm eager to learn all there is to know about these topics.
I, for one, am currently experimenting around with the Polyphony Client, which, by the way, will
likely be written with Iced as a GUI Framework, not GTK. I have no prior experience in GUI/Desktop
Application development, but I am feeling more confident than ever and I'm eager to learn all there
is to know about these topics.

That's that! Seeya next time.
Cheers,
That's that! Seeya next time. Cheers,

Flori
33 changes: 23 additions & 10 deletions blog/2023-09-02-client-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,39 @@
draft: false
date: 2023-09-02
categories:
- polyphony
- updates
- polyphony
- updates
authors:
- bitfl0wer
- bitfl0wer
---

# Getting started with the Polyphony Client

{/* truncate */}
{/_ truncate _/}

Us labeling Chorus to be in a public-alpha state was really great news for me, for a lot of reasons! It marked a point in Polyphonys history where, after all these months of work, we agreed upon the fact that what we *have* is good enough to be shown to the public, and that's always a nice thing when investing so much of your free-time into a project.
The other main reason why this is such a great thing is, because this alpha state (at least to me) means, that the public API is kind-of stable, or at least stable enough so that I, the project lead, can rely upon the fact that all the public methods will not, in fact, be replaced in 4 days.
Us labeling Chorus to be in a public-alpha state was really great news for me, for a lot of reasons!
It marked a point in Polyphonys history where, after all these months of work, we agreed upon the
fact that what we _have_ is good enough to be shown to the public, and that's always a nice thing
when investing so much of your free-time into a project. The other main reason why this is such a
great thing is, because this alpha state (at least to me) means, that the public API is kind-of
stable, or at least stable enough so that I, the project lead, can rely upon the fact that all the
public methods will not, in fact, be replaced in 4 days.

This means, that I can finally start working on the Client! And I have done that! For the past 2? 3? Days, I've been tinkering around with Iced-rs (a really, really great UI framework for Rust, written in Rust) and the client repository to create the 'skeleton' of the application. While this is definitely not trivial, especially since I have *no* prior experience in desktop application development, it's also not too hard either.
This means, that I can finally start working on the Client! And I have done that! For the past 2? 3?
Days, I've been tinkering around with Iced-rs (a really, really great UI framework for Rust, written
in Rust) and the client repository to create the 'skeleton' of the application. While this is
definitely not trivial, especially since I have _no_ prior experience in desktop application
development, it's also not too hard either.

While Iced is not mature yet, and "how-to" guides, as well as the promised Iced-book, are still largely missing, the maintainers have done a great job with providing a LOT of code examples and solid rustdocs. It's a fun library/framework to work with, and the Elm-inspired approach of dividing up State, Messages, View- and Update-Logic feels really intuitive and seems to make sure that your Application will never end up in an unexpected state.
While Iced is not mature yet, and "how-to" guides, as well as the promised Iced-book, are still
largely missing, the maintainers have done a great job with providing a LOT of code examples and
solid rustdocs. It's a fun library/framework to work with, and the Elm-inspired approach of dividing
up State, Messages, View- and Update-Logic feels really intuitive and seems to make sure that your
Application will never end up in an unexpected state.

That's all I have for today. Thanks for reading this! Here's a video of multi-user login already working ^^
That's all I have for today. Thanks for reading this! Here's a video of multi-user login already
working ^^

<video controls width="auto">
<source src="https://cloud.bitfl0wer.de/index.php/s/Gd556SnwAQYejYw/download/screenrec.mp4"/>
</video>

Loading