Writing to console.log specifically
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- ruby, wasm
- Domain
- documentation
Research direction
Start with the FAQ examples involving $stdout, JS.global, and browser output. Determine whether ruby.wasm already provides a console.log path that remains available after $stdout is replaced; if so, document it in the FAQ, and if not, define the missing capability before proposing an implementation. Done means the console.log behavior and its interaction with redirected stdout are clearly documented.
Written by the indexing model from the issue text.
Description
In the FAQ currently we have code like this:
$stdout = Object.new.tap { |obj|
def obj.write(i)
JS.global[:document].write(i)
end
}
Then we can simply use puts, which is convenient.
But how to write to console.log?
Past this point if we use:
JS.global[:document].write "foobar"
It will no longer write to console.log, instead just to primary stdout in the browser.
Is there a way to still write to console.log somehow? Could this be added to FAQ?
If not, could there be a way to show this? I'd like to get debug-like output right
via console.log() as well, so being able to write onto console.log even when having
modified $stdout, would be convenient, in my opinion. Could such a way be added
in addition to ruby.wasm?
- Dominant language
- Ruby
- Stars
- 875
- Forks
- 68
- Avg merge
- 9d 5h
- Merged PRs (30d)
- 1
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ruby/ruby.wasm
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
solana-foundation/pay-kit#341 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Cask still fails to install: `depends_on macos: :catalina` is now disabled (regression after #58)Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100