Skip to content

UADetect 5.0.0

Compare
Choose a tag to compare
@hiteacheryouare hiteacheryouare released this 22 Dec 19:51
· 68 commits to mega since this release
29d9a27

About

UADetect is the library that makes interacting with the Navigator API a breeze, and continuing with that motto, UADetect 5 brings many new features, with complete type definitions (for real this time), and the sunset of some redundant components.

What's New

  • "Methods" allow you to re-call the functions that create the components.
    • Many new, standalone methods are now available, such as vibrate, or registerServiceWorker
  • New components, such as
    • deviceMemory
    • language
    • camera
    • audio
  • General improvements to documentation

Complete Type Definitions

We want to start this section by apologizing for the miscommunication regarding type definitions in the past. We believed that publishing the entire types/ directory with npm would allow editors to just pick up the entire definitions, and to our credit, it was working on our systems, but that is also because we wrote the library. Now, npm only publishes the index.d.ts file, which imports all of the other files, which means
OUR LIBRARY IS NOW FULLY STRONGLY TYPED

Breaking Changes/Depreciations

It's always sad to see some of our beloved components go the way of the dinosaurs, but in keeping the library fresh, and modern, some must be removed in order to make room for other features, while keeping the library as small as possible. Here are the removed components:

  • version
    • Never reliably returned the version of the browser
  • codeName
    • Always returned mozilla
  • engine
    • Always returned Gecko
  • doNotTrackStatus
    • Was not an accurate indicator of the user's actual tracking preferences.