Skip to content

Commit

Permalink
Refine changelog details regarding v1 to v2 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Nov 14, 2024
1 parent ee51caf commit ba980c8
Showing 1 changed file with 60 additions and 28 deletions.
88 changes: 60 additions & 28 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,68 @@
# UAParser.js Changelog

# Version 2.0
## Migrating from v1 to v2

- What's breaking:
- Licensed under AGPLv3 (open-source) or PRO License (commercial)
- Browser detection on mobile device: `"Chrome" => "Mobile Chrome"`, `"Firefox" => "Mobile Firefox"`
- OS detection: `"Mac OS" => "macOS"`, `"Chromium OS" => "Chrome OS"`
- What's new:
- New device type: `xr`, to identify AR/VR devices
- New browser property: `browser.type`, to identify the type of the browser: `crawler`, `cli`, `email`, `fetcher`, `inapp`, `library`, `mediaplayer`
- New methods in result object (all of `get*()` return value):
- Enhance detection using client hints: `withClientHints()`
- Enhance detection using feature check: `withFeatureCheck()`
- Utility for easy comparison: `is()`
- Utility to print full-name: `toString()`
- Parse user-agent directly from command line using `npx ua-parser-js "[User-Agent]"`
- Extensions can be passed as a list to `UAParser()`
- Support for ES module & TypeScript `import { UAParser } from 'ua-parser-js'`
- Provided Enums submodule `'ua-parser-js/enums'`
- Provided Extensions submodule `'ua-parser-js/extensions'`
- Provided Helpers submodule `'ua-parser-js/helpers'`:
- `getDeviceVendor()`: guess for a device vendor based on its model name
- `isAppleSilicon()`: check if the device has Apple Silicon Mac device properties
- `isBot()`: check if the browser is identified as a bot
- `isChromeFamily()`: check if the browser is Chrome-based (has Blink engine, i.e: New Opera, New Edge, Vivaldi, Brave, Arc, etc.)
- `isElectron()`: check if current window is running inside Electron
- `isFromEU()`: check if current window is from an EU (European Union) country
- `isFrozenUA()`: check if a user-agent string match with the reduced/frozen user-agent pattern
- `isStandalonePWA()`: check if current window is a standalone PWA
### What's Breaking:

---
- **Licensing Changes:**
- UAParser.js is now licensed under AGPLv3 for open-source use, with PRO Licenses available for commercial/proprietary use

- **Browser Detection on Mobile Devices:**
- `"Chrome"` => `"Mobile Chrome"`
- `"Firefox"` => `"Mobile Firefox"`

- **OS Detection:**
- `"Mac OS"` => `"macOS"`
- `"Chromium OS"` => `"Chrome OS"`

### What's New:

- **Support for ES Modules & TypeScript:**
- Import directly as an ES module with TypeScript support: `import { UAParser } from 'ua-parser-js'`

- **Support for Custom/Predefined Extensions:**
- Pass custom regexes or predefined extensions as a list to `UAParser()`

- **Support for CLI Parsing:**
- Parse a user-agent directly from the command line using `npx ua-parser-js "[User-Agent]"`

- **Enhanced Detection with Client Hints:**
- `withClientHints()`: Improves detection accuracy by leveraging client hints

- **Enhanced Detection with Feature Detection:**
- `withFeatureCheck()`: Refines detection results using feature detection

- **Simple Comparison for Detection Results:**
- `is()`: Enables easy comparison checks against the detection result

- **Detailed Result Output:**
- `toString()`: Returns the detection result in form of a full-name string

- **New Device Type:**
- Added `xr` to identify AR/VR devices

- **New Browser Property:**
- Added `browser.type` to identify additional browser types:
- `crawler`, `cli`, `email`, `fetcher`, `inapp`, `library`, `mediaplayer`

- **New Submodules:**
- **`'ua-parser-js/enums'`**: Provides constants for these specific properties:
- `browser.name`, `browser.type`, `cpu.architecture`, `device.type`, `device.vendor`, `engine.name`, `os.name`

- **`'ua-parser-js/extensions'`**: Predefined extensions for various use cases:
- `Bots`, `Crawlers`, `CLIs`, `Emails`, `ExtraDevices`, `Fetchers`, `InApps`, `Libraries`, `Mediaplayers`

- **`'ua-parser-js/helpers'`**: Provides utility methods to extend detection functionality:
- `getDeviceVendor()`: Guesses the device vendor based on its model name
- `isAppleSilicon()`: Detects Apple Silicon device properties
- `isBot()`: Checks if the browser is a bot
- `isChromeFamily()`: Checks if the browser is Chrome-based (uses Blink engine) — e.g., New Opera, New Edge, Vivaldi, Brave, Arc, etc.
- `isElectron()`: Detects if current window is running within Electron
- `isFromEU()`: Detects if current browser's timezone is from an EU country
- `isFrozenUA()`: Checks if the user-agent matches a frozen/reduced user-agent pattern
- `isStandalonePWA()`: Detects if current window is a standalone PWA

---

## Version 2.0.0-rc.3

Expand Down

0 comments on commit ba980c8

Please sign in to comment.