-
-
Notifications
You must be signed in to change notification settings - Fork 485
Fix breaking change by hiding File again #321
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 breaking change by hiding File again #321
Conversation
|
@creativecreatorormaybenot for some reason importing transitive dependencies isn't allowed in packages |
|
@sidrao2006 ok, it makes sense in packages. But in that case I would prefer to make the dependency explicitly visible, or not? 🤔 The reason I said it was a breaking change is that in our apps, it would not compile anymore, unless we add: import 'package:flutter_cache_manager/flutter_cache_manager.dart' hide File;Because of the mentioned conflict. |
|
I completely understand and apologize for the change. When I made the change, the |
|
@sidrao2006 No worries. The change itself is fine as well (although I would say it generally does not make most sense to export other packages from your package), but it should have bumped the major. |
|
Slightly different fix from PR #324 is released as 3.1.1 |
|
@renefloor I thought about this approach as well, but I think it is a bad idea. You are essentially proxying Now, you are required to publish a breaking change / major version update whenever |
|
@creativecreatorormaybenot , only |
|
@sidrao2006 yes that is true. |
|
Indeed, if for example |
✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)
This fixes the breaking change I explained in #302 (comment).
When you run
pub upgradewithflutter_cache_manager: ^3.0.0and used3.0.0before, your code breaks because you might have importeddart:io(oruniversal_io) andflutter_cache_managerin the same file.🆕 What is the new behavior (if this is a feature change)?
Removed the
exportofpackage:file. Instead, users canimportit when needed.What should be done instead?
@sidrao2006 said that you have to add a direct
package:filedepedendency if you want to annotate types without his PR (this reverts #302), however, that is not true.You can import
package:file/file.dart, even when it is a transitive dependency.Migration
So the migration is simply adding:
Whenever you want to use that
Fileclass.💥 Does this PR introduce a breaking change?
Technically yes, but it fixes the previous breaking change.
🤔 Checklist before submitting