跳转至

Publishing and versioning(发布与版本管理)

Module versioning allows builders to safely and iteratively build Workshop applications; the version accessible to end users can be controlled by publishing a stable version of the module. This allows for continuous development on a live Workshop application without necessarily exposing changes to end users when the module is saved.

Version history and settings

Versions dialog

The Versions dialog is where builders can view a history of the saved versions for a module. Each saved version displays a timestamp, editor, and description if available. For each saved version, builders have the option to:

  • Publish this version: Publish a saved version of a module that will be accessible to viewers.
  • View this version: View the module at that specific version. When viewing a non-published version, a warning banner will appear at the top of the module.

Version warning banner

  • Revert to this version: Save the historic version as the newest version of the module. A description detailing the revert action will be automatically generated.

:::callout{theme="neutral" title="Edit a previous version of a module"} To edit a previous version of a module, follow the steps below: * Ensure the Automatically publish when saving toggle switch is off in the Versions dialog. * Revert to the version you would like to edit. * Create a duplicate copy of the selected version of the module with File > Duplicate File. * Revert the original module to the newest version, and make any desired edits to the duplicate copy you created. :::

The Versions dialog is also where builders can go to edit settings related to saving and versioning actions:

  • Automatically publish when saving: This toggle controls whether saving will automatically publish a new version.
  • Always prompt to add a version description when saving: This toggle controls whether the builder is prompted to add an optional description when saving a new version. Descriptions can be added to help document the changes being made to modules and build up a richer record of the module's history. Descriptions can be viewed, added, and edited in the module’s Versions dialog.

Version description prompt

Viewing changes between versions

Use the Changelog panel to visualize differences between module versions. You can select:

  • Range selection: Choose a start and end version to see all changes between those versions.
  • Single selection: Select a single version to compare it to the previous version.

The Changelog panel highlights additions, deletions, changes, moves, and newly unused elements. You can inspect JSON diffs to see the exact modifications and review a visual hierarchy to understand how changes relate to nested components.

Branching and rebasing

When developing on a branch, you may need to rebase before merging your Workshop changes into main if main has changed since your last save. Rebasing applies your branch's changes to the latest main version of the module and surfaces any merge conflicts that must be resolved.

The rebasing user interface uses the Changelog panel to visualize changes and highlight conflicts, such as when the same widget was modified on both main and your branch. Once conflicts are resolved, save to finish the rebase, and then proceed to merge your branch into main.

For a complete walkthrough, see Rebasing and conflict resolution.


中文翻译


发布与版本管理

模块版本管理(versioning)使构建者能够安全且迭代地构建 Workshop 应用;通过发布(publishing)模块的稳定版本,可以控制最终用户可访问的版本。这样,在保存模块时,无需将更改直接暴露给最终用户,即可在实时 Workshop 应用上持续开发。

版本历史与设置

版本对话框

在"版本"对话框中,构建者可以查看模块已保存版本的历史记录。每个已保存版本都会显示时间戳、编辑者以及描述(如有)。对于每个已保存版本,构建者可以选择:

  • 发布此版本: 发布模块的已保存版本,使其可供查看者访问。
  • 查看此版本: 查看该特定版本的模块。查看未发布版本时,模块顶部会显示一条警告横幅。

版本警告横幅

  • 回滚至此版本: 将历史版本保存为模块的最新版本。系统会自动生成描述回滚操作的说明。

:::callout{theme="neutral" title="编辑模块的先前版本"} 要编辑模块的先前版本,请按以下步骤操作: * 确保"版本"对话框中的保存时自动发布(Automatically publish when saving)开关已关闭。 * 回滚至您要编辑的版本。 * 通过文件 > 复制文件(File > Duplicate File)创建所选模块版本的副本。 * 将原始模块回滚至最新版本,然后对您创建的副本进行所需编辑。 :::

在"版本"对话框中,构建者还可以编辑与保存和版本管理操作相关的设置:

  • 保存时自动发布: 此开关控制保存时是否自动发布新版本。
  • 保存时始终提示添加版本描述: 此开关控制保存新版本时是否提示构建者添加可选描述。添加描述有助于记录对模块所做的更改,并构建更丰富的模块历史记录。描述可在模块的"版本"对话框中查看、添加和编辑。

版本描述提示

查看版本间的更改

使用变更日志面板(Changelog panel)可视化模块版本之间的差异。您可以选择:

  • 范围选择: 选择起始版本和结束版本,查看这两个版本之间的所有更改。
  • 单个选择: 选择单个版本,将其与前一版本进行比较。

变更日志面板会高亮显示新增、删除、更改、移动以及新近未使用的元素。您可以检查 JSON 差异以查看确切的修改,并查看视觉层次结构以了解更改与嵌套组件之间的关系。

分支与变基

在分支上开发时,如果自上次保存后 main 分支已发生更改,则可能需要在将 Workshop 更改合并到 main 之前进行变基(rebasing)。变基会将您分支的更改应用到模块的最新 main 版本,并显示必须解决的任何合并冲突。

变基用户界面使用变更日志面板来可视化更改并高亮显示冲突,例如当同一小部件在 main 和您的分支上都被修改时。解决冲突后,保存以完成变基,然后将您的分支合并到 main

有关完整指南,请参阅变基与冲突解决