Repository navigation
v0.18.0
The thirteenth Fluent UI v9 parity release: Phase 13 of the roadmap, the customization surface and the 1.0 notices. An app can now style and extend WaveUI components without forking them or reaching into internal modules. The elements a component draws besides its root take your props through slotProps, one object per part keyed by the part's name in the class-name registry (slotProps={{ track: { className, onClick } }} on a Switch): every part of the class-name registry that no named slot fills and that is not excluded, 236 in all, merged by the rules a root follows (your classes last, your handlers first and cancellable, your ref beside the component's), while the attributes the component's wiring depends on stay locked. A slot object's children may be a render function (Component, props) => ReactNode, which replaces a named slot's element and keeps its wiring; getNativeElementProps keeps the props an element accepts, and mergeSlotProps, the helper every component applies to its parts, is public. A Field's child may be a function that receives the control's id and ARIA attributes, for a control Field cannot merge them into, and useFieldContext and FieldContextProvider are public. Hooks give content of your own a narrow view of its component: a radio card (useRadioGroupContext, useRadioGroupItem), a menu item (useMenuContext, useMenuListContext), an action that follows a MessageBar's status and layout (useMessageBarContext), and a DataGrid cell that reads and drives the sort and the selection (useDataGridSort, useDataGridSelection, useDataGridRowId). And the last minor before 1.0 announces every change 1.0 makes: four uses that code can detect now warn in development, the Deprecated list restates every change decided for 1.0 with the release that announced it, ref placement is decided (nothing moves), and Upgrading to 1.0 is drafted. It closes the fourteen gaps of P13-01 and P13-02 (foundation-34, foundation-35, foundation-36, foundation-38, foundation-39, form-basic-7, form-basic-8, form-basic-21, field-6, api-1, menu-17, messagebar-6, ctx-1, buttons-29), with four departures from Fluent: one slotProps object instead of a prop per part (whose names would collide with WaveUI's named slots); narrow hooks instead of the context objects, which throw in development outside their component where Fluent's return defaults; a Field context that is optional by design (useFieldContext() is null outside a Field); and foundation-38 closed by the stable classes, which a stylesheet targets app-wide, and per-instance className and slotProps, while a provider-level WaveProvider classNames (Fluent's customStyleHooks_unstable) is left for after 1.0. Nothing public is removed and no default changes, and without slotProps every component renders the attributes of 0.17, on some elements in another order: read "Upgrading from 0.17" before upgrading.
Upgrading from 0.17
- Nothing is removed and no default changes. A component given no
slotProps(or{}) renders the attribute names and values of 0.17 and behaves as in 0.17, but for the two changes of Changed, Behaviour: a MessageBar measuring its layout leaves out the text changes of the commit that renders the new layout, and a staticMenurenders its root once more as it mounts. On some elements the attributes come in another order: a part's merged props put its class before the attributes the component locks, a Tag's Dismiss button renders the attributes that itsdismissIconslot adds to it (a merged<button>orButton, the deprecated button object, an ARIA attribute of a slot object) before itsclass, and MessageBar's Dismiss button renders itstypefirst. Browsers, React's hydration, Testing Library's queries and Vitest's DOM snapshots ignore the order; a test that compares raw HTML strings (renderToStringoutput,innerHTML) changes. - New development warnings, once each, for uses that 1.0 removes or changes (see Deprecated):
Badge:color:importantandCounterBadge:color:important(color="important", whose look changes in 1.0: passcolor="severe"to keep the orange; CounterBadge warns only when it draws a count or a dot),deprecated:useRovingTabIndex:useRovingTabIndex(containerRef, options)(the 0.4 call shape),deprecated:DataGrid:onSortChange(columnId, direction)(the positional callback of a grid withoutitems,sortordefaultSort), andMenu.Popover:legacy-motion,Dialog.Content:legacy-motion,Drawer:legacy-motionandNavDrawer:legacy-motion(aclassNamewith presence variants whilemotionis unset). A test that spies onconsole.warnand renders one of these forms asserts the warning. They readprocess.env.NODE_ENVthemselves, ascreateBrandTokens' ramp check does, so a production bundle drops them and their text; imported without a bundler (noprocess), they are skipped, while WaveUI's other warnings assume development there. - Types.
FieldProps['children']widens to a function as well ((props: FieldControlProps) => ReactNode), and so does a slot object'schildren(SlotRenderFunction): code that reads these props in a wrapper of its own handles the function, or narrows it out.CardProps['checkbox']narrows: its slot object takes nochildren(an<input>has none; any are dropped at run time), so a variable typedSlot<'input'>, whosechildrenmay now be a function, no longer fits it: type the variableCardProps['checkbox'], or write the object inline. Every props type with parts gains an optionalslotProps(a polymorphic component's in its<X>OwnProps), and a few declare their own instead of inheriting one:AvatarGroupItemPropsis now an interface, Avatar's props without theirslotPropsand with the item's own, rather than an alias ofAvatarProps; the checkable menu items' props,AlphaSliderPropsandNavSubItemOwnPropsleave out theslotPropsof the type they extend.WaveContextValueis unchanged. details.eventmay be the grid's own. A cell of yours that sorts or selects throughuseDataGridSort().setSort(sort, event?)oruseDataGridSelection().toggle(id, event?)without an event reachesonSortChangeandonSelectedItemsChangewith an untrustedEventof typesortorselectand no target (asuseTableColumnSizingpassesnew Event('resize')), sodetailsalways comes: a handler that readsdetails.event.targetchecks it.- Decided for 1.0, announced now (see Deprecated):
refplacement does not change.refreaches the root element, the one that receivesclassName, with two exceptions that stay as they are: Input'srefreaches its<input>, also withcontentBeforeorcontentAfter, whereslotProps.root.refreaches the bordered wrapper that takesclassName, andRadioGroup.Item's reaches itsrole="radio"button, while itsclassNamestays on its root<label>, which no ref reaches.controlRefreaches the focusable element of the controls that have one, andslotProps.<part>.refa part. TimePicker'sformatwill follow the locale's hour cycle, the optionaldetailsarguments become required, and so doesImage.alt.WaveProvider classNames(app-wide classes per component) is not part of 1.0: it may come after it, as an addition. - Everything else is opt-in:
slotProps, the render-function slot children,getNativeElementProps,mergeSlotProps, Field's function child,FieldContextProvideranduseFieldContext, and the context hooks are new props and exports, and a page that uses none of them renders as in 0.17, apart from the order and the two behaviour changes of item 1.
Added
slotProps(foundation-34; typesSlotPart,SlotPartWithRefandSlotPartOwn; Fluent gives each part a prop of its own name,indicator={{ … }}): the elements a component draws itself besides its root take props of yours, one object per part, keyed by the part's key in the class-name registry (switchClassNames.trackisslotProps.track, with the classwave-switch__track). Every part key of the registry that no named slot fills and that is not excluded is one, 236 in all (the registry's other part keys are 100 named slots and 29 exclusions): a Switch's track and thumb, a Checkbox's box, an Input's<input>, a picker's listbox surface, a Calendar's days, a Dialog's body, a menu item's label and shortcut, a Tree item's row, a Nav category's toggle, a Carousel's track and slides, a DataGrid header's sort button and resize handle, a MessageBar's text column, every toast's container in a Toaster, and the rest. A part takes the attributes, handlers andrefof its element and anydata-*attribute (a string, a number or a boolean), but nochildren,as,keyordangerouslySetInnerHTML(type errors in an object literal, dropped at run time); a value typed by an interface (React.ButtonHTMLAttributes<HTMLButtonElement>, an interface of yours) or returned bygetNativeElementPropsfits a part too, andSlotPartWithRef<E, R>types a part whose ref takes another element (a List item's content, Input's root). Your props merge as a root's do: yourclassNameafter the part's own classes throughcn(the stable class stays first, and yours win a conflict of the same variant); yourstyleover the part's, except the keys a component must control (a positioned popup's position, size limits and visibility, a beak's offset, a carousel track's translation, a progress bar's value width); your handlers run first, andpreventDefault()in one skips the component's handling of that event, its ownon…prop included, while bookkeeping that only follows the DOM (where focus is, the end of a drag, a held key, the pointer over a control) runs after yours, also when they prevent the default; your ref beside the component's; youraria-labelledbyandaria-describedbyids after the component's, which are never removed; any other attribute replaces the component's default;nullandundefinedremove nothing. What the component's wiring depends on is locked: the attributes it sets on the part (the role, the ids and ARIA references, the tab stop, the disabled and checked state, the markers it finds its elements by) and its own props routed there, so an Input'splaceholderwins overslotProps.input.placeholder; and, unset, the hidden state of a part that holds a control, an item or a name (the parts that name by reference aside, the label of a Switch, Checkbox or radio, Field's and InfoLabel'slabel, Popover'stitle, a drawer header'sheadingand OptionGroup'slabel: the reference still reads hidden text), anaria-labelon a part whose text names a control (of those five, only the three control labels lock it), a tab index on a decorative part, a role, tab index or roving marker on a part inside a composite (a menu, a tree, a toolbar, a grid), and the form attributes that a control's hidden input owns. While a control is disabled (disabledordisabledFocusable) youronClickon its parts is not called, as its own is not: on its own element and on the parts inside it (a Switch's label and thumb, a Checkbox's or radio's label, a CompoundButton's text, a disabled menu item's label, an Input's bordered wrapper, a Dropdown's value, an Option's content and check square). Two exceptions: a disabledOption's ownonClickprop still runs, as in 0.17.1 (its parts' do not), and the drawings of ColorArea, ColorSlider and AlphaSlider (field,rail,thumb) take youronClickin every state, as their roots do. Input'srootandinputare one<input>withoutcontentBeforeandcontentAfter(both apply,inputlast), and an Avatar without abadgeis its ownvisualpart. Each part's JSDoc names its element, its stable class (the per-part documentation that the class names of 0.8 waited for) and the attributes it locks, and the guide's Customization chapter tables every part. No part: the elements that exist for layout, motion or measurement (the virtual spacers, the collapse elements, Dialog's positioner, the Carousel's viewport), the roots of the components you write yourself (Menu.Item, the table cells,Rating.Item, …), and the leaves a named slot fills: named slots stay the way to fill a leaf, and where a dismiss slot and adismissButtonpart both reach a button (MessageBar, SearchBox, Tag, TeachingPopover's Close button), the attributes of a button merged through the slot are defaults that the part replaces. A Server Component can pass a part's classes, styles and attributes; its handlers and refs belong in a client component.- Slot render functions (
foundation-35; typesSlotRenderFunctionandSlotRenderProps; Fluent's slot render function): a slot object'schildrenmay be(Component, props) => ReactNode, which renders in place of the slot's element.Componentis the element type (the object'sas, else the slot's default tag) andpropsevery prop the element receives (the component's defaults such asaria-hidden, the mergedclassName, the object'sref, what the component adds when it renders the element), so(Component, props) => <i {...props} />keeps the wiring. Every slot takes it throughresolveSlotandrenderSlot, with no change per component. In the dismiss, clear and close slots the component's own button stays: the function renders the content inside it, receives the default glyph asprops.children, and one that returns nothing keeps the default glyph; anasthat names a button there, and in the glyph slots inside a button, is merged or unwrapped as before, so no button nests in a button. A function counts as content for the glyph rules ({ children: () => null }renders nothing). Keep it pure: StrictMode and the check whether a slot renders anything call it more than once. AslotPropspart and TeachingPopover'sprimaryActionandsecondaryAction(a Wave Button) take none (a type error; an action drops one with a development warning), and a function cannot be passed from a Server Component. getNativeElementProps(tag, props, excludedNames?)(foundation-36; typeNativeElementProps; Fluent'sgetIntrinsicElementProps): the props of an object that an intrinsic element accepts, for a component of yours that spreads its props onto an element without leaking component props into the DOM: the global attributes, the DOM event handlers (a component callback such asonValueChangeis dropped),data-*,aria-*andref, and the attributes of the tag fora,button,img,input,label,li,ol,option,select,td,textareaandth(any other tag keeps the global set);excludedNamesdrops more (['size']for Input's size name).keyis dropped too, since React 19 warns when a props object that holds it is spread. Server-safe, in a module of its own that no component imports.mergeSlotProps(part, own): the helper every component applies to its parts, public and server-safe, for components of your own that take parts by the same rules.ownholds the part'sclassName,styleandref, itsdefaults(your props replace them), itslockedattributes and handlers (they always win; a locked handler runs after yours unless yours prevented the default) andblockHandlers(your handlers of those keys are dropped, as on a disabled control);partmay be a list of parts, applied in order as layers. Fluent's nearest counterpart,slot.always(props.part, { defaultProps }), spreads shallowly, so there a consumer handler or ref replaces the component's.- Field's function child (
form-basic-7,field-6; Fluent's render-function child):childrenmay be(props: FieldControlProps) => ReactNode, for a control that Field cannot merge its attributes into (a third-party input that takes them under another name). The function receives theidthe label points at,aria-labelledby(the label, which also names an element a label cannot point at),aria-describedby(the validation message, then the hint),aria-invalid(the error state only) andaria-required, each only when it has a value, and no nativerequiredorsize; Field renders the result inside its context with nothing merged into it. A library control in the result that receives noidgets its own and is named througharia-labelledby. An element child is wired as before. useFieldContext()andFieldContextProvider(form-basic-8; typeFieldContextProviderProps; Fluent'suseFieldContext_unstableandFieldContextProvider):useFieldContext()returns a Field'sFieldContextValue(the ids of its label, message and hint,required,size,validationState, …) inside a Field or aFieldContextProvider, andnulloutside one, without a warning, since a control works with and without a Field;FieldContextProviderprovides a value of yours, for a field layout of your own (memoise the value).- Context hooks (
foundation-39,api-1,buttons-29and the gaps below; Fluent'suse…Context_unstable): narrow views of a component for content of your own inside it, never its internal context. Each value is the same object while its members stay the same, and later releases can add members. Outside its component each hook throws in development ([WaveUI] useMenuContext must be used within Menu) and, in production, logs once and returns an inert value; Fluent's return defaults and never throw. Each lives in a module that imports no component, so an import of only the hook holds no component.- RadioGroup (
form-basic-21; typesRadioGroupContextValue,UseRadioGroupItemOptions,UseRadioGroupItemResult):useRadioGroupContext()returns{ value, disabled, select(value) }, anduseRadioGroupItem(value, { disabled })returns{ props, checked, disabled }, the props that make an element of yours a radio of the group (role="radio",aria-checked, the roving tab stop and its marker, the click and Space and Enter handling): a radio card that the arrow keys, the group's form value, a reset and its validation reach. - Menu (
menu-17; typesMenuContextValue,MenuListContextValue):useMenuContext()returns{ open, close(), isSubmenu }(closeis the function a built-in item's activation calls), anduseMenuListContext(){ hasIcons, hasCheckmarks }, the icon and check columns the built-in items of the list keep, read from the list as its CSS reads them (falsein the server HTML). An element of yours withrole="menuitem"joins the list's arrow keys, typeahead and hover focus;Menu.Itemhas noasChild. - MessageBar (
messagebar-6; typeMessageBarContextValue):useMessageBarContext()returns{ status, layout }, the bar's resolved status (Fluent'sintent) and the layout it renders, so an action adapts to them. - DataGrid (
ctx-1; typesUseDataGridSortResult,UseDataGridSelectionResult):useDataGridSort()returns{ sort, setSort(sort, event?) },useDataGridSelection(){ selectedItems, isSelected(id), toggle(id, event?) }(the selection the grid holds, rows that a window does not render included), anduseDataGridRowId()the id of theDataGrid.Rowit is in (undefinedin a header row).setSortandtoggletake the grid's own paths, soonSortChangeandonSelectedItemsChangefire once, withdetails("Upgrading from 0.17", 4). Every caller ofuseDataGridSelectionrenders again on each change of the selection.
- RadioGroup (
- Development warnings (keys): the 1.0 notices of "Upgrading from 0.17", 2, and
TeachingPopover:action:render-function(a render function in an action's slot object, which the action drops). - Stories: RadioGroup's
CustomRadioCard, Menu'sCustomMenuItem, MessageBar'sStatusAwareAction, DataGrid'sCustomCelland Field'sWithFunctionChild. - Documentation: the README's "Slots" section became the Customization chapter (named slots,
slotPropsand its merge rules, slot render functions withgetNativeElementPropsandmergeSlotProps, Field's function child, the context hooks,refandcontrolRef, what is not customizable); its link anchor#slotsis now#named-slots. The guide gains chapter 14, Customization, with the merge rules, a table of every part, its element and its locked attributes, and five recipes (a radio card, a menu item, a MessageBar action, a DataGrid cell, a component of your own onmergeSlotProps), so its Quick Reference and Deprecated APIs are now chapters 15 and 16 (#15-quick-reference,#16-deprecated-apis). Upgrading to 1.0 is new, and the testing guide coversslotPropsand the context hooks. - Types
SlotPart,SlotPartOwn,SlotPartWithRef,SlotRenderFunction,SlotRenderProps,NativeElementProps,FieldContextProviderProps,RadioGroupContextValue,UseRadioGroupItemOptions,UseRadioGroupItemResult,MenuContextValue,MenuListContextValue,MessageBarContextValue,UseDataGridSortResultandUseDataGridSelectionResult.
Changed
DOM structure
- Unchanged without
slotProps: every part renders the attribute names and values of 0.17, and only their order changed on some elements ("Upgrading from 0.17", 1). WithslotProps, a part's attributes join its element; no element is added, removed or replaced. - Locks completed before release (the parts table of the guide lists them): the text parts that name a control lock
aria-labelunset (a menu item's label of every kind,Option's content, which also locksrole, CompoundButton's two lines and the label of a Switch, Checkbox or radio), and all of them but those three labels the hidden state;OptionGroup's list locksinertandaria-hiddenbesidehidden; the decorative parts locktabIndexunset (a Switch's thumb, the required mark of Label and Field, Popover's beak, a calendar's marked dot, ColorArea's field and thumb, the rails of ColorSlider and AlphaSlider, the empty rows of Combobox, TimePicker and TagPicker,Option's check square, TagPicker's "+N" chip); the focusable control parts lockinertbesidehiddenandaria-hidden(the controls of Switch, Checkbox, a radio, Input, Combobox, Dropdown, SpinButton, SearchBox, TimePicker, DatePicker andColorPicker.HexField, their clear buttons, TagPicker's clear button and InfoLabel's info button; a radio's and an Input's at the item's or the Input's own value, and Input's bordered wrapper unset); a radio locks the roving container and skip markers, and every part of a menu item the roving container marker; MessageBar's text column locksroleandaria-live, and Toast's Dismiss buttonrole. A Switch's label and thumb, the label of a Checkbox or radio, an Input's bordered wrapper, a Dropdown's value and an Option's content and check square call noonClickof yours while the control is disabled. The work a component runs after a part's handler whatever it does (the end of a drag or of SpinButton's hold, the roving tab stop following focus) also runs when that handler throws.
Behaviour
- MessageBar's measurement (
layout="auto"with actions) ignores the text changes of the commit that renders a newly measured layout, so text rendered fromuseMessageBarContext().layoutsettles instead of measuring without end. Text that an effect changes from the layout still starts the measurement over: render it from the hook's value. A bar whose text does not depend on its layout measures as in 0.17. - A static
Menurenders its root once more as it mounts, to record its list element foruseMenuListContext; its items do not render again.
Types
FieldProps['children']andSlotObject['children']widen,CardProps['checkbox']narrows, and every props type with parts gainsslotProps("Upgrading from 0.17", 3); every other change is a new export.
Dev gates
verify-dist(the Phase 13 spec, §5 and its implementation notes):RECORDED_IMPORTS_0_18gates six imports whose closure holds a module of this release, each at its size measured at the end of the phase plusBUDGET_MARGIN_0_18(512 bytes minified, 192 gzip), with its published 0.17.1 size (BASELINES_0_17_1) printed beside it: onlyButton, onlyMessageBar, onlyTree, onlyDialog,WaveProviderwithDialog, and onlyDataGrid, whose budget was 0.16.0's size plus 25% (see Size). Other imports that hold one (onlyTable, the hook-only and helper-only imports) are measured, not gated. The 0.17 records of the first five are printed for drift only, and the budgets ofcreateBrandTokens,waveTokens,useVirtualWindowand the presence core stay, since no module of this release is in their closures. An import recorded in several lists is measured once (verifyDisttakes ameasureoption, which its tests count). Probes: an import of onlygetNativeElementPropsor onlymergeSlotPropsholds its module and no component, hook or React module, and an import of only one context hook holds its context module and no component, presence, positioning orreact-domcode (HOOK_PROBES_0_18); Button-only holds none of the customization modules (CUSTOMIZATION_MODULES), Dialog-only holds the part helper and none of the others, and DataGrid-only does not hold the module of its public hooks (EXCLUSION_PROBES_0_18), with positive controls (INCLUSION_PROBES_0_18). The react-server check runslib/slotPropsandlib/nativePropson the server and requires the entry to export their public names from them.TEST_ONLY_MODULES(lib/slotParts,lib/deprecations) are modules only the tests read, andcheckTestOnlyModulesfails on a file of theirs indist.MODULE_ONLY_NAMESgains the seams of the phase, and a test pinsmergeSlotPropsas the entry's last value export (exported earlier, it moved shared modules in every bundle).- Tests: the completeness gate (
src/__tests__/slotParts.test.ts) requires every part key of the class-name registry in exactly one list ofsrc/lib/slotParts.ts(aslotPropskey, whose owning props type must declare exactly its keys, a named slot, or an exclusion with a reason); the 1.0 inventory (src/__tests__/deprecations.test.tsx) keepssrc/lib/deprecations.tsin step with the code, the CHANGELOG and the upgrade guide (each row's announcement, each warning once, and thewarnDeprecatedandresolveDeprecatedPropcall sites counted against the rows that warn);src/test-utils.tsgainssortAttributes,normaliseIds,openingTagsandexpectInertSlotProps, with which every component that has parts pins the markup its parts had before they took props (captured once from the build before the change); the Server Component suite gains a component with parts from each category and every new public function butuseRadioGroupContext. - Stories: the color matrices of Badge and CounterBadge leave
importantout, which now warns.
Deprecated
1.0 removes or changes every item below but the last, which records a decision that changes nothing, and none of it changes before 1.0. Each line names the release that announced it. This is every change decided for 1.0: namespaced utilities (ROADMAP P14-01) are not decided yet, and if 1.0 ships them, a 0.x release announces them first, with a migration table. Upgrading to 1.0 lists every item with its replacement, and src/lib/deprecations.ts is the inventory that a test keeps in step with the code, this list and that guide. A development build warns once about each use that the guide marks "Warns: yes".
- The 0.4 names renamed in 0.5 (announced in 0.5): every old name of the migration table is removed: Checkbox and Switch
onChange, theonChangevalue callbacks of the other value controls,onOptionSelect,selectedValueanddefaultSelectedValue,onTabSelect,onNavItemSelect, TabListvertical,currentStepanddefaultCurrentStep,selectionMode="multi", DataGrid'sselectedKeys,defaultSelectedKeys,onSelectionChangeand 0.4 sort props,Table.HeadandTable.HeadCell, Stackdirection, thevariantof Skeleton, Link and Tooltip, a numeric Textweight, aNav.Categorylabel taken from its text and Accordion's single-modeopenItems,defaultOpenItemsandonOpenItemsChange. Use the 0.5 names of the table; each old name warns once in development. - The button-object form of the dismiss and clear slots (announced in 0.5):
MessageBar.dismiss,SearchBox.dismissandTag.dismissIconwith button props ({ as: 'button', onClick, … }) are removed; pass icon content, and handle the press inonDismissoronClear. Each warns once in development. A<button>orButtonelement passed there stays: it is merged into the built-in button. legacy-tokens.css(announced in 0.5):@mortenbrudvik/waveui/legacy-tokens.css, the 0.4 variable names, is removed; read and override the--wave-*variables.- The
darkandhigh-contrasttheme classes (announced in 0.5):WaveProviderstops adding them and Wave's styles stop selecting them. Targetwave-darkandwave-high-contrastin your CSS, and key a class-baseddark:variant on.wave-dark. animations.css(announced in 0.18):src/styles/animations.css, empty since 0.5 and outside the package's exports, is removed; drop an import of it by path.- Badge and CounterBadge
color="important"(announced in 0.6): it keeps its orange look through 0.x and becomes Fluent's neutral high-emphasis color in 1.0. Usecolor="severe"to keep the orange look. From 0.18 it warns once in development. - Tooltip
delay(announced in 0.7): useopenDelay. - A numeric
sizeon Input, Select and Slider (announced in 0.9): a type error from 1.0. UsehtmlSizeon Input and Select; on Slider it has no effect, so remove it. - InfoLabel
label(announced in 0.9): usechildren. wave-tag-picker__controlandwave-tag-picker__group(announced in 0.11): removed; targetwave-tag-picker-controlandwave-tag-picker-group.- PresenceBadge
'dnd'and'oof'(announced in 0.13): use'do-not-disturb'and'out-of-office'. DataGridColumn.id(announced in 0.14): usecolumnId.- Done calling
onDismiss(announced in 0.14): in 1.0 TeachingPopover's Done callsonFinishonly; handle Done inonFinish. useRovingTabIndex(containerRef, options)(announced in 0.18): the 0.4 call shape ofuseRovingTabIndexis removed. CalluseRovingTabIndex(options)and spread the returnedcontainerPropson the container. It warns once in development.- DataGrid's positional
onSortChange(announced in 0.18):onSortChange(columnId, direction), the 0.4 callback form of a grid withoutitems,sortordefaultSort, is removed. Give the grid one of them and readonSortChange(sort, details). It warns once in development. - A
classNamewith presence variants in place ofmotion(announced in 0.18): through 0.x aclassNamethat holds presence variants keeps turning the default motion off onMenu.Popover,Dialog.Content, Drawer and NavDrawer (the compatibility rule of 0.15); in 1.0 it no longer does, so pass those classes throughmotion. It warns once in development. - The
detailsarguments announced before (announced in 0.6, 0.7, 0.8, 0.10, 0.11 and 0.14): thedetailsparameter becomes required in Dialog, Drawer and NavDraweronOpenChange, Menu and ToolbaronCheckedValuesChange, TreeonCheckedItemsChange, CalendaronValueChange,useListbox'sonOpenChangeandonSelect, OverflowonOverflowChange, DataGridonSortChangeandonSelectedItemsChange, andTable.SelectionCellonCheckedChange. WaveUI passes it on every change it makes from an event; a form reset that restores thedefaultCheckedof aTable.SelectionCellpasses none in 0.x and passes it in 1.0. - The
detailsarguments announced now (announced in 0.18): AvatarGrouponOpenChange,onColumnWidthsChange(DataGrid anduseTableColumnSizing),Table.ResizeHandleonResize,useTableSort'sonSortChange,useSelection'sonSelectedItemsChangeanduseFlatTree'sonCheckedItemsChange(FlatTree's checked state) will require thedetailsargument in 1.0. WaveUI passes it on every change it makes from an event;useTableSort'ssetColumnSortandtoggleColumnSortanduseFlatTree'ssetChecked, called without an event, pass none in 0.x and pass it in 1.0, with an event of their own asuseTableColumnSizingalready does (new Event('resize')). Image.alt(announced in 0.18): required in 1.0 (alt=""for a decorative image), andStrictImagePropsbecomes an alias ofImageProps. A missingaltalready warns once in development.- TimePicker
format(announced in 0.18): withoutformata TimePicker shows 12-hour times through 0.x; in 1.0 it follows the locale's hour cycle. Passformat="12h"to keep 12-hour times. TimePicker has nohourCycleprop. - Ref placement: no change (decided in 0.18):
refstays on the root element (the one that receivesclassName), with two exceptions that stay too: Input'srefreaches its<input>, also withcontentBeforeorcontentAfter(slotProps.root.refreaches the wrapper), andRadioGroup.Item's reaches itsrole="radio"button, while itsclassNamestays on its<label>.controlRefstays on the focusable element of the controls that have one, and parts takeslotProps.<part>.ref. 1.0 moves noref.
Fixed
- Card
checkboxwithchildren(checkbox={{ children: … }}) crashed in 0.17.1: the slot object'schildrenwere spread onto the void<input>, and React threw. They are dropped now, andCardProps['checkbox']no longer takes them ("Upgrading from 0.17", 3). - Nothing else in 0.17's behaviour. Two limits that the 0.17 browser pass found stay as documented (ROADMAP §8.5):
weight="medium"has no face of its own on Windows' system fonts (see 0.17.0, Added), and under a Content Security Policy that blocks inline styles, Firefox's development build logs a hydration mismatch for a provider root withtokens, while nothing is drawn differently (guide).
Size
Against 0.17.1 as published on npm, measured with this release's build tools (verify-dist's measureImport: a minified production Vite build of an entry that imports the names from dist/index.mjs, bare imports external, gzip by node:zlib; dist/styles.css as built). Sizes are in bytes:
| Import | 0.17.1 | 0.18.0 |
|---|---|---|
dist/styles.css (as built, KiB) |
102.2 KiB (16.3 KiB gzip) | 102.2 KiB (16.3 KiB gzip), byte for byte the same |
An import of only Button |
11,222 (3,866 gzip) | 11,079 (3,865 gzip) |
An import of only MessageBar |
26,858 (9,324 gzip) | 29,221 (10,201 gzip) |
An import of only Tree |
47,327 (16,232 gzip) | 50,383 (17,271 gzip) |
An import of only Dialog |
70,850 (23,786 gzip) | 72,599 (24,466 gzip) |
An import of WaveProvider and Dialog |
73,403 (24,778 gzip) | 75,147 (25,458 gzip) |
An import of only DataGrid |
70,097 (23,719 gzip) | 73,306 (24,926 gzip) |
An import of only Table |
28,817 (9,956 gzip) | 31,658 (11,015 gzip) |
An import of only mergeSlotProps (new) |
— | 2,558 (1,224 gzip) |
An import of only getNativeElementProps (new) |
— | 2,604 (1,214 gzip) |
- Button pays nothing. It has no part, so it holds no
lib/slotProps; of this release's code it holds only the render-function children oflib/slot, paid for by compacting that module, so it is 143 bytes smaller (1 gzip).verify-distproves that it holds none of the customization modules. - A component with parts pays the helper once:
mergeSlotProps, with the helpers it imports, adds 1,183 to 1,644 bytes (452 to 673 gzip) to a bundle that holds a component with parts, measured as it landed, and each component its own part code, from a few dozen bytes to about 2 KiB (TagPicker, Carousel). MessageBar grows by 2,363 bytes (877 gzip): the helper, the text column and Dismiss button parts, the context ofuseMessageBarContextand the measurement's change (Changed, Behaviour). Tree grows by 3,056 (1,039): the helper and the parts of an item and of its persona layout. Dialog grows by 1,749 (680), and withWaveProviderby 1,744 (680): the helper, the title actions and body parts, and the part that the shared Close button takes for TeachingPopover. DataGrid grows by 3,209 (1,207) and Table by 2,841 (1,059): the helper and the parts of the header cells, the resize handle and the selection controls, and in DataGrid the path ofsetSortand the selection store's snapshot. The 0.17.1 size of Table comes from a build of the 0.17.1 commit with this release's tools, which reproduces every other figure of the table. - The hooks cost nothing until used: each context hook lives in a module that imports no component. An import of only one holds its context module and no component (in bytes, minified and gzip:
useFieldContext146 and 132,FieldContextProvider232 and 165,useRadioGroupContext852 and 511,useRadioGroupItem1,748 and 919,useMenuContext1,982 and 928,useMenuListContext1,410 and 749,useMessageBarContext700 and 450,useDataGridSort954 and 496,useDataGridSelection3,279 and 1,507,useDataGridRowId991 and 516), a DataGrid-only import holds the grid's contexts but not the module of its public hooks, and no component importsgetNativeElementProps. - Budgets:
verify-distnow gates the six imports of the table above from Button to DataGrid at the size measured at the end of the phase plus 512 bytes (192 gzip), in place of the 0.17 budgets of the first five (their 0.16.0 size plus an allowance) and DataGrid's (its 0.16.0 size plus 25%). The locks completed before release moved MessageBar, Tree, DataGrid and Table by a few bytes after that measurement; the table gives the sizes of the release. Table and the hook-only and helper-only imports have no budget;verify-distprobes what the latter hold. dist/styles.cssis unchanged, byte for byte, and so isdist/preflight.css: no part adds a utility.