Robyn
Robyn copied to clipboard
feat: live reloading when running as a module
Description
This PR fixes #654
how to run: python3 -m app --dev
@VishnuSanal is attempting to deploy a commit to the sparckles Team on Vercel.
A member of the Team first needs to authorize it.
CodSpeed Performance Report
Merging #858 will not alter performance
Comparing VishnuSanal:module-hot-reload (a7272e5) with main (1e33769)
Summary
✅ 109 untouched benchmarks
Hey @VishnuSanal 👋
I am unable to understand the changes. Could you add an example on why we need the new parameters?
And how you'd invoke the changes?
Hey @VishnuSanal 👋
I am unable to understand the changes. Could you add an example on why we need the new parameters?
And how you'd invoke the changes?
Hey @VishnuSanal , Could you please update the PR description with the above??
uh, oh. my previous comment never got sent.
Could you add an example on why we need the new parameters?
I have changed the implementation, PTAL. removed the need for new params.
And how you'd invoke the changes?
running as a module usually, like python3 -m app --dev would do.
please CMIIW.
@VishnuSanal , I just saw your description. That is not what we want to solve for 😄
We want to allow the dev mode to work like robyn -m src --dev. The robyn_app in description is src here
where src
src/
- __init__.py
- __main__.py
The --dev flag should rerender based on app changes.
thank you for the review, Sanskar! this currently works as expected in my testing, PTAL & LMK what you think. :)
Hey @VishnuSanal 👋
Thanks for the PR, I have some comments 😄
Hey @VishnuSanal 👋
Thanks for the update. I have some follow up comments
current issues:
- [ ] doesn't work when using
robyn -m src --dev.sys.argv[0]returns the path to the executable. but, from here, it seems like we shouldn't run it like it, but likepython3 -m src --dev. - [ ] doesn't work during
python3 app.py --dev(since path is not present inunknown_argsinarguement_parser) - [x] doesn't work during
robyn app.py --dev
(will edit & update this comment as I fix them...)
note to self:
the flow of control is like: cli#run => cli#start_dev_server => reloader#setup_reloader => EventHandler#reload => Robyn#start and, we are getting the file object at the last stage. my current implementation starts a new dev server from there.
we need a way to bypass it the first time (inorder to reach robyn#start) and, then kill the previous reloader & start new one from there.
as of now, I am getting an infinite loop! will address. :)
⚠️ Only 5 files will be analyzed due to processing limits.
😱 Found 3 issues. Time to roll up your sleeves! 😱