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

Drop support for .packages files #1546

Open
jakemac53 opened this issue Sep 3, 2024 · 2 comments
Open

Drop support for .packages files #1546

jakemac53 opened this issue Sep 3, 2024 · 2 comments

Comments

@jakemac53
Copy link
Contributor

jakemac53 commented Sep 3, 2024

This package should drop support for .packages files, and set a minimum SDK of 3.0.0 or higher (nvm, the min SDK is already sufficiently high).

Reasoning:

  • As of 3.x, only versions >= 2.12 are supported.
  • The .packages file behavior sets a version of 2.7, so it is not useful on SDKs >=3.0.0
  • If a .packages file is discovered, and there isn't a corresponding .dart_tool/package_config.json file, it will select that, instead of traversing further up the chain.
  • Specifically when refactoring to use pub workspaces, you can end up in a state where you have old .packages files but no .dart_tool/package_config.json file. This makes for example the formatter go off the rails and parse all files with language version 27.
  • It should also make the logic a bit simpler and faster to stop looking for these files.
@jakemac53
Copy link
Contributor Author

jakemac53 commented Sep 3, 2024

Actually I see now that a minVersion is supported - but it defaults to 1. I think we should at least change the default to 2. I don't believe that supporting version one provides any positive value, and it can provide negative value. So, I would opt for dropping support entirely, but leaving it in as an opt in mechanism could also be OK (although, I don't see any useful scenario for using version 1, it cannot produce a valid package config in Dart 3.x).

@lrhn
Copy link
Member

lrhn commented Oct 9, 2024

Ack. We should just kill support for .packages and have an SDK constraint of ^3.0.0.

@mosuem mosuem transferred this issue from dart-lang/package_config Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants