File tree 4 files changed +8
-4
lines changed
4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ ruby -run -e httpd . -p 8080
33
33
34
34
## Todo
35
35
- [x] explain how to add code outside gems to the image
36
- - [ ] show how to shrink/compress the ruby.wasm file (currently 51MB with debug info, but can be about 10mb or less.)
36
+ - [X] ~~ show how to shrink/compress the ruby.wasm file (currently 51MB with debug info, but can be about 10mb or less.)~~
37
37
- [ ] license + explanation
38
38
- [ ] ask upstream if they can make a javascript file that doesnt have the .wasm file path hardcoded.
39
39
- [ ] docker file
@@ -54,6 +54,7 @@ ruby -run -e httpd . -p 8080
54
54
- [ ruby.wasmでrequire_relativeを使えるようにしたい #Ruby - Qiita] ( https://qiita.com/ledsun/items/3f8ba1ee2699d546c18c#fetch%E3%81%8C%E9%9D%9E%E5%90%8C%E6%9C%9F%E9%96%A2%E6%95%B0 )
55
55
- [ RubyでWebAssemblyを試してみよう #ruby #WebAssembly #WASM #WASI - クリエーションライン株式会社] ( https://www.creationline.com/tech-blog/60328 )
56
56
- [ how_to_use_bundler_and_rubygems_on_wasm.md] ( https://gist.github.com/kateinoigakukun/5caf3b83b2732b1653e91b0e75ce3390 )
57
+ - [ TODO: Shrinking .wasm Size] ( https://rustwasm.github.io/docs/book/reference/code-size.html )
57
58
- see contributing.md in ruby.wasm repo
58
59
59
60
## GPT to convert JavaScript to Ruby code:
Original file line number Diff line number Diff line change @@ -2100,8 +2100,7 @@ SOFTWARE.
2100
2100
* an array of strings starting with the Ruby program name.
2101
2101
*/
2102
2102
initialize ( args = [ "ruby.wasm" , "-EUTF-8" , "-e_=0" ] ) {
2103
- console . log ( "tests" ) ;
2104
- const c_args = args . map ( ( arg ) => arg + "\0" ) ;
2103
+ const c_args = args . map ( ( arg ) => arg + "\0" ) ;
2105
2104
this . guest . rubyInit ( ) ;
2106
2105
this . guest . rubySysinit ( c_args ) ;
2107
2106
this . guest . rubyOptions ( c_args ) ;
Original file line number Diff line number Diff line change @@ -4,4 +4,8 @@ cd ruby.wasm
4
4
bundle exec rake compile
5
5
rake install
6
6
cd ..
7
- bundle exec rbwasm --log-level debug build --ruby-version 3.3 --target wasm32-unknown-wasi --build-profile full -o ruby-app.wasm
7
+ bundle exec rbwasm --log-level debug build --ruby-version 3.3 --target wasm32-unknown-wasi --build-profile full -o ruby-app.wasm
8
+ # Remove the debug info
9
+ wasm-opt --strip-debug ruby-app.wasm -o ruby-app.wasm
10
+ # Optimize for size without hurting speed as much.
11
+ wasm-opt ruby-app.wasm -Os -o ruby-app.wasm
You can’t perform that action at this time.
0 commit comments