Skip to content

[examples] explicitly override deps#587

Merged
miquelbeltran merged 1 commit intofluttercommunity:mainfrom
alexbatalov:examples-override-deps
Nov 3, 2021
Merged

[examples] explicitly override deps#587
miquelbeltran merged 1 commit intofluttercommunity:mainfrom
alexbatalov:examples-override-deps

Conversation

@alexbatalov
Copy link
Copy Markdown
Contributor

Description

This PR explicitly specify platform-specific implementation paths in example apps.

The reason is the nature of federated plugins. In example apps main package is always specified via path. In case of unfederated plugin, it's platform-specific implementations are already part of the main package and will be picked up when building example (thus accounting for changes in any platform implementation). However with federated plugins main package has it's platform-specific implementations as version-locked dependencies. Building example app takes main package via path (thus accounting for changes Android/iOS implementations), but other platform implementations are resolved to published versions in pub ignoring current changes.

Specifying paths explicitly fixes CI's pub_get_check job and resolves failing check in #571 because it does not depend on running melos. As far as get this repo's CI configuration is built after flutterfire which uses same checks and build steps. See firebase_core/example how they do the same. A more complex example is firebase_database/example in which they specify platform-specific implementations for transitive dependencies for packages in the same monorepo.

It also removes args from examples' dependency_overrides. Some packages don't have it and they run perfectly fine. Not sure what it was used for, so I've removed it.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@alexbatalov alexbatalov mentioned this pull request Oct 29, 2021
9 tasks
@mhadaily mhadaily added Hacktoberfest Issues taking part in Hacktoberfest hacktoberfest-accepted labels Oct 31, 2021
Copy link
Copy Markdown
Member

@miquelbeltran miquelbeltran left a comment

Choose a reason for hiding this comment

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

Thanks for the extended explanation, the idea makes sense to me.

@miquelbeltran miquelbeltran merged commit fd25043 into fluttercommunity:main Nov 3, 2021
@alexbatalov alexbatalov deleted the examples-override-deps branch November 4, 2021 06:40
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Hacktoberfest Issues taking part in Hacktoberfest hacktoberfest-accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants