Skip to content

Commit

Permalink
Bump SpaceShoes version, remove some unused code and outdated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
noahgibbs committed Jul 10, 2024
1 parent eca5852 commit 183f14b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 39 deletions.
40 changes: 2 additions & 38 deletions lib/space_shoes/host/packaging.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

# WHY DO REPEATED BUILDS OF RUBY KEEP MAKING IT BIGGER IN CACHE DIR?

require "space_shoes/core"

require "scarpe/components/file_helpers"
Expand Down Expand Up @@ -47,6 +45,8 @@ def build_packed_wasm_file(pack_root: ".", out_file:)
run_or_raise("bundle exec rbwasm build -o #{out_file}")
end
end

out_file
end

# Note: packed Ruby+source package should be outside the app dir (a.k.a. src dir)
Expand All @@ -58,41 +58,5 @@ def build_default_wasm_package

out_file
end

# TODO: index for prebuilt single-file Shoes app w/ no Gemfile
def build_html_index(wasm_url: "./packed_ruby.wasm")
rbwasm_version = RubyWasm::VERSION
<<~INDEX
<!DOCTYPE html>
<html lang="en">
<head>
<script type="module">
import { DefaultRubyVM } from "https://cdn.jsdelivr.net/npm/@ruby/wasm-wasi@#{rbwasm_version}/dist/browser/+esm";
// For Locally-compiled Ruby.wasm VM:
const response = await fetch("#{wasm_url}");
const module = await WebAssembly.compileStreaming(response);
const { vm } = await DefaultRubyVM(module);
window.rubyVM = vm;
vm.eval(`
require "/bundle/setup"
require "js" # Needed even with /bundle/setup
$LOAD_PATH.unshift "/spaceshoes_lib"
require "space_shoes/core"
require "scarpe/space_shoes" # Scarpe display service
`);
</script>
</head>
<body>
</body>
</html>
INDEX
end
end
end
2 changes: 1 addition & 1 deletion lib/space_shoes/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module SpaceShoes
VERSION = "0.1.0"
VERSION = "0.1.1"
end

0 comments on commit 183f14b

Please sign in to comment.