feat: integrate trace mark with render#25
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| return Promise.resolve(value).then(onfulfilled, onrejected) | ||
| } | ||
| catch (e) { | ||
| return Promise.reject(e).then(onfulfilled, onrejected) |
There was a problem hiding this comment.
Do we need Promise.reject and Promise.resolve? Shouldn't this just be onfulfilled(value), onrejected(e)?
There was a problem hiding this comment.
There's subtle difference and I believe Promise.resolve/reject is robust and supposedly this is manual thenable implementation idiom (Claude told me so).
A few edge case I came up with is:
promise.then().then(...):thenwith empty arguments should return same-ish promisepromise.then(() => { throw ... }, onrejected): whenonfulfilled(synchronously) throws, it shouldn't handled by its ownonrejected.
| /** | ||
| * Unmount the component. Also records a `vue.unmount` trace mark. | ||
| * | ||
| * Synchronous usage is deprecated and will be removed in the next major version. |
There was a problem hiding this comment.
Can we keep sync with a @deprecated tag? The same for other APIs (in svelte too)
There was a problem hiding this comment.
IDE cannot pick overload with sync/async return types, so either deprecated highlighted everywhere or nowhere. What are you suggestion to write types here?
There was a problem hiding this comment.
Hm, I see. Since there is no difference in arguments, we can’t really overload
Vue counterpart of vitest-community/vitest-browser-react#47 using marvelous thenable trick vitest-community/vitest-browser-react#47 (comment).
Example