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

Migrating to Yazi v0.4.0 #1772

Closed
sxyazi opened this issue Oct 13, 2024 · 8 comments
Closed

Migrating to Yazi v0.4.0 #1772

sxyazi opened this issue Oct 13, 2024 · 8 comments
Labels
feature New feature request

Comments

@sxyazi
Copy link
Owner

sxyazi commented Oct 13, 2024

Yazi v0.4 release note: https://github.com/sxyazi/yazi/releases/tag/v0.4.0

If you encounter any issues during the upgrade, please create a discussion and upload your logs.

TOC

1. Reserve the term select for future use

See #1773 for details.

1.1 - Renamed select command to toggle

# keymap.toml
[manager]
- { on = "<Space>", run = "select --state=none" },
+ { on = "<Space>", run = "toggle" },
# keymap.toml
[manager]
- { on = "<C-r>", run = "select_all --state=none" },
+ { on = "<C-r>", run = "toggle_all" },

- { on = "<C-a>", run = "select_all --state=true" },
+ { on = "<C-a>", run = "toggle_all --state=on" },

The documentation is now available for the two new commands: toggle command and toggle_all command.

1.2 - Renamed the select component to pick component

# yazi.toml / keymap.toml / theme.toml
- [select]
+ [pick]

2. Correct the misuse of the term ctime and unify others

See #1761 for details.

2.1 - Renamed ctime to btime for the linemode command

# keymap.toml
[manager]
- { on = [ "m", "c" ], run = "linemode ctime"  }
+ { on = [ "m", "b" ], run = "linemode btime" }

2.2 - Renamed created to btime, modified to mtime for the sort_by option

# yazi.toml
[manager]
- sort_by = "created"
+ sort_by = "btime"

- sort_by = "modified"
+ sort_by = "mtime"

2.3 - Renamed created to btime, modified to mtime for the sort command

# keymap.toml
[manager]
- { on = [ ",", "c" ], run = "sort created" }
+ { on = [ ",", "b" ], run = "sort btime" },

- { on = [ ",", "m" ], run = "sort modified" }
+ { on = [ ",", "m" ], run = "sort mtime" }

3. Remove the x- prefix from mimetypes to unify behavior across different versions of file(1)

See #1927 for details.

# yazi.toml
[open]
- { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "red" },
+ { mime = "application/{tar,bzip*,7z-compressed,xz,rar}", fg = "red" },
# theme.toml
[filetype]
- { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "red" },
+ { mime = "application/{tar,bzip*,7z-compressed,xz,rar}", fg = "red" },

4. Deprecate the --sync option for the plugin command

See #1891 for details.

# keymap.toml
[manager]
- plugin --sync my-sync-plugin
+ plugin my-sync-plugin

5. Remove the meaningless --confirm option to simplify the shell command

See #1982 for details.

# keymap.toml
[manager]
- shell "$SHELL" --block --confirm
+ shell "$SHELL" --block
@sxyazi sxyazi added the feature New feature request label Oct 13, 2024
@sxyazi sxyazi pinned this issue Oct 13, 2024
@sxyazi
Copy link
Owner Author

sxyazi commented Nov 1, 2024

Lua API breaking changes

1. Renamed the created, modified, accessed, length, and permissions properties of the Cha

  • created => btime
  • modified => mtime
  • accessed => atime
  • length => len
  • permissions => perm

Note that the old names are still available, but a deprecation warning will shown — they will be completely removed in the next major version 0.4.2. See #1761 for details.

2. Task information for peek()/seek()/preload() has been moved from self to the job parameter

Before:

function M:peek()
  ya.err("area:", self.area)
  ya.err("file:", self.file)
  ya.err("skip:", self.skip)
end

Now:

function M:peek(job)
  ya.err("area:", job.area)
  ya.err("file:", job.file)
  ya.err("skip:", job.skip)
end

These properties can still be accessed via self, but a deprecation warning will be shown. This compatibility layer will be fully removed in Yazi 0.4.2. See #1966 for details.

3. The first parameter of entry() has been replaced with the new job parameter

Before:

function M:entry(args)
  ya.err("first arg:", args[1])
end

Now:

function M:entry(job)
  ya.err("first arg:", job.args[1])
end

The new job can still be used just like the original args (like job[1] or ipairs(job)), but a deprecation warning will be shown. This compatibility layer will be fully removed in Yazi 0.4.2. See #1966 for details.

4. The first parameter of seek() has been changed from a number units to a table job

Before:

function M:seek(units)
  ya.err("units:", units)
end

Now:

function M:seek(job)
  ya.err("units:", job.units)
end

See #1966 for details.

5. Renaming ui.Paragraph to ui.Text

local area = ui.Rect { x=0, y=0, width=10, height=10 }
local lines = { ui.Line("Hello"), ui.Line("World") }

- ui.Paragraph(area, lines):align(ui.Paragraph.RIGHT)
+ ui.Text(lines):area(area):align(ui.Text.RIGHT)
- ui.Paragraph.parse("Hello world")
+ ui.Text.parse("Hello world")

The old ui.Paragraph is still available, but it will show a deprecation warning. This compatibility layer will be completely removed in version 0.4.2. See #1776 for more details.

6. Removed ui.ListItem

Now, ui.List can directly accept ui.Line objects, without needing to wrap them in ui.ListItem:

local line = ui.Line("Hello world")

- ui.List { ui.ListItem(line) }
+ ui.List { line }

See #1776 for more details.

7. Decoupling ui.List, ui.Bar, ui.Border, and ui.Gauge from coordinates

- ui.List(area, items)
+ ui.List(items):area(area)
- ui.Bar(area, ui.Bar.TOP)
+ ui.Bar(ui.Bar.TOP):area(area)
- ui.Border(area, ui.Border.ALL)
+ ui.Border(ui.Border.ALL):area(area)
- ui.Gauge(area)
+ ui.Gauge():area(area)

See #1782 for more details.

8. Replaced numeric error code with a Error type for better human-readable

See #1939 for details.

@sxyazi
Copy link
Owner Author

sxyazi commented Nov 21, 2024

Packaging

@sxyazi
Copy link
Owner Author

sxyazi commented Dec 2, 2024

Theme system breaking changes

1. Use dark and light instead of use under [flavor] to support auto-switching between light and dark modes

# theme.toml
[flavor]
- use  = "dracula"
+ dark = "dracula"

See #1946 for details.

2. Unify the fg_dark and fg_light into one fg as fg_light is never used and redundant

# theme.toml
[icon]
exts = [
-  { name = "3gp", text = "🎵", fg_dark = "#fd971f", fg_light = "#fd971f" },
+  { name = "3gp", text = "🎵", fg = "#fd971f" },
}

See #1946 for details.

3. Extend the available styles for mode by separating mode from the separator styles

See #1953 for details.

tmeijn pushed a commit to tmeijn/dotfiles that referenced this issue Dec 9, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [sxyazi/yazi](https://github.com/sxyazi/yazi) | minor | `v0.3.3` -> `v0.4.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>sxyazi/yazi (sxyazi/yazi)</summary>

### [`v0.4.0`](https://github.com/sxyazi/yazi/releases/tag/v0.4.0)

[Compare Source](sxyazi/yazi@v0.3.3...v0.4.0)

This is the biggest release ever, with 53 new features, 41 fixes, and 12 performance optimizations.

The main focus of this release is improving the plugin system, and we’ve made some adjustments to certain APIs based on real-world usage to better support future extensibility. This release is a key step in moving the plugin system from BETA to stable!

**This is a breaking change release, so please make sure to read: [Migrating to Yazi v0.4.0](sxyazi/yazi#1772

#### Spotter

sxyazi/yazi#1802 introduces the concept of "spotter". When you "spot" a file, a popup will show up with metadata about that file.

For example, it can display the mime type and size of a regular file, the dimensions and color space of an image, the duration and resolution of a video, or the line count of a code file, etc.

You can easily copy this info with a simple keystroke or quickly swipe through files in the spot window.

What's even cooler is that users can set custom spotters for different file types, and plugin developers can use Lua APIs to build various spotters, just like with previewers!

https://github.com/user-attachments/assets/0e034f6b-f1ec-4e53-8701-57c6f8a218e3

#### Support for Transparent Image Preview

Transparent image previews are now supported in sxyazi/yazi#1556 (Thanks to [@&#8203;diegodorado](https://github.com/diegodorado)), and it works across all 4 image backends Yazi supports (kitty graphics-protocol, Inline images protocol, Sixel graphics format, Überzug++).

![screenshot-002179](https://github.com/user-attachments/assets/1ee9a147-3bc8-4fca-a495-a0ea0bfe84e5)

#### Auto Switch Between Dark and Light Icons/Flavors Based on Terminal Background

sxyazi/yazi#1946 adds dark/light mode support — Yazi will automatically detect your terminal's color scheme and choose the appropriate icon color and flavor.

In `theme.toml`, the `[flavor]` section now includes two new attributes, `dark` and `light`, to allow setting different flavors for light and dark modes:

```toml

### theme.toml
[flavor]
dark  = "dracula"
light = "one-light"
```

#### New `ya emit` and `ya emit-to` Subcommands to Emit Commands to a Specific Instance

Two new subcommands, `ya emit` and `ya emit-to`, have been added to the `ya` CLI tool in sxyazi/yazi#1946.

They allow you to send commands from outside Yazi (e.g., from your shell) to run on a specific Yazi instance for better interactivity.

The new `ya emit` subcommand allows users to send a [command](https://yazi-rs.github.io/docs/configuration/keymap#manager) to the current Yazi instance. The format is:

```sh
ya emit <command> <args>
```

For example:

```sh
ya emit cd /tmp
ya emit reveal /tmp/foo
```

Just like you would write them in your `keymap.toml` file! You can also send commands to a specific remote instance using `ya emit-to`:

```sh
ya emit-to <receiver> <command> <args>
```

For example:

```sh
ya emit-to "$YAZI_ID" cd /tmp
```

#### Support Passing Arguments to Previewer/Preloader/Spotter/Fetcher

With sxyazi/yazi#1979, you can now pass arguments to previewers, preloaders, spotters, and fetchers when configuring them:

```toml

### yazi.toml
[plugin]
prepend_previewers = [
  { mime = "image/*", run = 'my-plugin test --foo --bar=baz' }
]
prepend_preloaders = [
  { mime = "image/*", run = 'my-plugin test --foo --bar=baz' }
]
prepend_spotters = [
  { mime = "image/*", run = 'my-plugin test --foo --bar=baz' }
]
prepend_fetchers = [
  { id = "test", mime = "image/*", run = 'my-plugin test --foo --bar=baz' }
]
```

This makes them much more flexible, meaning the same plugin can behave differently based on different arguments, tailored to the user's preferences!

#### Suggest Keywords in the Header When a Finder Is Active

A new keyword indicator has been added to the header, in sxyazi/yazi#1847, letting users know the current finding state with real-time feedback:

https://github.com/user-attachments/assets/3a1c5ada-db21-458f-996c-ebb8f6dba583

#### Allow Disabling Certain Preset Keybinds with the New `noop` Virtual Command

A new `noop` command has been introduced in sxyazi/yazi#1882:

```toml
[[manager.prepend_keymap]]
on  = [ "g", "c" ]
run = "noop"
```

This allows users to disable specific default keybindings, and the disabled keys won’t appear in the "which key" component or the help menu.

#### Make the Built-in `extract` Plugin Support Compressed Tarballs (`*.tar.gz`, `*.tar.bz2`, etc.)

The built-in extract plugin now has experimental support for extracting compressed tarballs, making it more convenient for users who frequently work with `.tar` files.

Thanks to [@&#8203;DirkFi](https://github.com/DirkFi) for his excellent work on sxyazi/yazi#1583

#### Prioritize Paths That Need to Be Processed First During Bulk Renaming

The bulk renaming feature now has smart conflict resolution, done in sxyazi/yazi#1801 (thanks to [@&#8203;yw1ee](https://github.com/yw1ee)).

For example, if you’re renaming a list of files:

```sh
1
2
3
```

And renaming them to:

```sh
1 -> 2
2 -> 3
3 -> 4
```

Previously, Yazi would stop with an error when trying to rename `1 -> 2` because `2` already exists.

Now, it will intelligently pick files that won’t conflict and process them in order, so in this case, it will rename them like this:

```sh
3 -> 4
2 -> 3
1 -> 2
```

#### Fallback to `CSI 16 t` for Terminals That Don’t Support `TIOCGWINSZ`

All terminals on Windows (MS Terminal, WezTerm for Windows) do not support `TIOCGWINSZ` because [Windows doesn't have `ioctl`](microsoft/terminal#8581).

Some terminals based on `node-pty` also don't support it (like Tabby, VSCode, Hyper, etc.).

sxyazi/yazi#2004 falls back to `CSI 16 t` when `TIOCGWINSZ` is unavailable to provide better image size calculation for previews.

https://github.com/user-attachments/assets/50af66ef-40a8-46f0-b1c7-f09d2dd9fb9d

#### Launch From Preset Settings If the User’s Config Cannot Be Parsed

Now, if Yazi can’t parse your config file because of invalid values, it will ask if you want to launch with the default settings instead of failing to start.

This improves the user experience. Done in sxyazi/yazi#1832

#### Other improvements

These are a few of my favorite features. For a complete list of improvements in Yazi 0.4, check out the full changelog below.

#### What's Changed

-   fix: match icon by extension case-insensitive by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1614
-   refactor: privatize `url` of the `File` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1619
-   perf: introduce URN to speed up large directory file sorting by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1622
-   fix: set `allow-passthrough` always to `all` instead of `on` to prevent overriding a user setting with a higher priority `all` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1626
-   fix: set a dedicated `Mimetype` agency to reconcile regular files and search results by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1627
-   feat: make the builtin `extract` plugin support compressed tarballs (`*.tar.gz`, `*.tar.bz2`, etc.) by [@&#8203;DirkFi](https://github.com/DirkFi) in sxyazi/yazi#1583
-   feat: support transparent image preview by [@&#8203;diegodorado](https://github.com/diegodorado) in sxyazi/yazi#1556
-   perf: avoid unnecessary allocations in base64 encoding of IIP by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1639
-   perf: introduce URN to speed up large directory locating by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1648
-   feat: support setting different input titles for `create --dir`  by [@&#8203;Tyarel8](https://github.com/Tyarel8) in sxyazi/yazi#1650
-   perf: introduce URN to speed up large directory file updates by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1652
-   refactor: ensure that each `Url` contains the full location information by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1659
-   feat: support calling methods in builtin plugins with arbitrary types of arguments (`self` can now be omitted) by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1666
-   feat: add the `area()` API for renderable elements by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1667
-   fix: one file's mime-type changed multiple times without triggering a preview again by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1682
-   fix: `enter` and `leave` commands should treat the search results as regular entities by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1687
-   fix: `magick` previewer for multi-layered image files with `-flatten` argument by [@&#8203;v3natio](https://github.com/v3natio) in sxyazi/yazi#1684
-   feat: improve jemalloc memory efficiency by [@&#8203;dm9pZCAq](https://github.com/dm9pZCAq) in sxyazi/yazi#1689
-   feat: adapt for image preview in the Rio terminal by [@&#8203;raphamorim](https://github.com/raphamorim) in sxyazi/yazi#1690
-   fix: increase the revision when there is a change in `Urn` on updating by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1691
-   feat: allow overriding and rewriting the sync methods of builtin plugins by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1695
-   feat: add more context to error messages by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1701
-   fix: replace control characters to printable characters in plain text preview by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1704
-   feat: async micro task initialization error handling by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1710
-   feat!: make `backspace` command not close the input even when value is empty by [@&#8203;XYenon](https://github.com/XYenon) in sxyazi/yazi#1680
-   feat: reuse the `code` previewer seeking behavior for `json`, `archive`, and `empty` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1721
-   fix: temporarily disable TIFF decoding by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1723
-   refactor: turn `RectRef`, `PaddingRef`, `PositionRef` into `Rect`, `Padding`, `Position` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1730
-   refactor: use `Kgp` instead of `Kitty` since "Kitty" is a terminal emulator not a protocol name by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1732
-   fix: compositors not supported by Überzug Wayland layer, or WSL not with WezTerm should fallback to Chafa by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1735
-   fix: clamp when seeking a non-zero unit between `-1` and `1` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1736
-   fix: upserting operation should handle deleting in edge cases where the source and target URNs are different by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1737
-   refactor: derive the `Into<Opt>` trait with procedural macros to avoid bloat by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1742
-   perf: merge multiple file operations into one to greatly speed up updates in large directories by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1745
-   fix!: introduce a new `btime` term to align `ctime` with Unix by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1761
-   feat: `yazi --debug` supports detecting whether `tmux` is built with `--enable-sixel` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1762
-   refactor: simplify module exports by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1770
-   refactor!: rename the term `select` to `toggle` to reserve `select` for future use by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1773
-   feat!: add `ui.Text`, `ui.Table`, remove `ui.Paragraph` and `ui.ListItem` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1776
-   feat!: decouple `ui.List`, `ui.Bar`, `ui.Border`, and `ui.Gauge` from coordinates by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1782
-   feat: prevent paths from being treated as options in `file` command by [@&#8203;gaesa](https://github.com/gaesa) in sxyazi/yazi#1783
-   refactor: replace `Metadata` with `Cha` in the file scheduler to improve interoperability with `yazi-fs` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1785
-   feat: append the suffix to the end when generating unique filenames for directories, i.e., after not before the extension by [@&#8203;Saru2003](https://github.com/Saru2003) in sxyazi/yazi#1784
-   fix: images were not cleared when closing a tab in front of the current tab by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1792
-   feat: add a compatibility layer for `ui.Paragraph` to help users transition more smoothly to the new `ui.Text` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1794
-   refactor: remove migration code as it's no longer needed and causes errors by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1795
-   feat: custom styles for the `confirm` component by [@&#8203;GrzegorzKozub](https://github.com/GrzegorzKozub) in sxyazi/yazi#1789
-   perf: apply rotate in place to images with orientation by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1807
-   feat: add ICC profile to images for better color accuracy by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1808
-   fix: use std copy function in a blocking thread by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1817
-   feat: allow customizing Zoxide's FZF options with `YAZI_ZOXIDE_OPTS` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1822
-   fix: use a unique `Id` for each tab by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1826
-   feat: launch from preset settings if the user's config cannot be parsed by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1832
-   fix: reset image rendering and skip peeking if the TUI in the background by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1833
-   refactor: add tests for `Pattern::match_path` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1837
-   perf: eliminate all memory reallocations during sorting by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1846
-   feat: suggest keywords in the header if a finder is active by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1847
-   fix: copy the CWD path regardless even if the directory is empty by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1849
-   perf: introduce reflow for the rendering engine by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1863
-   fix: wrong file list offset squeeze when `scrolloff = 0` by [@&#8203;aidancz](https://github.com/aidancz) in sxyazi/yazi#1866
-   refactor: use for loop to generate completions file by [@&#8203;Integral-Tech](https://github.com/Integral-Tech) in sxyazi/yazi#1869
-   fix: use complete rendering instead of partial rendering for no task progress report by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1876
-   refactor: destructure tuples to enhance readability by [@&#8203;Integral-Tech](https://github.com/Integral-Tech) in sxyazi/yazi#1874
-   feat: new `copy --separator` option to allow specifying the path separator by [@&#8203;alan910127](https://github.com/alan910127) in sxyazi/yazi#1877
-   feat: allow disabling certain preset keybinds with the new `noop` virtual command by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1882
-   feat: include package revision hash in `ya pack --list` by [@&#8203;yudai0804](https://github.com/yudai0804) in sxyazi/yazi#1884
-   feat: add a new `tab` parameter for all tab-specific commands to specify which one by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1885
-   feat: support searching with the alias `fdfind` if `fd` cannot be found by [@&#8203;Integral-Tech](https://github.com/Integral-Tech) in sxyazi/yazi#1889
-   feat!: deprecate `--sync` option for the `plugin` command by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1891
-   perf: lazy load `ui`, `ya`, `fs`, and `ps` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1903
-   chore: add `CODE_OF_CONDUCT.md` by [@&#8203;Perfectio07](https://github.com/Perfectio07) in sxyazi/yazi#1911
-   feat: spotter by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1802
-   feat: `noop` for spotters by [@&#8203;boydaihungst](https://github.com/boydaihungst) in sxyazi/yazi#1924
-   fix: show "0/0" instead of "1/0" in empty directories by [@&#8203;Integral-Tech](https://github.com/Integral-Tech) in sxyazi/yazi#1925
-   fix!: eliminate the `x-` prefix in mime-types by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1927
-   refactor: make error messages more user-friendly by [@&#8203;Integral-Tech](https://github.com/Integral-Tech) in sxyazi/yazi#1935
-   refactor: remove unnecessary UI element construction by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1938
-   feat!: use an `Error` userdata instead of a plain error code for I/O errors by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1939
-   feat: new log system by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1945
-   perf: introduce copy-on-write for event system to eliminate all memory reallocations by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1962
-   feat: true custom `mime` fetcher support - using user rules even during open or in watcher by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1976
-   feat: support `assets` installation for the `ya pack` subcommand by [@&#8203;zooeywm](https://github.com/zooeywm) in sxyazi/yazi#1973
-   feat: new `ya emit` and `ya emit-to` subcommands to emit commands to a specified instance for execution by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1979
-   feat: new `load` DDS event by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1980
-   feat!: remove the meaningless `--confirm` option to simplify the `shell` command by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1982
-   feat: move notification from top-right to bottom-right corner to avoid covering content as much as possible by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1984
-   fix: propagate and update the directory node till its first parent when the files of a directory change by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1987
-   fix: missing a repeek on unyanking files in the hovered folder by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1988
-   fix: revise `revision` if the new file list is empty but the previous one was not by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#2003
-   feat: fallback to `CSI 16 t` for certain terminals that do not support `TIOCGWINSZ` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#2004
-   docs: add README for default configuration files by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#2005
-   fix: respect `PREVIEW.image_quality` for the default PDF previewer by [@&#8203;gaesa](https://github.com/gaesa) in sxyazi/yazi#2006
-   fix: introduce own `CWD` instead of `chdir` to avoid potential race conditions by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#2008
-   fix: `backspace --under` didn't map UTF-8 character code points to byte indices by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#2010
-   chore: bump version to 0.4.0 by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#2011

#### New Contributors

-   [@&#8203;DirkFi](https://github.com/DirkFi) made their first contribution in sxyazi/yazi#1583
-   [@&#8203;diegodorado](https://github.com/diegodorado) made their first contribution in sxyazi/yazi#1556
-   [@&#8203;Tyarel8](https://github.com/Tyarel8) made their first contribution in sxyazi/yazi#1650
-   [@&#8203;v3natio](https://github.com/v3natio) made their first contribution in sxyazi/yazi#1684
-   [@&#8203;dm9pZCAq](https://github.com/dm9pZCAq) made their first contribution in sxyazi/yazi#1689
-   [@&#8203;raphamorim](https://github.com/raphamorim) made their first contribution in sxyazi/yazi#1690
-   [@&#8203;Saru2003](https://github.com/Saru2003) made their first contribution in sxyazi/yazi#1784
-   [@&#8203;GrzegorzKozub](https://github.com/GrzegorzKozub) made their first contribution in sxyazi/yazi#1789
-   [@&#8203;aidancz](https://github.com/aidancz) made their first contribution in sxyazi/yazi#1866
-   [@&#8203;alan910127](https://github.com/alan910127) made their first contribution in sxyazi/yazi#1877
-   [@&#8203;yudai0804](https://github.com/yudai0804) made their first contribution in sxyazi/yazi#1884
-   [@&#8203;Perfectio07](https://github.com/Perfectio07) made their first contribution in sxyazi/yazi#1911
-   [@&#8203;boydaihungst](https://github.com/boydaihungst) made their first contribution in sxyazi/yazi#1924

**Full Changelog**: sxyazi/yazi@v0.3.3...v0.4.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
gladevise added a commit to gladevise/dotfiles that referenced this issue Dec 12, 2024
@sxyazi sxyazi mentioned this issue Dec 17, 2024
3 tasks
wekauwau added a commit to wekauwau/yatline-modified-time.yazi that referenced this issue Dec 22, 2024
wekauwau added a commit to wekauwau/yatline-created-time.yazi that referenced this issue Dec 22, 2024
pierreay added a commit to pierreay/eza-preview.yazi that referenced this issue Dec 24, 2024
Fix following error message:
---

Deprecated API:
The `ui.Paragraph` and `ui.ListItem` elements have been deprecated in Yazi
v0.4.
Please use the new `ui.Text` instead, in your `eza-preview.yazi` plugin. See
issue #1772 for details: sxyazi/yazi#1772
pierreay added a commit to pierreay/eza-preview.yazi that referenced this issue Dec 24, 2024
Fix following error message:
---

Deprecated API:
The `ui.Paragraph` and `ui.ListItem` elements have been deprecated in Yazi
v0.4.
Please use the new `ui.Text` instead, in your `eza-preview.yazi` plugin. See
issue #1772 for details: sxyazi/yazi#1772
@pirafrank
Copy link

pirafrank commented Dec 28, 2024

The new job can still be used just like the original args (like job[1] or ipairs(job)), but a deprecation warning will be shown. This compatibility layer will be fully removed in Yazi 0.4.2. See #1966 for details.

Hi @sxyazi, this is not exactly true since job.args behaves differently for shell-style plugin options than it used to, breaking plugins (AnirudhG07/custom-shell.yazi#11 (comment))

This breaking change is not listed or clearly stated above.

edit: add mention

@sxyazi
Copy link
Owner Author

sxyazi commented Dec 28, 2024

Hey @pirafrank

The new job can still be used just like the original args (like job[1] or ipairs(job)), but a deprecation warning will be shown. This compatibility layer will be fully removed in Yazi 0.4.2. See #1966 for details.

This refers to the new job (not job.args) can still be used in the same way as the previous args, ensuring that the old plugin code remains compatible, e.g.:

- function M:entry(args)
+ function M:entry(job)
-  print(args[1])
+  print(job[1])  -- its now a new `Job` type, but the old code still works
end

But when using job[1], a warning will be shown prompting the migration to the new job.args to ensure a smooth transition. The new job.args can be found at the linked issue or the documentation

@pirafrank
Copy link

I see, yet explicitly mentioning in the list the new way to handle the shell-script like options for plugins would have helped. It's good to reference the original issue, but that can't be the only source of truth since it tends to become messy.

Also, it would be better if web docs include the version where something has been introduced, with a link to the list of breaking changes for that version.

In this case, I guess, the whole matter comes from the following:

This compatibility layer will be fully removed in Yazi 0.4.2

One would expect patch version not to have deprecation changes or the compatibility layer removed.

A note for the future. Since yazi is gaining both a user base and a growing community of people developing plugins, I'd rather have removed that layer in 0.5.0 so that users upgrading to 0.4.2+ would not get a different experience than those upgrading to 0.4.0 or 0.4.1.

@sxyazi
Copy link
Owner Author

sxyazi commented Dec 29, 2024

It's good to reference the original issue, but that can't be the only source of truth since it tends to become messy

In the previous 0.3 migration documentation, this was indeed the approach. However, for 0.4, I stopped doing this because 0.4 is the largest version ever, with the most breaking changes. Listing them all in a single thread would have made the thread very lengthy, so I decided to only include a brief summary in the 0.4 migration documentation and link to the corresponding PRs, where the specific reasons for the changes and alternatives are detailed.

it would be better if web docs include the version where something has been introduced

I've always wanted to introduce versioning for the documentation, so users can freely switch between v0.3 and v0.4 in the top-right, and even between subversions like v0.4.0 and v0.4.1, so they can see the differences between versions at any time. I just haven't had time to do it. If you want to explore this idea further or want to help maintain the documentation, please file an issue to let me know.

removed that layer in 0.5.0

This sounds good. The only reason for removing it in the minor version is that Yazi's major version iteration speed is too slow. It took 3 months from 0.2 to 0.3, and another 3 months from 0.3 to 0.4. This seriously affects the progress of Yazi's development. My to-do list has a lot of features I want to add, but they all require breaking changes, so I have to wait and move them to the next major version, 0.5. I think maybe I could speed up the major version iteration.


Note that, this issue is for the migration documentation, and I want to keep it clean. If you have any questions/ideas about specific breaking changes, documentation, or version strategies, please create a separate discussion for them, I'd be happy to discuss them there.

@sxyazi sxyazi closed this as completed Dec 29, 2024
@spenserblack
Copy link

spenserblack commented Dec 29, 2024

One would expect patch version not to have deprecation changes or the compatibility layer removed.

To be fair, while it may be surprising, I don't think it's completely unexpected for v0 to be unstable. While many people follow the the convention 0.MAJOR.MINOR+PATCH

Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

Source: semver.org

So I don't think the maintainer did anything wrong here.


One thing that can help with documenting breaking changes is to tag all of your PRs with the labels breaking, minor, and patch (of course, feel free to use different labels depending on what makes sense). Then you can create a .github/release.yml file to categorize PR titles based on their labels. Here's an example .github/release.yml and an example of how a release might look. It's much easier than trying to document changes manually IMO, but the trade-off is you need to make sure your PRs will generate good release notes.

trueNAHO pushed a commit to danth/stylix that referenced this issue Jan 3, 2025
…719)

Add a testbed and resolve the 0.4.0 breaking changes [2] [3] [4].

Migrate the highlight colors to mnemonics with the following script to
improve readability and simplify the process of reusing upstream
templates [4]:

    colors_base=(
      "base08" "base09" "base0A" "base0B" "base0C" "base0D" "base0E"
      "base0F"
    )

    colors_name=(
      "red" "orange" "yellow" "green" "cyan" "blue" "magenta" "brown"
    )

    for i in "${!colors_base[@]}"; do
      sed \
        --in-place \
        "s/${colors_base[i]}/${colors_name[i]}/g" \
        modules/yazi/hm.nix
    done

[1]: sxyazi/yazi#1772
[2]: sxyazi/yazi#1927
[3]: sxyazi/yazi#1953
[4]: https://github.com/yazi-rs/flavors/blob/main/scripts/catppuccin/template.toml

Closes: #604
Closes: #683
Link: #719

Reviewed-by: NAHO <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

3 participants