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

Edit 0.94.0 release notes #1412

Merged
Merged
Changes from 1 commit
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
Next Next commit
Write themes of this release
  • Loading branch information
IanManske committed May 26, 2024
commit 2411fa75e322f0d53b61ad9de73ff456dcfc80e5
51 changes: 47 additions & 4 deletions blog/2024-05-28-nushell_0_94_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ Today, we're releasing version 0.94.0 of Nu. This release adds...

Nu 0.94.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.94.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`.

::: tip Note
The optional dataframe functionality is available by `cargo install nu --features=dataframe`.
:::

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
- [*Themes of this release / New features*](#themes-of-this-release-new-features-toc)
- [*Fixing path and CWD handling*](#fixing-path-and-cwd-handling)
- [*Case-preserving environment*](#case-preserving-environment)
- [*Streaming all the things*](#streaming-all-the-things)
- [*New language feature: raw strings*](#new-language-feature-raw-strings)
- [*Removal of deprecated features*](#removal-of-deprecated-features)
- [*Hall of fame*](#hall-of-fame-toc)
- [*Bug fixes*](#bug-fixes-toc)
- [*Enhancing the documentation*](#enhancing-the-documentation-toc)
Expand Down Expand Up @@ -67,6 +68,48 @@ As part of this release, we also publish a set of optional plugins you can insta
for the list of available *containers*
-->

## Fixing path and CWD handling

One of our contributors, [@YizhePKU](https://github.com/YizhePKU), has started an effort to refactor how Nushell internally handles the current working directory and paths in general. Namely, Nushell aggressively canonicalizes paths instead of using logical paths which can lead to unintuitive or annoying behavior ([#2175](https://github.com/nushell/nushell/issues/2175)). Thanks to their work, `$env.CWD` and the `pwd` now support logical paths. With time, we intend to make similar to changes to other commands to make them more intuitive and consistent with the rest of Nushell. Another goal with these changes is to eliminate bugs in commands, as some commands incorrectly use the Nushell process's current working directory instead of `$env.CWD`. So far, the `grid`, `path type`, and `touch --reference` commands have been fixed, and we are aiming to bring more fixes in the next release. We kindly ask for your patience as we rework this part of Nushell, and we would appreciate if you would report any issues you encounter!

## Case-preserving environment

::: warning Breaking change
See a full overview of the [breaking changes](#breaking-changes)
:::

In an effort to allow more ergonomic cross-platform scripting, we have changed the environment in
Nushell to be case-preserving ([#12701](https://github.com/nushell/nushell/pull/12701)). That is, environment variables keep their initial casing but can be accessed in a case-insensitive manner within Nushell. This means that accessing `$env.PATH` or `$env.Path` will now work on both unix-based systems and Windows systems. To get environment variables in a case-sensitive manner, you can use `get -s`.
```nushell
$env | get -s PATH
```
Please note that there are still a few things that have to be ironed out with this new behavior. For example, it is currently unclear what `load-env { FOO: BAR, foo: bar }` should do. So, there may be more changes in the near future.

## Streaming all the things

Another major effort with this release was to make streaming more consistent and widespread ([#12774](https://github.com/nushell/nushell/pull/12774), [#12897](https://github.com/nushell/nushell/pull/12897), [#12918](https://github.com/nushell/nushell/pull/12918), and more). For example, Nushell now passes operating system pipe descriptors directly to external commands, meaning there should be an improvement to throughput for some pipelines. Additionally, several commands were reworked so that they are now able to stream their output in more cases instead of having to collect it all in memory beforehand. The commands in question include `from csv`, `to csv`, `from tsv`, `to tsv`, `from json --objects`, `take`, `skip`, `first`, `last`, `bytes ends-with`, `bytes collect`, `str join`, `into string`, and `into binary`. Of course, the plan is to add more commands to this list in the future, so this is only the beginning!

## New language feature: raw strings

This release adds a new type of string literal to the language: raw strings ([#9956](https://github.com/nushell/nushell/pull/9956)). These are just like single quoted strings, except that raw strings may also contain single quotes. This is possible, since raw strings are enclosed by a starting `r#'` and an ending `'#`. This syntax should look familiar to users of Rust.
```nushell
r#'some text'# == 'some text' # true

r#'contains 'quoted' text'# == "contains 'quoted' text"
```
Additional `#` symbols can be added to the start and end of the raw string to enclose one less than the same number of `#` symbols next to a `'` symbol in the string.
```nushell
r###'this text has multiple '## symbols'###
```

## Removal of deprecated features

::: warning Breaking change
See a full overview of the [breaking changes](#breaking-changes)
:::

Last release, we deprecated the dataframe commands and feature in favor of the new polars plugin. See the [previous release notes](https://www.nushell.sh/blog/2024-04-30-nushell_0_93_0.html#introduction-of-the-polars-plugin-toc) for more information and migration steps. In this release, the dataframe commands have been removed as planned alongside the `dataframes` cargo feature. Similarly, this release removes lazy records from the language following their deprecation. This includes the removal of the `lazy make` command and the `--collect-lazyrecords` flag on `describe`. One consequence of this change is that the `sys` command will now return a regular record and will take a minimum of 400ms to complete (to sample CPU usage). As such, the `sys` command has been deprecated, and new subcommands have been added in its place (`sys mem`, `sys cpu`, `sys host`, `sys disks`, `sys net`, `sys temps`, and `sys users`).

## Hall of fame [[toc](#table-of-content)]
### Bug fixes [[toc](#table-of-content)]
Thanks to all the contributors below for helping us solve issues and bugs :pray:
Expand Down