chore: refactor instanceid handling #8572
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes the
runtimestore andRuntimeProvidercomponent in favor of storing the necessary parameters for querying directly on thehttpClient, which now features methods to set and get those properties.This is a fundamental restructuring that better aligns the storage and access of these properties with how they're used.
On Rill Developer,
instanceIdis alwaysdefaultand there are no tokens. As such, there is no value in having either of these stored using Svelte's store API. It makes elements that depend oninstanceIdunnecessarily use derived stores or$access. It also suggests that it can change, which it cannot. In general, reactivity is not required.On Rill Cloud,
instanceId,host, andJWTare directly tied to a project and, within a project, they are largely stable (JWT may be refreshed). As such, the exact same access mechanism (through thehttpClient) can be used. To enable updates to propagate when switching projects, we simply add a high level key oninstanceId. This is preferred to the "illusion" of fine grained reactivity. Switching projects is such a fundamental change that "warm" reloading components can cause unexpected issues that are difficult to debug.To Do:
Checklist: