Closed ebruchez closed 1 month ago
So the way we compute baseline updates is quite unclear.
We have a global BindingLoader
, which handles the index of bindings. This also keeps track of a global CSS/JS baseline based on:
oxf.xforms.resources.baseline
(deprecated)oxf.xforms.assets.baseline
(only taking into account the "xbl"
part)oxf.xforms.xbl.library
(XBL only)We also have a global non-XBL baseline, which is based on:
oxf.xforms.assets.baseline
(taking into account the "css"
/"js"
part)Finally, we have a system of updates that are not global, but specified by form, using oxf.xforms.assets.baseline.updates
, passed as static property to forms by Form Runner, reading other properties such as:
oxf.xforms.assets.baseline.updates.fr
oxf.xforms.assets.baseline.updates.offline
Those update properties achieve the following:
We could also remove XBL by direct binding QName, but we don't have any use case currently.
A given form should create a form-specific (but typically shared amongst all Form Runner forms) baseline of resources by combining all of the above:
One problem is that the global XBL baseline is currently returned as CSS/JS by path, so if you say for example to remove with -fr:code-mirror
, what should the logic be? For example you don't want to remove global files, let's say if an XBL component includes foo.css, and that is not specific to that component. Well, for now, we could just support not removing from the baseline by direct binding QName.
We shouldn't have what's in the XBL library (oxf.xforms.xbl.library
) in the baseline. This should just be a mechanism to look up XBL bindings.
Looking at the code, this seems to be correct: getUpToDateLibraryAndBaseline()
gets the baseline bindings only, and then load the corresponding AbstractBinding
s, and then gathers the CSS/JS paths.
We could store instead a mapping direct QName → paths. This would make it easier to build the final baseline.
We have the notion of:
oxf.xforms.assets.baseline
-baseline updates, read by Form Runner, and passed down to the XForms level withxxf:assets.baseline.updates
When a page loads, we call
outputCSSResources()
.baselineStyles
getUpToDateLibraryAndBaseline
collectResourceBaselines
readAndIndexBindings
, which containsoxf.xforms.assets.baseline
andoxf.xforms.xbl.library
assets.baseline.updates
So, upon loading the page, the baseline assets are not properly handled?
The updated assets with
assets.baseline.updates
are used upon loading, but only the.css
and.js
parts, not the.xbl
parts.Concrete issue: setup
fb
baseline updates for Form Builder to includefr:section
, in case there is no form loaded initially.Can we make it so that
baselineStyles
handles this?Where
XFormsAssetsBuilder.updateAssets
is used:XFormsAssetServer
outputCSSResources()
, but again only for handling the.css
and.js
partsFound while @obruchez worked on #3414.