From 3727749060e2c18587c6d6d52642d55180c49d95 Mon Sep 17 00:00:00 2001 From: George Stagg Date: Tue, 12 Nov 2024 09:52:53 +0000 Subject: [PATCH] Handle renamed R wasm binary and script --- .github/workflows/deploy.yml | 6 +++--- R/Makefile | 6 +++--- src/webR/webr-worker.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6c354745..195fa63e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -120,10 +120,10 @@ jobs: - name: Upload files to S3 bucket run: | aws s3 sync . s3://${{ secrets.AWS_S3_BUCKET }}/_webr/${{ github.ref_name }}/ - gzip -k R.bin.wasm + gzip -k R.wasm aws s3 cp --content-encoding="gzip" --content-type="application/wasm" \ - --metadata-directive="REPLACE" R.bin.wasm.gz \ - s3://${{ secrets.AWS_S3_BUCKET }}/_webr/${{ github.ref_name }}/R.bin.wasm + --metadata-directive="REPLACE" R.wasm.gz \ + s3://${{ secrets.AWS_S3_BUCKET }}/_webr/${{ github.ref_name }}/R.wasm aws s3 cp --exclude "*" --include "*.js.metadata" --recursive \ --content-type="text/javascript" --metadata-directive="REPLACE" \ s3://${{ secrets.AWS_S3_BUCKET }}/_webr/${{ github.ref_name }}/ \ diff --git a/R/Makefile b/R/Makefile index 7ff84010..4d3360bd 100644 --- a/R/Makefile +++ b/R/Makefile @@ -227,10 +227,10 @@ install: @mkdir -p $(DIST) $(MAKE) vfs @cp "$(R_SOURCE)/build/src/main/R.wasm" "$(DIST)/R.wasm" - @cat $(R_WASM)/pre.js $(R_SOURCE)/build/src/main/R.bin > $(DIST)/R.bin.js + @cat $(R_WASM)/pre.js $(R_SOURCE)/build/src/main/R.bin > $(DIST)/R.js # Patch Emscripten library to redirect a warning message to console.warn() - @sed -i.bak 's/out("LazyFiles/console.warn("LazyFiles/' $(DIST)/R.bin.js - @rm $(DIST)/R.bin.js.bak + @sed -i.bak 's/out("LazyFiles/console.warn("LazyFiles/' $(DIST)/R.js + @rm $(DIST)/R.js.bak # Build lazy virtual filesystem, backed by XHR when loaded in browsers WASM_LAZY_VFS := $(WASM_LAZY_VFS) diff --git a/src/webR/webr-worker.ts b/src/webR/webr-worker.ts index b2071acb..968d50af 100644 --- a/src/webR/webr-worker.ts +++ b/src/webR/webr-worker.ts @@ -948,7 +948,7 @@ function init(config: Required) { // At the next tick, launch the REPL. This never returns. setTimeout(() => { - const scriptSrc = `${_config.baseUrl}R.bin.js`; + const scriptSrc = `${_config.baseUrl}R.js`; void loadScript(scriptSrc); }); }