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

Upgrade Flow to v0.142.0 #11456

Merged
merged 5 commits into from
Feb 2, 2022
Merged

Upgrade Flow to v0.142.0 #11456

merged 5 commits into from
Feb 2, 2022

Conversation

mourner
Copy link
Member

@mourner mourner commented Feb 1, 2022

Continuing #11426. This PR upgrades Flow to v0.132.0, a version which forbids using implicit any as a type, which previously led to incorrectly typed or untyped code that Flow ignored. Similar to #11400 but extends to all other libraries we import. Then further upgrades to v0.142.0, the last version that supports types_first = false.

In particular, adds types for @mapbox/grid-index and @mapbox/tiny-sdf (previously untyped and assumed Object = any), and makes sure Point type is used explicitly where it's referenced (for some reason Flow didn't complain when it didn't). Also note that I had to disable a few errors with any or $FlowFixMe in places where proper typing is very difficult — I would leave fixing this for later when we're on the latest Flow version.

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'

@mourner mourner added the skip changelog Used for PRs that do not need a changelog entry label Feb 1, 2022
@mourner mourner requested review from ansis and karimnaaji February 1, 2022 12:12
@mourner mourner changed the title Upgrade Flow to v0.132.0 Upgrade Flow to v0.142.0 Feb 1, 2022
@mourner mourner merged commit b67b666 into main Feb 2, 2022
@mourner mourner deleted the upgrade-flow-4 branch February 2, 2022 16:42
@@ -16,7 +14,7 @@ class RasterDEMTileWorkerSource {
loadTile(params: WorkerDEMTileParameters, callback: WorkerDEMTileCallback) {
const {uid, encoding, rawImageData, padding, buildQuadTree} = params;
// Main thread will transfer ImageBitmap if offscreen decode with OffscreenCanvas is supported, else it will transfer an already decoded image.
const imagePixels = (ImageBitmap && rawImageData instanceof ImageBitmap) ? this.getImageData(rawImageData, padding) : rawImageData;
const imagePixels = rawImageData instanceof RGBAImage ? rawImageData : this.getImageData(rawImageData, padding);
Copy link
Contributor

Choose a reason for hiding this comment

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

This change breaks terrain in Firefox, which doesn't support OffscreenCanvas. This check fails since rawImageData is of type ImageData.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changelog Used for PRs that do not need a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants