This documentation is under construction. Pages can be missing or change at any time. Follow it on GitHub.

Skip to content

Changelog

The changes of the phem/phem package, its client (assets/) and the phemc compiler. The editor extensions have their own changelogs (for example editors/vscode/CHANGELOG.md).

The project has no stable release yet: a minor version can break the public API. The entries that break the code of an application start with Breaking.

Unreleased#

  • The language server gives the tag editing. It links the name of an open tag and the name of its closing tag (textDocument/linkedEditingRange), also for a component (<Card>) and a slot tag (<Card.footer>): a change of one name also changes the other. The new phem/closingTag request gives the closing tag to add after the user types the > of an open tag (<div> becomes <div>|</div>). It gives nothing in PHP code (->), in Twig code, in an attribute value and after a void element (<br>).
  • The language server gives the signature help (textDocument/signatureHelp): in the arguments of a call, the editor shows the parameters and marks the parameter of the argument at the cursor. It works for a PHP call ($this->remove(, new Scientist(), a Twig handler call (onClick={{ remove(1, |) }}), a method of a Twig variable, and a Twig function or filter (path('app_home', |)). A named argument marks its parameter.
  • The language server finds the references in the .php files of the project too, and the rename changes them. A call of a function of a .phem file in a controller (Initials('Ada')) is a usage. The declaration must still be in a .phem file, and a .php class that overrides a method refuses the rename of the method.
  • The language server finds the references of the properties, the props, the slots, the class constants and the enum cases, and renames them. A prop has its PHP names ($this->title), its Twig names ({{ title }}) and the attributes of the tags (<Card title="Hello" />). A slot also has its slot tags (<Layout.footer>).

0.11.0 (2026-11-30)#

  • The language server resolves a name in a group import to its own symbol: in use function App\Ui\Cards\{BigCard, Card};, go to definition and hover on Card open Card, not BigCard. The label of a named argument (currency: Currency::Eur) and the name of an enum case (case Card;) are not class names any more.
  • The language server completes the value of a backed enum prop: <Button variant="|" /> shows the values of the cases. The prop item writes variant="".
  • The language server has quick fixes for an unknown component (E010, add the import), an attribute without its use import (W004), the old slot syntax <Card:footer> (E013), and a void element that is not self-closed (E004).
  • The language server renames components, functions, classes and methods. It changes the tags, the closing tags, the slot tags, the imports, the PHP names and the Twig handlers in the .phem files.
  • The language server has completion and hover for the built-in controllers: the data-controller values, the data-phem-<controller>-target attributes and their parts, and the data-phem-<controller>-<name>-value attributes. The hover also shows on the tag of a component.

0.10.2 (2026-11-24)#

  • phem requires twig/twig 3.31.1 or higher, the security release of Twig. Twig 3.31 also refuses a spread (...) outside a sequence, a mapping and the arguments of a call. phemc compiles a spread of attributes to a call, so the templates of phem do not change.

0.10.1 (2026-11-23)#

  • A required phem-toggle with an <input type="hidden"> (a native <button>, or an unchecked-value) stops the submit of a phem-form while it is not checked. The browser does not validate a hidden input, so the toggle gives phem-form and phem-field a valueMissing error with the message of the browser for a required checkbox.

0.10.0 (2026-11-23)#

  • Breaking phem-tabs no longer supports a tab that is a link (<a href>). A bar of links to pages is not a tab list: use a <nav> with aria-current="page", or phem-navigation-menu.

  • Breaking phem-sortable no longer moves the item while the pointer moves. The list of the drop place gets data-drop, phem.css draws a drop marker (--sortable-drop-color, --sortable-drop-thickness), and the item moves one time on release, with moveBefore() when the browser has it. Escape removes the marker.

  • Breaking phem.css sets touch-action: none only on the phem-sortable handles. A touch on an item with no handle scrolls the page, and a hold of 250 ms starts its drag.

  • Breaking A required phem-radio-group gives required to its inputs and stops the submit with no checked radio. Use <input hidden> for its input: the browser does not validate an <input type="hidden">. The focus goes to the radio of the tab stop.

  • Breaking A modal phem-dialog keeps the page scroll with overscroll-behavior: contain in phem.css, not with overflow: hidden on <html>. Only a browser with no closedby (Safari) still gets the <html> lock. Load phem.css, or add the rules yourself.

  • Add a mode with one input for the whole code to phem-otp-field: a codeInput target in place of the input targets gets autocomplete="one-time-code", inputmode, maxlength and a pattern of the full code. Optional slot targets (aria-hidden) show each character, with data-filled and data-active at the caret. A paste removes the spaces and the dashes.

  • phem-tabs has the hiddenUntilFound value and data-phem-tabs-hidden-until-found: the search of the browser finds the text of a hidden panel and selects its tab.

  • phem-tabs gives tabindex="0" only to a panel with no focusable element.

  • Tab and Shift+Tab close a phem-context-menu. The focus goes back to the element that had it before the open, and the Tab moves on from it. The menu does not trap the focus.

  • A modal phem-dialog gets closedby (closerequest, or none when dismiss is false). The controller still closes it on a tap on the backdrop, one time. A second Escape that the browser does not let the page cancel closes the dialog and sets the state.

  • The pointer can cross the gap between a phem-tooltip trigger and its tooltip.

  • A phem-tooltip whose text is not the name of its trigger gets role="tooltip", and the trigger gets aria-describedby.

  • The time of the phem-toast toasts stops while a modal dialog makes them inert. After the close, each toast stays for the rest of its time, and the user can get to it.

  • The controls of phem-field get aria-invalid="false" until the field is invalid. Before, the attribute was not set.

  • In the onBlur mode, phem-field validates on blur only after a change by the user, after a submit, or when the field is invalid. A Tab through an empty required field shows no error now.

  • phem-field announces an error that shows on a blur, a change or Enter in the polite live region of the page, 500 milliseconds later. A submit announces nothing.

  • phem-form and phem-field give the focus to the switch or the checkbox of phem-toggle, not to its hidden input. In a phem-field, the element gets aria-invalid and aria-describedby.

  • phem-sortable sets aria-pressed="true" on the handle during a keyboard drag, announces the drop and the cancel of a pointer drag, and sends each announcement 500 ms after its step.

  • phem-scroll-area renders a scroll once per frame, and removes data-scrolling at scrollend (500 ms after the last scroll in a browser with no scrollend).

  • phem-scrollspy uses an IntersectionObserver, and sets aria-current when the scroll stops.

  • The stand-in field of data-phem-autofocus-keyboard has no aria-hidden. It gets the name of the element of the tap and aria-busy="true".

  • A part with an animation that runs forever (a spinner in a toast, a dialog or a popup) closes when its other animations end. Before, its close waited forever: a loading toast stayed on the page, and a dialog with a spinner did not close.

  • The keys of an IME composition (a Japanese or a Chinese word that the user confirms with Enter) go to the IME in Safari too. Before, the Enter that ends the composition chose the highlighted item of phem-combobox. In the filter input of phem-menu, Enter clicked the highlighted item and the arrow keys moved the highlight during a composition in all browsers. phem-select, phem-field, phem-number-field, Escape and phem:shortcut use the same check.

  • A view transition (data-phem-transition) that the browser skips, for example in a hidden tab, no longer logs an unhandled promise rejection.

  • Breaking The defaults of the state options are safer: phem.state_bind_session is true (it was false), and phem.state_max_age is 3600 seconds, one hour (it was 86400). A state that leaks (a log, a shared HAR file) is valid only in the session of its user, and only for one hour. A login, a logout or a new session id reloads the open pages on their next event, and a page that stays open for more than one hour reloads on its next event. The Mercure token of a page lives as long as a state, so a page with real-time updates and no event for one hour reloads when the hub closes its connection. The default of data-phem-offline-queue-max-age-value is 3600 too. Set the old values in config/packages/phem.yaml to keep the old behavior, for example for a dashboard that users leave open. See "Keep security decisions out of the state" in docs/security.md.

  • The server does not register the handler of a disabled form control (disabled on a <button>, an <input>, a <select> or a <textarea>) or of an inert element (inert) for the events that the browser never sends to it: onClick, onKeyDown, onKeyUp, onFocus and onPaste. The element keeps its handler id, but an event for it runs no handler, and the page stays as it is. Before, a user could send the id of <button onClick={{ publish }} disabled={{ not ready }}> by hand and run publish, and the second click of a double click on a button that the first click disabled ran its handler again. phemc evaluates disabled and inert once, in a Twig variable, and gives them to phem_on() ({% set _phem_off_0 = (not ready) %} and phem_on('click', publish, _phem_off_0)). A form control with a spread uses the new phem_control_attrs(). A click on a control that the server rendered disabled and that a script enabled does nothing. See "A disabled element has no handler" in docs/security.md.

0.9.0 (2026-11-23)#

  • New phem-palette controller and palette_script() Twig function: the user picks a named palette (a set of colors) next to the light and the dark theme. {{ palette_script(['base', 'contrast']) }} in the <head> gives <html> the stored palette before the first paint (data-palette), and a phem-palette#choose picker stores the choice in localStorage. See "Let the user pick a palette" in docs/controllers.md. The language server completes palette_script().

0.8.0 (2026-11-22)#

  • Breaking The #[Async] event handlers are removed: Phem\Attribute\Async, the Phem\Async\* classes (Promise, AsyncHandlerMessage and the others), the Messenger handler of the worker and ComponentTester::settle(). phemc does not report E054 and E055 any more. symfony/messenger is no longer a suggested package. Run the slow work in your own Messenger message handler, and push its result with Streams.

0.7.0 (2026-11-21)#

  • An inline phem-combobox list (no popup part) in a <dialog> starts again when the dialog closes (its close event, after the close animation of phem-dialog), as Base UI unmounts the popup: the input gets its default value, the filter shows the items of that text, the highlight goes and the list scrolls to its top. With autoHighlight="always", the first item gets the highlight at the next open. The focus that leaves an inline list keeps its text, its filter and its highlight, as in Base UI: a close button of the dialog shows no change of the highlight during the close animation.
  • A phem-combobox grid with a filter of the browser fills its rows again after each filter: the visible items of each group go into its rows in their order, with as many items in each row as the first row has. A row with no visible item gets hidden. An empty text, a morph and the Turbo cache put the items back in their first rows. The new data-phem-combobox-insert-into-value (the id of a text field) inserts the data-value of a chosen item into the field at its caret, closes the popup and gives the field the focus. phem/ui-base: the insertInto prop of Combobox and Autocomplete.
  • phem-combobox has a fuzzy filter of the browser (data-phem-combobox-filter-value="fuzzy"): the characters of the text are in the label in the same order, as the MATCHES rank of match-sorter. The lines of the data-keywords attribute of an item are more keys of the filter (all the modes): each key matches alone. A highlight target shows the text of the user in mark elements. phem/ui-base: filter="fuzzy", the keywords prop of ComboboxItem, and the new ComboboxHighlight part.
  • A status part of a phem-combobox opens the popup only when it shows something: a part of its state, or a text that is not hidden. The new results part shows when items show, and the new more part shows with it when the limit value hides matches of the filter of the browser. An element with data-phem-combobox-text is a text template: {count} is the number of hidden matches, and {query} is the text of the input. The morph keeps its text. The ComboboxStatus of phem/ui-base has the results and more props, and the ComboboxEmpty has a text prop. The state of a filter of the browser does not wait for the server.
  • Breaking: The items of a phem-combobox with no selection (an Autocomplete) get no aria-selected now, as in Base UI: the highlight is data-highlighted and aria-activedescendant. A CSS rule on [aria-selected="true"] for the highlight must use [data-highlighted]. The input gets aria-controls only while the popup is open (an inline list keeps it), and spellcheck="false", autocorrect="off" and autocapitalize="none" unless the markup gives them. A groupLabel part gets aria-hidden="true". The items of a closed popup lose data-highlighted at the end of the close animation.
  • A phem-combobox popup with nothing to show (a text with no match, no empty part, and no status part that shows something) closes on the first Escape, and the text stays, as in Base UI. The second Escape clears the text. Before, the first Escape cleared the text and opened the popup with all the items.
  • An input of a phem-combobox that the user empties closes the popup, as in Base UI. The next ArrowDown opens it with all the items. With openOnInputClick, or with the input in the popup, the popup stays open.
  • With autoHighlight: true, a phem-combobox gives the highlight to the first item only after the user types a text, or when an arrow key opens the popup. The pointer that leaves the items removes the highlight, as in Base UI, and the next ArrowDown goes to the first item. Before, the first item got the highlight again at each render.
  • A choice in a phem-combobox with a list of the server and no selection (an Autocomplete) writes the label of the item in the input. The input and change events go after the event of the click, so the server searches the label. An onClick handler of the item does not have to set the text of the input.

0.6.1 (2026-11-21)#

  • phemc mcp has the --project <dir> option: the project root, for an agent that starts the server in another directory (for example Cursor and VS Code, with ${workspaceFolder}). The new doc "Connect a coding agent to the MCP server" (docs/mcp-server.md) shows the setup for Claude Code, Cursor, VS Code, Codex and a container.

0.6.0 (2026-11-20)#

  • The website has /llms-full.txt: all the docs in one file, in the order of the navigation, without the changelog. /llms.txt links to it.
  • The check hook of the Claude Code plugin checks only the files of the project of the session: a file in another directory could come with its own vendor/bin/phemc, and the hook never runs it.
  • make eval-agents runs the agent eval of the Claude Code plugin: real claude -p sessions on eight UI tasks, with and without the plugin, scored with phemc check and the tags of each task (editors/claude-code/evals/).
  • The Claude Code plugin (0.2.0) starts phemc mcp of the project, has a phem skill (the workflow, the new cheatsheet and the list of the docs) and a phem-ui skill (the components of the installed packages), and runs phemc check after each write or edit of a .phem file: an error goes back to Claude, which corrects the file. New doc: "Phem cheatsheet" (docs/cheatsheet.md, phemc docs cheatsheet), the syntax on one page and the rules that are easy to break.
  • New phemc mcp command: a Model Context Protocol server on stdin and stdout for the coding agents. Its tools give the texts of phemc search, docs, components and examples (phem_search, phem_doc, phem_components, phem_component, phem_examples), and phem_check checks a file of the project or a code in place of it, with the diagnostics of this file only. The server reads the project again for each call, and its tools write nothing. See "Connect the agent to the MCP server" in docs/ai-agents.md.
  • phemc examples <key> shows the code of an example as a complete file: the use statements that it needs, the top-level constants and the classes that it uses, the example without its docblock (the text is above it), then its helpers. A component of the examples that another example uses (an icon, a part of a demo, also in another file) is a helper: it is not an example of its own.
  • Fix: a comma separates the words of an @aliases docblock tag, so an alias can have more than one word (@aliases popup window). Before, each word was an alias of its own.
  • phemc search does not score the list of the components that an example uses (it stays in the context of the result), so an example does not rank above a component that it only uses.
  • New phemc docs, phemc components, phemc examples and phemc search commands give a coding agent the texts that it needs, with the installed versions: the docs of Phem (in the phemc binary), the components of the app and of the packages (docblocks, props with their defaults and enum cases, and the parts of each family from #[Context] and #[Provide]), and the examples and the guide of a package. Each text has a stable key (events#poll-the-server, Acme\Ui\Dialog, acme/ui#naming). The search is lexical (BM25) and gives the same result each time. phemc search --eval <file> runs a retrieval eval and fails under 100 % recall. --format json prints JSON for the tools. The new doc "Use Phem with coding agents" shows the workflow and a text to copy into AGENTS.md or CLAUDE.md.
  • A package can give examples (extra.phem.examples) and a guide for agents (extra.phem.guide), and the other names of a component in an @aliases docblock tag. An app build never compiles the examples. phemc build, check and watch compile them with --examples-of <package>, for the demo of a package.
  • phemc check <file> and phemc check - (stdin, with --stdin-path) check one file: the project compiles with it, and only its diagnostics show.
  • Fix: the first focus of a phem-dialog does not scroll the dialog and the content of its popup, as in Base UI. Before, a viewport that scrolls (the "outside scroll" layout) opened at the bottom of a tall popup: the browser gave the focus while the start transition moved the popup out of the screen, and scrolled to it. Only a drawer went back to the top.
  • Fix: a phem-combobox with multiple and a list of the server removes a kept item from the list when its chip goes, also when the morph of the answer changes only the chips. Before, the item stayed with aria-selected="true" when the chips were in a component of their own (for example a class component around them), because phem morphs only the components that changed, and the list did not change.
  • phem:error gives the ids of the DOM events of the request in detail.ids, as phem:send, phem:receive and phem:done do, and phem:queue gives the id of its DOM event in detail.id. A listener can tell which DOM event failed.
  • A choice of phem-combobox that shows before the answer hides only the error message of its own event: the failure of another event of the same handler shows the message. The chip of the chipTemplate part keeps a $ and a {value} of the label as they are. A choice ends also when a morph moves the combobox before the answer: its chip loses data-pending.
  • The multiple selection mode of phem-combobox also works with a list of the server, for a form that sends the choices on submit: the server searches, and the browser keeps the chosen items. A click on an item with no handler adds a chip from the chipTemplate part, where {value} in the attributes is the value of the item (for example <input type="hidden" name="reviewers" value="{value}">). The chips that the browser made stay through the morph, until a chip of the server for the same value replaces them. A chip that the server renders with no hidden is a first value, and a server render that removes it removes the value. The form fields of a hidden chip get disabled, so a form sends only the chosen values. In phem/ui-base, selectionMode="single" or "multiple" gives the selection to the browser also with a list of the server, and with a name each ComboboxChip with a value (and the chip of a ComboboxChipTemplate) has a hidden input with its value.
  • A phem-combobox with a list of the server shows a choice before the onClick handler of the item answers. With multiple, a click on an item that is not chosen adds a chip from the new chipTemplate part (a <template>: {label} is the label of the item), and the item gets aria-selected="true". With the single selection mode, the browser selects the item, as before. While the handler runs, the chip (or the clear parts of the single selection mode) gets data-pending, and the chip stays through the morph of another event. The answer shows the server render. When the handler fails, the part gets data-failed, phem shows no error message, and after one second the choice goes: the chip leaves, or the selection is cleared.
  • Fix: a click on an item of a phem-combobox with the single selection mode and a list of the server sends the input and change events of the label after the event of the click, as with multiple. Before, the search went first: its server render did not have the item, so the onClick handler of the item did not run (the server answered 409, and the page loaded again). The input still shows the label at once.
  • Fix: the highlight of the keyboard in a phem-combobox stays when the pointer leaves the items, also on an item that the pointer highlighted before. Before, the item lost the highlight, for example the first chosen item of a multiple combobox after the user emptied the input, when the list changed under the pointer.
  • Fix: a phem-combobox with the single selection mode and a list of the server keeps the text that the user types when the server render marks the item that the browser already selected (for example with a bound value). Before, the answer of the search wrote the label of the item in the input again, for example Lindsay Walton after the user deleted a letter.
  • Fix: a phem-combobox with the single selection mode and a list of the server keeps a new selection when the next server render removes the item of the old selection. Before, the input, the value part and the selection went empty, for example after a choice with Enter in a search that still showed the old selected item.
  • Escape on the closed popup of a phem-combobox clears the selected item and the chips too, as in Base UI, not only the text: a shown clear part gets the click (with its handler), and with multiple and a list of the server, the chipRemove of each chip gets a click. When the selection goes, the item that the browser kept for it leaves the list at once, and the status parts with no text to search do not wait for the server.
  • The single selection mode of phem-combobox removes the selection when the user deletes all the text of the input, as in Base UI: the value part gets "", the clear part hides, and the input stays empty when the popup closes. An input in the popup (a search) keeps the selection.
  • The single selection mode of phem-combobox (data-phem-combobox-selection-mode-value="single") also works with a list of the server, as the Async search of Base UI: the server searches, and the browser keeps the selection. A click on an item selects it, writes its label in the input and sends the input and change events, so a bound value part sends the value of the item. The label of the selection is not a search: the event of the input gives "" in $e->value (and a phem:bind input gets ""). The browser keeps the selected item in the list: a server render that does not have it keeps it at the end of the list. When the popup closes, the input gets the label of the selection again. The clear part shows only while an item is selected, and a popup that opens has the highlight on the selected item. In phem/ui-base, phem:bind on Combobox (with no multiple) gives the single selection mode, with a hidden input of the selected value, ComboboxItem is selected when its value is the bound value, and the new label prop of ComboboxItem gives its data-label. The Async search (single) demo searches in the onChange handler of the input with a repository service.
  • A phem-combobox with multiple has no free text, as in Base UI: when the popup closes, the text of the input goes (with its input event), and the chips stay. A popup that opens before the user types has the highlight on the first chosen item, and so does an input that the user empties. With a list of the server, a choice while the input has a text closes the popup, and then the text goes: the event of the click goes first. The browser keeps the chosen items in the list while their chip part (with the data-value of the item) shows. In phem/ui-base, a Combobox with multiple opens on a click on the input. The Async search (multiple) demo searches in the onChange handler of the input with a repository service.
  • The status part of phem-combobox shows the state of a search of the server with its parts (the elements with data-phem-combobox-status): pending while the event of the input runs, error when it failed (the items get hidden, and phem shows no error message), idle with no text and no item, and empty when no item matches the text. The text of an input with no phem:bind stays through the morph. In phem/ui-base, ComboboxStatus takes the idle, pending (with a spinner), empty and error texts, and hides when it has no text to show.
  • The value of an event ($e->value) is the text of the user when a controller shows another text in the field (phemValue, for example the inline completion of phem-combobox), as the value of a bound field already was.
  • A phem-combobox with its input in the popup (a searchable select) gives the popup role="dialog", as in Base UI. The trigger gets aria-haspopup="dialog", aria-controls to the popup while it is open, and data-placeholder while no item is selected. In phem/ui-base, ComboboxIcon gets the icon color of Base UI.
  • A phem-combobox with a client filter and the new multiple selection mode (data-phem-combobox-selection-mode-value="multiple") keeps the chosen items in the browser, as the Combobox of Base UI with multiple. A choice sends no event to the server. A click on an item adds or removes its value, and the chip parts with a data-value show only for the chosen values, in the order of the choices. A chipRemove and the clear part remove the values. A choice clears the text of the input, and closes the popup when the input had a text. The controller dispatches phem-combobox:change with the array of the values. While a value is chosen, the input has no placeholder and gets the aria-description of its data-phem-combobox-description attribute ({count}), and the new chips part keeps its aria-label. As in Base UI, the chips part gets role="toolbar" while a chip shows, the focus on a chip closes the popup, a press on an inputGroup out of the input and its parts gives the focus to the input, and an inputGroup gets data-placeholder while no item is selected (also in the single selection mode).
  • Breaking: In phem/ui-base, a Combobox with multiple and a filter keeps the chosen items in the browser (the multiple selection mode). Render a ComboboxChip with the value of its item for each item, and give no handler to the items and to the ComboboxChipRemove. A handler that toggles the item on the server now runs after the choice of the browser. Set selectionMode="none" to keep the choice on the server. defaultValue can be a list, and ComboboxInput has a selectedDescription prop for the aria-description of the chosen items. ComboboxChips is now the row of the chips, as the Chips of Base UI: put it in a ComboboxInputGroup, the box around it. ComboboxChip (now a <div>) and ComboboxChipRemove get the classes of the Multiple select demo of Base UI.
  • A phem-combobox with a client filter keeps its items and its highlight while its popup closes, as in Base UI. Before, a choice wrote the label of the item in the input, and the closing popup showed all the items again, with no highlight. Escape after a text with no match also showed all the items. The next open filters again. An item that the filter hid also gets its data-selected and aria-selected now.

0.5.0 (2026-11-18)#

  • Breaking: The reply of a handler moves from Phem\Event to the new Phem\Reply class. A handler declares Reply $reply, at any position, alone or with Event $e, and calls $reply->toast(), $reply->announce(), $reply->refresh(), $reply->clearFiles() and $reply->dispatch('saved', ['id' => 1]). Phem\Event has only the input of the event now: toast(), announce(), refresh(), refreshes(), clearFiles(), clearsFiles() and the dispatcher property are removed, and Event::fromArray() has no $dispatcher parameter. HandlerMiddleware::handle() and HandlerCallMiddleware::handleCall() get the Reply after the event: handle(\Closure $handler, Event $event, Reply $reply, \Closure $next). A unit test of a handler checks $reply->refreshes() and $reply->clearsFiles(). The work of an #[Async] handler logs a warning for a $reply->refresh() or a $reply->clearFiles(), as for a toast. phemc gives the error E047 for a handler call in the markup that gives an argument to a Reply parameter, as for an Event parameter.
  • A phem-navigation-menu in a content of another navigation menu (a nested menu) gives its arrow keys to that content, as in Base UI. The arrow keys in the content move the focus between its links and the triggers and the links of the nested menu, from the last one to the first one. Before, ArrowRight on the trigger of a vertical nested menu opened it, and the arrow keys in the content skipped that trigger. Enter, Space, a click and the pointer still open the nested menu. The docs no longer say that a nested menu is not supported.
  • The pointer that leaves the trigger of a hover popup (phem-popover and phem-menu with openOnHover, and a submenu) away from the popup closes it at once, as the safePolygon of Base UI. The safe space is now the triangle from the point where the pointer left the trigger to the popup, and the gap between them. Before, it was the shape around the trigger and the popup: with a tall submenu, it covered the items below the trigger, so a move down over the triggers of several submenus kept them all open for a time.
  • In a phem-menu with a filter (input part), the highlight on another item (with the pointer or the arrow keys) closes an open submenu, as the focus does in a menu with no filter. Before, the input kept the focus, so the submenu stayed open while the pointer was on other items.
  • In a phem-menu with a filter, the arrow keys open and close a submenu, as in Base UI. ArrowRight in the input opens the submenu of the item with the highlight, when the caret is at the end of the text: the input of the submenu gets the focus (or else its first item). ArrowLeft in the input of a submenu closes it, when the caret is at the start of the text. A submenu that closes gives the focus back to the input of the menu, and its trigger keeps the highlight. Before, only Enter opened the submenu, and Escape gave the focus to the trigger of the submenu.
  • A popup of phem-popover, phem-tooltip, phem-menu, phem-context-menu, phem-combobox, phem-select and phem-navigation-menu goes to its place at once, also with a CSS transition of top and left. The transition animates only the move of an open popup to another trigger, as in Base UI. Before, the transition also moved the popup from the corner of the viewport on the open, and delayed the popup behind its trigger on a scroll.
  • A popup in the top layer (an open popover) gets position: absolute and a place in the page, as in Base UI. A scroll of the page moves it with its anchor in the same frame. Before, it had position: fixed, and the client moved it after the scroll, so a fast scroll showed the popup behind its trigger. A popup with an anchor in a fixed or sticky box, or at the point of the pointer, keeps position: fixed.
  • Nested drawers of phem-dialog work as in Base UI:
    • Each dialog around an open dialog counts the open dialogs at all levels in --nested-dialogs and --nested-drawers. With three open drawers, the first one gets 2 and the second one gets 1. Before, only the dialog directly around it changed, so the first drawer did not go back in the stack.
    • The count changes when the close of a dialog starts. Before, it changed at the end of the close animation, so the dialogs behind moved only after it.
    • The popup of a drawer gets --drawer-height (its own height) while a drawer in it is open or closes, and while it closes. With height: var(--drawer-height, auto), the drawer behind gets its own height back with an animation. A drawer in a drawer gets --drawer-height: initial when it keeps no height, so it does not inherit the value of the drawer around it. Before, only a drawer with snap points got --drawer-height.
  • A dialog of phem-dialog in an open dialog gets its own --nested-dialogs (and --nested-drawers for a drawer): 0 when no dialog is open in it, as in Base UI. Before, it inherited the value of the dialog around it, so a stack style moved and scaled the two dialogs in the same way, and the dialog in front covered the dialog behind.

0.4.11 (2026-11-18)#

  • phem:lock disables the element of a handler while its event runs: <button onClick={{ submit }} phem:lock>. At the event, the browser gives the element aria-disabled="true" at once, before the request goes. The element keeps the focus and sends no other event until the answer. The server keeps no loading state. phemc warns about phem:lock on an element with no handler (W006).
  • A panel of phem-collapsible and phem-accordion that the search of the browser (Ctrl+F) finds opens with no animation, as in Base UI. It gets data-instant and the auto size at once. Before, the height animation moved the text that the browser scrolled to.
  • A closed panel of phem-collapsible and phem-accordion gets 0px in its --<name>-panel-height and --<name>-panel-width variables at the end of the close. Before, a panel with hidden="until-found" kept its size in px, and got its open height again as an empty block after the close.

0.4.10 (2026-11-17)#

  • Fixes of the popups, the menu and the toasts:
    • The morph of an event keeps the trigger-id value of phem-popover, phem-menu, phem-tooltip and phem-dialog, and the attributes of a detached trigger (data-popup-open, aria-expanded). Before, the popup lost its active trigger.
    • The payload of a <span> viewport is in a <span>: before, a <div> put the text on a new line.
    • A phem-dialog that opens with its open value shows the payload of the trigger of its trigger-id value.
    • The filter of phem-menu shows again only the items that it hid: an item that the server hides stays hidden. The reset of the query at the close dispatches an input event.
    • The update of a toast with its id makes its parts again from the template: it can add a title or an action. A toast with an anchor gets its place after it shows, so its size is not zero.
    • Toasts::show() and $e->toast() throw an InvalidArgumentException for data that is a list or that has an array or an object as a value. Toast::fromDetail() keeps only the names with a scalar value or null.
  • A toast has the options of toastManager.add() of Base UI: $e->toast() and Toasts::show() take an id (a toast with the same id updates the toast on the screen, with data-update-key and data-updated), an action (a [data-phem-toast-action] button that calls the onCall handler around the toasts), data (the [data-phem-toast-data] parts), an anchor (the toast shows next to the element, with the side and side-offset values and a [data-phem-toast-arrow] part) and a viewport (the name value of the phem-toast element that shows it). A click on a data-phem-toast-show element shows its toast at once. The loading type is new. Phem\Toast has the new options. See docs/controllers.md.
  • A drawer of phem-dialog opens with a swipe from the edge of the screen: the new swipeArea part. The new virtual-keyboard value gives the popup the height of the keyboard of the device in --drawer-keyboard-inset. The new phem-drawer-provider controller gives the page an indent while a drawer in it is open (data-active and --drawer-swipe-progress). phem-dialog dispatches phem-dialog:open, phem-dialog:close and phem-dialog:swipe, and the viewport and backdrop parts get --drawer-swipe-progress during a swipe. A drawer that opens scrolls its viewport and its content back to the top: before, the first focus of the browser scrolled them to the last button. A swipe that the close confirmation stops gives the drawer its place again. See docs/controllers.md.
  • phem-menu has several triggers, as phem-popover: the trigger parts and the detached triggers with data-phem-menu-for. While a menu that is not modal is open, a press on another trigger moves it there. The viewport part shows a copy of the <template data-payload> of the data-phem-menu-payload of the trigger, the trigger-id value is the id of the active trigger, and the open action takes a triggerId param. Each trigger gets its own aria-expanded. A menu with an input part filters the items of its list part, with the new empty and clear parts, the data-label attribute of an item, and the new auto-highlight and filter values. The arrow keys move the highlight while the input keeps the focus. See docs/controllers.md.
  • phem-dialog has several triggers, as phem-popover: the trigger parts and the detached triggers with data-phem-dialog-for, for example an item of a menu. Each trigger gets its own aria-expanded, the payload part shows the data-phem-dialog-payload of the trigger, the trigger-id value is its id, and the open action takes a triggerId param. The new confirm-close value opens another dialog on a request to close when the user changed a field, and a [data-phem-dialog-discard] element in it closes the two dialogs and resets the fields. The new final-focus value gives the focus to an element after the close. See docs/controllers.md.
  • A preview card of phem-popover (open-on-hover with link triggers) moves at once to the next link that gets the keyboard focus, and the focus out to that link does not close it. Before, the card closed and opened again after the delay. The open action does not move the focus into a preview card. See docs/controllers.md.
  • phem-popover has several triggers, as phem-tooltip: the trigger parts and the detached triggers with data-phem-popover-for. A click on another trigger moves the open popup. The viewport part shows a copy of the <template data-payload> of the data-phem-popover-payload of the trigger, so a payload can have markup (also in a tooltip). The trigger-id value is the state of the active trigger, and the open action takes a triggerId param. Each trigger gets its own aria-expanded. See docs/controllers.md.
  • phem-tooltip has several triggers, as the detached triggers of a Base UI tooltip: the trigger parts, and the elements anywhere in the page with data-phem-tooltip-for and the id of the controller element. The popup moves to the trigger under the pointer or with the focus, and its viewport part shows the data-phem-tooltip-payload of that trigger, with data-current, data-previous and data-activation-direction for an animation. The popup gets --popup-width and --popup-height. The open and trigger-id values are the state, and the show action takes a triggerId param. See docs/controllers.md.
  • phem-combobox has the highlight values of the Base UI Autocomplete: auto-highlight takes always (an open list always has a highlight), keep-highlight keeps the highlight when the pointer leaves the items, and highlight-item-on-hover="false" stops the highlight on hover. A combobox with no popup part has an inline list that is always open (a command palette). The grid value makes the list a grid of row parts, with the arrow keys of a grid. See docs/controllers.md.
  • phemc passes a variable with the name of a Twig word operator (matches, in, and…) to its template when it is in the place of an operand: {% for id, name in matches %}. Before, it read the word as the operator, and the template had no variable.
  • The input of phem-combobox can be in the popup, as the Input inside the Popup of a Base UI combobox: a trigger opens the popup with the focus in the input, a value part that is not an input shows the label of the selection or its placeholder, and a choice gives the focus back to the trigger. See docs/controllers.md.
  • A group of phem-combobox gets the name of its new groupLabel part (aria-labelledby), as the GroupLabel of a Base UI combobox. Before, a group had no name.
  • The value part of phem-select takes a data-phem-select-template for two values or more ({first} (+{others} more)), and data-phem-select-markup to show a copy of the markup of the selected item, as the children function of a Base UI Select.Value. See docs/controllers.md.
  • phem-otp-field has a normalize value (uppercase or lowercase) that changes the accepted characters before the state, as the normalizeValue prop of a Base UI OTP field.
  • A fallback of phem-avatar with data-phem-avatar-delay uses its own delay, as the delay prop of a Base UI Avatar.Fallback. Render it with hidden: it does not show before the controller connects. See docs/controllers.md.
  • A link tab (<a href>) of phem-tabs opens its link on Enter and on Space, as the link tabs of Base UI. Before, Enter and Space selected the tab and did not open the link.
  • A phem-checkbox-group with a data-value inside another group is an item of that group, as the Nested parent checkbox of Base UI: it is checked when all its items are checked, the outer parent is indeterminate when some of them are checked, and the outer parent checks and unchecks all of them. See docs/controllers.md.
  • A panel of phem-accordion with data-phem-accordion-hidden-until-found, or of phem-collapsible with data-phem-collapsible-hidden-until-found, has hidden="until-found" when it is closed, as the hiddenUntilFound prop of a Base UI panel. Before, only the hiddenUntilFound value of the root did this.

0.4.9 (2026-11-17)#

  • Breaking: $e->toast(), Toasts::show() and new Toast() give a toast with no type by default, as in Base UI: the toast gets no data-type. Before, the default was ToastType::Info. Give ToastType::Info, or call Toasts::info(), for an info toast.
  • Breaking: phem-context-menu: a release of the right button on an item clicks it at once on macOS (more than 1 px from the point of the open), not after 500 ms. On the other systems, which send contextmenu after the release, the release does not click an item, as in Base UI.
  • phem-tooltip: a focus that moves from one trigger to the next (Tab) ends the close of the other tooltip at once, so the page shows one tooltip at a time, as for the pointer.
  • phem-menu: when a submenu closes before the 150 ms of the pointer on a sibling item, the item gets the highlight at once, and the trigger of the submenu loses it.
  • phem-select: the text of the selected item is on the text of the value also when the popup has a margin or a transform (translate: 0 1px). A popup over the trigger that gets smaller gives its list the height of its content box in --available-height, so a list with max-height: var(--available-height) scrolls, and the popup stays over the trigger.
  • phem-number-field: a space goes in the input only when the format has one (for example the group separator of fr-FR): in en-US, "1 2" gives "12", as in Base UI.
  • Breaking: Home and End do not move the focus in a phem-toolbar, as in Base UI. Before, they went to the first and to the last item.
  • The tab stop of phem-tabs is the tab with the last focus, also after the morph of an event. Before, Tab into the list went to the selected tab. An arrow key with Shift does not move the focus.
  • The indicator of phem-tabs keeps the fractions of a pixel, and does not count the border of the list. Before, the line was up to 0.5px off, and moved by the width of the border.
  • A press on a phem-slider gives the focus to the thumb with no focus ring. A single thumb gets z-index: 1 only during the press. In a range, the thumb of the press gets z-index: 2 and the thumb of the last change z-index: 1.
  • phem-scroll-area removes data-scrolling at the end of a drag of a thumb, not 500 ms after it. The size and the offset of a thumb keep the fractions of a pixel.
  • Breaking: phem-number-field does not handle PageUp and PageDown, as in Base UI. Use Shift with an arrow key for the large step.
  • Breaking: Enter in a phem-number-field does not format the text. Only a blur does. Enter puts the value of the hidden input in the limits, so a form submit gets a valid value, and sends phem-number-field:commit with the reason keyboard. Before, the reason was input-blur.
  • Breaking: the input of a phem-number-field gets inputmode="numeric" (on iOS decimal with a min of 0 or more, else text). Before, it was decimal.
  • Breaking: the first step of a phem-number-field with no value goes to 0 in the limits (min when min is more than 0, max when max is less than 0). This is one step, also for a wheel step or a scrub of many steps. Before, the step started from 0 (or from min), so ArrowUp gave 1 and ArrowDown gave -1.
  • phem-number-field takes one sign, one decimal separator, one currency sign and one percent sign, and a minus sign only when the value can be negative. It reads the digits of other scripts (Arabic-Indic, Persian, fullwidth, Han), and the Arabic and fullwidth separators.
  • The scrub area of phem-number-field locks the pointer on the body, and not on WebKit. A press with no movement is a click, so a click on the label focuses the input. The controller sends this click only when the pointer was locked: else the browser sends it. A touch press on a button waits 50 ms before the repeat, so a scroll does not change the value.
  • Breaking: the slots of a phem-otp-field get type="text" (or password with mask). phem-otp-field:complete comes when a typed character fills the code, and at each paste of a full code (also the same code). Before, a change of a character in a complete code sent it, and a paste of the same code did not.
  • phem-otp-field waits for the end of an IME composition, and a slot with two characters fills two slots, in the order of the text of the slot (as in Base UI). The root gets role="group" and aria-labelledby, and the slots get autocorrect, enterkeyhint and maxlength on the first slot.
  • Breaking An open panel of phem-collapsible and phem-accordion has the auto size in --collapsible-panel-height and --collapsible-panel-width (--accordion-panel-height and --accordion-panel-width) at the end of its open animation, and on load. Before, the size stayed in px, so content that grew after the open was cut. A close measures the panel again, so the close starts from the real height. CSS that uses the variables in calc(), in max-height or in a keyframe of an open panel must change: use them only in height (or width), and put the closed size on [data-starting-style] and [data-ending-style].
  • The header of a closed phem-accordion item gets data-closed, also after the morph of an event. Before, it got only data-open when its item was open.
  • Breaking: phem-toast puts a new toast first in the DOM, as Base UI. Tab goes to the newest toast first, and --toast-index is 0 for the first toast. phem.css shows the stack with flex-direction: column-reverse, so the newest toast stays at the bottom. A stack style of an application that uses the DOM order (flex-direction: column, :last-child) shows the toasts in the other order: use --toast-index and --toast-offset-y.
  • Breaking: A phem-toast toast with no type, or with a type that is not info, success, warning or error, has no data-type. Before, it had data-type="info". A toast of $e->toast() and Phem\Toasts still has data-type="info" by default.
  • Breaking: Phem\Toast::$type is nullable. Toast::fromDetail() gives a null type for a detail with no type, or with a type that the controller does not know, as the phem-toast controller does. Before, it gave ToastType::Info. So assertToast($message, ToastType::Info) fails for such a toast, and Toast::detail() has no type key for a toast with no type.
  • The time of a phem-toast toast goes on after a hover, a keyboard focus or a short swipe. Before, the full time started again. The time also stops while the browser window does not have the focus.
  • A swipe of a phem-toast toast keeps the axis of its first move, and the toast follows the pointer with no transition. The toast gets data-swipe-direction at the first move in a direction of the swipe. Before, a diagonal swipe moved the toast on two axes.
  • The focus does not move to another toast after a mouse click on the close button of a phem-toast toast. Escape still moves the focus, also after a mouse click on the toast. The close button gets aria-hidden="true" while the stack is not expanded and the button has no focus.
  • Breaking: phem-combobox with no selection (the default selectionMode none, an Autocomplete) and no autoHighlight opens on ArrowDown or ArrowUp with no highlighted item, as in Base UI. The next key highlights the first or the last item. Before, the key that opened the popup highlighted an item. The single selection mode and the multiple value keep the highlight at the open.
  • Breaking: in all the modes of phem-combobox, Enter on an open popup with no highlighted item closes the popup, and the form still submits. The single selection mode shows the label of the selected item again. Before, Enter left the popup open.
  • Breaking: in all the modes of phem-combobox, the highlight of the pointer goes when the pointer leaves the items, and the both and inline modes show the text of the user again. A highlight of the keyboard stays. Before, the last item under the pointer kept the highlight.
  • A clear of a closed phem-combobox (a click on the clear part, or the second Escape) keeps the popup closed. Before, the input event of the clear opened it.
  • phem-combobox gives aria-haspopup="listbox" and data-list-empty to the input. A trigger part gets aria-haspopup="listbox", aria-expanded, data-popup-open, and aria-controls while the popup is open. An inputGroup part gets role="group" and data-popup-open. The attributes stay through the morph.
  • Breaking: the popup of a preview card (phem-popover with open-on-hover and a link trigger) no longer gets aria-hidden="true", as in Base UI. A screen reader can read the card in the reading order of the page. Its links and fields keep tabindex="-1". Put aria-hidden="true" in the markup of the popup to keep the old behavior.
  • Breaking: phem-tooltip closes at the press of the pointer on its trigger (pointerdown), before the click, as in Base UI. Enter and Space still close it at the click. A test that clicks the trigger and expects the open tooltip in the click handler must change.
  • phem-tooltip: when a tooltip of a group opens, the tooltip that closed before it gets data-instant="delay" while its close animation runs, so a [data-instant] rule shows one tooltip at a time.
  • phem-popover: a click outside on an element that takes no focus gives the focus back to the trigger, as in Base UI. A popover that the hover opened and a preview card keep the focus where it is. Each focus return to the trigger (Escape, a close part, a click outside) now uses preventScroll, so the page does not scroll to the trigger.
  • Breaking: phem-navigation-menu: a click on a trigger that the pointer opened 500 ms or more before closes the menu, as in Base UI. Before, the first click always kept it open.
  • Breaking: phem-navigation-menu: Escape, a link with close-on-click and the close action give the focus back to the trigger only when the focus is in the content, in the popup, on that trigger or on the page body, as in Base UI. Before, Escape with the focus on another trigger moved the focus to the trigger of the open item. The pointer out, a click outside and the focus out never move the focus.
  • Breaking: phem-navigation-menu: the --popup-width, --popup-height, --positioner-width and --positioner-height variables are auto at rest. They have px values only during the size transition from one item to another, and go back to auto when the width or height transition of the popup ends. The positioner gets the new size at once. Before, they kept the px size of the content, and content that grew in the open popup was cut.
  • phem-navigation-menu gives data-open to the nav, the lists and the arrow while an item is open, data-side and data-align to the popup in a positioner, and tabindex="-1" to the popup. It keeps them after the morph of an event.
  • phem-navigation-menu: the first move from one trigger to another animates the position of the popup. Before, only the next moves animated it.
  • phem-navigation-menu: the arrow is at its place at the first open. Before, it slid in from the place of the last content.
  • phem_position.js: place() and unposition() take mirror elements, which get the data-side and the data-align of the popup. Popup (phem_popup.js) takes a mirror option.
  • phem-menu, phem-context-menu and phem-select: a touch outside closes the popup at the end of the touch (in 1 s), or when the touch moves more than 10 px, as in Base UI. Before, the popup closed at the start of the touch. A long touch does not close it.
  • Breaking: phem-select: a popup over the trigger stays over it when it is too tall for the viewport: it gets smaller and its list scrolls. Give the list overflow-y: auto and min-height: 0 in a popup with display: flex; flex-direction: column (in a :not([hidden]) rule, not in the style attribute). The popup goes next to the trigger only near an edge of the viewport, or when it would be less than 100 px high (or less than the full height of a list that is shorter than 100 px). A popup over the trigger stays 5 px from the left and the right of the viewport, not collisionPadding. The trigger of a popup over it gets data-popup-side="bottom", not none. A press of the mouse outside closes the popup at the press, and the focus goes back to the trigger.
  • phem-select: the text of the selected item is exactly on the text of the value: the controller does not round the top of the popup. A mouse open with no value highlights the first item, and the highlight goes away when the pointer leaves the items. The typed text stays for 750 ms, and a new text starts after the selected item. The scroll arrows scroll one item each 40 ms, and the item with the focus does not go under an arrow. The highlighted item gets tabindex="0", and the other items tabindex="-1". A key move keeps the highlight when the list scrolls under a pointer that does not move.
  • phem-select: a mouse selection gives the focus back to the trigger with no focus ring. The press on the trigger gives it a focus of the mouse, as in Base UI, and does not select text.
  • Breaking: phem-menu opens at the press of the mouse on its trigger, as in Base UI, and a release on an item 200 ms after the press clicks the item. A touch, Enter and Space still use the click. A click listener that calls preventDefault() on the trigger no longer stops the open: cancel the pointerdown. ArrowUp on a closed trigger no longer opens the menu on its last item. A closed trigger has no aria-controls: the trigger has it only while the menu is open.
  • phem-menu: a press outside closes the menu at once, also with the right button, and the focus goes back to the trigger. A drag from the trigger to outside the menu keeps it open. Shift+Tab gives the focus to the trigger. The highlighted item gets tabindex="0", and the popup of a submenu gets data-nested. A submenu that the pointer entered stays open when the pointer goes to empty space, and closes when the pointer gets to another item. Its trigger loses the highlight while the pointer is in the submenu.
  • phem-context-menu keeps its side near an edge of the viewport and flips its align, as in Base UI. Tab does nothing in an open context menu. A release of the right button on an item, 500 ms after the open, clicks the item. The popup gets data-instant="click" at the open.
  • phem-menubar: ArrowLeft and ArrowRight in an open menu open the next menu with the focus on its popup, and no item highlighted. Shift+Tab gives the focus to the trigger, and the menu stays open.
  • Breaking: the submit of a form locks its buttons with aria-disabled="true" in place of disabled, and a click on a locked button does nothing. The focused submit button keeps the focus, as in Base UI. Before, the focus went to <body>. Replace a :disabled style or a test of button.disabled for the lock with [aria-disabled="true"].
  • phem-form selects the text of the first invalid control on a submit. After the submit event of the form, the first control with a server error gets the focus and its text is selected. An error of the browser, another event of the form and a redirect do not move the focus.
  • A link that changes only the hash of the page (href="#") starts no Turbo visit: the browser does its native jump. With data-turbo-action="replace", the jump replaces the history entry. Before, Turbo loaded the page again and the focus went to <body>.
  • phem:poll keeps its period: the interval starts at the start of the last poll, not at its end. A 1000 ms poll with a 200 ms answer sent a poll every 1.2 s. The polls still never overlap.
  • Breaking data-instant gives only the cause of a change of a popup (click, dismiss, focus, delay, group). The CSS stops the animation: add [data-instant] { transition: none }. Before, a popup with data-instant changed at once with no animation. Now a keyboard open, a focus open and an Escape close of a menu, a menubar, a popover and a tooltip animate when the CSS has no such rule.
  • A popup with align start or end and no arrow gets --transform-origin at its aligned edge (0% or 100%, the other way in a right-to-left page), as in Base UI. Before, the origin was the center of the anchor.
  • The typeahead of phem-menu, phem-context-menu and phem-select starts a new text after a letter that matches no item, as in Base UI. Before, the letters stayed until the timeout, and the next letter found no item.
  • A press that starts in a popup, a dialog that is not a modal or a navigation menu and ends outside it (for example a text selection) does not close it, as in Base UI. Before, the click of the press closed it.
  • The shared client modules get new options for the next popup changes: the event option of dismissable() and Popup ("pointerdown" closes a popup at the pointerdown outside, with each button), collision: "context" in place(), the resetMs and from options of Typeahead, the leaveList() helper and the settle() export of phem_transition.js. No controller uses them yet.
  • Tab in a modal phem-dialog goes from the last element of the dialog to the first one, and Shift+Tab goes back, as in Base UI. Before, only modal="trap-focus" kept the focus in the dialog: Tab in a showModal() dialog went from its last element to the browser.
  • A drawer (phem-dialog with swipeDirection) gives the focus to its popup on open, unless an element in it has autofocus. Before, the first button got the focus and showed a focus ring.
  • The trigger of an open phem-dialog gets aria-controls.
  • A press on the backdrop of a phem-dialog does not move the focus to the page. After an open with the keyboard, the trigger gets the focus back with its focus ring.

0.4.8 (2026-11-16)#

  • Escape on a phem-popover gives the focus back to the trigger only when the focus is in the popup. Before, Escape on a preview card that the pointer opened focused the link, and the keyboard focus then opened the card again after its delay.
  • The tab stop of a phem-otp-field is the slot with the focus. Before, Tab from a filled slot went to the first empty slot, not out of the field.
  • Tab on the last trigger or link of a phem-navigation-menu list goes to the next element of the page, and the menu closes. Before, the focus went into the content of the viewport again.
  • phem-field shows a server error again when an event sends the same value again and the answer has no new HTML for the field: a submit of the form, an event of the control, or each event for a control with phem:bind. Before, the field showed as valid.
  • The error part of the server in a phem-field shows the errors of the browser after the user changes the value. Before, a cleared control showed no valueMissing message after a server error. In a field with a part of the server, an error part with no data-match no longer shows, so a message does not show two times.

0.4.7 (2026-11-16)#

  • A field of the application in the popup of a phem-combobox (an input, a textarea, a select, editable content) gets the focus of a mouse press again. v0.4.6 kept the focus in the input of the combobox for each press in the popup.

0.4.6 (2026-11-16)#

  • phem-combobox keeps the focus in the input on each press in the popup: on the space around the items, on a group label, and on a list with tabindex="-1". Before, only a press on an item kept the focus, so the text that the user typed after the press did not go into the input.
  • The arrow of a popup with a border points at the center of the anchor. phem_position.js gives the left or the top of the arrow from the padding box of the popup. Before, the value was from the border box, so a border of 1 px moved the arrow 1 px.

0.4.5 (2026-11-16)#

  • The open animation of a popup in the top layer runs. phem-popover, phem-tooltip, phem-menu, phem-select, phem-combobox and phem-dialog give the popup data-open and data-starting-style before showPopover() and showModal(). Before, the browser computed the open styles first, so the popup (and the ::backdrop of a dialog) showed with no animation.
  • phem-collapsible and phem-accordion measure the content of a panel with no alignment (justify-content, align-items, align-content, justify-items), as Base UI. Before, a panel with justify-content: flex-end got --collapsible-panel-height: 0px, and showed nothing.
  • phem-toast measures the height of the content of a toast (its height with height: auto) for --toast-height and --toast-frontmost-height, and removes --toast-frontmost-height from the element when no toast remains, as Base UI. Before, with the CSS height: var(--toast-frontmost-height, var(--toast-height)), the first toast after the last dismiss had a height of 0.

0.4.4 (2026-11-16)#

  • Breaking phem-tooltip is only visual, as the Tooltip of Base UI v1.9.0: the popup gets no role="tooltip", and the trigger gets no aria-describedby. For a description that a screen reader reads, give the popup an id and role="tooltip", and give the trigger aria-describedby, in the markup.
  • Breaking The empty part of phem-combobox is a live region that stays in the page, as the Empty part of Base UI: it gets role="status", aria-live="polite" and aria-atomic="true", and it has its content only when the list has no item. The controller does not set hidden on it: remove hidden from the markup of the part, and use :empty to remove its padding.
  • Breaking In phem-menu, the keys and the pointer go to an item with aria-disabled="true", which gets the highlight, as in Base UI. A click or Enter on it does nothing: its handler does not run. The keys still skip an item with disabled, and the first focus of a menu skips the two kinds. An item loses the highlight when the pointer goes out of it, and not to another item: the focus goes to the popup.
  • Breaking In phem-navigation-menu, ArrowDown, Enter and Space on a trigger open the content with the focus on the trigger, as in Base UI. Tab on the last element of the content goes to the next trigger with the menu open. The arrow keys of the list stop at the last trigger (the loopFocus value is false by default), and Home and End do not move the focus. The four arrow keys move the focus between the links of a content.
  • Breaking In phem-number-field, a scrub changes the value by one step for each pixel of the last movement, after a movement of pixelSensitivity pixels, as in Base UI. Before, it was one step for each pixelSensitivity pixels. The virtual cursor has its center at the pointer, and a new teleportDistance value keeps it near the scrub area. The scrub area gets role="presentation", and phem.css stops the scroll of a touch in it. The repeat of a button stops at the limit, and while the pointer is out of the button.
  • Breaking In phem-otp-field, Backspace on a slot with a character moves the focus to the slot before, as in Base UI. Ctrl+Backspace removes all the characters, ArrowUp and ArrowDown go to the first and to the last slot, Ctrl with an arrow key does the same, and a press of the mouse selects the character of a slot.
  • Breaking phem-popover gives the focus to the first element of the popup that Tab goes to (after [autofocus]), and to the popup after an open with a touch. The pointer out of a popover or a menu with openOnHover closes it after the closeDelay value with no minimum of 100 ms (0 ms by default): the popup stays open while the pointer is in the space between the trigger and the popup. A preview card closes at once on the focus out, and gets data-instant="focus" (an open by the focus) and data-instant="dismiss" (Escape).
  • Breaking phem-toast makes its element a landmark and each toast a dialog, as in Base UI. The element gets role="region", aria-label (the new label value, "Notifications"), tabindex="-1", aria-atomic and aria-relevant. A toast gets role="dialog", tabindex="0", aria-modal="false", aria-labelledby and aria-describedby. F6 moves the focus to the element, Escape closes the toast with the focus, and only the focus of the keyboard expands the stack. Each toast always has --toast-swipe-movement-x and --toast-swipe-movement-y (0px with no swipe). The mark data-phem-toast-live is now data-phem-toast-owned.
  • New phem-button controller: Enter and Space click an element that is not a <button>, as a Base UI button with nativeButton={false}. A button with aria-disabled="true" does nothing.
  • More behavior of the Base UI v1.9.0 components. A modal phem-menu that the pointer opened does not lock the page. A menu popup gets data-instant="click" (Enter or Space) and data-instant="dismiss" (Escape), and a menu of a phem-menubar gets data-instant="group" for an arrow key, the focus out and the open of another menu. phem-combobox with the single selection mode gives the input and the value part the selection of the server render, and opens with the highlight on the selected item, in view. phem-dialog gives the focus to the popup after an open with a touch. A drawer gets --drawer-frontmost-height, and data-nested-drawer-swiping during the swipe of a drawer in it, which does not move the drawer around it. phem-accordion gives data-disabled to the parts of an item with a disabled trigger, and data-orientation to its element and its panels. The element of phem-collapsible gets data-starting-style and data-ending-style. Enter toggles a switch of phem-toggle. The viewport of phem-scroll-area gets tabindex="0" only when it scrolls. See docs/controllers.md.

0.4.3 (2026-11-15)#

  • Breaking phem-accordion does not move the focus between the triggers with the arrow keys by default, as the accordion pattern of the ARIA Authoring Practices says now (and Base UI v1.9.0). Set data-phem-accordion-roving-focus-value="true" for the arrow keys, Home and End.
  • Breaking In phem-combobox, an arrow key after the last item goes back to the input (no highlight), and the next key goes to the first item. A clear part has hidden when there is nothing to clear. A press on a clear part keeps the focus in the input.
  • Behavior of the Base UI v1.9.0 components that the controllers did not have, from an audit of the phem/ui-base kit. phem-combobox has a selectionMode value (single: one selected item with data-selected, a value part for a form, no free text, and all the items when the popup opens with the label of the selection), an openOnInputClick value, and an inputGroup part that is the anchor of the popup. A modal phem-dialog locks the scroll of the page. A mouse press in a content part of a drawer selects its text, and data-phem-swipe-ignore stops a swipe. phem-accordion has a header part with data-open, and its parts get data-index. The triggers of phem-popover and phem-context-menu get data-pressed. phem-menubar gives data-instant="group" to the popups when it goes from one menu to another. phem-select has a label part that names the trigger and gives it the focus on a click. The position has the collision-padding-inline and flip values. phem-field validates on Enter in an <input> control. A limited toast gets inert, and the title, the description and the close button of a toast get data-type. See docs/controllers.md.

0.4.2 (2026-11-15)#

  • Breaking The default markup of a toast has a content part ([data-phem-toast-content]) around its text: the description is not a child of the toast root now. A CSS rule such as [data-phem-toast] > [data-phem-toast-description] does not match. A template of the app does not change.
  • A toast can have a title: $e->toast('The file is in your downloads.', title: 'Export complete'), the title argument of the Phem\Toasts methods, and title in the detail of the phem:toast event. phem-toast shows it in a new title part ([data-phem-toast-title]), and removes this part from a toast with no title. A new content part ([data-phem-toast-content]) gets data-behind and data-expanded, as the Toast.Title and Toast.Content of Base UI. assertToast() takes a title argument. See docs/controllers.md.
  • phem-menu and phem-context-menu keep the state of a checkbox item and of a radio item with no handler in the browser, as Base UI does. A click on an item with role="menuitemcheckbox" changes its aria-checked. A click on an item with role="menuitemradio" checks it and unchecks the other radio items of its group. The item gets data-checked or data-unchecked, and sends phem-menu:change with { checked, value }. The state stays after the morph of an event, unless the server render gives a new aria-checked. An item with an onClick handler takes its state from the server, as before. See docs/controllers.md.

0.4.1 (2026-11-15)#

  • Accessibility fixes of the controllers, from the browser tests of a Base UI kit. phem-toggle links a <span role="checkbox"> or role="switch" to the <label> around it (aria-labelledby, or ariaLabelledByElements when the label has no id), so a screen reader names it. phem-popover links a title, a description and a popup with no id with element references, as phem-dialog does. A phem-toggle-group in a phem-toolbar leaves the arrow keys and the tab order to the toolbar, when its items are toolbar items. phem-select, phem-menu, phem-context-menu and phem-combobox highlight an item on a move of the pointer (pointermove), not when it comes under a pointer that does not move: a popup that opens over the pointer keeps the highlight of the keyboard, and a pointer highlight in a combobox does not scroll the list. The indicators of a switch and of a checkbox get aria-hidden="true", so the check mark is not in the name. A popover keeps the aria-label of its popup. In a toolbar, a toggle group takes the data-orientation of the toolbar. See docs/controllers.md.
  • The ARIA links of the controllers do not use the temporary id that the morph gives an element with a key or a bound field with no id (phem_ids.js). Before, after the morph of an event, the label of a bound field pointed to an id that was gone (for="phem-key:bind:…"), and so did the aria-controls of the number field buttons and the aria-activedescendant of a combobox with keyed items. phem_number.js uses the link() of phem_aria.js. See docs/controllers.md.

0.4.0 (2026-11-15)#

  • Fixes after a review of the new controllers. phem-combobox with an inline mode sends the text of the user for a bound input, not the label of the highlighted item (a field can give phem its value in phemValue). A state that a controller changes in the click of an event is a change before the request, and each answer renders with the time of its own request, also when two answers render at the same time. A drawer with snap points lets a touch scroll its content at its full height, and places its snap point again after a resize. A bound hidden input gets data-phem-value (the server value), so a reset gives it back. trap-focus skips the hidden fields. A drawer with snap points takes the style of the server after the morph. The controllers share the ARIA links in phem_aria.js.
  • phemc gives E068 for a class or a function with a reserved name of PHP, such as class Switch or function List(). PHP cannot declare it, so the error came only when PHP loaded the file. See docs/compiler.md.
  • A field with an optional Bound prop (?Bound $value = null) can have its own value, or checked for a checkbox or a radio button, next to phem:bind. The field renders it only when the prop is null, as the defaultValue of a UI kit input. A bound field ignores it. Before, phemc gave E033. See docs/forms.md.
  • phem-navigation-menu gives data-instant to the positioner (or to the popup, with no positioner) on the first open, and removes it when the open item changes. So a CSS transition of the position moves the popup only from one trigger to another, and the first open does not slide in from the corner of the page. See docs/controllers.md.
  • phem-checkbox-group and phem-toggle-group give their value to a phem-toggle item that connects after them. Before, the item took its first state from its input or its aria-checked when it connected, and the group lost a checked value of the server render.
  • phem-menu, phem-context-menu, phem-tooltip, phem-combobox and phem-collapsible give no id to a part. Before, they gave an id to a popup, a group label, a list, an option or a panel with no id. The morph of an event removed this id, because the server render did not have it, so aria-controls, aria-labelledby, aria-describedby and aria-activedescendant pointed to an id that was not on the page. Now the controller uses the element references of ARIA (ariaControlsElements, ariaLabelledByElements, ariaDescribedByElements and ariaActiveDescendantElement) for a part with no id. A part with an id from the markup still gets its id in the attribute. The highlight of a combobox stays on the same item through the morph, or on an item with the same id. See docs/controllers.md.
  • The state value of a built-in controller (for example the open value of phem-dialog, or the value of phem-radio-group) keeps the value of the client through the morph of an answer when the client changed it after the request of the event left, as a bound field does. Before, the answer of an event that left before the last change of the user gave the old value back. A bound <input type="hidden"> that a script changes (with an input or change event) is now dirty, so phem:bind and phem:live send its value. See docs/controllers.md.
  • New phem-field and phem-form controllers, as Base UI Field, Fieldset, Form and Input. A field links its label, control, description and error parts, and validates the control with the constraint validation of the browser in the onSubmit, onBlur or onChange mode (validationDebounceTime). An error part with data-match shows for one ValidityState key, and an error with no text gets the validationMessage. All the parts get data-valid, data-invalid, data-dirty, data-touched, data-filled, data-focused and data-disabled. A server error (a control that the server renders with aria-invalid="true", as phem:bind does) stays until the user changes the value. phem-form adds novalidate, stops an invalid submit before its onSubmit handler sends the event, and focuses the first invalid control.
  • New phem-otp-field controller, as Base UI OTPField: one input for each character of a code, with a hidden input that has the full value. Typing moves to the next slot, Backspace removes a character and goes back, the arrow keys, Home and End move, and a paste fills the slots. The validationType (numeric, alpha, alphanumeric, none), mask, autoSubmit, disabled, readOnly and required values, autocomplete="one-time-code" on the first slot, and data-complete when all the slots have a value.
  • Add the phem-toggle controller: a toggle button (aria-pressed, data-pressed), a switch or a checkbox (role="switch" or role="checkbox", aria-checked, data-checked, data-unchecked), with the checked, indeterminate, disabled, readOnly and required values. A click, a label and Space toggle it. The input target keeps a checkbox or a hidden input for forms (name, value, uncheckedValue, form), and the indicator target gets the state and the open and close animations. See docs/controllers.md.
  • phem-checkbox-group works with phem-toggle checkboxes, for the items and the parent. It has a value value (the values of the checked items) and an allValues value (the items of the parent). The third click on the parent gives back the items that were checked, as Base UI CheckboxGroup does. A disabled or read-only item keeps its state. Each change dispatches phem-checkbox-group:change. See docs/controllers.md.
  • Add the phem-toggle-group controller: a group of toggle buttons with one value state (the values of the pressed items), multiple, orientation, loopFocus and disabled, and a roving focus with the arrow keys, Home and End. An item can be a phem-toggle button. Each change dispatches phem-toggle-group:change. See docs/controllers.md.
  • The new phem-toolbar controller gives a row of item parts (buttons, links, inputs) one tab stop. The arrow keys of the orientation value, Home and End move the focus, with the loopFocus value. In a text input, the arrow keys move the caret until it is at the edge of the text. An item with aria-disabled="true", an item of a disabled group, or an item of a toolbar with the disabled value stays in the focus order, but a click on it does nothing. The parts get role="toolbar", role="group", role="separator", aria-orientation and data-orientation. See docs/controllers.md.
  • The new phem-radio-group controller makes a radio group from elements that are not native inputs: role="radiogroup", role="radio" items with aria-checked, data-checked and data-unchecked, and an indicator part with the animations. The value value is the state, and it stays through the morph. A click, a click on a <label>, Space and the arrow keys check a radio, and the arrow keys skip a disabled radio. The disabled, readOnly and required values set the ARIA and the data attributes. An input part (a hidden input or native radio inputs) gets the value and sends input and change, and the controller dispatches phem-radio-group:change. See docs/controllers.md.
  • The new phem-avatar controller hides the image part until it loads, and shows the fallback part while the image is not loaded, after the delay value. An image in the cache shows at once, and a new src loads the image again. The image gets data-loading and data-error, and each change of the status (idle, loading, loaded, error) dispatches phem-avatar:status. See docs/controllers.md.
  • The new phem-number-field controller edits a number in a text input, as the NumberField of Base UI. It has increment and decrement buttons that repeat the step while the user holds them, the arrow keys (Alt for smallStep, Shift for largeStep), PageUp, PageDown, Home and End, the mouse wheel (allowWheelScrub), and a scrub area with the pointer lock and a virtual cursor. It reads and shows the value in the format of the locale and format values (Intl.NumberFormat). A hidden input gets the raw value. The value stays after the morph. See docs/controllers.md.
  • The new phem-slider controller selects one value or a range on a track, as the Slider of Base UI. A press on the control moves the nearest thumb, and a drag moves it. The keys of the native range input in each thumb step the value. The thumbs do not cross (minStepsBetweenValues, thumbCollisionBehavior). The positions are inline styles, as in Base UI, and the value part shows the values with Intl.NumberFormat. The values stay after the morph. See docs/controllers.md.
  • New phem-scroll-area controller: custom scrollbars over a native scroll container, as the ScrollArea of Base UI. A drag of a thumb and a press on a scrollbar scroll the viewport. A scrollbar with no overflow on its axis gets hidden, unless it has data-keep-mounted. The parts get data-has-overflow-x/-y, data-overflow-x-start/-end, data-overflow-y-start/-end, data-scrolling and data-hovering, and the --scroll-area-thumb-*, --scroll-area-corner-* and --scroll-area-overflow-* CSS variables. The overflowEdgeThreshold value sets the distance before an edge attribute shows. The scroll position and the state stay after the morph. See docs/controllers.md.
  • New phem-select controller: a button that opens a list of options, as the Select of Base UI. The value value is the state (a JSON array with multiple), and the value part shows the label of the selected item or its placeholder (data-placeholder). With alignItemWithTrigger (the default), the selected item goes over the trigger (data-side="none"). The controller has the keyboard of a listbox (the arrow keys, Home, End, a typeahead, Enter, Space, Escape and Tab), a select on a release after a drag from the trigger, scroll arrows, groups, an item indicator, the modal, disabled, readOnly, required and loopFocus values, and data-popup-open/data-pressed on the trigger. An input part (an <input> or a <select>) gets the value and sends input and change events, and the controller dispatches phem-select:change. The value and the open popup stay after the morph. See docs/controllers.md.
  • phem-menu sends phem-menu:open and phem-menu:close, and its trigger gets data-pressed while the menu is open, as in Base UI (not the trigger of a submenu). open("first") and open("last") open the menu with the focus on the first or on the last item. In a vertical phem-menubar, ArrowRight opens the menu and its popup goes on the inline-end side. See docs/controllers.md.
  • New phem-menubar controller (Base UI Menubar): a bar of phem-menu menus with one tab stop. The arrow keys of the orientation value move between the triggers, Home and End go to the first and to the last trigger, and loopFocus goes from the last trigger to the first one. While a menu is open, ArrowLeft and ArrowRight open the menu before or after it on its first item, and the pointer on another trigger opens its menu at once. The modal value (the default) locks the page and keeps the pointer events of the menubar. The disabled value opens no menu. The menubar gets role="menubar", aria-orientation, data-orientation, data-modal and data-has-submenu-open. See docs/controllers.md.
  • New phem-navigation-menu controller (Base UI NavigationMenu): the triggers of a list open their content in one shared popup, with the pointer (delay and closeDelay, 50 ms) and with a click. With a viewport part, the open content moves into the viewport, and goes back to its item when it closes and before a morph. The popup gets --popup-width and --popup-height (the positioner --positioner-width and --positioner-height) for a transition of the size, and the contents get data-activation-direction. The arrow keys move between the triggers and the links of the list, ArrowDown opens a content, and Escape closes it. The value value is the state. A link with aria-current="page" gets data-active. See docs/controllers.md.
  • A phem-popover with openOnHover and a link trigger (<a href>) is a preview card, as the PreviewCard of Base UI. A click on the link opens the link, not the popup. The keyboard focus on the link opens the popup after the delay, and the focus out closes it after the closeDelay. The link stays the only part for the keyboard and a screen reader: it gets no aria-haspopup and aria-expanded, the popup gets aria-hidden="true" and no role, and its links and fields get tabindex="-1". See docs/controllers.md.
  • phem-dialog has the parts and the values of Base UI Dialog, AlertDialog and Drawer. The disablePointerDismissal value keeps an alert dialog open on a tap on the backdrop: only Escape closes it. The modal value: false opens the dialog with show() (the page stays active, and Escape and a press outside close it), and trap-focus also keeps Tab in the dialog. The backdrop part opens and closes with the dialog, and a <dialog> as the viewport part holds the popup part (a press on the viewport outside the popup closes it). A title or a description with no id links with the element references of ARIA. A drawer stops at the heights of the snapPoints value: the snapPoint value is the state, and the popup gets --drawer-snap-point-offset, --drawer-height and data-expanded. See docs/controllers.md.
  • Breaking The swipe variables of a drawer are now the variables of Base UI: --drawer-swipe-movement-x, --drawer-swipe-movement-y and --drawer-swipe-progress (before --dialog-swipe-*), and the new --drawer-swipe-strength. The popup of a drawer always has data-swipe-direction, and a swipe that closes it gives data-swipe-dismiss. A drawer in a drawer gives data-nested-drawer-open and --nested-drawers.
  • In the markup of a class component, a call of a name that is a method of the class calls the method: aria-valuetext={{ text(10) }} compiles to this.text(10). Before, it compiled to a Twig function text(), and the render failed with Unknown "text" function. A method hides a Twig function with the same name, except render(). A handler call (onClick={{ remove(item) }}) does not change. phemc gives E067 for a call of a private method. See docs/syntax.md.
  • A Bound prop can be optional: ?Bound $value = null. When the tag of the child has no phem:bind, phem:bind={{ value }} binds nothing, and the field is a plain field. Before, the render failed with a TypeError in PhemRuntime::bind(). phem:error={{ value }} renders nothing for a null prop. See docs/forms.md.
  • Breaking The default toast styles of phem.css apply only to a part with no class attribute: the phem-toast container, [data-phem-toast], [data-phem-toast-description] and [data-phem-toast-close]. A part with classes gets all its look from them. Before, a Tailwind utility could not replace a default style, because the utilities are in a cascade layer and phem.css is not. A toast with a class now hides with data-limited and moves with the swipe variables only with the styles of the app. See docs/styling.md.
  • Breaking The state of phem-tabs is now the active value: the value of the selected tab, not its index. Replace data-phem-tabs-index-value="1" with the value of the tab. The value of a tab and of a panel is its data-value, its key, or its position, and a tab shows the panel with the same value, so the panels can be in another order. With no active value, the first tab that is not disabled is selected. A tab and its panel need no id now: with no id, the controller links them with ariaControlsElements and ariaLabelledByElements, so a function component can render the tabs with no id. See docs/controllers.md.
  • phem-combobox can filter in the browser a list that the server renders one time: set the filter value to contains or starts-with. The match ignores the case and the accents (Intl.Collator, with the locale value). An item that does not match gets hidden, a group part with no visible item too, and the limit value shows only the first matches. The new mode value (list, both, inline, none) is the aria-autocomplete of the input: with both and inline, the arrow keys write the label of the highlighted item in the input, and Escape gives back the text of the user. With a client list, a choice writes the label of the item in the input and sends its input and change events, and the text stays through the morph. The popup gets aria-busy while an event of the input runs. The server filter does not change. See docs/controllers.md.

0.3.26 (2026-11-14)#

  • Breaking A named slot tag is now <Card.footer>, not <Card:footer>. phemc gives E013 for the old form, with the new name in the hint. The compiled Twig does not change.
  • A named slot can be a prop with markup: <Card footer={{ <em>Saved</em> }} /> is the same as <Card><Card.footer><em>Saved</em></Card.footer></Card>. The value follows the rules of markup in {{ }} (one literal, a branch of ?:, or markup after and). children={{ <p>Body</p> }} also works. The compiler checks a slot prop as a slot tag (variables, feeds, phem:error). A slot that the tag gives two times, or a slot tag outside its component tag, is E013. Markup in a prop that is not an Html slot stays E031. See docs/syntax.md.

0.3.24 (2026-11-13)#

  • phem:announce on an element tells a screen reader its new text after the morph of an event of the user, also in a component with no handler, such as a grid with no #[State] that loads its data in mount(). The browser announces each text of these elements that the answer renders and that was not there before, in the live region of $e->announce(). The same text again, the page load, a boundary that loads, a poll, onVisible, a push and a refresh announce nothing. The text is what a screen reader reads: hidden content is not in it, and an element in another phem:announce element is part of the outer text. ComponentTester::assertAnnounced() also sees these texts. phemc gives E032 for a text value of phem:announce. See docs/events.md.

0.3.22 (2026-11-13)#

  • Security The #[IsGranted] on the class of a component now applies to a handler method of a parent class. A subject of #[IsGranted] that names a parameter of the handler must come from the call in the markup: before, it fell back to a component property with the same name, and the voter checked another object than the handler used.

0.3.21 (2026-11-12)#

  • The #[IsGranted] attribute of Symfony protects one event handler: on a handler method, on a closure in render(), or on the class of a component for all its handlers. The attribute of the class and of the method both apply. The subject is the argument of the call in the markup (delete(todo)), or else a property of the component. Before, Phem ignored the attribute on a handler, and the handler ran for every user. See docs/security.md.
  • The new HandlerCallMiddleware interface gives a middleware the arguments of the call in the markup. A Closure or an Expression key of #[RateLimit] now gets them in args.
  • A route file can route a page, as a controller: controller: App\Ui\BlogPage. The route gets the route values, the events and the access rules of the page. A #[Page] with no path has no route of its own, and its first route in a route file has the name of the page as an alias. A page of the application with no path and no route is an error. See docs/pages.md.
  • The events of a page under an import with a localized prefix or a localized host now have the route name of the page (_route), so the access_control rules on route names cover them. Phem adds the event routes after all the imports. The event route of a page under a name prefix is now phem_event.acme_blog, not acme_phem_event.blog.
  • Breaking The default value of a #[Path] property or of a parameter of a function page makes its route value optional, as for a Symfony controller: #[Page('/blog/{page}')] and #[Path] public int $page = 1 match /blog. Only the last route values of a path can be optional. A requirement without a placeholder name is an error. See docs/pages.md.

0.3.20 (2026-11-12)#

  • data-phem-sync-tabs-value="true" on the <Root> element refreshes the other tabs of the same page in the browser after an event of the user, with a BroadcastChannel: no #[Broadcast] and no Mercure hub. A hidden tab refreshes when it becomes visible. A page that comes back from the Turbo cache refreshes when a message came for it, and a page from the back/forward cache always refreshes. A refresh, a phem:live update, a load, a poll, an onVisible event and an event that pushed a refresh() through an open hub connection send no message. See docs/real-time.md.
  • The new phem-theme controller keeps the choice of the user between a light, a dark and the system theme in localStorage, and gives <html> data-theme="light" or data-theme="dark". The new theme_script() Twig function goes in the <head>: it sets the theme before the first paint, so a dark page does not flash white, and gives its default to the switches. See docs/controllers.md.
  • More upload work in the browser. The new phem-image-input controller shows a preview of the images of a file input, and makes the large images smaller before the submit (maxWidth, maxHeight, type, quality). data-phem-upload="chunked" on a file input (or on the element of a drop or a paste) sends the files in chunks before the event: a file can be larger than post_max_size, a chunk goes again after a network error, and the upload continues after a reload. data-phem-upload="direct" sends the files to a storage, such as a presigned URL of S3, from a Phem\Upload\DirectUploader service, which autoconfiguration finds; the handler gets a Phem\Upload\DirectFile. The browser uploads up to 3 files at the same time, with the retries of the events. A chunked upload continues only for a file with the same fingerprint. The files of data-phem-upload count in max_upload_size. The pending chunked uploads have a maximum size (each one counts at least one chunk) and a maximum number, and an upload with no chunk goes after 15 minutes. New options: upload_chunk_size, upload_dir, upload_dir_max_size and upload_dir_max_files. ComponentTester sends the files of data-phem-upload as the browser does. clear-files is a reserved name of a browser event. See docs/forms.md.
  • The new phem-scrollspy controller marks the link of the section in view, for a table of contents: the link gets aria-current="true" and data-active. A section is current from its scroll-margin-top, so a click on a link marks the clicked link. The controller dispatches phem-scrollspy:change. See docs/controllers.md.
  • phem-collapsible takes a persist value: a key for the state in localStorage. A banner that the user closed stays closed after a reload. Only a click or an action of the user stores the state, and the other collapsibles with the same key, also in the other tabs, get it. See docs/controllers.md.
  • More parts for the built-in controllers. A phem-menu in the popup of a menu is a submenu, which opens on hover, with a click and with ArrowRight. data-phem-menu-modal-value="true" locks the scroll and the pointer events of the page while the menu is open. The new phem-context-menu controller opens a menu at the pointer on a right click or a long press. phem-combobox takes multiple, with chip and chipRemove parts and their keys. phem-toast expands the stack on hover (data-expanded, --toast-offset-y) and closes a toast with a swipe (swipeDirection). phem-dialog takes swipeDirection for a drawer that closes with a swipe. A touch swipe needs no touch-action: a touch in another direction scrolls. phem-sortable tells each step of a keyboard drag to a screen reader. See docs/controllers.md.
  • A positioned popup (phem-popover, phem-tooltip, phem-menu, phem-combobox) has its right place at once: the first place measured a block popup as wide as its container, and only a later resize gave it its place.
  • Breaking The pointer or the focus on the phem-toast element stops the time of all the toasts, not only of the toast under the pointer.
  • Keyboard shortcuts of the page: phem:shortcut="mod+k" on an element clicks it, or focuses it when it is a field, when the user presses the keys where the focus is. A shortcut runs a server handler, a link, or a trigger of a built-in controller. A key with no modifier does not run while the user types in a field, and only the shortcuts of an open modal dialog run. The tester has shortcut($key, $modifiers). See docs/events.md.
  • phem:key and phem:shortcut take the mod+ modifier: the Command key on a Mac, an iPhone and an iPad, and Ctrl on other systems.
  • Built-in controllers for state that belongs to the browser, with no round trip. phem-count shows the number of characters of a field ({count}/{max}, data-over above the max) or of checked boxes. phem-reveal shows and hides the text of a password field. phem-checkbox-group adds a "select all" box that is checked or indeterminate from its items. phem-accordion opens one item at a time, with the arrow keys between the triggers. phem-depends shows a panel from the value of a field, and disables the controls of a hidden panel. phem-time shows a <time datetime> in the time zone and the language of the user, as a relative time that updates, and dispatches phem-time:reached when a future time comes. See docs/controllers.md.
  • The morph keeps the value of a touched password field of a Symfony form also when the client shows it as a text field.
  • The phem:live events of the fields of one phem:bind property that wait in the queue go in one event: a "select all" of 100 checkboxes queues one event, with one phem:done, not 100.
  • After the morph, a bound field that gets the server value again (a value that the server did not take) dispatches phem:reset, so the built-in controllers show the new value.

0.3.18 (2026-11-10)#

  • Scroll and screen-reader support after a morph. phem:scroll-into-view on an element that an event adds (a new comment) scrolls the browser to it after the morph of an event of the user, but not on page load, for a boundary that loads, a poll, onVisible, a push or a refresh. phem:keep-scroll on an element that scrolls keeps the element in view at its place in each render, also in a push and when the render replaces the element. phem:keep-scroll="end" also keeps a chat at its end. $e->announce('3 results') and the Phem\Announcements service put a message in a hidden live region for screen readers, with no toast. ComponentTester::assertAnnounced() checks it in a test. phemc gives E032 for a text value of phem:scroll-into-view, and for a text other than "end" of phem:keep-scroll.
  • Built-in controllers for complex input, with the design of Base UI: no CSS, named parts, and the state in data attributes and CSS variables. phem-popover shows a popup next to its trigger, phem-tooltip a short text on hover and on the focus of the keyboard, phem-menu a list of actions with the keyboard of a menu (roving focus, typeahead), and phem-combobox a list of suggestions that the server gives, with the keyboard in the input. phem-sortable moves items with the pointer and with the keyboard, also to another list of the same group, and calls the onCall handler of the list with { id, index, list }. The popups go next to their anchor with side, align, the offsets and collision-padding, flip and shift in the viewport, and get data-side, data-align, --anchor-width, --available-height and --transform-origin. A popup with popover="manual" shows in the top layer. See docs/controllers.md.
  • Breaking: the built-in controllers use the conventions of Base UI. phem-toggle is now phem-collapsible, with the trigger and panel targets, and no Escape or click outside (use phem-popover or phem-menu for a dropdown). The dialog target of phem-dialog is now popup, and its trigger and close targets need no data-action. phem-tabs moves the focus with the arrow keys and selects with Enter or Space (activate-on-focus gives the old behavior), and takes the orientation from its orientation value in place of aria-orientation. The toasts have the data-phem-toast, data-type, data-phem-toast-description and data-phem-toast-close attributes in place of the phem-toast-* classes, a template target for the markup of the app, and a limit value. phem-clipboard sets data-copied in place of the copied class. The parts get data-open, data-closed, data-starting-style and data-ending-style, and a close waits for the end of its animations.
  • Load more on view, and polling. onVisible={{ more }} runs the handler when the element comes into view, and again each time it comes back into view: the trigger of an infinite scroll. An element that is still in view after the update of its event sends it again, but only when the update moved it (new items before it). phem:poll={{ 30000 }} onPoll={{ refresh }} runs the handler every 30 seconds while the tab is visible, and phem:poll={{ null }} stops it. ComponentTester::visible() and poll() send the events in a test. phemc checks the interval (E032), and warns about phem:poll with no onPoll and onPoll with no phem:poll (W006).
  • Call a handler from JavaScript. onCall={{ move }} runs the handler when JS code dispatches a phem:call event on the element or in it, with its own data: el.dispatchEvent(new CustomEvent("phem:call", { detail: { card: 12, index: 0 } })). The handler gets the detail in $e->detail, and must check it. The event needs no bubbles. ComponentTester::call() sends it in a test, and BrowserEventDispatcher rejects the name call.
  • Key filters and event modifiers. phem:key="ctrl+Enter Escape" sends the onKeyDown or onKeyUp event only for these keys, and the other keys keep their default action. phem:stop keeps the events of an element and its content from the handlers around it. phem:prevent cancels the default action of the event of a handler, such as the visit of a link. phemc checks the keys (E032), and W006 now also warns about phem:key with no key handler and phem:prevent with no handler. ComponentTester::keyDown() and keyUp() take the modifiers, and send no event for a key that phem:key does not list.

0.3.17 (2026-11-10)#

  • Feeds for long lists: a public Phem\Feed property of a class component, shown with phem:feed={{ messages }}, keeps its items in the browser. The items are not in the state, and an event does not load them again. A handler calls append(), prepend(), update(), delete() or reset(), and the response has a Turbo Stream for each change, after the morph of the component. A handler in an item gets the item again: the browser sends its signed item, bound to the instance of the component (the page, its route values and the fiber id), and the server loads it with EntityFinder. A component with a feed runs mount() on its first render only. Streams::toComponent(...)->feed('messages')->append($item) pushes a change to the other browsers, and each one renders the item itself, so its handlers work. A feed element renders in each render of its component. phemc checks the feed element: E065 (not a Feed property, or another place) and E066 (other content than one loop on the feed with one element for each item). ComponentTester applies the streams of the feeds and the pushes of a feed.
  • The internal Phem\Stream\Stream class is now Phem\Stream\TurboStream.
  • Validation::hasError($field): true when the field has an error. A template checks it before it shows the error: {% if validation.hasError('email') %}.
  • Breaking The Phem\Component trait (setState()) is removed. No code used it. Set the state properties directly.
  • A new doc, docs/configuration.md, lists all the options of the bundle.
  • The client sends 100 <Suspense> boundaries in one load event at most, the limit of the server. With more boundaries, the server answered 400, and the client loaded each boundary alone.
  • The language server completes onFocusIn and onFocusOut.

0.3.16 (2026-11-09)#

  • Class names in markup: a capitalized name that the file imports with use (or a component or an enum of the namespace) is the class, not a variable. OrderStatus.Cancelled reads a case or a constant, OrderStatus.cases() the cases of an enum, and path(ProductPage, {product: product}) or url(...) links to a page. phemc checks the names: E062 (no such case of an enum of the sources), E063 (not a page with a route) and E064 (a class name in another place). Twig checks the cases of the other classes when it compiles the template (phem:warmup). The editors complete the cases after OrderStatus. and the pages in path(, with their import.
  • PageUrlGenerator and RedirectTo take the values by prop: a prop gives its route value, an entity the value of its mapped field (['product' => $product] for /products/{id:product}), and a backed enum its value. PageUrlGenerator::url() gives an absolute URL. The route values of each page are in a cache file (cache:warmup writes it), so a link doesn't load the routes.
  • Toast messages from a handler: $e->toast('Saved'), or $e->toast('No stock', ToastType::Error, 0) with a type and a duration in ms. A component or a service injects Phem\Toasts ($this->toasts->error('…')), with a method for each type. An empty message, or a duration below 0 or above Toasts::MAX_DURATION (2147483647 ms), throws an InvalidArgumentException. ComponentTester::assertToast() checks a toast of the last action, as the phem-toast controller shows it. The error toast of a #[MapForm] without a Validation property uses it too, with the first error that has a message.
  • The worker of an #[Async] handler logs a warning when its work dispatches a browser event (a toast): the worker has no response, so the browser does not get it.
  • Entity broadcasts: #[Broadcast(on: [Order::class, OrderLine::class])] on a page or a component names the Doctrine entities that it shows. After each flush that inserts, updates or deletes one of them, Phem refreshes the page or the component in every browser. A #[Path] entity selects the URL of a page, and a #[BroadcastKey] entity selects the instances of a component. A related entity follows its to-one association. With no such prop, all the URLs or all the instances refresh. A field list ([Order::class => ['status']]) limits the refresh after an update. toPage() takes the entity of a #[Path]. The streams go out at the end of a console command and of a Messenger message too.
  • Hint H001: a variable that only copies a property for the markup ($rows = $this->lines;). The markup reads the properties of the class, also the private ones. The editors fade the copy, and the quick fix removes it and uses the name of the property in the markup. A copy that can keep an older value of the property isn't a hint. phemc build and phemc check don't print hints.

0.3.15 (2026-11-08)#

  • The error of a handler on a field: Validation::withError() adds an error that no constraint finds, for example a name that the database has already ($this->validation = $this->validation->withError('name', 'This name is taken.')). The field shows it as the error of a constraint: phem:bind, phem:error, error(), errors() and valid() see it, and it goes before the error of a constraint on the same field. The state keeps it for the next events. It goes when the user changes the field, on the next submit of a handler, or with new Validation(). The error of the whole component ('') goes only on a submit or with new Validation(). A path (draft.name) and a Bound prop work too.
  • data-phem-guard asks in a <dialog> of the page: data-phem-guard-dialog="#confirm" gives the selector of the dialog, and data-phem-guard-accept the label of its accept button. The dialog is the same as for phem-confirm. The guard cancels the click of a Turbo link, and after a confirm it visits the link with its data-turbo-action and no second question. Escape, a tap on the backdrop and turbo:before-cache close the dialog. A visit of a script or of a Turbo form, no dialog, or a dialog that cannot ask, asks with window.confirm(). The question of beforeunload stays the question of the browser.
  • Fix: a guard whose confirmed visit another turbo:before-visit listener cancels asks again. Before, the guard and beforeunload asked no more on that page.
  • Breaking: phemc: an aria-invalid on a bound field is the error E033, so the build of an app with one fails. phem:bind sets aria-invalid from the Validation property: remove the attribute, and show the error with phem:error. For an error that no constraint finds, use Validation::withError().

0.3.14 (2026-11-08)#

  • Fix: the phem-confirm dialog closes on a tap on the backdrop, with no event (phem-dialog too), and on turbo:before-cache: a visit back shows no old question.

0.3.13 (2026-11-08)#

  • Draft objects in #[State]: a #[State] property can keep an object of a plain class (a draft of a form, a date). The Serializer encodes it in the state, and phem:bind binds its public properties with a path (phem:bind={{ draft.name }}). A handler can change the object in place: a child that gets it renders again only when it changed. A Doctrine entity in #[State], also in a property of a draft, throws a LogicException.
  • A bound date field shows the date in the format of the type of the input (Y-m-d for <input type="date">), in the timezone of the date. The server reads the new text in the same timezone.
  • Redirect before a page renders: a function page, or the mount() of a class page, can return a RedirectTo. The GET of the page ends with a 302, and the page does not render (function VerifyLink(string $token): RedirectTo). A function page, or a page with no #[State], can also redirect in an event. The mount() of a component that is not a page throws a LogicException.
  • RedirectTo gets a headers argument: the headers of the redirect response (new RedirectTo(AccountPage(...), headers: ['Referrer-Policy' => 'no-referrer'])).
  • Fix: the answer of an event that redirects drops the headers and the cookies of the redirect response no more. A handler that returns a RedirectResponse with a cookie now sets it.
  • Typed form data in a handler: #[MapForm] on a parameter maps the form fields of the event to an object (addClosed(#[MapForm] ClosedDates $dates)). The Serializer converts the strings to the types of the properties, and the Validator checks the object. When it is not valid, the handler does not run: the errors go to the Validation property of the component, or the first error goes to an error toast. The map runs before the transaction of a #[Transactional] handler. Each submit replaces the errors of the last one, and a valid submit removes them. Options: name (a prefix of the fields), validationGroups and serializationContext. A call in the markup can't give a value to a #[MapForm] parameter. It needs symfony/serializer.
  • The errors of a bound field. A bound field with a validation error gets aria-invalid="true" and the id of the error in aria-describedby, after its own ids. The new phem:error={{ email }} directive renders an element only when the field has an error, with the id of the error and the message: <p phem:error={{ email }} className="error" />. On a component tag, the component gets the id and children props. The id is <component id>-<field>-error, so the field needs no id. A Bound prop works too: the error is the error of the parent property.
  • phemc: an invalid phem:error is the error E061 (not a #[State] property or a Bound prop, a component with no Validation property, an element with an id or content).
  • Handler arguments in the markup: onClick={{ pickReason(r) }} runs pickReason($r) when the user clicks. The arguments are values of the render: the handler id has their fingerprint, so the browser can't change them. They go to the first parameters, and the other parameters get the event and the services as before. A closure prop works too: onPick={{ pick('menu') }}, and the child adds its arguments (onClick={{ onPick(size) }}). phem:loading and phem:progress accept a call.
  • phemc: a handler call whose arguments don't fit the method of the class component is the error E047. Breaking: the warning W001 ("calls the handler during render") is gone, because a call in an on* attribute is now a handler call.

0.3.12 (2026-11-08)#

  • phemc: mount or render passed as a handler (onClick={{ mount }}, phem:loading={{ render }}) in a class component or a page is the error E046. Phem calls these methods itself: they are not handlers. A PHP or Twig variable, a prop or a property of the same name is still a value.

0.3.11 (2026-11-08)#

  • Security: an event has the route name of its page (_route), not phem_event.<name>. An access_control rule on a route name (route: ^admin_) now applies to the events of the page and to a POST to its URL. Before, a client that the rule denied could send them.
  • Security: $e->form takes linear time for many fields of the same name. Before, one small gzip event with many fields of one name used seconds of CPU.
  • data-phem-autofocus-keyboard on a link or on the element of an event opens the keyboard of iOS for the field that phem-autofocus focuses after the visit or the morph. Before, the field got the focus, and no keyboard opened. It works in an open <dialog>, and gives the focus back to the element of the tap when no field gets the focus.

0.3.10 (2026-11-07)#

  • Error pages: #[ErrorPage] on a function of a .phem file renders the page of the HTTP errors (a 404, a 500), in the document of the application. A status (#[ErrorPage(404)], #[ErrorPage([401, 403])]) and a path (#[ErrorPage(path: '/admin')]) choose the page: the longest path wins, then the status. The page gets int $status, the FlattenException $exception of Symfony (or the exception itself for \Throwable $exception) and the arguments of a function page. It has no state and no events, and it can be a plain HTML document with no <Root>. The status and the headers of the error stay. The preview at /_error/{code} shows it (?path=/admin for a section), and error:dump writes it to static files at the host of the router. The container build checks the attributes.
  • The option phem.show_exceptions (the debug mode of the kernel by default) shows the page of the exception in place of the error pages. Set false in the e2e tests.
  • errorPage() in the tests renders the error page of an error at a URL, with a session.
  • visit() in the tests runs Symfony in the web mode, as WebTestCase: an HTTP error renders the error page of the application, not the output of the CLI error renderer.
  • phemc reports E059 for #[ErrorPage] on a class, E060 for #[ErrorPage] in a package, and E053 for #[Broadcast] on an error page. An error page used as a tag is E056. The hover of the editors shows the statuses and the paths of an error page.

0.3.9 (2026-11-07)#

  • Fix: phemc did not pass a local to the template when only a tag ({% if missing %}) used it and its name was missing, ignore, only, key or sandboxed. The page failed at runtime with Variable "missing" does not exist, and phemc check gave no error. The words ignore missing, with and only are now keywords only after the expression in {% include %}, {% embed %} and {% with %}, as in Twig: {% with a ~ only %} reads only.
  • Fix: phemc did not pass a local named with, if, starts, ends, has, some or every. These words are keywords only in the operators starts with, ends with, has some and has every: {{ with }} reads $with.
  • Fix: in {% if flags b-and 4 %}, phemc read b as a variable and gave an error. It now reads b-and, b-or and b-xor as operators.

0.3.8 (2026-11-07)#

  • Fix: after an event, a kept component with slots showed old HTML when its owner rendered again and the slots read an object that the handler changed in place (an entity). The slots now belong to the component that gives them: a component with slots renders again each time that its owner renders. A component with props only is still kept when it gets the same objects. Before, only a function component with a body of one return <markup>; (a template component) rendered its slots again: a statement in the body, for example $x = ...;, made the page show old HTML.

0.3.7 (2026-11-05)#

  • Fix: in the tests, the browser kept a cookie with an empty Domain (for example the session cookie of PHP, with the default session.cookie_domain) on no host, so it did not send the cookie. As a browser, it now ignores an empty Domain: the cookie goes to the host of the page.

0.3.6 (2026-11-05)#

  • The visit() of the tests takes cookies for the browser (cookies: ['currency' => 'EUR']), on InteractsWithPhem and on a page. cookies() gives the cookies that the browser of a page sends to its URL, sorted by name.
  • Fix: in the tests, visit() and followRedirect() of a page opened a relative URL on localhost. They now open it from the URL of the page, as a link does.

0.3.5 (2026-11-05)#

  • Breaking The file extension of the components is now .phem (before: .phpm). The open tag is now <?phem (before: <?phpm), and the Twig namespace of the compiled templates is now @phemc (before: @phpm). Rename your files, and change each <?phpm tag to <?phem: an old <?phpm tag is now an error (E006).

0.3.1 (2026-11-03)#

  • Phem needs PHP 8.4 or later (before: 8.5). A .phpm file can use the syntax of PHP 8.5 (the |> operator, a closure in an attribute such as the key of #[RateLimit]) only when the application runs on PHP 8.5.

0.3.0 (2026-11-03)#

  • No change in the code. The Flex recipe of phem/phem starts at this version (phem/phem/0.3/ in symfony/recipes-contrib): it enables PhemBundle, adds the document of the pages, the first page at /, and the phemc worker of symfony serve.

0.2.7 (2026-11-03)#

  • Fix: the morph kept the files of a file input, so the next submit sent them again. A handler calls $e->clearFiles() when it takes the files, and the controller empties the file inputs that sent them. A handler that shows a validation error does not call it, so the user does not select the files again. A file input with files makes its form dirty (phem-dirty, and data-phem-guard).

0.2.6 (2026-11-03)#

  • Fix: the Tailwind merger removed the custom values of the theme. For example, with --text-caption in @theme, a class list with text-caption and then text-ink-muted gave text-ink-muted: tailwind-merge put the size with the text colors. The new phem.class_merger.tailwind.css option reads the custom names of the @theme blocks of the Tailwind entry CSS, and the new phem.class_merger.tailwind.theme option gives them in the configuration (theme: { text: [caption, price-lg] }).
  • Live validation of a Symfony form. A handler of onChange on the <form> calls handleRequest(), and the view of the form shows the errors of the fields that the user touched only. The form keeps all its errors, so isValid() checks all the fields. The server marks the touched fields with data-phem-touched, and a submit touches all of them. TouchedFields::touchAll($request) does the same for a handler of another event (a save with a click). Phem decorates the request handler of the forms when symfony/form is installed.
  • Breaking: onChange on a <form> gets each key of its text fields. Before, it got the native change event only (when the user left the field). Add phem:debounce={{ 'blur' }} to keep the old behavior. A phem:live field still sends its own events.
  • Breaking: a submit, a change or a click of an element in a form sends the fields of the form ($e->form and the POST data of the Request), also for a control with the form attribute. The fields go with their values when the event leaves. Only the submit sends the files: before, a change of a form sent them too.
  • The morph keeps the values of the form fields with no phem:bind that the user changes while an event runs. For a field that the server marks as touched, it also keeps the value of the focused text field and of a password field.
  • Fix: a change that phem:before-queue cancels (for example with phem-confirm) gives the old value back to the field that changed, also when the handler is on its form.
  • phem:debounce={{ 'blur' }} on a <form> sends the event when the user leaves one of its fields. Before, the event waited for another event.
  • Fix: a morph after an event or a push no longer replaces a bound field that the user edits. Before, when a component before the field went away (for example the <FieldError> of a field that became valid), the next component of the same class got its fiber id. The morph then matched the parent of the field with another element, and built the field again: the typed value and the focus were lost. While a morph runs, each bound field now has an id from its phem:bind key (and from its value, for a checkbox or a radio button), so the morph matches the field and its parents.

0.2.5 (2026-11-02)#

  • Live validation of the #[State] properties. A #[State] property of the type Phem\Validation turns it on for a class component. The bound values of an event touch their fields, and the errors of the touched fields go into the Validation.
  • #[Validated] on a handler method or a closure touches all the fields and validates before the transaction. When there are errors, the handler does not run. It takes validation groups.

0.2.4 (2026-11-02)#

  • Install Phem in 3 commands: symfony new --webapp, composer require phem/phem and symfony serve. The page routes go into the routing.controllers resource (Symfony 7.4+), so an application needs no routes file. The type: phem import still works.
  • config/preload.php needs no change: the container preload file includes phem-preload.php from the build directory. symfony/stimulus-bundle is now required.
  • Breaking: phemc does not write a preload.php file any more.
  • Compile the .phpm components of the Composer packages with the application, and show them in the editor.
  • #[Component(replaces: ...)]: a component of the application replaces a component of a package in all the tags of the project. phemc reports E016 for a replacement that does not keep the props and the slots of the original, and E017 for a replacement that it cannot use.
  • Theme packages: a base package has abstract classes (the props, the state, the handlers and #[Provide]), and each theme extends them. #[Provide] on a parent class applies to its children. #[Component] or #[Page] on an abstract class is E045.
  • <Dynamic> renders an element with a tag name from a value. It refuses the unsafe elements.
  • Merge the classes of a component with the classes of its caller: classes() gives a Phem\ClassList. Set phem.class_merger.tailwind to remove the conflicting Tailwind classes.
  • Convert a string or an int prop to a case of its backed enum.
  • Publish to a standalone Mercure hub (for example with PHP-FPM): set phem.mercure.publisher_key and phem.mercure.publish_url. A page with #[Broadcast] and no hub logs a warning.
  • The client stops after the hub refuses 3 connections in a row, with a warning in the console. Before, a page with no hub sent a refresh every 5 seconds.

0.2.3 (2026-10-28)#

  • New Stimulus controllers: phem-optimistic (optimistic changes, matched to their events by DOM event id), phem-toggle, phem-dialog, phem-tabs, phem-toast, phem-clipboard, phem-autofocus and phem-confirm.
  • Stream the <Suspense> boundaries in the response of the page.
  • The fiber id goes on the root element of a component. A component that renders a text, more than one element or another component still gets a <phem-c>.
  • Send one placeholder for a run of kept components, and a patch of the render shape.
  • Send a patch of each state entry that changed only a bit.
  • Check that the browser can send the state of a page back in an event. In debug mode, a state larger than phem.max_event_size throws. In production, the server logs an error.
  • Breaking: phemc writes its output to var/phem, not to var/cache/phem, so rm -rf var/cache keeps it.
  • Fix: the markup values render one time in each render pass. Before, a consumer in a slot of a component that rendered alone could keep the old value of its context.
  • Performance: the fibers of a request are freed with no run of the cycle collector, and the loaded templates of the markup literals stay for the request.

0.2.2 (2026-10-26)#

  • After a handler of a component with #[Broadcast], the other browsers render the component again. #[Broadcast] on some handler methods limits this to these handlers.
  • #[BroadcastKey] marks the props that identify an instance: the refresh goes only to the instances with the same values. phemc reports E057 for a #[BroadcastKey] that is not on a prop of a component that broadcasts.
  • Breaking: Streams::toComponent() takes the values of the key props, and refresh() takes no target.
  • The browser that sent the event does not render the component of the handler again.

0.2.1 (2026-10-25)#

  • Breaking: rename the #[Subscribe] attribute to #[Broadcast].
  • Renew the hub topic of a broadcast component only when it renders in the event. A viewer who loses access to a component stops to get its pushes when the topic expires.

0.2.0 (2026-10-24)#

  • #[Subscribe] can mark a component.
  • Breaking: Streams::to() is now two methods: toPage() and toComponent().

0.1.3 (2026-10-24)#

  • #[Subscribe] can mark a function page. Streams::to() takes the first-class callable of a function page (Guestbook(...)).
  • The language server finds the references of a component, a function or a method, and shows a usage count above each one.

0.1.2 (2026-10-24)#

  • The <Suspense> boundaries that start to load together send one load event. After a failed load, each boundary loads alone.
  • A state smaller than phem.state_cache_min_size (4096 bytes) goes with each event and is not cached.

0.1.1 (2026-10-24)#

  • No change in the package. The repository has no quickstart app any more, and the dev Docker image moved to docker/.

0.1.0 (2026-10-24)#

The first release.

  • .phpm components: class and function components with JSX-like markup and Twig, compiled by phemc to PHP and Twig. Props (#[Prop], rest props), slots, #[State] and Phem\Node.
  • Pages: #[Page] on a class or a function, the route values as #[Path] props (also entities), and #[Url] properties in the query string.
  • Event handlers with the arguments of a Symfony controller, RedirectTo and a RedirectResponse. The client morphs the page with Turbo Streams.
  • Form fields bound to #[State] properties with phem:bind and phem:live, also in an array path and from a child component. File uploads, with phem:progress.
  • Loading states (phem:loading, aria-busy), form locks, phem:debounce, phem:throttle, retries, an offline class and view transitions.
  • Render only the components that can change after an event. The signed state goes into a cache, and an event sends only its signature.
  • <Suspense>, <ErrorBoundary>, contexts (#[Provide] and #[Context]) and Stimulus client code, with list items morphed by key.
  • Real-time pushes with #[Subscribe] and the Mercure hub of FrankenPHP.
  • #[Transactional], #[RateLimit] and #[Async] handlers, and server-to-browser events.
  • Test helpers for components and pages, and a Phem panel in the Symfony profiler.
  • The phemc lsp language server, used by the VS Code and PhpStorm plugins and by the Claude Code plugin.
Edit this page on GitHubLast updated
Phem
Esc
↑↓ to navigate↵ to openEsc to close