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

Start 0.96.0 release notes #1472

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
200 changes: 195 additions & 5 deletions blog/2024-07-23-nushell_0_96_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ 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.96.0 of Nu. This release adds...
---

<!-- TODO: complete the excerpt above -->

# Nushell 0.96.0

Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines.

<!-- TODO: write this excerpt -->

Today, we're releasing version 0.96.0 of Nu. This release adds...

# Where to get it
Expand All @@ -21,6 +23,7 @@ Nu 0.96.0 is available as [pre-built binaries](https://github.com/nushell/nushel
As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`.

# Table of content

- [_Highlights and themes of this release_](#highlights-and-themes-of-this-release-toc)
- [_Changes to commands_](#changes-to-commands-toc)
- [_Additions_](#additions-toc)
Expand Down Expand Up @@ -51,6 +54,7 @@ As part of this release, we also publish a set of optional plugins you can insta
-->

# Highlights and themes of this release [[toc](#table-of-content)]

<!-- NOTE: if you wanna write a section about a breaking change, when it's a very important one,
please add the following snippet to have a "warning" banner :)
> see [an example](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0.html#pythonesque-operators-removal)
Expand All @@ -69,20 +73,204 @@ As part of this release, we also publish a set of optional plugins you can insta

## Additions [[toc](#table-of-content)]

### `str deunicode` [[toc](#table-of-content)]

This release adds the `str deunicode` command which will convert unicode characters in a string to ASCII characters ([#13270](https://github.com/nushell/nushell/pull/13270)).

```nushell
> "A…B" | str deunicode
A...B
```

### `chunks` [[toc](#table-of-content)]

The `group` command has been deprecated in favor of the new `chunks` command in [#13377](https://github.com/nushell/nushell/pull/13377). The hope is that the name "chunks" is more descriptive or intuitive compared to "group" so that users can more easily find the command they are looking for. `chunks` behaves exactly like `group` except that it will error if provided a chunk size of zero.

### `watch --quiet` [[toc](#table-of-content)]

https://github.com/nushell/nushell/pull/13415

Thanks to [@Zoybean](https://github.com/Zoybean) in [#13415](https://github.com/nushell/nushell/pull/13415), the `watch` command now has a `--quiet` flag which will prevent the initial watch message from being shown.

### `char nul` [[toc](#table-of-content)]

Thanks to [@weirdan](https://github.com/weirdan) in [#13241](https://github.com/nushell/nushell/pull/13241), the NUL character (0x0) is now available via `char nul`, `char null_byte`, or `char zero_byte`.

## Breaking changes [[toc](#table-of-content)]

### `generate` [[toc](#table-of-content)]

To support default closure parameters, the argument order for `generate` has been reversed. Instead of the initial value followed by the closure, `generate` now takes a closure followed by an initial value ([#13393](https://github.com/nushell/nushell/pull/13393)).

For example, using a closure with a default parameter:

```nushell
> generate {|fib=[0, 1]| { out: $fib.0, next: [$fib.1, ($fib.0 + $fib.1)] } } | skip 2 | take 6
╭───┬────╮
│ 0 │ 1 │
│ 1 │ 2 │
│ 2 │ 3 │
│ 3 │ 5 │
│ 4 │ 8 │
│ 5 │ 13 │
╰───┴────╯
```

### Default column numbering [[toc](#table-of-content)]

The naming for default columns in `from csv`, `from tsv`, and `from ssv` was changed from 1-based indexing to 0-based indexing in [#13209](https://github.com/nushell/nushell/pull/13209) thanks to [@ito-hiroki](https://github.com/ito-hiroki). I.e., instead of:

```nushell
> "foo,bar,baz" | from csv -n
╭───┬─────────┬─────────┬─────────╮
│ # │ column1 │ column2 │ column3 │
├───┼─────────┼─────────┼─────────┤
│ 0 │ foo │ bar │ baz │
╰───┴─────────┴─────────┴─────────╯
```

the columns will now be named:

```nushell
> "foo,bar,baz" | from csv -n
╭───┬─────────┬─────────┬─────────╮
│ # │ column0 │ column1 │ column2 │
├───┼─────────┼─────────┼─────────┤
│ 0 │ foo │ bar │ baz │
╰───┴─────────┴─────────┴─────────╯
```

### `select` [[toc](#table-of-content)]

When providing cell paths with multiple members (e.g., `outer.inner`), the `select` command would name the output column by concatenating each cell path member with an underscore (e.g., `outer_inner`). After [#13361](https://github.com/nushell/nushell/pull/13361), instead of an underscore, a period will be used to concatenate the cell path members (e.g., `outer.inner`).

Before:

```nushell
> { a: { b: 1 } } | select a.b
╭─────┬───╮
│ a_b │ 1 │
╰─────┴───╯
```

After:

```nushell
> { a: { b: 1 } } | select a.b
╭─────┬───╮
│ a.b │ 1 │
╰─────┴───╯
```

### `std path add` [[toc](#table-of-content)]

To be less surprising, [#13258](https://github.com/nushell/nushell/pull/13258) made the `std path add` function no longer resolve symlinks in either the newly added paths, nor expand paths already in the variable. To mimic the previous resolving behavior, you can use, for example, `std path add ("foo/bar" | path expand)`.
To be less surprising, [@t-mart](https://github.com/t-mart) made the `std path add` function no longer resolve symlinks in either the newly added paths, nor expand paths already in the variable ([#13258](https://github.com/nushell/nushell/pull/13258)). To mimic the previous resolving behavior, you can use `path expand`:

```nushell
std path add ("foo/bar" | path expand)
```

### `default` [[toc](#table-of-content)]

Previously, when given a list as input, the `default` command would replace `null` values inside of the list with the default value. This made it impossible to keep input lists intact while also replacing input nulls with a default value. I.e., the transformation from `null | list<null | string>` to `list<null | string>` is now possible after [#13386](https://github.com/nushell/nushell/pull/13386) thanks to [@weirdan](https://github.com/weirdan).

To replace nulls in a list with a default value, you can now use `each` instead:

```nushell
[null, "a", null] | each { default "b" } # [b a b]
```

### `window` [[toc](#table-of-content)]

With [#13401](https://github.com/nushell/nushell/pull/13401), the `window` command will now error if the provided window size is zero. Similarly, `window` will also error if `--stride` is zero.

### `break` and `continue` [[toc](#table-of-content)]

After [#13398](https://github.com/nushell/nushell/pull/13398), `break` and `continue` are no longer allowed inside the `each` and `items` commands. This means `break` and `continue` are now only allowed inside loops (`for`, `while`, and `loop`).

## Deprecations [[toc](#table-of-content)]

### `group` [[toc](#table-of-content)]

See the notes for the new [`chunks` command](#chunks-toc) above.

## Removals [[toc](#table-of-content)]

### `register` [[toc](#table-of-content)]

The long deprecated `register` command has been finally removed in [#13297](https://github.com/nushell/nushell/pull/13297). Instead, please use the `plugin add` command. For more information, see the [release notes for 0.93.0](https://www.nushell.sh/blog/2024-04-30-nushell_0_93_0.html#redesigned-plugin-management-commands-toc).

### `for --numbered` [[toc](#table-of-content)]

The `--numbered` flag on `for` has been removed in [#13239](https://github.com/nushell/nushell/pull/13239) following its deprecation in the last release. See the [previous release notes](https://www.nushell.sh/blog/2024-06-25-nushell_0_95_0.html#for-numbered-toc) for more information.

## Other changes [[toc](#table-of-content)]

### `http` commands [[toc](#table-of-content)]

The data provided to the `http` family of commands (`post`, `put`, `patch`, `delete`) could previously only be supplied as a positional argument. But after [#13254](https://github.com/nushell/nushell/pull/13254), these commands now support taking data as pipeline input. This also means that these commands can now stream the input data over the network!

```nushell
# non-streaming version, content-type is automatically set
open test.json | http post https://httpbin.org/post

# streaming version, content-type needs to be set manually
open --raw test.json | http post -t application/json https://httpbin.org/post
```

### `metadata set --content-type` [[toc](#table-of-content)]

To implement automatic content-type detection, a new metadata field, the `content-type`, was added to pipeline outputs in [#13284](https://github.com/nushell/nushell/pull/13284). This field can be manually set using `metadata set` with the `--content-type` flag. Using this, we could have rewritten the streaming `http post` example above as:

```nushell
open --raw test.json
| metadata set --content-type application/json
| http post https://httpbin.org/post
```

### `to json` [[toc](#table-of-content)] [[toc](#table-of-content)]

Thanks to [@drmason13](https://github.com/drmason13) in [#133523](https://github.com/nushell/nushell/pull/13352), `to json` now places braces on the same line instead of on a new line.

### `into bits` [[toc](#table-of-content)]

With [#13310](https://github.com/nushell/nushell/pull/13310), `into bits` now streams its output if provided a streaming input.

## Bug fixes [[toc](#table-of-content)]

### `find` [[toc](#table-of-content)]

Thanks to [@suimong](https://github.com/suimong) in [#13246](https://github.com/nushell/nushell/pull/13246), the `find` command now preserves the casing of its input. Before, it would output only lower cased text.

### `detect columns --guess` [[toc](#table-of-content)]

`detect columns --guess` would sometimes panic when handling multi-byte unicode characters. This has been fixed in [#13272](https://github.com/nushell/nushell/pull/13272) thanks to [@alex-tdrn](https://github.com/alex-tdrn).

### `do` [[toc](#table-of-content)]

The signature of the `do` command has been fixed in [#13216](https://github.com/nushell/nushell/pull/13216) thanks to [@NotTheDr01ds](https://github.com/NotTheDr01ds). The first parameter is now correctly typed as a `closure` instead of `any`, and this should allow for
better compile-time checks/safety.

### `into datetime` [[toc](#table-of-content)]

Thanks to [@hqsz](https://github.com/hqsz) in [#13289](https://github.com/nushell/nushell/pull/13289), `into datetime` can now take date strings without a timezone in combination with the `--format` flag.

### `from toml` [[toc](#table-of-content)]

Thanks to [@ito-hiroki](https://github.com/ito-hiroki) in [#13315](https://github.com/nushell/nushell/pull/13315), `from toml` now correctly handles toml date values in more cases.

### `help operators` [[toc](#table-of-content)]

With [#13307](https://github.com/nushell/nushell/pull/13307), the output of `help operators` has been updated and fixed. Some of precedence values were previously out of date.

### `into binary` [[toc](#table-of-content)]

In [#13305](https://github.com/nushell/nushell/pull/13305), an issue has been fixed where external command output would still be treated as raw bytes after being passed through `into binary`.

### `take until` [[toc](#table-of-content)]

The input/output types were edited in [#13356](https://github.com/nushell/nushell/pull/13356) to prevent type checking false positives.

<!-- NOTE: to start investigating the contributions of last release, i like to list them all in a raw table.
to achieve this, one can use the [`list-merged-prs` script from `nu_scripts`](https://github.com/nushell/nu_scripts/blob/main/make_release/release-note/list-merged-prs)
as follows:
Expand Down Expand Up @@ -111,6 +299,7 @@ To be less surprising, [#13258](https://github.com/nushell/nushell/pull/13258) m
-->

# All breaking changes [[toc](#table-of-content)]

<!-- TODO:
paste the output of
```nu
Expand All @@ -125,15 +314,16 @@ To be less surprising, [#13258](https://github.com/nushell/nushell/pull/13258) m

Thanks to all the contributors below for helping us solve issues and improve documentation :pray:

| author | title | url |
| ------------------------------------ | ----------- | ------------------------------------------------------- |
| [@author](https://github.com/author) | ... | [#12345](https://github.com/nushell/nushell/pull/12345) |
| author | title | url |
| ------------------------------------ | ----- | ------------------------------------------------------- |
| [@author](https://github.com/author) | ... | [#12345](https://github.com/nushell/nushell/pull/12345) |

# Full changelog [[toc](#table-of-content)]

<!-- TODO:
paste the output of
```nu
./make_release/release-note/get-full-changelog
```
here
-->
-->
5 changes: 5 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[files]
extend-exclude = ["pt-BR", "de", "ja", "es", "blog/202[0-3]*", "commands/"]

[default]
extend-ignore-re = [
"changes_length: fals" # false positive in cookbook/tables.md
]

[default.extend-words]
ons = "ons" # false positive in commands/docs/str_replace.md
ful = "ful" # false positive in commands/docs/str_replace.md
Expand Down