Repository navigation
1.2.0
This release fixes how props, attributes and children are applied, and adds an experimental plugin hook that the upcoming @fiorejs/signals and @fiorejs/jsx packages build on. Some fixes change behaviour; check the list under "Behaviour changes" before upgrading.
Behaviour changes
- Attribute values are passed through.
0and''are now set; 1.1.5 skipped every falsy value.nullandundefinedremove the attribute.falseremoves it too, except foraria-*,data-*and enumerated attributes such asdraggable, where it is written as"false". - Inline handler attributes are ignored. An attribute that is a real event handler of the element, such as
onclickin any case, is never set, so no handler string is run. Other names that start withon, such asonline, are set. Useeventfor listeners. - Children are kept when none are given. An element created without
childrenkeeps thetextContentorinnerHTMLset throughprops; 1.1.5 cleared it. null,undefined,trueandfalsechildren are skipped, souser.isAdmin && badge()works. Numbers are accepted as children.value,selectedIndexandcheckedare assigned after the attributes and children, soselect({ props: { value: 'M' }, children: [...] })selects the option.- Nested props merge only plain objects and their own keys.
undefinedleaves a property unchanged, and__proto__,constructorandprototypeare ignored. - MathML elements are created in the MathML namespace; 1.1.5 used the SVG namespace. The MathML
aelement is deprecated, because TypeScript and MathML Core do not define it. - Types: the SVG attribute map no longer accepts arbitrary keys, and
valueanddefaultValueare typed asstring | number | null | undefinedinstead ofany.
Added
- Experimental plugin hook.
use(plugin)registers a plugin by name that can bind live values to props, attributes and children. The API may change in a later release. fiorejs warns when it is loaded twice, because plugins registered on one copy do not reach the other. - Lists of more than 10,000 children are inserted in chunks instead of one spread call.