diff --git a/blog/2024-12-24-nushell_0_101_0.md b/blog/2024-12-24-nushell_0_101_0.md index 6caa61d6385..b3751b50fdb 100644 --- a/blog/2024-12-24-nushell_0_101_0.md +++ b/blog/2024-12-24-nushell_0_101_0.md @@ -5,6 +5,7 @@ author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png excerpt: Today, we're releasing version 0.101.0 of Nu. This release adds... --- + @@ -12,6 +13,7 @@ excerpt: Today, we're releasing version 0.101.0 of Nu. This release adds... # Nushell 0.101.0 + Today, we're releasing version 0.101.0 of Nu. This release adds... # Where to get it @@ -46,8 +48,63 @@ As part of this release, we also publish a set of optional plugins you can insta ## Breaking changes +### `++` operator + +The `++` operator previously performed both appending and concatenation. + +```nu +# Appending +[1 2 3] ++ 4 == [1 2 3 4] + +# Concatenation +[1 2 3] ++ [4 5 6] == [1 2 3 4 5 6] +``` + +This created ambiguity when operating on nested lists: + +```nu +[[1 2] [3 4]] ++ [5 6] +# Should this be [[1 2] [3 4] [5 6]] or [[1 2] [3 4] 5 6] ? +``` + +Additionally, the `++=` operator was able to change the type of a mutable a due to its dual role: + +```nu +mut str: string = 'hello ' +($str | describe) == string + +$str ++= ['world'] +($str | describe) == list +``` + +After [#14344](https://github.com/nushell/nushell/pull/14344), the `++` operator now only performs concatenation (between lists, strings, or binary values). To append a value to a list, either wrap the value in a list or use the `append` command. + +```nu +mut list = [1 2] +$list ++= [3] +$list = $list | append 4 +``` + + + +### `timeit` + +The `timeit` command previously had a special behavior where expressions passed as arguments would have their evaluation deferred in order to later be timed. This lead to an interesting bug ([14401](https://github.com/nushell/nushell/issues/14401)) where the expression would be evaluated twice, since the new IR evaluator eagerly evaluates arguments passed to commands. + +To make the deferred evaluation more explicit, the `timeit` command can now only take a closure as an argument instead of any expression or value ([#14483](https://github.com/nushell/nushell/pull/14483)). Additionally, blocks are no longer supported by `timeit`, so any changes to the environment will be isolated to inside the closure. + +### `sys cpu` + +The `cpu_usage` column outputted by `sys cpu` works by sampling the CPU over a 400ms period. This wait long time is unhelpful if you are only interested in other information about the CPU like the number of cores (i.e., `sys cpu | length`). With [#14485](https://github.com/nushell/nushell/pull/14485), the `cpu_usage` column is now gated behind the `--long` flag. This way, `sys cpu` will take around 0-2ms instead of 400ms by default. + ## Deprecations +### `split-by` + +In [#14019](https://github.com/nushell/nushell/pull/14019), the `split-by` command was deprecated. Instead, please use `group-by` with multiple groupers. + ## Removals ## Bug fixes and other changes @@ -58,18 +115,204 @@ As part of this release, we also publish a set of optional plugins you can insta Thanks to all the contributors below for helping us solve issues, improve documentation, refactor code, and more! :pray: -| author | title | link | -| ------------------------------------ | ----------- | ------------------------------------------------------- | -| [@author](https://github.com/author) | ... | [#12345](https://github.com/nushell/nushell/pull/12345) | +| author | title | link | +| -------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------- | +| [@132ikl](https://github.com/132ikl) | Change tests which may invoke externals to use non-conflicting names | [#14516](https://github.com/nushell/nushell/pull/14516) | +| [@Bahex](https://github.com/Bahex) | docs(reduce): add example demonstrating accumulator as pipeline input | [#14593](https://github.com/nushell/nushell/pull/14593) | +| [@DziubaMaksym](https://github.com/DziubaMaksym) | fix: sample_config | [#14465](https://github.com/nushell/nushell/pull/14465) | +| [@Jasha10](https://github.com/Jasha10) | enable test_cp_recurse on macos | [#14358](https://github.com/nushell/nushell/pull/14358) | +| [@Kissaki](https://github.com/Kissaki) | Fix doc and code comment typos | [#14366](https://github.com/nushell/nushell/pull/14366) | +| [@PegasusPlusUS](https://github.com/PegasusPlusUS) | Fix unstable test case: One time my windows report drive letter as lowercase | [#14451](https://github.com/nushell/nushell/pull/14451) | +| [@alex-kattathra-johnson](https://github.com/alex-kattathra-johnson) | Shorten --max-time in tests and use a more stable error check | [#14494](https://github.com/nushell/nushell/pull/14494) | +| [@cptpiepmatz](https://github.com/cptpiepmatz) | Fix missing `installed_plugins` field in `version` command | [#14488](https://github.com/nushell/nushell/pull/14488) | +| [@maxim-uvarov](https://github.com/maxim-uvarov) | rewrite error message to not use the word `function` | [#14533](https://github.com/nushell/nushell/pull/14533) | +| [@sgvictorino](https://github.com/sgvictorino) | skip `test_iteration_errors` if `/root` is missing | [#14299](https://github.com/nushell/nushell/pull/14299) | # Full changelog +| author | title | link | +| ------ | ----- | ---- | + + + + + + + +|[@132ikl](https://github.com/132ikl)|Change tests which may invoke externals to use non-conflicting names|[#14516](https://github.com/nushell/nushell/pull/14516)| + + + + + +|[@Bahex](https://github.com/Bahex)|fix(group-by): re #14337 name collision prevention|[#14360](https://github.com/nushell/nushell/pull/14360)| + + + + + + + +|[@Bahex](https://github.com/Bahex)|docs(reduce): add example demonstrating accumulator as pipeline input|[#14593](https://github.com/nushell/nushell/pull/14593)| + + + + +|[@DziubaMaksym](https://github.com/DziubaMaksym)|fix: sample_config|[#14465](https://github.com/nushell/nushell/pull/14465)| +|[@IanManske](https://github.com/IanManske)|Deprecate `split-by` command|[#14019](https://github.com/nushell/nushell/pull/14019)| +|[@IanManske](https://github.com/IanManske)|Change append operator to concatenation operator|[#14344](https://github.com/nushell/nushell/pull/14344)| + + + +|[@IanManske](https://github.com/IanManske)|Add `Filesize` type|[#14369](https://github.com/nushell/nushell/pull/14369)| +|[@IanManske](https://github.com/IanManske)|Remove `ListStream` type|[#14425](https://github.com/nushell/nushell/pull/14425)| +|[@IanManske](https://github.com/IanManske)|Make `timeit` take only closures as an argument|[#14483](https://github.com/nushell/nushell/pull/14483)| +|[@IanManske](https://github.com/IanManske)|Remove duplicate implementations of `CallExt::rest`|[#14484](https://github.com/nushell/nushell/pull/14484)| +|[@IanManske](https://github.com/IanManske)|Add `--long` flag for `sys cpu`|[#14485](https://github.com/nushell/nushell/pull/14485)| +|[@Jasha10](https://github.com/Jasha10)|enable test_cp_recurse on macos|[#14358](https://github.com/nushell/nushell/pull/14358)| +|[@Kissaki](https://github.com/Kissaki)|Fix doc and code comment typos|[#14366](https://github.com/nushell/nushell/pull/14366)| + + + + + + +|[@NotTheDr01ds](https://github.com/NotTheDr01ds)|Fix small typos in std/dirs|[#14422](https://github.com/nushell/nushell/pull/14422)| + + + +|[@NotTheDr01ds](https://github.com/NotTheDr01ds)|Remove long-unused `autoenv` tests|[#14436](https://github.com/nushell/nushell/pull/14436)| +|[@NotTheDr01ds](https://github.com/NotTheDr01ds)|Add example for PROMPT_COMMAND_RIGHT|[#14439](https://github.com/nushell/nushell/pull/14439)| +|[@NotTheDr01ds](https://github.com/NotTheDr01ds)|Bump reedline to current main|[#14455](https://github.com/nushell/nushell/pull/14455)| +|[@NotTheDr01ds](https://github.com/NotTheDr01ds)|Update default-files README|[#14461](https://github.com/nushell/nushell/pull/14461)| + + + + + + + +|[@NotTheDr01ds](https://github.com/NotTheDr01ds)|Update sample and scaffold files|[#14568](https://github.com/nushell/nushell/pull/14568)| + + + +|[@PegasusPlusUS](https://github.com/PegasusPlusUS)|Fix unstable test case: One time my windows report drive letter as lowercase|[#14451](https://github.com/nushell/nushell/pull/14451)| + + + + +|[@WindSoilder](https://github.com/WindSoilder)|Tests: add a test to make sure that function can't use mutable variable|[#14314](https://github.com/nushell/nushell/pull/14314)| +|[@WindSoilder](https://github.com/WindSoilder)|make std help more user friendly|[#14347](https://github.com/nushell/nushell/pull/14347)| + + + + + + + +|[@WindSoilder](https://github.com/WindSoilder)|update miette to 7.3|[#14454](https://github.com/nushell/nushell/pull/14454)| +|[@WindSoilder](https://github.com/WindSoilder)|update unicode-width to 0.2|[#14456](https://github.com/nushell/nushell/pull/14456)| +|[@WindSoilder](https://github.com/WindSoilder)|run `cargo update` manually to update dependencies|[#14569](https://github.com/nushell/nushell/pull/14569)| +|[@alex-kattathra-johnson](https://github.com/alex-kattathra-johnson)|Shorten --max-time in tests and use a more stable error check|[#14494](https://github.com/nushell/nushell/pull/14494)| +|[@amtoine](https://github.com/amtoine)|add `from ndnuon` and `to ndnuon` to stdlib|[#14334](https://github.com/nushell/nushell/pull/14334)| +|[@amtoine](https://github.com/amtoine)|fix multiline strings in NDNUON|[#14519](https://github.com/nushell/nushell/pull/14519)| + + + +|[@app/dependabot](https://github.com/app/dependabot)|Bump crate-ci/typos from 1.27.0 to 1.27.3|[#14321](https://github.com/nushell/nushell/pull/14321)| +|[@app/dependabot](https://github.com/app/dependabot)|Bump serial_test from 3.1.1 to 3.2.0|[#14325](https://github.com/nushell/nushell/pull/14325)| +|[@app/dependabot](https://github.com/app/dependabot)|Bump tempfile from 3.13.0 to 3.14.0|[#14326](https://github.com/nushell/nushell/pull/14326)| +|[@app/dependabot](https://github.com/app/dependabot)|Bump mockito from 1.5.0 to 1.6.1|[#14336](https://github.com/nushell/nushell/pull/14336)| +|[@app/dependabot](https://github.com/app/dependabot)|Bump terminal_size from 0.3.0 to 0.4.0|[#14393](https://github.com/nushell/nushell/pull/14393)| +|[@app/dependabot](https://github.com/app/dependabot)|Bump thiserror from 1.0.69 to 2.0.3|[#14394](https://github.com/nushell/nushell/pull/14394)| +|[@app/dependabot](https://github.com/app/dependabot)|Bump shadow-rs from 0.35.2 to 0.36.0|[#14396](https://github.com/nushell/nushell/pull/14396)| +|[@app/dependabot](https://github.com/app/dependabot)|Bump crate-ci/typos from 1.27.3 to 1.28.1|[#14447](https://github.com/nushell/nushell/pull/14447)| +|[@app/dependabot](https://github.com/app/dependabot)|Bump crate-ci/typos from 1.28.1 to 1.28.2|[#14503](https://github.com/nushell/nushell/pull/14503)| +|[@app/dependabot](https://github.com/app/dependabot)|Bump indexmap from 2.6.0 to 2.7.0|[#14505](https://github.com/nushell/nushell/pull/14505)| +|[@app/dependabot](https://github.com/app/dependabot)|Bump multipart-rs from 0.1.11 to 0.1.13|[#14506](https://github.com/nushell/nushell/pull/14506)| +|[@app/dependabot](https://github.com/app/dependabot)|Bump ureq from 2.10.1 to 2.12.0|[#14507](https://github.com/nushell/nushell/pull/14507)| +|[@app/dependabot](https://github.com/app/dependabot)|Bump bytes from 1.8.0 to 1.9.0|[#14508](https://github.com/nushell/nushell/pull/14508)| +|[@app/dependabot](https://github.com/app/dependabot)|Bump scraper from 0.21.0 to 0.22.0|[#14557](https://github.com/nushell/nushell/pull/14557)| +|[@ayax79](https://github.com/ayax79)|Add support for converting polars decimal values to nushell values|[#14343](https://github.com/nushell/nushell/pull/14343)| +|[@ayax79](https://github.com/ayax79)|Upgrading to polars 0.44|[#14478](https://github.com/nushell/nushell/pull/14478)| +|[@ayax79](https://github.com/ayax79)|Convert Filesize to Int|[#14491](https://github.com/nushell/nushell/pull/14491)| +|[@ayax79](https://github.com/ayax79)|Documentation and error handling around `polars with-column --name`|[#14527](https://github.com/nushell/nushell/pull/14527)| +|[@ayax79](https://github.com/ayax79)|Improve handling of columns with null values|[#14588](https://github.com/nushell/nushell/pull/14588)| + + + + +|[@cptpiepmatz](https://github.com/cptpiepmatz)|Fix missing `installed_plugins` field in `version` command|[#14488](https://github.com/nushell/nushell/pull/14488)| +|[@cptpiepmatz](https://github.com/cptpiepmatz)|Fix `table` command when targeting WASM|[#14530](https://github.com/nushell/nushell/pull/14530)| + + + + +|[@devyn](https://github.com/devyn)|Turn compile errors into fatal errors|[#14388](https://github.com/nushell/nushell/pull/14388)| + + + + +|[@fdncred](https://github.com/fdncred)|update uutils crates|[#14371](https://github.com/nushell/nushell/pull/14371)| + + + + + +|[@fdncred](https://github.com/fdncred)|remove `terminal_size` crate everywhere it makes sense|[#14423](https://github.com/nushell/nushell/pull/14423)| +|[@fdncred](https://github.com/fdncred)|update rust toolchain to rust 1.81.0|[#14473](https://github.com/nushell/nushell/pull/14473)| + + + + + +|[@fdncred](https://github.com/fdncred)|update to reedline 9eb3c2d|[#14541](https://github.com/nushell/nushell/pull/14541)| + + + +|[@fdncred](https://github.com/fdncred)|tweak polars join for better cross joins|[#14586](https://github.com/nushell/nushell/pull/14586)| +|[@hustcer](https://github.com/hustcer)|Bump to dev version 0.100.1|[#14328](https://github.com/nushell/nushell/pull/14328)| +|[@maxim-uvarov](https://github.com/maxim-uvarov)|rewrite error message to not use the word `function`|[#14533](https://github.com/nushell/nushell/pull/14533)| +|[@michel-slm](https://github.com/michel-slm)|Bump quick-xml to 0.37.0|[#14354](https://github.com/nushell/nushell/pull/14354)| +|[@michel-slm](https://github.com/michel-slm)|Bump titlecase dependency|[#14502](https://github.com/nushell/nushell/pull/14502)| +|[@musicinmybrain](https://github.com/musicinmybrain)|Update rstest from 0.18 to 0.23 (the current version)|[#14350](https://github.com/nushell/nushell/pull/14350)| +|[@musicinmybrain](https://github.com/musicinmybrain)|Update procfs and which dependencies to their latest releases|[#14489](https://github.com/nushell/nushell/pull/14489)| +|[@musicinmybrain](https://github.com/musicinmybrain)|Update roxmltree from 0.19 to 0.20, the latest version|[#14513](https://github.com/nushell/nushell/pull/14513)| + + + + + + +|[@schrieveslaach](https://github.com/schrieveslaach)|Bump Calamine|[#14403](https://github.com/nushell/nushell/pull/14403)| +|[@sgvictorino](https://github.com/sgvictorino)|skip `test_iteration_errors` if `/root` is missing|[#14299](https://github.com/nushell/nushell/pull/14299)| + + + + + + + + +|[@sholderbach](https://github.com/sholderbach)|Cut down unnecessary lint allows|[#14335](https://github.com/nushell/nushell/pull/14335)| +|[@sholderbach](https://github.com/sholderbach)|Remove unused `FlatShape`s `And`/`Or`|[#14476](https://github.com/nushell/nushell/pull/14476)| +|[@sholderbach](https://github.com/sholderbach)|Add `remove` as a search term on `drop` commands|[#14493](https://github.com/nushell/nushell/pull/14493)| +|[@sholderbach](https://github.com/sholderbach)|Improve `sleep` example using multiple durations|[#14520](https://github.com/nushell/nushell/pull/14520)| + + + + +|[@ysthakur](https://github.com/ysthakur)|Avoid recomputing fuzzy match scores|[#13700](https://github.com/nushell/nushell/pull/13700)| + + + +