Front end XWiki APIs

Last modified by Lucas Charpentier (Sereza7) on 2024/11/19 16:14

 XWiki
 Design
 Idea

Description

This page is a brainstorming document to define criteria of what should be an API or not. What is written should be understood as proposal only, and not something voted or even discussed.

Goal

Define for all non java resources:

  • How do we mark an element public or internal?
  • How do we deprecate them?
  • How we do introduce a new element?
  • How do we keep backward compatibility?
  • What elements are public or internal

All non java resources:

  • vms
  • javascript API
  • velocity macros
  • CSS / LESS elements

Front end components

On Front End resources, we already have a list of components. The featuresaddaddadd, style add and architecture addadd of these components would be part of the API as they are meant to be exposed publicly, reused and augmented.

There's velocity macros bundled in the default flavor, some of them match the resources above.

DOM API

Any style attribute should never be considered as API: it's been a long time that we indicate in our documentation to not use inline style, so scripts should never rely on it, and it should always be ok to remove them in old code. Example of such change: https://github.com/xwiki/xwiki-platform/pull/2812/files/95f349912c19b66f00b684153dcf8be6ec526db1#r1504545037

The changes on this basic layout should be documented and backward compatible (CSS or DOM or both ?): https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/Skins/CSSLayout/

The DOM of the different Admin sections are not considered part of the API : admins shouldn't have to extend them. Extensions should only provide their admin UI through dedicated extension points and templates.

CSS API

Elements to include in the API:

1. Bootstrap 3 classes: used everywhere, for a long time. When moving to a new design system, we want to consider how to keep support for those classes. E.g. `.btn`, `.btn-default`, ...

2. Special CSS classes defined in https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/FrontendResources/SpecialCSSClasses/

Get a list of all classes used in the XWiki interface with their meaning, possibly the docs it's used in and a screenshot?

Javascript API

Already pretty well defined in https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/FrontendResources/JavaScriptAPI/

Resources

Previous research about defining a CSS API: https://design.xwiki.org/xwiki/bin/view/Standards/CSSAPI


 

Get Connected