-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Adding a command to the global namespace post 1.0 is a breaking change #12768
Comments
One idea I had for this was to only allow external commands without I don't know if that's for sure what we want, but this is definitely an issue I already ran into with someone not being so happy about |
Maybe we can introduce a new We can have a new flag like |
Random idea: maybe we can take inspiration from Rust's "edition" system. Each file should declare the Nushell edition it wants, and we can disable newly-introduced commands or keywords based on that. |
I think the solution we come up with should impose the smallest burden on our users to get the stability after 1.0 (before like with
For smaller single-file scripts keeping that metadata around sounds like some extra ceremony, but we could hash out some niches where it might make sense to have a compatibility layer like that. An edition system means we still have to keep old behavior around and (if we promise to) keep it compatible with new behavior along some dimension.
To me that sounds like a high burden on users to keep life for developers easy that develop either builtins or conflicting Nushell reimplementations, and makes a pretty severe distinction between REPL and script/module.
Also feels like a way to push the burden on users and I don't want more confusing flags on
While |
Maybe let the user declare a default edition in their
If we're just adding new commands, it should be managable. Adding keywords might be tough though. |
After our 1.0 release where we want to promise stability to our users the addition of a new command to the global namespace can break existing code of users if they rely on an external command with the same name.
Example
Code uses the
stat
command from the GNU/coreutils. Post 1.0 the Nushell team decides they want to provide the functionality with rich structured data as our ownstat
command. Now code runningstat
will return structured data instead of the existing external stream. Sadness ensues if we think the new command is so important that it should be part of the standard namespace.Possible mitigations
std
module (just containing command implementations written in Nu and no Rust builtins). For this you need touse std
. For new modules the same concern would apply so they either have to be shipped with 1.0 or be a submodule of an already reserved module.Non-issues (with current design)
Adding a command to the default namespace is not breaking if the user only relies on a custom command, as they currently are able to shadow non-keyword commands. But this is no vindication as arbitrary names could be external executables a user relies on.
The text was updated successfully, but these errors were encountered: