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

enconding: Add preferred option #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bjohansebas
Copy link
Member

Use of the preferred option in encoding

There must be a backport to version 1, as it is a feature needed for expressjs/compression#194

Copy link
Member

@blakeembrey blakeembrey left a comment

Choose a reason for hiding this comment

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

Honestly, I'm not super comfortable with this code as-is and would like to remove the variadic hack from the library instead of going deeper into it with options too.

@bjohansebas
Copy link
Member Author

It was the way I found to avoid breaking compatibility and to be backward compatible. It took me a while to understand why it used arguments (it's the first time I see it), maybe it can be done in cleaner ways

@blakeembrey
Copy link
Member

Ideally we get rid of that altogether, it's hard to understand, hard to fix, and worse for performance. I'd like to do it in a new major version. For now, I'm going to suggest you skip accepts altogether by doing: expressjs/compression#194 (comment). I think it's a better change anyway, and I won't need to maintain multiple releases of accepts this way.

@wesleytodd
Copy link
Member

I will push to oppose a new major at this stage. This package is passed through to express and we cannot do more majors in these without incurring an unnecessary maintenance burden until we are preparing for a v6 release.

I agree with the proposed breaking change from @blakeembrey, just not the timing.

@blakeembrey
Copy link
Member

@wesleytodd Why can't we can do a major version? You can just upgrade in express v5 or v6 when you're comfortable with it. A backward incompatible API change in this package doesn't mean it changes the exposed behavior in express, and coupling them together means we can't make useful API changes and makes the idea of independent package redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants