Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[google_maps_flutter] Federate mobile implementations #6171

Merged
merged 23 commits into from
Aug 3, 2022

Conversation

stuartmorgan-g
Copy link
Contributor

Moves the iOS and Android implementations to their own federated packages.

Temporarily marks google_maps_flutter as unpublishable to allow the implementations to be moved, rather than copied and deleted, in order to better preserve git history. A follow-up PR will restore it to publishable form.

In addition to moving the existing implementations, this adds the step of moving to in-platform method channels using platform-specific Dart implementations. Usually I make that a follow-up PR, but doing it this way means that I can clean up the tech debt of having the integration test inspector implementation for the shared method channel implementation living in the app-facing package (since I can rely on all implementations that we are testing with now providing their own implementations of the inspector). As usual, the Dart implementations and their tests are starting out as exact copies with only minor changes:

  • Renaming the class
  • Renaming the channels to be class-specific to avoid accidental cross-calling from the shared implementation (as they are expected to diverge over time)
  • Adding registerWith() and a test for it

Also as usual, currently the implementation package example and integration tests are all direct copies of the app-facing version, except for trimming out wrong-platform-specific test code from the platform implementation versions. Over time we can tune which things we test in both places vs just implementation packages.

Fixes flutter/flutter#68498
Fixes flutter/flutter#94224

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

@stuartmorgan-g stuartmorgan-g marked this pull request as ready for review August 2, 2022 18:36

## Usage

This package is [endorsed][2], which means you can simply use
Copy link
Contributor

Choose a reason for hiding this comment

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

Link to README of google_maps_flutter would be useful here to smooth out the user journey

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's already linked a few lines above. (Also, the standard user journey is "nobody ever sees this file, or thinks much about this package at all" 🙂 )

commit-message:
prefix: "[google_maps]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10

- package-ecosystem: "gradle"
directory: "/packages/google_maps_flutter/google_maps_flutter/example/android/app"
directory: "/packages/google_maps_flutter/google_maps_flutter_android/android"
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these two examples apps now duplicated or are they different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are basically the same; see flutter/flutter#46716

Longer term it's something we want to fix, but we haven't been blocking federation on it. (It's a bit tricky to solve even beyond the package structure logistics, because sometimes, like here, we have shims that make the actual example code almost identical, whereas in others the examples are written against a different API layer; it depends on whether there is important widget code in the app-facing package. So we'll need a flexible approach.)

Copy link
Contributor

@GaryQian GaryQian left a comment

Choose a reason for hiding this comment

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

Android side LGTM, deferring to someone else for iOS side verification. @cyanglaz

Copy link
Contributor

@bparrishMines bparrishMines left a comment

Choose a reason for hiding this comment

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

LGTM

It generally looks good to me. As long as we ensure the tests are truly running.

@stuartmorgan-g
Copy link
Contributor Author

As long as we ensure the tests are truly running.

Yep, I've checked that drive is actually running tests for google_maps_flutter on both platforms, google_maps_flutter_ios for iOS, and google_maps_flutter_android for Android, as well as that the relevant platform's native unit tests are running in the two implementation packages.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 3, 2022
@auto-submit auto-submit bot merged commit edc6c0e into flutter:main Aug 3, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 4, 2022
yutaaraki-toydium pushed a commit to yutaaraki-toydium/plugins that referenced this pull request Aug 12, 2022
moisefeelin pushed a commit to feelinproject/plugins that referenced this pull request Aug 26, 2022
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: google_maps_flutter platform-android platform-ios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eliminate use of shared method channels in flutter/plugins Federate the Android and iOS implementations of 1P plugins
3 participants