-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Issues 1633 Add frontend_path to config to support running multiple reflex apps off the same domain, and 1583 Show the correct info on where the site is being served. #1724
Conversation
Update to 0.2.5.
- Tests. - And sorted config in next.config.js template.
Update to latest main.
Update to latest main.
Update to 0.2.6.
Update to latest.
Update to 0.2.6.
After merging and resolving the conflict I've retested locally for the thing that needed resolving, and for the things the changes do, and I've rerun the tests and everything, and it's all good. I'm redeploying to my own sites on DigitalOcean. |
Had to discover that I needed to change |
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.
This looks really great! Just a couple of comments, and will discuss with the team about the walrus operator.
reflex/utils/exec.py
Outdated
@@ -36,9 +37,13 @@ def run_process_and_launch_url(run_command: list[str]): | |||
) | |||
|
|||
for line in processes.stream_logs("Starting frontend", process): | |||
if "ready started server on" in line: | |||
url = line.split("url: ")[-1].strip() | |||
if match := re.search("ready started server on ([0-9.:]+)", line): |
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.
the walrus was introduced in python 3.8, but reflex still claims to support 3.7 although we do not test with it... this would certainly require us to drop 3.7 support in the main package.
The team has been discussing dropping 3.7 for at least a month, but we haven't made a solid decision yet. Although 3.7 went end of life 2 months ago (2023-06-27), there are still some supported linux distributions that might be shipping it.
i'm not asking you do change the code here...yet, but will discuss with the team and see if the time has come to drop 3.7 support. (Personally, I'm of the mind, that if we don't test it in CI, then we don't really support it).
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.
There are things you cannot do without the :=, but since this isn't one of them, happy to change it.
reflex/utils/exec.py
Outdated
if "ready started server on" in line: | ||
url = line.split("url: ")[-1].strip() | ||
if match := re.search("ready started server on ([0-9.:]+)", line): | ||
url = match.group(1) |
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.
url = match.group(1) | |
url = f"http://{match.group(1)}" |
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.
Done.
reflex/utils/exec.py
Outdated
if match := re.search("ready started server on ([0-9.:]+)", line): | ||
url = match.group(1) | ||
if get_config().frontend_path != "": | ||
url += get_config().frontend_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'd prefer to see urllib.parse.urljoin
here, to ensure that leading and trailing slashes are squashed.
url += get_config().frontend_path | |
url = urljoin(url, get_config().frontend_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.
Done.
reflex/utils/exec.py
Outdated
console.print(f"App running at: [bold green]{url}") | ||
else: | ||
console.debug(line) |
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 process.stream_logs
already logs each line at debug level.
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.
Done.
Actually, it looks like it is caused by 63b5fbd because the pre-commit wasn't run on it? |
Yeah that should be fixed now, if you remerge from main |
Hi @masenf. I hadn't run |
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.
sorry the CI was flaky, looks good!
All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
I've run this, all good, except for some pre-existing issues that are in main complaining about test_config.py.
Changes To Core Features:
Closes #1633 and #1583.