Immediately after switching the page, it will work with CSR.
Please reload your browser to see how it works.

Source:https://github.com/SoraKumo001/next-streaming

⬅️ /usr/bin/env -S uv run
BiteCode_dev 2 hoursReload
Other neat tricks with uvx (uv equivalent of npx) to run one time commands in some contexts:

- alias download_mp3="uvx --no-cache --from yt-dlp[default] yt-dlp --extract-audio --audio-format mp3" to download sound from Youtube videos, SoundCloud pages, etc. This update yt-dlp every time, which is required given the counter measures change so often and the dl rarely affect the total processing time anyway (requires ffmpeg).

- "uvx --with <package> --with pyqt5 --from qtconsole jupyter qtconsole" starts a qtconsole (GUI version of ipython) with <package> installed so you can test it quickly. Temp venv, everything cached so next time it's instant, one single copy of pyqt5 for the current use no matter how many times you run those.

- "uvx --with virtualenv pipx run pipsi install nodejs-bin". Ok it's useless, but it's fun that it even works :)

uv's cache system and downloads optimization are quite smart, as Charlie marsh (astral CEO) explains in the interview: https://www.bitecode.dev/p/charlie-marsh-on-astral-uv-and-th...


mrweasel 4 hoursReload
While neat, doesn't it also comes with certain issues?

Startup times has to be slower, but probably only for the first run?

There's a some level of violation of the "Principle Of Least Surprise", depending on the setting. For some it will be the reverse, the script they got just works, without any setup or package installation. For others we'll wonder why it just started downloading a bunch of packages we already have.

Probably not the greatest idea for production environments, where you should not or can not just pull in packages from the internet.

It's really cool that it works, but I think I'd recommended using it highly selectively.


smaddox 8 hoursReload
I've been using this for a few weeks now, and it's really handy. But I did learn the hard way that it fails if you don't have internet connection, even if you already have the venv cached.

p4bl0 3 hoursReload
It's a neat trick, but it still depends on uv being installed and network connectivity.

What's the advantage of this that makes it worth despite these constraints, compared to e.g. using pyinstaller [1] to build and distribute a single executable file with the python interpreter and all the dependencies of your project bundled in it in the exact versions you chose in your development virtual environment?

[1] https://pyinstaller.org/


thewisenerd 7 hoursReload
this builds upon PEP 723, which is "accepted", so it's likely here to stay.

https://peps.python.org/pep-0723/

I've been very slowly migrating scripts to work with this, and `pipx run`. glad to know uv has also picked it up.