Skip to content

feat: Instance context to enable routes and reactivity w/ consistent interface#1315

Open
Pecacheu wants to merge 2 commits into
mainfrom
feat/instance
Open

feat: Instance context to enable routes and reactivity w/ consistent interface#1315
Pecacheu wants to merge 2 commits into
mainfrom
feat/instance

Conversation

@Pecacheu

@Pecacheu Pecacheu commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Perquisite for:

Supersedes:

Adds the Instance context for accessing instance-specific configurations and detecting the API endpoint from the current instance. Also adds an easy-to-use memo to the ClientController that simplifies limit checks and safely returns defaults if client is unconfigured, and drops some now-unused CONFIGURATION env vars.

Note: This PR does not actually enable instance switching, nor does it add/change any UI. But it is the groundwork for doing so, adding the necessary reactivity, and enabling the route handling for alternate instances.

Edit: Messed around with the commit history a bit to make sure Gtoasted gets credited for their initial contributions to this.

@Pecacheu Pecacheu requested review from a team as code owners June 29, 2026 17:22
@Pecacheu Pecacheu marked this pull request as draft June 29, 2026 17:25
@Pecacheu Pecacheu force-pushed the feat/instance branch 2 times, most recently from d324b96 to bd9890a Compare June 29, 2026 17:33
@Pecacheu Pecacheu marked this pull request as ready for review June 30, 2026 13:55
@Pecacheu Pecacheu force-pushed the feat/instance branch 3 times, most recently from eacb13f to 74f076e Compare June 30, 2026 15:11
@Pecacheu Pecacheu force-pushed the feat/instance branch 2 times, most recently from 71c5f1a to f5a2fe5 Compare June 30, 2026 15:47
Gtoasted and others added 2 commits July 2, 2026 11:14
refactor: use Instance.apiUrl instead of CONFIGURATION.DEFAULT_API_URL
refactor: use Instance.wsUrl instead of CONFIGURATION.DEFAULT_WS_URL
refactor: use Instance.mediaUrl instead of CONFIGURATION.DEFAULT_MEDIA_URL
refactor: use Instance.proxyUrl instead of CONFIGURATION.DEFAULT_PROXY_URL
refactor: use Instance.gifboxUrl instead of CONFIGURATION.DEFAULT_GIFBOX_URL
refactor: use Instance.isStoat instead of CONFIGURATION.IS_STOAT
refactor: use Instance.hcaptcha_sitekey instead of CONFIGURATION.HCAPTCHA_SITEKEY
refactor: use Instance.maxEmoji instead of CONFIGURATION.MAX_EMOJI
refactor: use Instance.enableVideo instead of CONFIGURATION.ENABLE_VIDEO
chore: take note of remaining variables to be implemented in instance.ts
chore: fix formatting
feat: add hostname to Instance.ts
feat: modify routes to allow access to other instances

Signed-off-by: Gtoasted <git@gtoasted.de>
fix: Use instance global limits in Draft.ts because it is outside of the ClientController context
refactor: Move client init from Lifecycle into Instance so that the configuration is only pulled once
fix: Use instance prop for server emoji limit

Signed-off-by: Pecacheu <3608878+Pecacheu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants