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

Added min, max and steps arguments as an alternative to sizes #31

Merged
merged 4 commits into from
Jul 12, 2017

Conversation

callumacrae
Copy link
Contributor

closes #26

@callumacrae
Copy link
Contributor Author

@herrstucki: I'm not sure what's going on with the tests here - could you help me out?

@alex-ketch
Copy link
Collaborator

@callumacrae You're getting syntax errors in older versions of Node, See Travis logs.

I ran into the same problem in a previous PR, see our discussion.

I had to add a 'use strict'; // eslint-disable-line at the function level scope.

@callumacrae
Copy link
Contributor Author

Got it. I was confused because I thought the syntax error was in the test file, not index.js. I've moved the use strict statement from the previous PR to cover the entire function, or it's not possible to use let.

@callumacrae
Copy link
Contributor Author

Anything I can do to get this merged?

@TomDeBacker
Copy link

@alex-ketch @herrstucki
No pressure but alot of people are excited for this!

@alex-ketch
Copy link
Collaborator

@TomDeBacker I'm afraid you'll have to wait for @herrstucki to chime in.
I imagine he is busy with other commitments, and I'd want to wait for his thoughts about this PR.

I know he's been working on a large PR #29, so he might want to merge that before this.

Sorry for the wait, and thank you for the work @callumacrae.

@jstcki
Copy link
Contributor

jstcki commented Mar 27, 2017

Yeah, I'm sorry for the delay! 😓 I've been pretty busy with other things.

First impression is good, although I'm not yet 100% convinced that it's super-necessary to add more API surface for this relatively trivial use case. But if this is what a lot of people want, I won't say no I guess 😁

Three small things:

  • Please add a entry to the change log
  • I see that you're not doing any rounding. Is that going to be a problem?
  • Should generatedSizes really take precedent over explicitly defined sizes?

As @alex-ketch wrote, #29 is a bigger change but this doesn't depend on it, we just need to make sure we don't forget to add it there as well.

@callumacrae
Copy link
Contributor Author

callumacrae commented Apr 12, 2017

Not rounding probably wouldn't be a problem (I'm honestly not sure), but I've told it to round up so that nothing unexpected happens. I've also changed the order of precedence and added an entry to the changelog.

I never really understood how adding sizes to the webpack config file would have solved the problem: if I have an image which displays full width up to 1280px (*2 for retina), and I have an image which takes up half of an 1000px wide grid—500px—then setting the sizes in the webpack config will only work for one of them.

@callumacrae
Copy link
Contributor Author

Sorry to bump again @herrstucki, but is there anything else I can do to get this merged?

@callumacrae
Copy link
Contributor Author

@herrstucki would you like me to send a PR to the sharp branch instead? I figure this PR will break once that one is merged

@TheLarkInn
Copy link

👋👋👋 @herrstucki, I'm Sean from the webpack team. If there's anything we can do to help support this PR, let us know. Nice work @callumacrae

@jstcki
Copy link
Contributor

jstcki commented Jul 10, 2017

Hi @callumacrae, sorry again and thanks for your patience. I just merged and shipped the sharp branch as v1.0, so you can rebase against master. I'll be happy to release this in v1.1.

👋 and 🙇 for the offer @TheLarkInn

@callumacrae callumacrae force-pushed the min-and-max branch 2 times, most recently from dfb90ef to 753f107 Compare July 11, 2017 11:25
@callumacrae
Copy link
Contributor Author

callumacrae commented Jul 11, 2017

@herrstucki done! I started again from master instead of rebasing, but I guess it's had the same effect.

I've never used jest or flow before, so let me know if I'm doing anything wrong there.

@jstcki jstcki self-assigned this Jul 12, 2017
@jstcki
Copy link
Contributor

jstcki commented Jul 12, 2017

Thanks @callumacrae, this looks good 👍 . You missed an edge case where setting ?size wouldn't override existing min/max options. I fixed it and added some tests for this but I couldn't push to your branch. Can you give me permissions to do this?

@callumacrae
Copy link
Contributor Author

@herrstucki allow edits from maintainers is already checked, but i've given you collaborator access to my repo now too.

@jstcki
Copy link
Contributor

jstcki commented Jul 12, 2017

@callumacrae it seems the git origin wasn't set up properly. Sorry for the confusion 😄

@callumacrae
Copy link
Contributor Author

Cool, those changes look good 👍

Any particular reason you're not willing to have an .editorconfig file in this project? or is it just not suitable for this PR?

@jstcki jstcki merged commit 7303638 into dazuaz:master Jul 12, 2017
@callumacrae callumacrae deleted the min-and-max branch July 12, 2017 09:14
@jstcki
Copy link
Contributor

jstcki commented Jul 12, 2017

@callumacrae I'm generally not against having it but I assumed it slipped in by accident and wasn't really related to this PR. Also, I'd probably rather use prettier to format the code. Not sure if both are needed.

Thanks again! Released as v1.1.0 🚢

@callumacrae
Copy link
Contributor Author

Awesome 🎉 thanks!

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.

min and max arguments to calculate sizes automatically
5 participants