-
Notifications
You must be signed in to change notification settings - Fork 159
refactor!: use origin instead of base_url in configuration #979
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
base: 12-23-feat_change_mutation_detection_and_allow_reactive_boolean_defaults
Are you sure you want to change the base?
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
e925b44
to
70e86a3
Compare
b63562e
to
4927662
Compare
a97b75b
to
1d29010
Compare
Streamlines configuration. Whereas previously we had `base_url=origin+root_path`, which forced us to check if the two matched, we now have only the two constituent pieces `origin` and `root_path`
0cef192
to
2bd9071
Compare
4927662
to
8687bfb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work, just the None to signal no configuration would be nice to keep in
"SOLARA_BASE_URL is deprecated, please use SOLARA_ORIGIN and SOLARA_ROOT_PATH instead. " | ||
"SOLARA_BASE_URL will be removed in a future major version of Solara.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@@ -178,8 +179,8 @@ class MainSettings(BaseSettings): | |||
mode: str = "production" | |||
tracer: bool = False | |||
timing: bool = False | |||
root_path: Optional[str] = None # e.g. /myapp (without trailing slash) | |||
base_url: str = "" # e.g. https://myapp.solara.run/myapp/ | |||
root_path: str = "" # e.g. /myapp (without trailing slash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used the None option to signal it's not configured, which then in starlette.py will recognize it (put a comment there where we do that)
scope = request.scope | ||
root_path_asgi = scope.get("route_root_path", scope.get("root_path", "")) | ||
if settings.main.root_path is None: | ||
if settings.main.root_path == "": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to keep this to None, to make sure we only do this when it is not explicitly configured.
All Submissions:
pre-commit
prior to committing my changes (see development setup docs).Changes to / New Features:
Description of changes
This streamlines the url configuration for Solara server, since we no longer have redundant information in
base_url
, and both remaining parameters are without trailing slashes.