Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Init Runtime Store #4519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 6, 2024
Merged

Init Runtime Store #4519

merged 7 commits into from
Apr 6, 2024

Conversation

briangregoryholmes
Copy link
Contributor

@briangregoryholmes briangregoryholmes commented Apr 5, 2024

This PR initializes the runtime store with default values and, in Rill Developer, removes the use of the RuntimeProvider component, which is not necessary.

Additionally, it cleans up the process by which we derive the runtime URL.

This is a necessary change to enable data fetching in + files as the http-client requires that runtime be defined.

@briangregoryholmes briangregoryholmes self-assigned this Apr 5, 2024
@briangregoryholmes briangregoryholmes marked this pull request as draft April 5, 2024 08:00
@briangregoryholmes briangregoryholmes marked this pull request as ready for review April 5, 2024 09:27
Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting an error when running the Cloud UI. It looks like the feature flag store is trying and failing to find the rill.yaml file.
image

@briangregoryholmes
Copy link
Contributor Author

briangregoryholmes commented Apr 5, 2024

Alright, should be okay now. The types kind of threw me off. instanceId is treated as a string throughout the application with the undefined state being an empty string. There are some query wrappers that run when they should't but are disabled so long as "instanceId" is falsy. Should probably move to an explicit string | null type and restructure , but the exposure to that change across the app is huge.

For my own sanity, I'll try to explain the host behavior. In Rill developer, the host should be http://localhost:9009 when in dev mode. Instead of using the RILL_DEV flag in package.json, I've changed it to use the SvelteKit flag. In testing and prod, the host should be an empty string so that the requests are made via relative paths.

In web-admin, there's another httpClient for the admin service that uses Axios. It runs on http://localhost:8080 or, in production, on a host that is injected via an environment variable. This PR doesn't touch that.

web-admin also uses the runtime service, but the host is conditional based on the project and no calls should be made to it until you have a host and instance id. However, the layout does have hooks like useDashboards being called in the tree above the RuntimeProvider. Because of that, the web-common runtime store needs to be initialized with empty strings so that those queries are not enabled.

@briangregoryholmes briangregoryholmes merged commit 682a933 into main Apr 6, 2024
4 checks passed
@briangregoryholmes briangregoryholmes deleted the bgh/init-runtime branch April 6, 2024 23:16
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