Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

With the advent of Vue 3 and composables, this structure does not make as much sense as it previously did, and we have introduced a feature-based “v2 structure”.

v2 structure

Supported in Totara 19+. tui.json must be in the correct location to enable support for the v2 structure (directly under the component folder, not inside src/).

...

In a component that by its nature contains only a single feature, for example a block, the feature subdirectory may be omitted and its contents placed directly under src/.

Migrating from v1 to v2

As there is currently no mechanism for handling file renames, it is suggested that existing code be left in place for now. New development within a component can happen in the v2 structure though. As long as the tui.json file is in the correct place (not inside src/), the v1 and v2 structures may coexist within the same Tui component.

New features should be built using the v2 structure.

v1 structure

Supported in Totara 13+.

Code Block
core_mfa/
    src/
        tui.json
        upgrade.txt
        components/
            factors/
                FactorChooser.vue
        pages/
            Verify.vue
        js/
          constants.js

...