From 535604579fedcbe1589e239d7f35c6c5a852793e Mon Sep 17 00:00:00 2001 From: peefy Date: Fri, 13 Sep 2024 15:48:58 +0800 Subject: [PATCH] chore: update wasm loading text Signed-off-by: peefy --- .github/workflows/deploy.yaml | 55 ----------------------------------- src/js/editor/index.js | 8 +++-- 2 files changed, 5 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml deleted file mode 100644 index 15196c60..00000000 --- a/.github/workflows/deploy.yaml +++ /dev/null @@ -1,55 +0,0 @@ -# Sample workflow for building and deploying a Next.js site to GitHub Pages -# -# To get started with Next.js see: https://nextjs.org/docs/getting-started -# -name: Deploy Next.js site to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: ["main"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Build job - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Install dependencies - run: npm install - - name: Build - run: npm run build - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: ./dist - - # Deployment job - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/src/js/editor/index.js b/src/js/editor/index.js index 2e350b55..e6b7d872 100644 --- a/src/js/editor/index.js +++ b/src/js/editor/index.js @@ -9,9 +9,6 @@ import './share'; import './codemirror-kcl'; import { load, invokeKCLRun, invokeKCLFmt } from "../module"; -const response = await fetch("kcl.wasm"); -const wasm = await response.arrayBuffer(); -const inst = await load({ data: wasm }); const source = document.getElementById('source'); const run = document.getElementById('run'); const outputContainer = document.getElementById('output-container'); @@ -27,6 +24,11 @@ const editor = CodeMirror.fromTextArea(source, { lineWrapping: true, smartIndent: true, }); +editor.setValue("Loading KCL WASM module..."); + +const response = await fetch("kcl.wasm"); +const wasm = await response.arrayBuffer(); +const inst = await load({ data: wasm }); class Mutex { constructor() {