Skip to content

v0.18.0

Choose a tag to compare

@github-actions github-actions released this 01 Nov 21:54
· 225 commits to main since this release

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

  1. 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 static Menu renders 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 its dismissIcon slot adds to it (a merged <button> or Button, the deprecated button object, an ARIA attribute of a slot object) before its class, and MessageBar's Dismiss button renders its type first. Browsers, React's hydration, Testing Library's queries and Vitest's DOM snapshots ignore the order; a test that compares raw HTML strings (renderToString output, innerHTML) changes.
  2. New development warnings, once each, for uses that 1.0 removes or changes (see Deprecated): Badge:color:important and CounterBadge:color:important (color="important", whose look changes in 1.0: pass color="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 without items, sort or defaultSort), and Menu.Popover:legacy-motion, Dialog.Content:legacy-motion, Drawer:legacy-motion and NavDrawer:legacy-motion (a className with presence variants while motion is unset). A test that spies on console.warn and renders one of these forms asserts the warning. They read process.env.NODE_ENV themselves, as createBrandTokens' ramp check does, so a production bundle drops them and their text; imported without a bundler (no process), they are skipped, while WaveUI's other warnings assume development there.
  3. Types. FieldProps['children'] widens to a function as well ((props: FieldControlProps) => ReactNode), and so does a slot object's children (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 no children (an <input> has none; any are dropped at run time), so a variable typed Slot<'input'>, whose children may now be a function, no longer fits it: type the variable CardProps['checkbox'], or write the object inline. Every props type with parts gains an optional slotProps (a polymorphic component's in its <X>OwnProps), and a few declare their own instead of inheriting one: AvatarGroupItemProps is now an interface, Avatar's props without their slotProps and with the item's own, rather than an alias of AvatarProps; the checkable menu items' props, AlphaSliderProps and NavSubItemOwnProps leave out the slotProps of the type they extend. WaveContextValue is unchanged.
  4. details.event may be the grid's own. A cell of yours that sorts or selects through useDataGridSort().setSort(sort, event?) or useDataGridSelection().toggle(id, event?) without an event reaches onSortChange and onSelectedItemsChange with an untrusted Event of type sort or select and no target (as useTableColumnSizing passes new Event('resize')), so details always comes: a handler that reads details.event.target checks it.
  5. Decided for 1.0, announced now (see Deprecated): ref placement does not change. ref reaches the root element, the one that receives className, with two exceptions that stay as they are: Input's ref reaches its <input>, also with contentBefore or contentAfter, where slotProps.root.ref reaches the bordered wrapper that takes className, and RadioGroup.Item's reaches its role="radio" button, while its className stays on its root <label>, which no ref reaches. controlRef reaches the focusable element of the controls that have one, and slotProps.<part>.ref a part. TimePicker's format will follow the locale's hour cycle, the optional details arguments become required, and so does Image.alt. WaveProvider classNames (app-wide classes per component) is not part of 1.0: it may come after it, as an addition.
  6. Everything else is opt-in: slotProps, the render-function slot children, getNativeElementProps, mergeSlotProps, Field's function child, FieldContextProvider and useFieldContext, 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; types SlotPart, SlotPartWithRef and SlotPartOwn; 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.track is slotProps.track, with the class wave-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 and ref of its element and any data-* attribute (a string, a number or a boolean), but no children, as, key or dangerouslySetInnerHTML (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 by getNativeElementProps fits a part too, and SlotPartWithRef<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: your className after the part's own classes through cn (the stable class stays first, and yours win a conflict of the same variant); your style over 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, and preventDefault() in one skips the component's handling of that event, its own on… 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; your aria-labelledby and aria-describedby ids after the component's, which are never removed; any other attribute replaces the component's default; null and undefined remove 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's placeholder wins over slotProps.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's label, Popover's title, a drawer header's heading and OptionGroup's label: the reference still reads hidden text), an aria-label on 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 (disabled or disabledFocusable) your onClick on 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 disabled Option's own onClick prop still runs, as in 0.17.1 (its parts' do not), and the drawings of ColorArea, ColorSlider and AlphaSlider (field, rail, thumb) take your onClick in every state, as their roots do. Input's root and input are one <input> without contentBefore and contentAfter (both apply, input last), and an Avatar without a badge is its own visual part. 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 a dismissButton part 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; types SlotRenderFunction and SlotRenderProps; Fluent's slot render function): a slot object's children may be (Component, props) => ReactNode, which renders in place of the slot's element. Component is the element type (the object's as, else the slot's default tag) and props every prop the element receives (the component's defaults such as aria-hidden, the merged className, the object's ref, what the component adds when it renders the element), so (Component, props) => <i {...props} /> keeps the wiring. Every slot takes it through resolveSlot and renderSlot, 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 as props.children, and one that returns nothing keeps the default glyph; an as that 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. A slotProps part and TeachingPopover's primaryAction and secondaryAction (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; type NativeElementProps; Fluent's getIntrinsicElementProps): 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 as onValueChange is dropped), data-*, aria-* and ref, and the attributes of the tag for a, button, img, input, label, li, ol, option, select, td, textarea and th (any other tag keeps the global set); excludedNames drops more (['size'] for Input's size name). key is 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. own holds the part's className, style and ref, its defaults (your props replace them), its locked attributes and handlers (they always win; a locked handler runs after yours unless yours prevented the default) and blockHandlers (your handlers of those keys are dropped, as on a disabled control); part may 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): children may 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 the id the 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) and aria-required, each only when it has a value, and no native required or size; Field renders the result inside its context with nothing merged into it. A library control in the result that receives no id gets its own and is named through aria-labelledby. An element child is wired as before.
  • useFieldContext() and FieldContextProvider (form-basic-8; type FieldContextProviderProps; Fluent's useFieldContext_unstable and FieldContextProvider): useFieldContext() returns a Field's FieldContextValue (the ids of its label, message and hint, required, size, validationState, …) inside a Field or a FieldContextProvider, and null outside one, without a warning, since a control works with and without a Field; FieldContextProvider provides a value of yours, for a field layout of your own (memoise the value).
  • Context hooks (foundation-39, api-1, buttons-29 and the gaps below; Fluent's use…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; types RadioGroupContextValue, UseRadioGroupItemOptions, UseRadioGroupItemResult): useRadioGroupContext() returns { value, disabled, select(value) }, and useRadioGroupItem(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; types MenuContextValue, MenuListContextValue): useMenuContext() returns { open, close(), isSubmenu } (close is the function a built-in item's activation calls), and useMenuListContext() { hasIcons, hasCheckmarks }, the icon and check columns the built-in items of the list keep, read from the list as its CSS reads them (false in the server HTML). An element of yours with role="menuitem" joins the list's arrow keys, typeahead and hover focus; Menu.Item has no asChild.
    • MessageBar (messagebar-6; type MessageBarContextValue): useMessageBarContext() returns { status, layout }, the bar's resolved status (Fluent's intent) and the layout it renders, so an action adapts to them.
    • DataGrid (ctx-1; types UseDataGridSortResult, 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), and useDataGridRowId() the id of the DataGrid.Row it is in (undefined in a header row). setSort and toggle take the grid's own paths, so onSortChange and onSelectedItemsChange fire once, with details ("Upgrading from 0.17", 4). Every caller of useDataGridSelection renders again on each change of the selection.
  • 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's CustomMenuItem, MessageBar's StatusAwareAction, DataGrid's CustomCell and Field's WithFunctionChild.
  • Documentation: the README's "Slots" section became the Customization chapter (named slots, slotProps and its merge rules, slot render functions with getNativeElementProps and mergeSlotProps, Field's function child, the context hooks, ref and controlRef, what is not customizable); its link anchor #slots is 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 on mergeSlotProps), 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 covers slotProps and the context hooks.
  • Types SlotPart, SlotPartOwn, SlotPartWithRef, SlotRenderFunction, SlotRenderProps, NativeElementProps, FieldContextProviderProps, RadioGroupContextValue, UseRadioGroupItemOptions, UseRadioGroupItemResult, MenuContextValue, MenuListContextValue, MessageBarContextValue, UseDataGridSortResult and UseDataGridSelectionResult.

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). With slotProps, 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-label unset (a menu item's label of every kind, Option's content, which also locks role, 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 locks inert and aria-hidden beside hidden; the decorative parts lock tabIndex unset (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 lock inert beside hidden and aria-hidden (the controls of Switch, Checkbox, a radio, Input, Combobox, Dropdown, SpinButton, SearchBox, TimePicker, DatePicker and ColorPicker.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 locks role and aria-live, and Toast's Dismiss button role. 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 no onClick of 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 from useMessageBarContext().layout settles 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 Menu renders its root once more as it mounts, to record its list element for useMenuListContext; its items do not render again.

Types

  • FieldProps['children'] and SlotObject['children'] widen, CardProps['checkbox'] narrows, and every props type with parts gains slotProps ("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_18 gates six imports whose closure holds a module of this release, each at its size measured at the end of the phase plus BUDGET_MARGIN_0_18 (512 bytes minified, 192 gzip), with its published 0.17.1 size (BASELINES_0_17_1) printed beside it: only Button, only MessageBar, only Tree, only Dialog, WaveProvider with Dialog, and only DataGrid, whose budget was 0.16.0's size plus 25% (see Size). Other imports that hold one (only Table, 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 of createBrandTokens, waveTokens, useVirtualWindow and the presence core stay, since no module of this release is in their closures. An import recorded in several lists is measured once (verifyDist takes a measure option, which its tests count). Probes: an import of only getNativeElementProps or only mergeSlotProps holds 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 or react-dom code (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 runs lib/slotProps and lib/nativeProps on 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, and checkTestOnlyModules fails on a file of theirs in dist. MODULE_ONLY_NAMES gains the seams of the phase, and a test pins mergeSlotProps as 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 of src/lib/slotParts.ts (a slotProps key, 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) keeps src/lib/deprecations.ts in step with the code, the CHANGELOG and the upgrade guide (each row's announcement, each warning once, and the warnDeprecated and resolveDeprecatedProp call sites counted against the rows that warn); src/test-utils.ts gains sortAttributes, normaliseIds, openingTags and expectInertSlotProps, 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 but useRadioGroupContext.
  • Stories: the color matrices of Badge and CounterBadge leave important out, 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, the onChange value callbacks of the other value controls, onOptionSelect, selectedValue and defaultSelectedValue, onTabSelect, onNavItemSelect, TabList vertical, currentStep and defaultCurrentStep, selectionMode="multi", DataGrid's selectedKeys, defaultSelectedKeys, onSelectionChange and 0.4 sort props, Table.Head and Table.HeadCell, Stack direction, the variant of Skeleton, Link and Tooltip, a numeric Text weight, a Nav.Category label taken from its text and Accordion's single-mode openItems, defaultOpenItems and onOpenItemsChange. 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.dismiss and Tag.dismissIcon with button props ({ as: 'button', onClick, … }) are removed; pass icon content, and handle the press in onDismiss or onClear. Each warns once in development. A <button> or Button element 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 dark and high-contrast theme classes (announced in 0.5): WaveProvider stops adding them and Wave's styles stop selecting them. Target wave-dark and wave-high-contrast in your CSS, and key a class-based dark: 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. Use color="severe" to keep the orange look. From 0.18 it warns once in development.
  • Tooltip delay (announced in 0.7): use openDelay.
  • A numeric size on Input, Select and Slider (announced in 0.9): a type error from 1.0. Use htmlSize on Input and Select; on Slider it has no effect, so remove it.
  • InfoLabel label (announced in 0.9): use children.
  • wave-tag-picker__control and wave-tag-picker__group (announced in 0.11): removed; target wave-tag-picker-control and wave-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): use columnId.
  • Done calling onDismiss (announced in 0.14): in 1.0 TeachingPopover's Done calls onFinish only; handle Done in onFinish.
  • useRovingTabIndex(containerRef, options) (announced in 0.18): the 0.4 call shape of useRovingTabIndex is removed. Call useRovingTabIndex(options) and spread the returned containerProps on 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 without items, sort or defaultSort, is removed. Give the grid one of them and read onSortChange(sort, details). It warns once in development.
  • A className with presence variants in place of motion (announced in 0.18): through 0.x a className that holds presence variants keeps turning the default motion off on Menu.Popover, Dialog.Content, Drawer and NavDrawer (the compatibility rule of 0.15); in 1.0 it no longer does, so pass those classes through motion. It warns once in development.
  • The details arguments announced before (announced in 0.6, 0.7, 0.8, 0.10, 0.11 and 0.14): the details parameter becomes required in Dialog, Drawer and NavDrawer onOpenChange, Menu and Toolbar onCheckedValuesChange, Tree onCheckedItemsChange, Calendar onValueChange, useListbox's onOpenChange and onSelect, Overflow onOverflowChange, DataGrid onSortChange and onSelectedItemsChange, and Table.SelectionCell onCheckedChange. WaveUI passes it on every change it makes from an event; a form reset that restores the defaultChecked of a Table.SelectionCell passes none in 0.x and passes it in 1.0.
  • The details arguments announced now (announced in 0.18): AvatarGroup onOpenChange, onColumnWidthsChange (DataGrid and useTableColumnSizing), Table.ResizeHandle onResize, useTableSort's onSortChange, useSelection's onSelectedItemsChange and useFlatTree's onCheckedItemsChange (FlatTree's checked state) will require the details argument in 1.0. WaveUI passes it on every change it makes from an event; useTableSort's setColumnSort and toggleColumnSort and useFlatTree's setChecked, called without an event, pass none in 0.x and pass it in 1.0, with an event of their own as useTableColumnSizing already does (new Event('resize')).
  • Image.alt (announced in 0.18): required in 1.0 (alt="" for a decorative image), and StrictImageProps becomes an alias of ImageProps. A missing alt already warns once in development.
  • TimePicker format (announced in 0.18): without format a TimePicker shows 12-hour times through 0.x; in 1.0 it follows the locale's hour cycle. Pass format="12h" to keep 12-hour times. TimePicker has no hourCycle prop.
  • Ref placement: no change (decided in 0.18): ref stays on the root element (the one that receives className), with two exceptions that stay too: Input's ref reaches its <input>, also with contentBefore or contentAfter (slotProps.root.ref reaches the wrapper), and RadioGroup.Item's reaches its role="radio" button, while its className stays on its <label>. controlRef stays on the focusable element of the controls that have one, and parts take slotProps.<part>.ref. 1.0 moves no ref.

Fixed

  • Card checkbox with children (checkbox={{ children: … }}) crashed in 0.17.1: the slot object's children were spread onto the void <input>, and React threw. They are dropped now, and CardProps['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 with tokens, 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 of lib/slot, paid for by compacting that module, so it is 143 bytes smaller (1 gzip). verify-dist proves 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 of useMessageBarContext and 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 with WaveProvider by 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 of setSort and 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: useFieldContext 146 and 132, FieldContextProvider 232 and 165, useRadioGroupContext 852 and 511, useRadioGroupItem 1,748 and 919, useMenuContext 1,982 and 928, useMenuListContext 1,410 and 749, useMessageBarContext 700 and 450, useDataGridSort 954 and 496, useDataGridSelection 3,279 and 1,507, useDataGridRowId 991 and 516), a DataGrid-only import holds the grid's contexts but not the module of its public hooks, and no component imports getNativeElementProps.
  • Budgets: verify-dist now 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-dist probes what the latter hold.
  • dist/styles.css is unchanged, byte for byte, and so is dist/preflight.css: no part adds a utility.