Comments (2)
Hmm it seems "pp" can be used to do so. Still I think it may be useful to add it to a FAQ entry.
On a semi-related note, when I use "pp", the console also says:
Ignoring debug-1.9.1 because its extensions are not built. Try: gem pristine debug --version 1.9
And so forth. Not sure why. I am using:
https://cdn.jsdelivr.net/npm/@ruby/[email protected]/dist/browser.script.iife.js
from ruby.wasm.
console
is a JS global just like document
so you can access it the same:
JS.global[:console].log('hello')
Feel free to make whatever shortcut you find comfortable:
# global variable
$console = JS.global[:console]
$console.log('hello')
# Kernel patch
# (this is where `puts` is defined too)
module Kernel
def console
JS.global[:console]
end
end
console.log('hello')
console.error('bad')
from ruby.wasm.
Related Issues (20)
- rbwasm build fails due to LDFLAGS misconfiguration HOT 2
- Unable to use any CDN for ESM HOT 5
- Error on <non-js-value> == <js-value> HOT 2
- [FAQ] Is it possible to install simple gems? If not, how to simulate doing so?
- [FAQ] Primary authors and / or maintainers HOT 1
- [FAQ] How to find out the most recent URL to ruby wasm browser.script.life.js? HOT 1
- Accessing files and directories?
- Error requiring bundler HOT 3
- `VALUE` should not be used as object identity
- Gems with native extensions HOT 6
- `no implicit conversion of nil into Integer (TypeError)`
- jco is not found on build HOT 7
- `JS::Object#await` is unavailable inside Proc converted into JS closure
- "js" gem fails to install on M1 Mac HOT 4
- Request: add another example, but showing how to use a gem
- null function or function signature mismatch HOT 5
- uwasi instread of browser_wasi_shim HOT 3
- Better build orchestration
- Intermittent `403 Forbidden` error in the `Build ruby.wasm` Github Actions workflow
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby.wasm.