From cf41d5595f72a44d3d005ead2f0d2ca4b4b006c1 Mon Sep 17 00:00:00 2001 From: "Nicholas H.Tollervey" Date: Mon, 5 Aug 2024 14:06:12 +0100 Subject: [PATCH 1/3] Bump version to 2024-08-2 in examples. --- docs/beginning-pyscript.md | 8 ++++---- docs/user-guide/first-steps.md | 4 ++-- docs/user-guide/plugins.md | 10 +++++----- docs/user-guide/workers.md | 4 ++-- version.json | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/beginning-pyscript.md b/docs/beginning-pyscript.md index 7a4f90f..12a7717 100644 --- a/docs/beginning-pyscript.md +++ b/docs/beginning-pyscript.md @@ -117,8 +117,8 @@ module in the document's `` tag: 🦜 Polyglot - Piratical PyScript - - + + @@ -168,8 +168,8 @@ In the end, our HTML should look like this: 🦜 Polyglot - Piratical PyScript - - + +

Polyglot 🦜 💬 🇬🇧 ➡️ 🏴‍☠️

diff --git a/docs/user-guide/first-steps.md b/docs/user-guide/first-steps.md index d0fcffe..7ff3b46 100644 --- a/docs/user-guide/first-steps.md +++ b/docs/user-guide/first-steps.md @@ -20,9 +20,9 @@ CSS: - + - + diff --git a/docs/user-guide/plugins.md b/docs/user-guide/plugins.md index 8d2d696..836bc08 100644 --- a/docs/user-guide/plugins.md +++ b/docs/user-guide/plugins.md @@ -99,7 +99,7 @@ For example, this will work because all references are contained within the registered function: ```js -import { hooks } from "https://pyscript.net/releases/2024.8.1/core.js"; +import { hooks } from "https://pyscript.net/releases/2024.8.2/core.js"; hooks.worker.onReady.add(() => { // NOT suggested, just an example! @@ -113,7 +113,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/2024.8.1/core.js"; +import { hooks } from "https://pyscript.net/releases/2024.8.2/core.js"; // NO NO NO NO NO! ☠️ let i = 0; @@ -146,7 +146,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/2024.8.1/core.js"; +import { hooks } from "https://pyscript.net/releases/2024.8.2/core.js"; // The `hooks.main` attribute defines plugins that run on the main thread. hooks.main.onReady.add((wrap, element) => { @@ -196,8 +196,8 @@ hooks.worker.onAfterRun.add(() => { - - + + + PyWorker - mpy bootstrapping pyodide example diff --git a/version.json b/version.json index 08382ff..f0baa93 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "2024.8.1" + "version": "2024.8.2" } From af49775703487652ca2dc223c76c8b57bec90b48 Mon Sep 17 00:00:00 2001 From: "Nicholas H.Tollervey" Date: Mon, 5 Aug 2024 14:21:02 +0100 Subject: [PATCH 2/3] Document the new async behaviour. --- docs/api.md | 14 ++++++-------- docs/faq.md | 2 +- docs/user-guide/first-steps.md | 23 +++++++++++++++++++++-- docs/user-guide/plugins.md | 7 ++++--- docs/user-guide/workers.md | 3 +-- 5 files changed, 33 insertions(+), 16 deletions(-) diff --git a/docs/api.md b/docs/api.md index 664145f..b12953d 100644 --- a/docs/api.md +++ b/docs/api.md @@ -197,10 +197,8 @@ Pyodide and MicroPython. It is closely modelled on the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) found in browsers with some important Pythonic differences. -The simple use case is to pass in a URL and `await` the response. Remember, in -order to use `await` you must have the `async` attribute in the `script` tag -that references your code. If this request is in a function, that function -should also be defined as `async`. +The simple use case is to pass in a URL and `await` the response. If this +request is in a function, that function should also be defined as `async`. ```python title="A simple HTTP GET with pyscript.fetch" from pyscript import fetch @@ -834,7 +832,7 @@ While over on the main thread, this fragment of MicroPython will be able to access the worker's `version` function via the `workers` reference: ```html - PyWorker - mpy bootstrapping pyodide example - - + ``` From 8653cd12519c8f10cee80b646bef56fea0c43666 Mon Sep 17 00:00:00 2001 From: "Nicholas H.Tollervey" Date: Mon, 5 Aug 2024 14:22:52 +0100 Subject: [PATCH 3/3] Fix typo --- docs/user-guide/first-steps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/first-steps.md b/docs/user-guide/first-steps.md index 1c7805a..b13ba18 100644 --- a/docs/user-guide/first-steps.md +++ b/docs/user-guide/first-steps.md @@ -75,7 +75,7 @@ attributes: JSON or a TOML file, `config='{"packages":["numpy"]}'` and `config="./config.json"` or `config="./config.toml"` are all valid. -* `async` - set this flag to `"false"` so your code won't not run within a +* `async` - set this flag to `"false"` so your code won't run within a [top level await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#top_level_await) (the default behaviour).