Skip to content
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: expose url builder api #225

Merged
merged 15 commits into from
Nov 22, 2018
Merged

feat: expose url builder api #225

merged 15 commits into from
Nov 22, 2018

Conversation

frederickfogerty
Copy link
Contributor

Description

This PR exposes a pure function buildURL which allows users to generate imgix URLs directly, for instance, if they want to use the url to set the background of a custom DIV, they can accomplish that with this feature.

Fixes #131

New Feature

  • If this is a big feature with breaking changes, consider [opening an issue][issues] to discuss first. This is completely up to you, but please keep in mind that your PR might not be accepted.
  • Run unit tests to ensure all existing tests are still passing
  • Add new passing unit tests to cover the code introduced by your PR
  • Update the readme
  • Add some steps so we can test your cool new feature!
  • The PR title is in the conventional commit format: e.g. feat(<area>): added new way to do this cool thing #issue-number
  • Add your info to the contributors array in package.json!

Steps to Test

Review new unit tests.

README.md Outdated
@@ -22,7 +22,7 @@ A [React](https://facebook.github.io/react/) component that renders images using
- [Lazy Loading](#lazy-loading)
- [Low Quality Image Placeholder Technique (LQIP)](#low-quality-image-placeholder-technique-lqip)
- [Picture support](#picture-support)
- [Background mode](#background-mode)
- [Background mode](#background-mode) - [Custom URLS](#custom-urls)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Needs a newline here

const actualURL = new URL(actual);
expect(actualURL.searchParams.get("w")).toBe("450");
expect(actualURL.searchParams.get("h")).toBe("100");
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test here to ensure that the parameter override behavior outlined in the README is adhered to?

@frederickfogerty
Copy link
Contributor Author

@jayeb this should be good to go now 😄

@frederickfogerty frederickfogerty merged commit ae9b31b into master Nov 22, 2018
@frederickfogerty frederickfogerty deleted the fred/expose-url-api branch November 22, 2018 08:06
frederickfogerty added a commit that referenced this pull request Dec 4, 2018
* master:
  chore(release): 8.4.0
  feat: use exponential increase for srcset widths (#224)
  chore(deps): update dependency webpack to v4.26.1 (#229)
  chore: update travis node version to 10.x (#228)
  feat: expose url builder api (#225)
  chore(deps): update dependency webpack to v4.26.0 (#226)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants