New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add console.log #39
add console.log #39
Conversation
Thank you for the PR! 👍 |
@deniskolodin , Thanks for your reply! |
All other console methods would be cool too. 🙂 |
I think this contribution would be better if it was sent to stdweb, that way other projects using Rust to WASM will have console support out of the box, too. |
Console service is useful for us, and I think it's enough to keep only Also I will create issue in |
@deniskolodin what's the purpose of splitting the different I'm not referring to things like |
On another note: it would be cool to see an overload of the logging methods that do get implemented taking a vector of strings to pass as args to the logging methods. Might be overkill though. |
I mean, ideally the entire console API is available through the service, no? I'd say there's a pecking order in terms of how hard it would be to implement various methods. Super easyThese can just be copied and pasted from
Really easyThese just have no arguments
Medium
Hard
It looks like a lot, but the entire first section is basically just a few copy-pastes, the second section is even simpler, and I wouldn't mind tacking these on myself at all, but this PR already exists. Kind of seems silly to me to not add them now. I'd understand more if we were only doing |
@rivertam I'd go over the methods and see what's most commonly used too I don't recall the |
It'd be nice to update the examples to use this service as well since currently they use |
@wldcordeiro I'd argue looking at commonness makes sense iff it were hard to implement these functions. I referenced Mozilla's documentation and reference the fact that some of them are non-standard (and I could see an argument for not including the non-standards, though they're pretty cool and I don't see much harm in implementing them anyways) |
Also one thing you mentioned that most can be done with copy/paste but to me that means you could abstract them in some way and simplify it further. Most are very similar but really smaller incremental PRs will win over larger monolithic ones. @rivertam Why don't you copy/paste your comment above as an issue? |
I agree that there should be a way to abstract them, though I'm not sure how we'd do it in a typesafe way. I know in C++ we could basically just use a macro like |
In my opinion, before coding, we'd better have more discussion. and then, i will have more time to study rust and improve my code 😄 at last, happy new year!! 新年快乐! |
As I used a wrong way to update my |
No description provided.