Just Editions
- Dominant language
- Rust
- Stars
- 35.8k
- Forks
- 846
- Avg merge
- 27m
- Merged PRs (30d)
- 3
Description
This is mostly copy-pasta'ed from my [comment here](https://github.com/casey/just/issues/953).
Just is now 1.0, and has a strong commitment to backwards-compatibility. In practice, backwards-compatibility was important even before 1.0, since there have been enough justfiles out there for a while now that breaking things would have been really annoying for users.
However, time marches forward, and there will always be backwards-incompatible changes that seem desirable to introduce, and old mistakes that would be nice to fix.
To be able to make changes while preserving backwards compatibility, I suggest we steal Rust's concept of an [edition](https://doc.rust-lang.org/edition-guide/editions/index.html). An edition is an opt-in set of backwards-incompatible changes. For `just`, it would work like this:
1. We add a new feature that would be a breaking change, but we make it an opt-in setting, i.e. `set good-thing := true`, so that it doesn't break existing justfiles.
2. We fix some old behavior that was bad, but which people might have been relying on, but we make it an opt-in setting, i.e. `set dont-do-bad-thing := true`, so that it doesn't break existing justfiles.
3. Some time passes, and we get confident that `good-thing` and `dont-do-bad-thing` are good and useful enough that they should be true by default
4. We create a new setting called `edition`, that takes a number. If you don't set it, it defaults to `set edition := 1`, which corresponds to the way `just` works now.
5. We announce edition `2`, which, if you do `set edition := 2`, turns on both `good-thing` and `dont-do-bad-thing`.
Pros:
- We can make changes that are backwards compatible
- We don't have to try to justify breaking edge-case behavior by telling ourselves "well this is really a bug so it's okay if we break existing justfiles"
- Users don't need to micromanage their settings, they can just do `set edition := LATEST_EDITION` and get good defaults
- No existing justfiles will be broken
Cons:
- Users have to put `set edition := 2` at the top of their justfile or else they get edition 1.
Contributor guide
Assessment
This issue has not been assessed yet.