Skip to content

Commit

Permalink
Add notes for (most) of my PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
IanManske committed Dec 15, 2024
1 parent ba9f36b commit ec3cebb
Showing 1 changed file with 66 additions and 7 deletions.
73 changes: 66 additions & 7 deletions blog/2024-12-24-nushell_0_101_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,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<string>
```

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
```

<!-- A helpful error message will be shown if you try to use `++` to append a value to a list.
TODO: waiting on #14429
-->

### `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
Expand Down Expand Up @@ -84,14 +139,18 @@ Thanks to all the contributors below for helping us solve issues, improve docume
<!-- | [@Bahex](https://github.com/Bahex) | lsp and --ide-check fix for `path self` related diagnostics | [#14538](https://github.com/nushell/nushell/pull/14538) | -->
<!-- | [@Beinsezii](https://github.com/Beinsezii) | command/http/client use CRLF for headers join instead of LF | [#14417](https://github.com/nushell/nushell/pull/14417) | -->
<!-- | [@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) | 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) | Make `Hooks` fields non-optional to match the new config defaults | [#14345](https://github.com/nushell/nushell/pull/14345) | -->
<!-- | [@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) | -->

| [@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) | -->
<!-- | [@NotTheDr01ds](https://github.com/NotTheDr01ds) | Load `default_env.nu`/`default_config.nu` before user `env.nu`/`config.nu` | [#14249](https://github.com/nushell/nushell/pull/14249) | -->
<!-- | [@NotTheDr01ds](https://github.com/NotTheDr01ds) | Deprecate `date to-record` and `date to-table` | [#14319](https://github.com/nushell/nushell/pull/14319) | -->
Expand Down

0 comments on commit ec3cebb

Please sign in to comment.