⚠️ 提示
此版本为 2.21.0 的早期版本,不适用于生产环境。这个版本移除了一些过时 API 和一些不兼容改动,发布此版本的主要目的是为了可以让社区的插件和主题开发者提前适配。具体改动方案请查阅下方的适配列表和破坏性更新列表。
从 2.21.0 开始,Halo 开发环境的最低运行环境为 Java 21。
新特性
- 支持在概览页面配置外部访问地址。 by @JohnNiang in #7459
功能优化
- 编辑器支持为链接设置 搜索引擎忽略链接关系。 by @Nimbus3009 in #7444
- 用户搜索支持根据邮箱地址。 by @liuyiwuqing in #7441
- 优化 Console 和 UC 中数据列表的 UI 在不同尺寸设备下的表现。 by @ruibaby in #7383
问题修复
- 修复因 Locale 解析错误导致无法访问页面的问题。 by @JohnNiang in #7458
依赖更新
- 升级依赖 Spring Boot 至 3.5.0。 by @JohnNiang in #7467
- 升级依赖 Lucene 至 10.2.1。 by @JohnNiang in #7476
开发者相关
- 更新最低运行环境为 Java 21。 by @JohnNiang in #7451
- 添加用户登录/登出事件。 by @liuyiwuqing in #7440
- UI 组件添加
VEntityContainer
组件,以优化数据列表的样式。 by @ruibaby in #7383
适配列表
VEntity 组件
此版本为了优化使用 VEntity
组件渲染的数据列表样式,引入了新的 VEntityContainer
组件,适配方式为在所有 VEntity
组件外使用
VEntityContainer
组件包裹,以下是具体步骤和示例:
升级 @halo-dev/components
包至 2.21.0 版本:
# 临时地址,等待 2.21.0 正式发布之后,可改为 @halo-dev/components@2.21.0
pnpm i https://pkg.pr.new/@halo-dev/components@7383
示例:
<script lang="ts" setup>
import { VEntity, VEntityContainer } from "@halo-dev/components"
</script>
<template>
<VEntityContainer>
<VEntity />
<VEntity />
</VEntityContainer>
</template>
完整更改方式可参考:https://github.com/halo-dev/plugin-feed/pull/66/files
破坏性更新
- 移除过时类
run.halo.app.extension.router.selector.FieldCriteriaPredicateConverter
和
run.halo.app.extension.router.selector.LabelCriteriaPredicateConverter
,推荐用
run.halo.app.extension.router.selector.SelectorConverter
替代。 - 移除过时类
run.halo.app.search.SearchParam
,推荐用run.halo.app.search.SearchOption
替代。 - 移除过时类
run.halo.app.search.post.PostDoc
和run.halo.app.search.post.PostHit
,推荐用
run.halo.app.search.HaloDocument
替代。 - 移除 Plugin 过时字段
spec.pluginClass
,推荐在插件定义文件中移除此字段。 - 移除 Plugin 过时字段
spec.website
,推荐使用spec.homepage
替代。 - 移除 Plugin 过时字段
spec.require
,推荐使用spec.requires
替代。 - 移除
SystemSetting.AuthProvider
过时字段enabled
,已经由SystemSetting.AuthProvider
的states
字段替代。 - 移除
run.halo.app.extension.ExtensionMatcher
过时方法getGvk
、getLabelSelector
和getFieldSelector
。 - 移动方法
run.halo.app.extension.MetadataOperator#metadataDeepEquals
至
run.halo.app.extension.MetadataOperator#equals
。 - 移除
run.halo.app.extension.router.QueryParamBuildUtil
过时方法buildParametersFromType
,推荐使用
org.springdoc.core.fn.builders.operation.Builder#parameter
替代。 - 移除
run.halo.app.extension.router.SortableRequest
过时方法toPredicate
,推荐使用
run.halo.app.extension.router.SortableRequest#toListOptions
替代。 - 移除
run.halo.app.extension.router.selector.SelectorUtil
过时方法labelSelectorsToPredicate
、
fieldSelectorToPredicate
和labelAndFieldSelectorToPredicate
,推荐使用
run.halo.app.extension.router.selector.SelectorUtil#labelAndFieldSelectorToListOptions
替代。 - 移除
run.halo.app.theme.finders.TagFinder
过时方法list(Integer, Integer, Predicate, Predicate)
,推荐使用
run.halo.app.theme.finders.TagFinder#list(Integer, Integer)
替代。 - 移除
run.halo.app.plugin.BasePlugin
过时构造函数BasePlugin(PluginWrapper)
,推荐使用BasePlugin(PluginContext)
替代。 - 移除接口
GET&PUT /apis/api.console.halo.run/v1alpha1/plugins/{name}/config
,推荐使用
GET&PUT /apis/api.console.halo.run/v1alpha1/plugins/{name}/json-config
替代。 - 移除接口
GET&PUT /apis/api.console.halo.run/v1alpha1/themes/{name}/config
,推荐使用
GET&PUT /apis/api.console.halo.run/v1alpha1/themes/{name}/json-config
替代。 - 移除接口
POST /apis/api.halo.run/v1alpha1/indices/post
,推荐使用POST /apis/api.halo.run/v1alpha1/indices/-/search
替代。 - 移除接口
POST /apis/api.console.halo.run/v1alpha1/indices/post
,推荐使用
POST /apis/api.console.halo.run/v1alpha1/indices/-/rebuild
替代。
最后,请确保更新 plugin.yaml
中的 requires
字段为 >=2.21.0
。
Full Changelog: v2.20.21...v2.21.0-alpha.1