v0.2.5
sxyazi/yaziv0.2.5Apr 23, 2024by github-actions[bot]
AI Summary
Introduces DDS (Data Distribution Service) for inter-instance communication and state persistence. Performance is improved through optimized icon matching and an async file watcher.
Key Highlights
- DDS (Data Distribution Service) for cross-instance sync
- Performance optimizations reducing CPU overhead for icons
- Reimplemented fzf and zoxide as plugins
New Features
- DDS implementation
- Async file watcher
- fzf and zoxide as plugins
- YAZI_ID environment variable
- is_exec and is_sticky properties
- Placeholder messages for empty directories
- ya send / ya pub CLI commands
Full Release Notes
This version introduces a new [DDS (Data Distribution Service)](https://yazi-rs.github.io/docs/dds) aimed at facilitating communication and state synchronization between multiple Yazi instances, as well as state persistence.
It's built on a client/server architecture (without the need for running additional server processes), and deeply integrates with a Lua-based publish-subscribe model.
It also provides a set of new command-line options for interaction, such as `ya pub`, `ya pub-static`, `yazi --local-events`, `yazi --remote-events`, and currently used for:
- [Cross-process yank-paste](https://yazi-rs.github.io/docs/dds#session.lua)
https://github.com/sxyazi/yazi/assets/17523360/c1e78168-c604-4390-ba55-e990b510baba
- [Change Yazi's `CWD` to `PWD` on subshell exit](https://yazi-rs.github.io/docs/dds#dds.lua)
https://github.com/sxyazi/yazi/assets/17523360/fe571f77-1922-4d72-99f8-3a341c2c9046
- Integration with the new [`yazi.nvim` plugin](https://github.com/mikavilpas/yazi.nvim): subscribing to file deletion, movement, and renaming events through `yazi --local-events` to keep Neovim's buffer/LSP in sync
- `bookmarks.yazi` plugin: Saving bookmarks added by the user through the persistence feature provided by DDS
## Performance optimizations
- Reduced CPU overhead during icon matching: Icon matching accounted for 35.6% of CPU time during rendering, and by changing the matching algorithm, this proportion has been [reduced by ~10%](https://github.com/sxyazi/yazi/pull/908)
- Caching of each matched icon to avoid repeated calculations: By caching icons, further reductions in CPU usage for matching are achieved, as only a few new files that appear when scrolling through panes need to be matched
- Re-implemented the file watcher in an async way: This is the only sync I/O operation besides configuration initialization at startup, which occurs during `cd` and scrolling through the file list. For certain slow external devices, Yazi would experience noticeable lagginess, which has now been addressed, see https://github.com/sxyazi/yazi/pull/877 for more details
## Feature enhancements
- Re-implemented `fzf` and `zoxide` as plugins for [better flexibility](https://github.com/sxyazi/yazi/issues/865): `fzf` and `zoxide` have added more runtime error handling. `zoxide` now supports the new `update_db` feature, which automatically adds Yazi's `CWD` to `zoxide` when navigating. To enable it, add the following to your `init.lua`:
```lua
require("zoxide"):setup {
update_db = true,
}
```
- Maintain the original modification time when copying files
- Support smart case for `cd` path completion
- Add placeholder messages when there are no files in the directory
- Preserve the order of file selection when performing `open`, `shell`, or bulk rename on multiple selected files
- Prevent copying a directory to itself
The plugin system has also seen some improvements:
- `ya.dbg()` and `ya.err()` now support printing any type of data
- New [`ps` API](https://yazi-rs.github.io/docs/plugins/utils#ps) as a carrier for DDS interaction
- `ya.manager_emit()` now supports passing `Url` type
## What's Changed
* fix: use `BTreeSet` for selected files to maintain order by @sxyazi in https://github.com/sxyazi/yazi/pull/799
* refactor: wrap `Opener` with `Cow` to avoid unnecessary memory reallocations when opening files by @sxyazi in https://github.com/sxyazi/yazi/pull/805
* fix: respond to the `SIGTERM` signal even when Yazi is in the background and has passed control of the terminal to the spawned process by @sxyazi in https://github.com/sxyazi/yazi/pull/797
* refactor: switch to `stderr` by @sxyazi in https://github.com/sxyazi/yazi/pull/819
* feat: fix all dependencies to specific version numbers to allow non-`--locked` builds by @sxyazi in https://github.com/sxyazi/yazi/pull/821
* fix: adjust calculation for number of lines in a notification message by @Rolv-Apneseth in https://github.com/sxyazi/yazi/pull/828
* fix: disable ANSI encoding for formatted events for the `tracing_subscriber` to clean up the logs by @Rolv-Apneseth in https://github.com/sxyazi/yazi/pull/832
* feat: enhance the `ya.dbg()` and `ya.err()` debugging functions by @sxyazi in https://github.com/sxyazi/yazi/pull/835
* perf: accelerate kitty graphics protocol encoding by avoiding string reallocation by @sxyazi in https://github.com/sxyazi/yazi/pull/837
* fix: mime-type for xz archives by @sxyazi in https://github.com/sxyazi/yazi/pull/841
* feat: time-based selection order preservation by @sxyazi in https://github.com/sxyazi/yazi/pull/843
* feat: add support for `YAZI_FILE_ONE` to the built-in `file` previewer by @sxyazi in https://github.com/sxyazi/yazi/pull/846
* fix: Windows `cmd.exe` not responding to correct CSI sequences due to ConPTY by @sxyazi in https://github.com/sxyazi/yazi/pull/845
* perf: add `BufWriter` to `Stderr` to avoid frequent system calls and increase rendering frame rate by @sxyazi in https://github.com/sxyazi/yazi/pull/849
* feat: DDS (Data Distribution Service) by @sxyazi in https://github.com/sxyazi/yazi/pull/826
* perf: port `require()` and `ya.sync()` to Rust to avoid plugin information initialization process by @sxyazi in https://github.com/sxyazi/yazi/pull/853
* feat: readable toml parsing error by @SoloJacobs in https://github.com/sxyazi/yazi/pull/854
* feat: add a new `sender` property to the DDS payload by @sxyazi in https://github.com/sxyazi/yazi/pull/855
* feat: the `cd` event in DDS will now also be triggered when the tab is first created by @sxyazi in https://github.com/sxyazi/yazi/pull/861
* feat: detect CSI u through `Stderr` to allow using `Stdout` as the carrier of DDS payload without an ANSI sequence response timeout by @sxyazi in https://github.com/sxyazi/yazi/pull/867
* fix: a race condition in DDS static messages sent as internal events by @sxyazi in https://github.com/sxyazi/yazi/pull/868
* feat: add `is_exec` and `is_sticky` to `Cha` bindings by @sxyazi in https://github.com/sxyazi/yazi/pull/875
* perf: re-implement file watcher in an async way by @sxyazi in https://github.com/sxyazi/yazi/pull/877
* fix: CJK text rendering issue where the input popup component overlaps with images by @sxyazi in https://github.com/sxyazi/yazi/pull/879
* feat: re-implement `fzf` as a built-in plugin by @sxyazi in https://github.com/sxyazi/yazi/pull/884
* feat: add new `--orphan` option to the `shell` command by @sxyazi in https://github.com/sxyazi/yazi/pull/887
* fix: file list expansion arguments (`$@`, `$*`) of shell command under opener rules are out of order by @sxyazi in https://github.com/sxyazi/yazi/pull/890
* feat: add new `move`, `trash`, and `delete` event kinds to DDS by @mikavilpas in https://github.com/sxyazi/yazi/pull/880
* feat: add `YAZI_ID` environment variable by @sxyazi in https://github.com/sxyazi/yazi/pull/895
* feat: when there are no files in the list, add a placeholder message by @sxyazi in https://github.com/sxyazi/yazi/pull/900
* feat: add loading state to directories by @sxyazi in https://github.com/sxyazi/yazi/pull/904
* feat: default "Reveal" opener for Linux by @sxyazi in https://github.com/sxyazi/yazi/pull/907
* perf: switch to `globset` to reduce CPU time spent on matching icons by @sxyazi in https://github.com/sxyazi/yazi/pull/908
* feat: trigger path completion with both `/` and `\` on Windows by @ndtoan96 in https://github.com/sxyazi/yazi/pull/909
* feat: add a new `ya send` command to allow standalone client processes to communicate with DDS from the command line by @sxyazi in https://github.com/sxyazi/yazi/pull/913
* feat: allow creating a tab with the startup directory when the `tab_create` command is called without specifying a `path` parameter by @sxyazi in https://github.com/sxyazi/yazi/pull/917
* feat: generate autocomplete script for `ya` command by @sxyazi in https://github.com/sxyazi/yazi/pull/919
* feat: allow opening interactively with the `--chosen-file` flag by @mikavilpas in https://github.com/sxyazi/yazi/pull/920
* fix: rollback ratatui to v0.26.1 to avoid panicking by @sxyazi in https://github.com/sxyazi/yazi/pull/922
* feat: expand the types supported by the event system by @sxyazi in https://github.com/sxyazi/yazi/pull/923
* feat: change status bar percent at 100 to Bot by @AidanV in https://github.com/sxyazi/yazi/pull/930
* fix: prevent pasting a directory into itself by @Rolv-Apneseth in https://github.com/sxyazi/yazi/pull/925
* feat: preserve files' modified at timestamp while copying by @Rolv-Apneseth in https://github.com/sxyazi/yazi/pull/926
* perf: cache each file's icon to avoid redundant calculations at rendering by @sxyazi in https://github.com/sxyazi/yazi/pull/931
* feat: split `ya send` into `ya pub` and `ya pub-static` to make it more ergonomic by @sxyazi in https://github.com/sxyazi/yazi/pull/933
* feat: new builtin `session.lua` plugin by @sxyazi in https://github.com/sxyazi/yazi/pull/940
## New Contributors
* @SoloJacobs made their first contribution in https://github.com/sxyazi/yazi/pull/854
* @mikavilpas made their first contribution in https://github.com/sxyazi/yazi/pull/880
* @AidanV made their first contribution in https://github.com/sxyazi/yazi/pull/930
**Full Changelog**: https://github.com/sxyazi/yazi/compare/v0.2.4...v0.2.5