What's New in PyScript 2023.11.2

Published November 29, 2023

Tags: pyscript python

With the 2023.11.1 release of PyScript behind us, i.e. the "break the world" release, the PyScript team is looking to push out releases more frequently. We're hoping to integrate both quality-of-life and significant feature improvements at a faster pace, and to push out releases to match.

With that, today PyScript released version 2023.11.2! You can see the detailed changelog here.

It's worth remembering at this point that PyScript uses the CalVer versioning system, where the parts of the version are YEAR.MONTH.RELEASE-NUMBER. That is, there is no minor version component of the release number, and all releases should be treated as potentially breaking. Given the speed at which PyScript is moving (and heck, the whole thing just got re-written from scratch), the versioning system accurately reflects that fact that things are going to break and change all the time.

That siad, there aren't too many terribly breaking things in this release - a better Error message when input() is used on the main thread is a UI nice touch. No, the biggest change is what's happening to /latest.

PyScript Versions

PyScript has had, up to this point, several valid URLs that it can be fetched from. In order from oldest to most-bleeding-edge, they are

  • https://pyscript.net/alpha/pyscript.js: The original release link promoted at the PyCon 2022 Keynote
  • https://pyscript.net/releases/20XX.X.X/pyscript.js: Pinned versions of each of the releases of PyScript. See below for a complete list of pinned releases.
  • https://pyscript.net/latest/core.js The most recent full release
  • https://pyscript.net/unstable/core.js Bleeding-edge builds; rebuilt on every merge to the main branch

The challenge is that highlighted item, the /latest version. It's very tempting to use - "hey, I want the most recent version, and here's an easy way to get it!" In press releases and official documentation, this was even the way pyscript recommended grabbing PyScript from a CDN. It's quick, it's easy, it's concise. So what's the problem?

It's an invitation to your code being broken.

The /latest problem

Linking to /latest, just like leaving any dependency of a thing unpinned, is an active invitation to the developers of that thing to break your code. They can change, update, roll back as they please, and you would welcome that. I, Jeff Glass, have personally done it to you! I've made changes to the PyScript codebase before that have definitely broken the sites that link to /latest when the next release rollled you. You're welcome! That's what you wanted after all, right?

That's usually not the approach you'd take with your code. Which is why /latest is being deprecated, and will be removed from the release process in releases 2023.12.x and later.

Of course, this change isn't made in a vacuum. We've added a a note in the documentation, of course, as well as visible-on-the-page warning to PyScript that yells at you if you're linking to /latest:

Loading scripts from latest is deprecated and will be removed soon. Please use a specific version instead.

Please feel free to come tell us all the reasons why /latest is easier, more convenient, less frustrating, etc. But in the long term, we think allowing (and promoting) unpinned versions was the wrong move, and we're breaking from that now.


List of Pinned Releases

For posterity's sake, the complete list of pinned releases (as of today, November 29 2023) is:

  • .../2022.05.1/pyscript.js (synonymous with alpha)
  • .../2022.06.1/pyscript.js
  • .../2022.09.1/pyscript.js
  • .../2022.12.1/pyscript.js
  • .../2023.03.1/pyscript.js
  • .../2023.05.1/pyscript.js
  • .../2023.11.1/core.js (note the change in file name)
  • .../2023.11.2/core.js