Skip to content

implement platform info - #412

Draft
Uzlopak wants to merge 16 commits into
mainfrom
platform-metrics
Draft

implement platform info#412
Uzlopak wants to merge 16 commits into
mainfrom
platform-metrics

Conversation

@Uzlopak

@Uzlopak Uzlopak commented Nov 8, 2025

Copy link
Copy Markdown
Collaborator

fixes #176

It is actually quite annoying to implement this without trying to start implementing stuff like useragent parsing. So the focus is nodejs.
I am not happy with some of the names.
Still need some input on how to show this information.

@pkg-pr-new

pkg-pr-new Bot commented Nov 8, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/tinybench@412

commit: 9df73b8

@github-actions

github-actions Bot commented Nov 8, 2025

Copy link
Copy Markdown

size-limit report 馃摝

Path Size Loading time (3g) Running time (snapdragon) Total time
dist/index.js 11.78 KB (+8.44% 馃敽) 236 ms (+8.44% 馃敽) 29 ms (+250.46% 馃敽) 264 ms

@Uzlopak
Uzlopak marked this pull request as draft November 8, 2025 02:57
@Uzlopak
Uzlopak requested a review from Copilot November 8, 2025 02:57

This comment was marked as duplicate.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.


馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/platform.ts Outdated
Comment thread src/platform.ts Outdated
Comment thread src/types.ts
Comment thread src/types.ts
Comment thread src/types.ts Outdated
Comment thread src/types.ts Outdated
Copilot AI review requested due to automatic review settings July 22, 2026 19:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

- types: collapse PlatformMetrics to a single flat interface (drop the
  non-discriminable Omit-based union; runtime: JSRuntime)
- machine: normalize to the process.arch vocabulary (drop phantom x32);
  align the Machine union to the closed process.arch set
- browser: derive OS from a navigator.platform prefix map instead of
  routing it through the arch normalizer (MacIntel -> darwin, etc.)
- cache: only memoize the default environment; custom g/runtime bypass
  it entirely (no stale reads, no poisoning on useCache:false)
- priority defaults to null (unknown), not -1 (a valid nice value)
- export getPlatformMetrics/normalizeMachine/normalizeOSType + types
- misc: hoist os.cpus(), consistent @ts-expect-error, type-only import,
  statement-form normalizers, richer JSDoc, drop interface semicolons
- tests: update arch expectations to process.arch; add browser + cache
  regression tests
Copilot AI review requested due to automatic review settings July 22, 2026 19:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

Copilot AI review requested due to automatic review settings July 22, 2026 20:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

- browserOSType now takes userAgent: real Android reports
  navigator.platform 'Linux armv8l', not 'Android', so detect it from
  the user agent before the linux prefix (fixes the dead android branch)
- machineLookup: map armv6l/armv7l/armv8l -> 'arm' so 32-bit ARM tokens
  stay in the process.arch vocabulary instead of leaking via the escape
  hatch
- add 'armv' to the cspell word list
- tests: Android-via-UA detection, desktop-linux stays linux, armv* arch
Copilot AI review requested due to automatic review settings July 22, 2026 20:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

Copilot AI review requested due to automatic review settings July 23, 2026 11:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

Copilot AI review requested due to automatic review settings July 23, 2026 21:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

size-limit bundles dist/index.js with esbuild (browser target), which
cannot resolve the dynamic `import('node:os')` used by the platform
feature. Declaring it as ignored lets size-limit resolve and measure the
bundle instead of failing to build.
Copilot AI review requested due to automatic review settings July 24, 2026 12:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

typedoc --treatWarningsAsErrors fails because normalizeOSType's public
doc comment linked to browserOSType, an internal (non-exported) helper.
Replace the {@link} with plain text so a public symbol no longer links
to a private one.
Copilot AI review requested due to automatic review settings July 24, 2026 12:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: add OS and hardware information to benchmark result when possible

3 participants