New target derivation patterns
Unpoly 3 lets you configure patterns to use for target derivation.
The following patterns are configured by default:
up.fragment.config.targetDerivers = [
'[up-id]',
'[id]',
'html',
'head',
'body',
'main',
'[up-main]',
'link[rel]',
'meta[property]',
'*[name]',
'form[action]',
'a[href]',
'[class]',
]
Note that tag names are now only used for unique elements (like <body>
or <main>
).
You can also push a Function(Element): string?
if your deriver can't be expressed in a pattern.