Open Sytten opened 1 month ago
Attention: Patch coverage is 97.29144%
with 25 lines
in your changes are missing coverage. Please review.
Project coverage is 71.59%. Comparing base (
304db5d
) to head (bf69953
).
Files | Patch % | Lines |
---|---|---|
util/src/console/formatter.rs | 96.10% | 10 Missing :warning: |
util/src/console/mod.rs | 75.00% | 10 Missing :warning: |
util/src/url_search_params.rs | 99.19% | 5 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Implementing console in rust is very complicated. The best way may be to reuse deno's js code, which will be very simple at the rust and consistent with deno. Here is an example, I hope it will be helpful.
https://github.com/ahaoboy/rqjs/blob/main/rqjs-ext/src/modules/console.rs
@ahaoboy That sounds like a bad idea considering it is js based and quickjs is really not that fast to run js code. I dont think we need to be 100% there. We have been using this console implementation for about a year.
Nice job~
@ahaoboy That sounds like a bad idea considering it is js based and quickjs is really not that fast to run js code.
I haven't tested the difference in size and speed between the js and rust code, but the two are not in conflict. Users should be able to choose different console implementations based on their scenario. If they need more style and more comprehensive output, they can choose console_deno(maybe this name). If they need more startup speed and size, then the simple rust implementation will be more suitable.
Based on the test of the following simple code, it seems that Promsie is not supported?
console.log([1, '1'])
console.log(1)
console.log('a')
const a = [1]
a[1] = a;
console.log(a)
console.log('Promise:', Promise.resolve(1))
console.log('Proxy:', new Proxy({ a: 1 }, {}))
Yeah still missing some things, thats why I said 80% done
This is a new util crate that is meant as a place for the community to contribute utilities that are not covered by quickjs natively. This first iteration adds: