Auto upgrade legacy filters
This leverages functionality inside the mapbox-gl-style-spec to auto-upgrade legacy filter syntax.
This avoids errors in styles which mix the legacy syntax with the modern syntax.
Will fail until the style-spec version is upgraded, which can happen after https://github.com/mapbox/mapbox-gl-js/pull/8493 is in a release.
This is passing on travis except for the coverage build, which I'm working on fixing over at #29
/cc @ian29 @mapsam
This PR is now rebased against latest master and includes the latest mapbox-gl-style-spec release, which means its ready for further review and testing /cc @ian29 @ericfischer @mapsam
This PR came up today in conversation with @briandaviddavidson. The main holdup on moving this forward is that we need to build confidence around styleSpec.convertFilter. I don't yet know the answers to these questions:
- Is
styleSpec.convertFilterrobust (won't throw odd errors or corrupt output) against all possible styles in the wild? - Have there been any recent releases of
@mapbox/mapbox-gl-style-specthat we should upgrade to before further testing this? - Do we need more unit test coverage in this PR of possible things that can go wrong with running
styleSpec.convertFilteragainst arbitrary input?
Getting the answers to these questions would involve:
- Building up a large set of sample styles to try running this against
- Careful canary to further see if any styles in the wild trigger new types of errors
- Building back any problem test styles into test fixtures
- Handling any newly discovered errors correctly in the code