-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Bug] 7.0->7.1 upgrade breaks when using MapLibre #2230
Comments
The empty package dependency is defined in your own project. I understand that it was suggested by the v7 documentation as a workaround, however it was never mentioned in react-map-gl's package.json, therefore nothing is broken as far as semantic versioning is concerned. I'm happy to amend the v7.1 upgrade guide to reflect this. |
Semantic versioning doesn't say anything about things being in package.json or not. It simply says to bump the major version when there's a backwards incompatible API change, which this is. The fix seems easy - release a v7.1.3 that doesn't break the workaround. Why not do that and save people time? Happy to submit a PR. |
Previously, the 7.0 documentation suggested mapping "empty-npm-package@^1.0.0" to mapbox-gl when using react-map-gl with maplibre. In order to avoid a breaking change, this reverts the mapbox-gl peer dependency from ">=1.13.0" to ">=1.0.0" so that users who followed this advice can safely upgrade within the 7.x series, complying with semantic versioning. Fixes visgl#2230.
I've written a PR and tested locally that it allows upgrading to work: #2231. Hope you'll consider merging this! |
The library does not work with mapbox-gl prior to v1.13.0, hence the restriction. I consider it more important to define the dependencies correctly than supporting an outdated workaround. |
Is that a problem that has come up in practice -- people trying to use versions of mapbox-gl between 1.0.0 and 1.13.0, and then complaining that it doesn't work? |
Okay, but why not release this fix as 8.0, while keeping the 7.x branch from breaking for existing users of the library? |
I ran into this as well but removed the empty package wich also resolves the issue. I suggest to update the update guide https://visgl.github.io/react-map-gl/docs/upgrade-guide to remind people to just remove the line if they followed the old workaround before… |
The short answer is that I did not think this was a breaking change, but I get your point. |
Published the clarification to upgrade guide. |
I appreciate your work on ReactMapGL and I realize I may not be able to convince you, but, respectfully, this really doesn't address the problem. The purpose of semantic versioning is that, for a minor version change, it should not be necessary to check an upgrade guide and work around a breaking change at all. Minor changes should not be breaking. I would ask once again that you please consider merging #2231 and issuing a new 7.1.x release to fix this bug. You could immediately revert that in a 8.0 release. You'd be saving a lot of people some time and headache. |
It is not a breaking API change to require a higher version of some dependency. Packages do so all the time with security updates. Given that the version of mapbox-gl is defined in your own project's package.json, you are responsible for upgrading it. |
all the non-major changes but we still need to work around semver-breaking react-map-gl >:| visgl/react-map-gl#2230
Description
npm is unable to upgrade react-map-gl from 7.0.21 to 7.1.2 while using MapLibre:
This seems to be happening because my dependencies in my package.json has this line, which was the previously recommended way to use react-map-gl with MapLibre:
NPM interprets that as version 1.0.0 of mapbox-gl, while react-map-gl 7.1.2 requires mapbox-gl >1.13.0.
Expected Behavior
To comply with semver, the peer dependency requirement for mapbox-gl should stay
"*"
(satisfied by 1.0.0) for 7.x versions of react-map-gl, to allow the previously suggested way of using react-map-gl with MapLibre to keep working. You could revert that requirement for now, call that 7.1.3, and then cut a version 8.0 release that changes the dependency, since this is a breaking change.Steps to Reproduce
Install react-map-gl 7.0.x with MapLibre using the recommended empty-npm-package workaround, then run
npm upgrade
.Environment
Logs
No response
The text was updated successfully, but these errors were encountered: