Skip to content

Bump docs to version 2025-7-1 #184

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

Merged
merged 3 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/beginning-pyscript.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ module in the document's `<head>` tag:
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>🦜 Polyglot - Piratical PyScript</title>
<link rel="stylesheet" href="https://pyscript.net/releases/2025.5.1/core.css">
<script type="module" src="https://pyscript.net/releases/2025.5.1/core.js"></script>
<link rel="stylesheet" href="https://pyscript.net/releases/2025.7.1/core.css">
<script type="module" src="https://pyscript.net/releases/2025.7.1/core.js"></script>
</head>
<body>

Expand Down Expand Up @@ -168,8 +168,8 @@ In the end, our HTML should look like this:
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>🦜 Polyglot - Piratical PyScript</title>
<link rel="stylesheet" href="https://pyscript.net/releases/2025.5.1/core.css">
<script type="module" src="https://pyscript.net/releases/2025.5.1/core.js"></script>
<link rel="stylesheet" href="https://pyscript.net/releases/2025.7.1/core.css">
<script type="module" src="https://pyscript.net/releases/2025.7.1/core.js"></script>
</head>
<body>
<h1>Polyglot 🦜 💬 🇬🇧 ➡️ 🏴‍☠️</h1>
Expand Down
42 changes: 42 additions & 0 deletions docs/user-guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,22 @@ following valid forms:
* An arbitrary URL to a Python package: `"https://.../package.whl"`
* A file copied onto the browser based file system: `"emfs://.../package.whl"`

#### Package Cache

For performance reasons, PyScript caches packages so that a delay resulting
from downloading the packages is only noticable on first load - after which,
PyScript will fall back on packages previously downloaded and held in the
browser's local cache.

The behaviour of caching can be configured via the `packages_cache` setting. If
this setting is not used, PyScript will cache packages. Otherwise, override
PyScript's behaviour by setting `packages_cache` to one of these two values:

* `never` - PyScript will not cache packages.
* `passthrough` - this only works with Pyodide (see [this wiki](https://deepwiki.com/cloudflare/pyodide/3-package-system)),
and will cause Pyodide to download packages in a parallel manner rather than
the default linear fashion. However, these packages will not be cached.

### Plugins

The `plugins` option allows user to either augment, or exclude, the list of
Expand Down Expand Up @@ -518,6 +534,32 @@ experimental_create_proxy = "auto"
[raise an issue](https://github.com/pyscript/pyscript/issues) with a
reproducable example, and we'll investigate.

### experimental_ffi_timeout

When bootstrapping a worker, the worker is told to use a cache for round-trip
operations (for example, `window.my_object.foo.bar.baz` causes a round-trip to
the main thread for each dot `.` in this chain of references). By caching the
dotted references performance can be improved by reducing the number of
round trips PyScript makes.

However, not everything can be cached (those APIs or objects with side-effects
won't work; for example DOM element based APIs etc).

The `experimental_ffi_timeout` setting defines the maximum lifetime of that
cache. If it's less than 0 (the default), there is no cache whatsoever. Zero
means to clean up the cache on the next iteration of the event loop. A positive
number is the maximum number of milliseconds the cache will be kept alive.

In this experimental phase, we suggest trying `0`, `30` or a value that won't
likely bypass the browser rendering of 60fps. Of course, `1000` (i.e. a second)
would be a fun, if greedy, experiment.

### debug

When using Pyodide, if the `debug` setting is set to `true`, then Pyodide will
run in debug mode. See Pyodide's documentation for details of what this
entails.

### Custom

Sometimes plugins or apps need bespoke configuration options.
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ CSS:
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!-- PyScript CSS -->
<link rel="stylesheet" href="https://pyscript.net/releases/2025.5.1/core.css">
<link rel="stylesheet" href="https://pyscript.net/releases/2025.7.1/core.css">
<!-- This script tag bootstraps PyScript -->
<script type="module" src="https://pyscript.net/releases/2025.5.1/core.js"></script>
<script type="module" src="https://pyscript.net/releases/2025.7.1/core.js"></script>
</head>
<body>
<!-- your code goes here... -->
Expand Down
10 changes: 5 additions & 5 deletions docs/user-guide/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ For example, this will work because all references are contained within the
registered function:

```js
import { hooks } from "https://pyscript.net/releases/2025.5.1/core.js";
import { hooks } from "https://pyscript.net/releases/2025.7.1/core.js";

hooks.worker.onReady.add(() => {
// NOT suggested, just an example!
Expand All @@ -114,7 +114,7 @@ hooks.worker.onReady.add(() => {
However, due to the outer reference to the variable `i`, this will fail:

```js
import { hooks } from "https://pyscript.net/releases/2025.5.1/core.js";
import { hooks } from "https://pyscript.net/releases/2025.7.1/core.js";

// NO NO NO NO NO! ☠️
let i = 0;
Expand Down Expand Up @@ -147,7 +147,7 @@ the page.

```js title="log.js - a plugin that simply logs to the console."
// import the hooks from PyScript first...
import { hooks } from "https://pyscript.net/releases/2025.5.1/core.js";
import { hooks } from "https://pyscript.net/releases/2025.7.1/core.js";

// The `hooks.main` attribute defines plugins that run on the main thread.
hooks.main.onReady.add((wrap, element) => {
Expand Down Expand Up @@ -197,8 +197,8 @@ hooks.worker.onAfterRun.add(() => {
<!-- JS plugins should be available before PyScript bootstraps -->
<script type="module" src="./log.js"></script>
<!-- PyScript -->
<link rel="stylesheet" href="https://pyscript.net/releases/2025.5.1/core.css">
<script type="module" src="https://pyscript.net/releases/2025.5.1/core.js"></script>
<link rel="stylesheet" href="https://pyscript.net/releases/2025.7.1/core.css">
<script type="module" src="https://pyscript.net/releases/2025.7.1/core.js"></script>
</head>
<body>
<script type="mpy">
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/pygame-ce.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ will be placed. Make sure to update the pyscript release to the latest version.
<title>PyScript Pygame-CE Quickstart</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" href="https://pyscript.net/releases/2025.5.1/core.css">
<script type="module" src="https://pyscript.net/releases/2025.5.1/core.js"></script>
<link rel="stylesheet" href="https://pyscript.net/releases/2025.7.1/core.css">
<script type="module" src="https://pyscript.net/releases/2025.7.1/core.js"></script>
</head>
<body>
<canvas id="canvas" style="image-rendering: pixelated"></canvas>
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,9 @@ Here's how:
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<!-- PyScript CSS -->
<link rel="stylesheet" href="https://pyscript.net/releases/2025.5.1/core.css">
<link rel="stylesheet" href="https://pyscript.net/releases/2025.7.1/core.css">
<!-- This script tag bootstraps PyScript -->
<script type="module" src="https://pyscript.net/releases/2025.5.1/core.js"></script>
<script type="module" src="https://pyscript.net/releases/2025.7.1/core.js"></script>
<title>PyWorker - mpy bootstrapping pyodide example</title>
<script type="mpy" src="main.py"></script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "2025.5.1"
"version": "2025.7.1"
}