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

fix: mime-db@1.53.0 #126

Merged
merged 1 commit into from
Aug 23, 2024
Merged

fix: mime-db@1.53.0 #126

merged 1 commit into from
Aug 23, 2024

Conversation

wesleytodd
Copy link
Member

@wesleytodd wesleytodd commented Jul 12, 2024

Updates mime-db which included an update to .js mapping to the correctly specified text/javascript mime type. This broke a test and is likely to be generally disruptive, but I believe that this should be considered non-breaking from a semver perspective since it is to spec. Please tell me why I am wrong before we release this 🤣.

EDIT: Copying this comment here so folks understand that I am both saying this from my opinion as well as precidence for this package's history.

#110 (comment)

Yes, this pins so there are two decision points. The semver is tricky bc typically in both packages, the data is has not been considered in the semver, as the way in which data changes in fluid with standards and browsers and there can be a lot of changes. Usually only the javascript api of the module has been considered in whay type of semver bump it would be.

And note: I removed the pin with this commit. That is up for debate, but I do believe that unless we can get more maintainers around to help with this stuff we plan to optimize for our ability to more quickly ship change in the future, including loosening version ranges like this.

Second edit: I will fix the CI error which is likely because npm that long ago didn't support ^ ranges, but I dont want to waste time until we get good agreement on switching to a range in the first place.

@blakeembrey
Copy link
Member

I think that’s correct and we should document the expectation in the readme so people can pin. Anything else is a huge pain to maintain.

Long sidebar:

I have the same issue with pluralize and I just stopped cutting releases until I can rewrite it into a data package + API package so that the data package can bump patches any time and be pinned independent of the data package. We might want to consider a model like that in a future release, so mime-db releases freely and mime-types can just import any version.

@wesleytodd
Copy link
Member Author

@blakeembrey, as discussed in slack I updated the readme to reflect the approach we are taking. Let me know if that is good enough or if you think we need to say more.

@wesleytodd
Copy link
Member Author

We might want to consider a model like that in a future release

I guess I should have addressed this as well. I think I agree with this but it might put more burden on end users. Going this route would be a breaking change, so we can probably just discuss it out of band of this right?

@blakeembrey
Copy link
Member

Going this route would be a breaking change, so we can probably just discuss it out of band of this right?

Absolutely, by future release I meant future major version.

In the past the version of `mime-db` was pinned to give two decision points when adopting MIME data changes. This is no longer true. We still update the
`mime-db` package here as a `minor` release when necessary, but will use a `^` range going forward. This means that if you want to pin your `mime-db` data
you will need to do it in your application. While this expectation was not set in docs until now, it is how the pacakge operated, so we do not feel this is
a breaking change.
Copy link
Member

@blakeembrey blakeembrey Jul 13, 2024

Choose a reason for hiding this comment

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

This sounds good to me. I think the argument is that if you didn't pin already, you expected updates on resolution automatically, and if you did pin, you didn't. This breaks the "you didn't" case, but since those users are currently pinned I agree with the change. Let's ensure the release notes are very clear (big and bold) to highlight this for pinned users.

I still think it's clearer to consider a major version that changes the way the API works and this change at the same time, but it's certainly easier (on both us and users) to consider this non-breaking.

Copy link

@jsumners jsumners left a comment

Choose a reason for hiding this comment

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

Looks good to me.

The upstream mime-db advertises the "specs" it pulls its data from. Disagreements with those specs should be handled locally, i.e. if an application considers .js => application/javascript, then that application should do its own inspection for that because the specs mime-db pulls from maps .js => text/javascript.

@wesleytodd
Copy link
Member Author

Pending this: jshttp/mime-db#331

I am considering pushing forward with this despite this objection. Since folks are not standing up to share other opinions, I am not sure anything presented has changed my opinion. I think that folks who want a different experience should either fork or pin.

That said, we have an opportunity here as we prepare for express v5 to do this one as a major which I think we should take to avoid larger disruption than necessary. If no one objects to that I will re-target this to the next major and work on releasing that.

Copy link

socket-security bot commented Aug 23, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/mime-db@1.53.0 None 0 219 kB wesleytodd

🚮 Removed packages: npm/mime-db@1.52.0)

View full report↗︎

@wesleytodd wesleytodd merged commit 540d9f3 into 3.x Aug 23, 2024
10 checks passed
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