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 version inconsistencies #1862

Merged
merged 8 commits into from
Mar 21, 2020
Merged

Fix version inconsistencies #1862

merged 8 commits into from
Mar 21, 2020

Conversation

mfedderly
Copy link
Collaborator

I ran into a bunch of issues today when moving more fully into ES module territory. In order to fix some of them I decided to synchronize all of the package versions. I was hoping to wait for a release to do this, but there were actually API breaks so we need to fix this before we can release.

Check the individual commits for more details on the issues I ran into.

Several of the package.json files were referencing @turf/* dependencies at a different version than is available in the repo.
When this happens, yarn will download an extra copy of that package, instead of using the one in the local repo, which can cause issues.
This version uses 'const', but at least it fixed the bug where diff wasn't even an export
Looks like @turf/union changed in a few ways
- it only takes 2 geojsons instead of an arbitrary number
- it can return a multipolygon instead of just a single polygon

This changes the output of a bunch of tests in a way that I'm not super comfortable with
Now we can get a MultiPolygon back so the checks for having the same type are a little wonky
I updated the check here because the logic below looks like it handles more things than the check allowed through
geojson-rbush depends on @turf/bbox but isn't in the turfjs/turf repo. This is a precarious setup especially with the '*' dependency in geojson-rbush.

This makes me sad on two fronts:
- export default from typescript modules is different between JS and ES builds
- I'm not sure whether or not we should even use default exports from each of the modules, which is a breaking change
- Maybe all of our default exports should have the extra nested default hack
@mfedderly
Copy link
Collaborator Author

Filed #1866 to track updating martinez-polygon-clipping and fixing the tests for real instead of skipping them.

@mfedderly mfedderly requested a review from rowanwins March 20, 2020 12:07
@mfedderly
Copy link
Collaborator Author

@rowanwins this is ready for you

Copy link
Member

@rowanwins rowanwins 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 - think it makes sense to skip those tests for the timebeing, hopefully they'll be resolved in the next release of martinez.

@mfedderly mfedderly merged commit 3abbb77 into master Mar 21, 2020
@mfedderly mfedderly deleted the mf/fix-versions branch March 21, 2020 18:45
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.

2 participants