Changing TUI framework files and components
TUI framework code can be classified into two types:
- TUI Core (the TUI framework itself)
- TUI Plugins (functional implementations that likely depend on TUI Core)
TUI Core is considered a public API, and should follow appropriately detailed steps as noted above for back-end deprecation. This is because TUI Plugins have many dependencies upon TUI Core, and TUI Core also has internal dependencies, e.g.
Uniform and its collection of Form components and utilities.
Whole files should remain in place and be noted as deprecated in
upgrade.txt and changelogs, and can be removed after being deprecated for at least one major release.
.js utility files
Exported methods should be marked with a
@deprecated comment, and can be removed after being deprecated for at least one major release.
* This function has been deprecated, please call myNewFunc() instead.
* @deprecated since Totara 13
Similar to *
.js files, marking methods, props and data structures as
@deprecated and updating
upgrade.txt and changelogs appropriately is also required for TUI Core components. This includes breaking changes to
<template /> ,
<script /> ,
<style /> and
<lang-strings /> code blocks within a Single-File Component (SFC).
To avoid cross-plugin dependencies, TUI Plugins should ideally not depend on each other, and should only be used within the context in which they need to exist when the Plugin is developed. For example,
client/component/totara_engage/src/components/sidepanel/NavigationPanel.vue should not be reused within
client/component/mod_perform/src/pages/Activities.vue (because the common functionality should be abstracted into TUI Core
If there are no cross-plugin dependencies for a TUI Plugin, then the deprecation of
Theme-based TUI component overrides
Totara TXP 13+ supports per-code-block overrides as described in the TUI front-end developer documentation. This feature can reduce the amount of work involved in maintaining Vue component customisations. It does, however, introduce a dependency risk, where the TUI Core or TUI Plugin component being overridden may contain deprecations. Therefore developers will need to be conscious of changelogs,
upgrade.txt entries and Git history to understand the impact of deprecation on Theme-based overrides.