New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ixlib url parameter to help Imgix support and analytics #145
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Branding nit in the documentation, but otherwise looks great 👍.
README.md
Outdated
@@ -108,6 +108,10 @@ Fallback width for images, useful for SSR or static site generation | |||
|
|||
Generate `2x` and `3x` src sets when using an `<img>` tag. Defaults to `true` | |||
|
|||
#### disableLibraryParam :: bool | |||
|
|||
By default this component adds a parameter to the generated url to help Imgix with analytics and support for this library. This can be disabled by setting this prop to `true`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Imgix/imgix
@@ -6,6 +6,8 @@ import PropTypes from "prop-types"; | |||
|
|||
import processImage from "./support.js"; | |||
|
|||
const PACKAGE_VERSION = require("../package.json").version; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noice 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 😄
Description
This PR adds an
ixlib
parameter to urls generated by this component. The url parameter is in the formixlib=react-7.1.1
. There are two reasons to add this parameter: a) it helps Imgix support see what versions of libraries that customers are using, and b) it help Imgix to see how many people overall are using the react library, and the specific versions.This functionality is enabled by default but can be turned off by passing the prop
disableLibraryParam
.This closes #142.
New Feature
feat(<area>): added new way to do this cool thing #issue-number
Steps to Test
Either review the unit tests in
test/unit/react-imgix.test.js
or set-up a new app and inspect the generated URLs.