Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-17921

Refactor Livedata API to be cleaner and more flexible

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Unresolved
    • Major
    • None
    • 12.8
    • Live Data
    • None
    • Hard

    Description

      Create namespaces so that the API is more organized

      For instance:

      logic.changeLayout
      logic.filterAdd
      logic.filterRemove
      ...
      

      becomes:

      logic.layout.change
      logic.filter.add
      logic.filter.remove
      ...
      

      Change method parameters to objects

      The goal is to get the API more flexible for now, but also for the future if we need to modify the parameters that a function takes.
      For instance:

      logic.getPropertyDescriptors()
      logic.getFilterablePropertyDescriptors()
      logic.getSortablePropertyDescriptors()
      

      becomes:

      logic.properties.getDescriptors({ filterable: true, sortable: true })
      

      Change Livedata configuration object name to config instead of data

      The logic object has the logic.data property that contains the whole Livedata configuration (query, data, meta). However, the term "data" is confusing for this object.

      Also, fix some variable names so that it stays coherent across files.

      Simplify the init method

      The Logic.js init method uses WeakMap to create and bind the passed element to it corresponding Livedata instance.
      Let's simply that by returning the Logic class instead!

      Attachments

        Activity

          People

            cdesableau Clément Desableau
            cdesableau Clément Desableau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: