Skip to content

Commit

Permalink
Spike: Figure out if pyodide will work in the web component (#945)
Browse files Browse the repository at this point in the history
closes #944

---------

Co-authored-by: create-issue-branch[bot] <53036503+create-issue-branch[bot]@users.noreply.github.com>
Co-authored-by: Lois Wells <88904316+loiswells97@users.noreply.github.com>
Co-authored-by: Lois Wells <lois.wells@raspberrypi.org>
  • Loading branch information
3 people committed Mar 7, 2024
1 parent 4f4c445 commit 2b0cecf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## Unreleased

### Fixed

- Get `pyodide` working in the web component (#945)

## [0.22.1] - 2024-02-23

### Fixed
Expand Down
6 changes: 4 additions & 2 deletions src/components/Editor/Runners/PyodideRunner/PyodideRunner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable react-hooks/exhaustive-deps */

import "../../../../assets/stylesheets/PythonRunner.scss";
import { useContext, useEffect, useMemo, useRef, useState } from "react";
import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { useTranslation } from "react-i18next";
import {
Expand Down Expand Up @@ -186,7 +186,9 @@ const PyodideRunner = () => {

const program = projectCode[0].content;

interruptBuffer.current[0] = 0; // Clear previous signals.
if (interruptBuffer.current) {
interruptBuffer.current[0] = 0; // Clear previous signals.
}
pyodideWorker.postMessage({ method: "runPython", python: program });
};

Expand Down

0 comments on commit 2b0cecf

Please sign in to comment.