Gathering detailed insights and metrics for @artsy/detect-responsive-traits
Gathering detailed insights and metrics for @artsy/detect-responsive-traits
Gathering detailed insights and metrics for @artsy/detect-responsive-traits
Gathering detailed insights and metrics for @artsy/detect-responsive-traits
Determine responsive traits to only server-side render markup truly needed.
npm install @artsy/detect-responsive-traits
Typescript
Module System
Node Version
NPM Version
TypeScript (97.64%)
JavaScript (2.36%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
39 Stars
206 Commits
5 Forks
34 Watchers
11 Branches
49 Contributors
Updated on Apr 18, 2024
Latest Version
0.1.0
Package Id
@artsy/detect-responsive-traits@0.1.0
Unpacked Size
31.16 kB
Size
7.15 kB
File Count
6
NPM Version
6.14.12
Node Version
10.24.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
This package provides information about devices, based on their reported user-agent, that gives insight into what responsive traits the device has. This can be used with a package such as @artsy/fresnel to only render markup on the server that the device actually supports and reduce the amount of bytes that need to be sent.
This package only cares about the viewport ‘width’ that the device supports, as that’s the only dimension that Artsy’s designs take into consideration.
The package exports a single findDevice
function, which given a user-agent string finds the first entry from the
exported Devices
list that matches. The result has the following fields of interest:
1{ 2 minWidth: number 3 maxWidth: number 4 resizable: boolean 5 touch: boolean 6}
In case resizing is supported, the device should be considered as being able to display at any size between minWidth
and maxWidth
. In case resizing is not supported, minWidth
and maxWidth
should be considered as the only two
possible width values.
The touch
value indicates if the device has a touch-screen.
The react-responsive-media example app for a demonstration of how to use this with server-side rendered React.
We only cover user-agents of which we’ve seen more than 1000 visits over the past 2 weeks on artsy.net. When new devices appear in that list we’ll add those to the existing coverage. Having said that, we very much appreciate additional coverage in the form of pull-requests!
In our current Android coverage we have many devices defined with a minWidth
of 0
, because we haven’t yet determined
what the minimum width is on these devices that Chrome will display at when resizing the window. In case you own these
devices, please visit a site that reports the viewport and test what the minimum width is both in portrait and
landscape mode.
1git clone https://github.com/artsy/detect-responsive-traits.git 2cd detect-responsive-traits 3yarn install 4 5# Open VS Code with `code .` 6 7# Run tests 8yarn jest
This project uses auto-release to automatically release on every PR. Every PR should have a label that matches one of the following
No release will happen on a Trivial
update.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
44 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More