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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename spans in the serialized form of Value #11972
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Span fields were previously renamed to `internal_span` to discourage their use in Rust code, but this change also affected the serde I/O for Value. I don't believe the Python plugin was ever updated to reflect this change. This effectively changes it back, but just for the serialized form. There are good reasons for doing this: 1. `internal_span` is a much longer name, and would be one of the most common strings found in serialized Value data, probably bulking up the plugin I/O 2. This change was never really meant to have implications for plugins, and was just meant to be a hint that `.span()` should be used instead in Rust code. When Span refactoring is complete, the serialized form of Value will probably change again in some significant way, so I think for now it's best that it's left like this. This has implications for nushell#11911, particularly for documentation and for the Python plugin as that was already updated in that PR to reflect `internal_span`. If this is merged first, I will update that PR. This would probably be considered a breaking change as it would break plugin I/O compatibility (but not Rust code). I think it can probably go in any major release though - all things considered, it's pretty minor, and users are already expected to recompile plugins for new major versions. However, it may also be worth holding off to do it together with nushell#11911 as that PR makes breaking changes in general a little bit friendlier.
fdncred
added
pr:breaking-change
This PR implies a change affecting users and has to be noted in the release notes
pr:language
This PR makes some language changes
labels
Feb 25, 2024
Thanks! |
kik4444
pushed a commit
to kik4444/nushell-fork
that referenced
this pull request
Feb 28, 2024
[Discord context](https://discord.com/channels/601130461678272522/615962413203718156/1211158641793695744) <!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> Span fields were previously renamed to `internal_span` to discourage their use in Rust code, but this change also affected the serde I/O for Value. I don't believe the Python plugin was ever updated to reflect this change. This effectively changes it back, but just for the serialized form. There are good reasons for doing this: 1. `internal_span` is a much longer name, and would be one of the most common strings found in serialized Value data, probably bulking up the plugin I/O 2. This change was never really meant to have implications for plugins, and was just meant to be a hint that `.span()` should be used instead in Rust code. When Span refactoring is complete, the serialized form of Value will probably change again in some significant way, so I think for now it's best that it's left like this. This has implications for nushell#11911, particularly for documentation and for the Python plugin as that was already updated in that PR to reflect `internal_span`. If this is merged first, I will update that PR. This would probably be considered a breaking change as it would break plugin I/O compatibility (but not Rust code). I think it can probably go in any major release though - all things considered, it's pretty minor, and users are already expected to recompile plugins for new major versions. However, it may also be worth holding off to do it together with nushell#11911 as that PR makes breaking changes in general a little bit friendlier. # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> Requires plugin recompile. # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use std testing; testing run-tests --path crates/nu-std"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> - 馃煝 `toolkit fmt` - 馃煝 `toolkit clippy` - 馃煝 `toolkit test` - 馃煝 `toolkit test stdlib` Nothing outside of `Value` itself had to be changed to make tests pass. I did not check the Python plugin and whether it works now, but it was broken before. It may work again as I think the main incompatibility it had was expecting to use `span` # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
pr:breaking-change
This PR implies a change affecting users and has to be noted in the release notes
pr:language
This PR makes some language changes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Discord context
Description
Span fields were previously renamed to
internal_span
to discourage their use in Rust code, but this change also affected the serde I/O for Value. I don't believe the Python plugin was ever updated to reflect this change.This effectively changes it back, but just for the serialized form. There are good reasons for doing this:
internal_span
is a much longer name, and would be one of the most common strings found in serialized Value data, probably bulking up the plugin I/OThis change was never really meant to have implications for plugins, and was just meant to be a hint that
.span()
should be used instead in Rust code.When Span refactoring is complete, the serialized form of Value will probably change again in some significant way, so I think for now it's best that it's left like this.
This has implications for #11911, particularly for documentation and for the Python plugin as that was already updated in that PR to reflect
internal_span
. If this is merged first, I will update that PR.This would probably be considered a breaking change as it would break plugin I/O compatibility (but not Rust code). I think it can probably go in any major release though - all things considered, it's pretty minor, and users are already expected to recompile plugins for new major versions. However, it may also be worth holding off to do it together with #11911 as that PR makes breaking changes in general a little bit friendlier.
User-Facing Changes
Requires plugin recompile.
Tests + Formatting
toolkit fmt
toolkit clippy
toolkit test
toolkit test stdlib
Nothing outside of
Value
itself had to be changed to make tests pass. I did not check the Python plugin and whether it works now, but it was broken before. It may work again as I think the main incompatibility it had was expecting to usespan
After Submitting