console icon indicating copy to clipboard operation
console copied to clipboard

Add `console.timeStamp()` to the specification

Open bmeurer opened this issue 1 year ago • 7 comments

This adds a minimal (vague) definition for the timeStamp() method, based on its current behavior across Chromium, Firefox, and Safari, and the MDN documentation^1.

Ref: #140

  • [x] At least two implementers are interested (and none opposed):
    • Google
    • Mozilla
    • Apple
  • [x] Implementations already exist:
    • Chromium
    • Gecko
    • WebKit
  • [x] MDN documentation already exists.
  • [x] The top of this comment includes a clear commit message to use.

Preview | Diff

bmeurer avatar Jul 12 '24 09:07 bmeurer

@domfarolino Let's get the ball rolling here. :muscle:

@and-oli Please loop in your contacts with other browser vendors here.

bmeurer avatar Jul 12 '24 09:07 bmeurer

Hmm, it looks like you removed this line about tests from the pull request template? Can you add that back and maybe write some tests for this API? You can follow the pattern in https://github.com/web-platform-tests/wpt/tree/master/console. Note the state of testing is a little sad at this point, since these are basically just manual tests :(

domfarolino avatar Jul 12 '24 12:07 domfarolino

@dcrousso @nchevobbe

and-oli avatar Jul 12 '24 12:07 and-oli

Hmm, it looks like you removed this line about tests from the pull request template? Can you add that back and maybe write some tests for this API? You can follow the pattern in https://github.com/web-platform-tests/wpt/tree/master/console. Note the state of testing is a little sad at this point, since these are basically just manual tests :(

Beyond testing that the function exists on the console object, how would we go about adding other (meaningful) tests?

bmeurer avatar Jul 24 '24 06:07 bmeurer

Hmm, it looks like you removed this line about tests from the pull request template? Can you add that back and maybe write some tests for this API? You can follow the pattern in https://github.com/web-platform-tests/wpt/tree/master/console. Note the state of testing is a little sad at this point, since these are basically just manual tests :(

Beyond testing that the function exists on the console object, how would we go about adding other (meaningful) tests?

@domfarolino any thoughts here?

bmeurer avatar Jul 30 '24 13:07 bmeurer

Sadly I don't think we can do much more than add a few manual tests to WPT, and do whatever vendor-specific testing you can do. I think this PR is good to go % https://github.com/whatwg/console/pull/236/files#r1676151812. @bmeurer does Firefox match Chrome in this case? (I couldn't find where Firefox puts timeStamp() marks on its performance timeline). If it does match Chrome, we can just land this since it would match 2/3 implementations without strong objections from another.

domfarolino avatar Dec 01 '24 15:12 domfarolino

@bmeurer does Firefox match Chrome in this case? (I couldn't find where Firefox puts timeStamp() marks on its performance timeline). If it does match Chrome, we can just land this since it would match 2/3 implementations without strong objections from another.

I've confirmed that Firefox removed UI support for this when they launched their new profiler but they used to support it. They still accept the API but currently don't use that information. Bug to add support here: https://bugzil.la/1730896

MDN updated here (with support from @canova from Firefox Profiler team): https://github.com/mdn/browser-compat-data/pull/28074

Not sure what that "half-support" in Firefox, and the small outstanding "default" issue in Safari means in terms of "2/3 implementations without strong objections from another" though? I'd argue it meets the bar and with some support in all three browsers it would be good to merge this and add it to the spec.

tunetheweb avatar Oct 23 '25 09:10 tunetheweb