Skip to content

Commit

Permalink
use webworker instead of python-runner
Browse files Browse the repository at this point in the history
  • Loading branch information
giggity-hub committed Jul 26, 2023
1 parent 291d5fb commit 2af8536
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 126 deletions.
21 changes: 9 additions & 12 deletions frontend-svelte/src/routes/new_challenge/[slug]/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
<script lang="ts">
/** @type {import('./$types').PageData} */
export let data;
import CodeMirror from "./CodeMirror.svelte";
import { isPyodideReady, pyodideWorker } from "$lib/stores/pyodide-store";
import CodeOutput from "./CodeOutput.svelte";
/** @type {import('./$types').PageData} */
export let data;
// https://github.com/nathancahill/split/tree/master/packages/splitjs
import Split from 'split.js'
import {executeUserCode, testUserCode, isPyodideReady} from './python-runner'
import { onMount } from "svelte";
const descritption = data.intro
let code = data.default_code
let resultUserCode = "";
async function handleRun(){
resultUserCode = await executeUserCode(code)
resultUserCode = await pyodideWorker.executeUserCode(code)
}
async function handleTest(){
testUserCode(code, data)
pyodideWorker.testUserCode(code, data)
}
let splitEditor;
let splitConsole;
let splitLeft;
let splitRight;
let splitEditor : HTMLElement;
let splitConsole: HTMLElement;
let splitLeft : HTMLElement;
let splitRight : HTMLElement;
onMount(()=>{
Split([splitEditor, splitConsole], {
sizes: [75, 25],
Expand Down
114 changes: 0 additions & 114 deletions frontend-svelte/src/routes/new_challenge/[slug]/python-runner.ts

This file was deleted.

0 comments on commit 2af8536

Please sign in to comment.