Skip to content

Conversation

@WebReflection
Copy link
Contributor

@WebReflection WebReflection commented Nov 24, 2025

Description

This MR goal is to create in dist/ folder a redistributable version of PyScript that works "offline", where offline means the current released version actually runs entirely from the localhost without reaching out any particular CDN to bootstrap Pyodide or MicroPython.

This also adds a feature-detection version of the mini-coi utility so that even python -m http.serve should work as expected without requiring any special header, but we still recommend to use such headers to be sure things will work as expected.

This MR fixes #2346

Instructions

From pyscript/core folder run:

node rollup/offline.cjs | bash

# OR ...

npm run build:offline

This will create the offline.zip file into dist folder.

We need to do this on release time only so it's not automated per each MR neither this can be easily tested out of the box without leaking artifacts around.

Changes

  • added a way to retrieve current released Pyodide or MicroPython from the dependencies
  • moved all necessary files to bootstrap either runtime into a dedicated dist/offline folder
  • moved all files in dist/ into such folder
  • created a template to bootstrap in either main or worker threads MicroPython or Pyodide
  • tested manually that everything works fine

Ideally, this should be reachable via our release channel (it's a 7MB zip file) so that we can update the docs and state: just download this zip, unzip it, enter the folder and start a server ... and that should be it.

Checklist

  • I have checked make build works locally.
  • I have created / updated documentation for this change (if applicable).

Copy link
Member

@ntoll ntoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me. 😉

Next step is to integrate this into the GH action for cutting a release.

@WebReflection WebReflection merged commit 7785e17 into pyscript:main Nov 24, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants