Download the PHP package barthy-koeln/browserslist-check-bundle without Composer
On this page you can find all versions of the php package barthy-koeln/browserslist-check-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download barthy-koeln/browserslist-check-bundle
More information about barthy-koeln/browserslist-check-bundle
Files in barthy-koeln/browserslist-check-bundle
Package browserslist-check-bundle
Short Description Detects browser versions, matches .browserslistrc files and serves encore builds accordingly.
License MIT
Homepage https://github.com/barthy-koeln/browserslist-check-bundle
Informations about the package browserslist-check-bundle
Browserslist Check Bundle
This bundle parses .browserslistrc
files for a config called modern
.
It then provides a php service and a twig method to compare the
user-agent string against this config.
It uses a great, light and fast user agent parsing library by @donatj.
The goal is to determine whether the browser requesting a response is "modern" in relation to JavaScript and CSS functionality.
You can use it to serve different front-end builds and save precious
bandwidth for modern browsers by serving less polyfills, vendor prefixes
and whatever else is handled by the .broserslistrc
.
Installing
Config
Your .browserslistrc
file should look like this:
Important notes:
- The
[modern]
config must be at the top - The constraints within that build must only map browser names with
minimum versions using the
>=
operator. Browsers with versions higher or equal are "modern".
Caching The Browser Configuration
Your .browserslistrc
file will be parsed and inlined as a PHP array when Symfony builds its cache.
Crawlers & Bots
This bundle recognizes a few evergreen crawlers capable of handling JavaScript and handles them as their browser counterpart (e.g. Chrome for Googlebot and Edge for Bingbot).
Simple Usage
The user agent parsing will not happen until you call the isModern
method without any arguments.
Advanced Symfony, Webpack Encore, and Asset Management Usage
file: config/packages/assets.yaml
file: config/packages/webpack_encore.yaml
file: config/packages/prod/webpack_encore.yaml
file: webpack.config.js
file: package.json
file: Any base twig template
All versions of browserslist-check-bundle with dependencies
donatj/phpuseragentparser Version ^1.1
symfony/config Version ^4.4 || ^5.4 || ^6.1
symfony/dependency-injection Version ^4.4 || ^5.4 || ^6.1
symfony/http-kernel Version ^4.4 || ^5.4 || ^6.1
symfony/yaml Version ^4.4 || ^5.4 || ^6.1
twig/twig Version ^2.11 || ^3.3