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 newphem/closingTagrequest 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
.phpfiles of the project too, and the rename changes them. A call of a function of a.phemfile in a controller (Initials('Ada')) is a usage. The declaration must still be in a.phemfile, and a.phpclass 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 onCardopenCard, notBigCard. 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 writesvariant="". - The language server has quick fixes for an unknown component (E010, add the import), an
attribute without its
useimport (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
.phemfiles. - The language server has completion and hover for the built-in controllers: the
data-controllervalues, thedata-phem-<controller>-targetattributes and their parts, and thedata-phem-<controller>-<name>-valueattributes. The hover also shows on the tag of a component.
0.10.2 (2026-11-24)#
- phem requires
twig/twig3.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-togglewith an<input type="hidden">(a native<button>, or anunchecked-value) stops the submit of aphem-formwhile it is not checked. The browser does not validate a hidden input, so the toggle givesphem-formandphem-fieldavalueMissingerror with the message of the browser for a required checkbox.
0.10.0 (2026-11-23)#
-
Breaking
phem-tabsno longer supports a tab that is a link (<a href>). A bar of links to pages is not a tab list: use a<nav>witharia-current="page", orphem-navigation-menu. -
Breaking
phem-sortableno longer moves the item while the pointer moves. The list of the drop place getsdata-drop,phem.cssdraws a drop marker (--sortable-drop-color,--sortable-drop-thickness), and the item moves one time on release, withmoveBefore()when the browser has it. Escape removes the marker. -
Breaking
phem.csssetstouch-action: noneonly on thephem-sortablehandles. 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-groupgivesrequiredto 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-dialogkeeps the page scroll withoverscroll-behavior: containinphem.css, not withoverflow: hiddenon<html>. Only a browser with noclosedby(Safari) still gets the<html>lock. Loadphem.css, or add the rules yourself. -
Add a mode with one input for the whole code to
phem-otp-field: acodeInputtarget in place of theinputtargets getsautocomplete="one-time-code",inputmode,maxlengthand apatternof the full code. Optionalslottargets (aria-hidden) show each character, withdata-filledanddata-activeat the caret. A paste removes the spaces and the dashes. -
phem-tabshas thehiddenUntilFoundvalue anddata-phem-tabs-hidden-until-found: the search of the browser finds the text of a hidden panel and selects its tab. -
phem-tabsgivestabindex="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-dialoggetsclosedby(closerequest, ornonewhendismissis 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-tooltiptrigger and its tooltip. -
A
phem-tooltipwhose text is not the name of its trigger getsrole="tooltip", and the trigger getsaria-describedby. -
The time of the
phem-toasttoasts 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-fieldgetaria-invalid="false"until the field is invalid. Before, the attribute was not set. -
In the
onBlurmode,phem-fieldvalidates 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-fieldannounces 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-formandphem-fieldgive the focus to the switch or the checkbox ofphem-toggle, not to its hidden input. In aphem-field, the element getsaria-invalidandaria-describedby. -
phem-sortablesetsaria-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-arearenders a scroll once per frame, and removesdata-scrollingatscrollend(500 ms after the last scroll in a browser with noscrollend). -
phem-scrollspyuses an IntersectionObserver, and setsaria-currentwhen the scroll stops. -
The stand-in field of
data-phem-autofocus-keyboardhas noaria-hidden. It gets the name of the element of the tap andaria-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
loadingtoast 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 ofphem-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 andphem:shortcutuse 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_sessionistrue(it wasfalse), andphem.state_max_ageis3600seconds, one hour (it was86400). 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 ofdata-phem-offline-queue-max-age-valueis3600too. Set the old values inconfig/packages/phem.yamlto keep the old behavior, for example for a dashboard that users leave open. See "Keep security decisions out of the state" indocs/security.md. -
The server does not register the handler of a disabled form control (
disabledon 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,onFocusandonPaste. 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 runpublish, and the second click of a double click on a button that the first click disabled ran its handler again. phemc evaluatesdisabledandinertonce, in a Twig variable, and gives them tophem_on()({% set _phem_off_0 = (not ready) %}andphem_on('click', publish, _phem_off_0)). A form control with a spread uses the newphem_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" indocs/security.md.
0.9.0 (2026-11-23)#
- New
phem-palettecontroller andpalette_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 aphem-palette#choosepicker stores the choice inlocalStorage. See "Let the user pick a palette" indocs/controllers.md. The language server completespalette_script().
0.8.0 (2026-11-22)#
- Breaking The
#[Async]event handlers are removed:Phem\Attribute\Async, thePhem\Async\*classes (Promise,AsyncHandlerMessageand the others), the Messenger handler of the worker andComponentTester::settle(). phemc does not report E054 and E055 any more.symfony/messengeris no longer a suggested package. Run the slow work in your own Messenger message handler, and push its result withStreams.
0.7.0 (2026-11-21)#
- An inline
phem-comboboxlist (nopopuppart) in a<dialog>starts again when the dialog closes (itscloseevent, after the close animation ofphem-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. WithautoHighlight="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-comboboxgrid 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 getshidden. An empty text, a morph and the Turbo cache put the items back in their first rows. The newdata-phem-combobox-insert-into-value(the id of a text field) inserts thedata-valueof a chosen item into the field at its caret, closes the popup and gives the field the focus. phem/ui-base: theinsertIntoprop of Combobox and Autocomplete. phem-comboboxhas afuzzyfilter of the browser (data-phem-combobox-filter-value="fuzzy"): the characters of the text are in the label in the same order, as theMATCHESrank of match-sorter. The lines of thedata-keywordsattribute of an item are more keys of the filter (all the modes): each key matches alone. Ahighlighttarget shows the text of the user inmarkelements. phem/ui-base:filter="fuzzy", thekeywordsprop of ComboboxItem, and the new ComboboxHighlight part.- A
statuspart of aphem-comboboxopens the popup only when it shows something: a part of its state, or a text that is not hidden. The newresultspart shows when items show, and the newmorepart shows with it when thelimitvalue hides matches of the filter of the browser. An element withdata-phem-combobox-textis 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 ofphem/ui-basehas theresultsandmoreprops, and the ComboboxEmpty has atextprop. The state of a filter of the browser does not wait for the server. - Breaking: The items of a
phem-comboboxwith no selection (an Autocomplete) get noaria-selectednow, as in Base UI: the highlight isdata-highlightedandaria-activedescendant. A CSS rule on[aria-selected="true"]for the highlight must use[data-highlighted]. The input getsaria-controlsonly while the popup is open (an inline list keeps it), andspellcheck="false",autocorrect="off"andautocapitalize="none"unless the markup gives them. AgroupLabelpart getsaria-hidden="true". The items of a closed popup losedata-highlightedat the end of the close animation. - A
phem-comboboxpopup with nothing to show (a text with no match, noemptypart, and nostatuspart 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-comboboxthat the user empties closes the popup, as in Base UI. The next ArrowDown opens it with all the items. WithopenOnInputClick, or with the input in the popup, the popup stays open. - With
autoHighlight: true, aphem-comboboxgives 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-comboboxwith a list of the server and no selection (an Autocomplete) writes the label of the item in the input. Theinputandchangeevents go after the event of the click, so the server searches the label. AnonClickhandler of the item does not have to set the text of the input.
0.6.1 (2026-11-21)#
phemc mcphas 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.txtlinks 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-agentsruns the agent eval of the Claude Code plugin: realclaude -psessions on eight UI tasks, with and without the plugin, scored withphemc checkand the tags of each task (editors/claude-code/evals/).- The Claude Code plugin (0.2.0) starts
phemc mcpof the project, has aphemskill (the workflow, the new cheatsheet and the list of the docs) and aphem-uiskill (the components of the installed packages), and runsphemc checkafter each write or edit of a.phemfile: 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 mcpcommand: a Model Context Protocol server on stdin and stdout for the coding agents. Its tools give the texts ofphemc search,docs,componentsandexamples(phem_search,phem_doc,phem_components,phem_component,phem_examples), andphem_checkchecks 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" indocs/ai-agents.md. phemc examples <key>shows the code of an example as a complete file: theusestatements 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
@aliasesdocblock tag, so an alias can have more than one word (@aliases popup window). Before, each word was an alias of its own. phemc searchdoes 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 examplesandphemc searchcommands give a coding agent the texts that it needs, with the installed versions: the docs of Phem (in thephemcbinary), 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 jsonprints JSON for the tools. The new doc "Use Phem with coding agents" shows the workflow and a text to copy intoAGENTS.mdorCLAUDE.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@aliasesdocblock tag. An app build never compiles the examples.phemc build,checkandwatchcompile them with--examples-of <package>, for the demo of a package. phemc check <file>andphemc 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-dialogdoes 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-comboboxwithmultipleand 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 witharia-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:errorgives the ids of the DOM events of the request indetail.ids, asphem:send,phem:receiveandphem:donedo, andphem:queuegives the id of its DOM event indetail.id. A listener can tell which DOM event failed.- A choice of
phem-comboboxthat 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 thechipTemplatepart 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 losesdata-pending. - The
multipleselection mode ofphem-comboboxalso 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 thechipTemplatepart, 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 nohiddenis a first value, and a server render that removes it removes the value. The form fields of a hidden chip getdisabled, 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 anameeachComboboxChipwith avalue(and the chip of aComboboxChipTemplate) has a hidden input with its value. - A
phem-comboboxwith a list of the server shows a choice before theonClickhandler of the item answers. Withmultiple, a click on an item that is not chosen adds a chip from the newchipTemplatepart (a<template>:{label}is the label of the item), and the item getsaria-selected="true". With thesingleselection mode, the browser selects the item, as before. While the handler runs, the chip (or theclearparts of thesingleselection mode) getsdata-pending, and the chip stays through the morph of another event. The answer shows the server render. When the handler fails, the part getsdata-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-comboboxwith thesingleselection mode and a list of the server sends theinputandchangeevents of the label after the event of the click, as withmultiple. Before, the search went first: its server render did not have the item, so theonClickhandler 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-comboboxstays 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 amultiplecombobox after the user emptied the input, when the list changed under the pointer. - Fix: a
phem-comboboxwith thesingleselection 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 exampleLindsay Waltonafter the user deleted a letter. - Fix: a
phem-comboboxwith thesingleselection 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, thevaluepart 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-comboboxclears the selected item and the chips too, as in Base UI, not only the text: a shownclearpart gets the click (with its handler), and withmultipleand a list of the server, thechipRemoveof each chip gets a click. When the selection goes, the item that the browser kept for it leaves the list at once, and thestatusparts with no text to search do not wait for the server. - The
singleselection mode ofphem-comboboxremoves the selection when the user deletes all the text of the input, as in Base UI: thevaluepart gets"", theclearpart hides, and the input stays empty when the popup closes. An input in the popup (a search) keeps the selection. - The
singleselection mode ofphem-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 theinputandchangeevents, so a boundvaluepart 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 aphem:bindinput 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. Theclearpart shows only while an item is selected, and a popup that opens has the highlight on the selected item. Inphem/ui-base,phem:bindonCombobox(with nomultiple) gives thesingleselection mode, with a hidden input of the selected value,ComboboxItemis selected when itsvalueis the bound value, and the newlabelprop ofComboboxItemgives itsdata-label. The Async search (single) demo searches in theonChangehandler of the input with a repository service. - A
phem-comboboxwithmultiplehas no free text, as in Base UI: when the popup closes, the text of the input goes (with itsinputevent), 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 theirchippart (with thedata-valueof the item) shows. Inphem/ui-base, aComboboxwithmultipleopens on a click on the input. The Async search (multiple) demo searches in theonChangehandler of the input with a repository service. - The
statuspart ofphem-comboboxshows the state of a search of the server with its parts (the elements withdata-phem-combobox-status):pendingwhile the event of the input runs,errorwhen it failed (the items gethidden, and phem shows no error message),idlewith no text and no item, andemptywhen no item matches the text. The text of an input with nophem:bindstays through the morph. Inphem/ui-base,ComboboxStatustakes theidle,pending(with a spinner),emptyanderrortexts, and hides when it has no text to show. - The
valueof 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 ofphem-combobox), as the value of a bound field already was. - A
phem-comboboxwith its input in the popup (a searchable select) gives the popuprole="dialog", as in Base UI. The trigger getsaria-haspopup="dialog",aria-controlsto the popup while it is open, anddata-placeholderwhile no item is selected. Inphem/ui-base,ComboboxIcongets the icon color of Base UI. - A
phem-comboboxwith a client filter and the newmultipleselection mode (data-phem-combobox-selection-mode-value="multiple") keeps the chosen items in the browser, as the Combobox of Base UI withmultiple. A choice sends no event to the server. A click on an item adds or removes its value, and thechipparts with adata-valueshow only for the chosen values, in the order of the choices. AchipRemoveand theclearpart remove the values. A choice clears the text of the input, and closes the popup when the input had a text. The controller dispatchesphem-combobox:changewith the array of the values. While a value is chosen, the input has noplaceholderand gets thearia-descriptionof itsdata-phem-combobox-descriptionattribute ({count}), and the newchipspart keeps itsaria-label. As in Base UI, thechipspart getsrole="toolbar"while a chip shows, the focus on a chip closes the popup, a press on aninputGroupout of the input and its parts gives the focus to the input, and aninputGroupgetsdata-placeholderwhile no item is selected (also in thesingleselection mode). - Breaking: In
phem/ui-base, aComboboxwithmultipleand afilterkeeps the chosen items in the browser (themultipleselection mode). Render aComboboxChipwith thevalueof its item for each item, and give no handler to the items and to theComboboxChipRemove. A handler that toggles the item on the server now runs after the choice of the browser. SetselectionMode="none"to keep the choice on the server.defaultValuecan be a list, andComboboxInputhas aselectedDescriptionprop for thearia-descriptionof the chosen items.ComboboxChipsis now the row of the chips, as the Chips of Base UI: put it in aComboboxInputGroup, the box around it.ComboboxChip(now a<div>) andComboboxChipRemoveget the classes of the Multiple select demo of Base UI. - A
phem-comboboxwith 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 itsdata-selectedandaria-selectednow.
0.5.0 (2026-11-18)#
- Breaking: The reply of a handler moves from
Phem\Eventto the newPhem\Replyclass. A handler declaresReply $reply, at any position, alone or withEvent $e, and calls$reply->toast(),$reply->announce(),$reply->refresh(),$reply->clearFiles()and$reply->dispatch('saved', ['id' => 1]).Phem\Eventhas only the input of the event now:toast(),announce(),refresh(),refreshes(),clearFiles(),clearsFiles()and thedispatcherproperty are removed, andEvent::fromArray()has no$dispatcherparameter.HandlerMiddleware::handle()andHandlerCallMiddleware::handleCall()get theReplyafter 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.phemcgives the error E047 for a handler call in the markup that gives an argument to aReplyparameter, as for anEventparameter. - A
phem-navigation-menuin 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-popoverandphem-menuwithopenOnHover, and a submenu) away from the popup closes it at once, as thesafePolygonof 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-menuwith a filter (inputpart), 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-menuwith 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-selectandphem-navigation-menugoes to its place at once, also with a CSS transition oftopandleft. 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) getsposition: absoluteand 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 hadposition: 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 afixedorstickybox, or at the point of the pointer, keepsposition: fixed. - Nested drawers of
phem-dialogwork as in Base UI:- Each dialog around an open dialog counts the open dialogs at all levels in
--nested-dialogsand--nested-drawers. With three open drawers, the first one gets2and the second one gets1. 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. Withheight: var(--drawer-height, auto), the drawer behind gets its own height back with an animation. A drawer in a drawer gets--drawer-height: initialwhen 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.
- Each dialog around an open dialog counts the open dialogs at all levels in
- A dialog of
phem-dialogin an open dialog gets its own--nested-dialogs(and--nested-drawersfor a drawer):0when 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:lockdisables the element of a handler while its event runs:<button onClick={{ submit }} phem:lock>. At the event, the browser gives the elementaria-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.phemcwarns aboutphem:lockon an element with no handler (W006).- A panel of
phem-collapsibleandphem-accordionthat the search of the browser (Ctrl+F) finds opens with no animation, as in Base UI. It getsdata-instantand theautosize at once. Before, the height animation moved the text that the browser scrolled to. - A closed panel of
phem-collapsibleandphem-accordiongets0pxin its--<name>-panel-heightand--<name>-panel-widthvariables at the end of the close. Before, a panel withhidden="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-idvalue ofphem-popover,phem-menu,phem-tooltipandphem-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-dialogthat opens with itsopenvalue shows the payload of the trigger of itstrigger-idvalue. - The filter of
phem-menushows again only the items that it hid: an item that the server hides stays hidden. The reset of the query at the close dispatches aninputevent. - 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 anInvalidArgumentExceptionfordatathat is a list or that has an array or an object as a value.Toast::fromDetail()keeps only the names with a scalar value ornull.
- The morph of an event keeps the
- A toast has the options of
toastManager.add()of Base UI:$e->toast()andToasts::show()take anid(a toast with the same id updates the toast on the screen, withdata-update-keyanddata-updated), anaction(a[data-phem-toast-action]button that calls theonCallhandler around the toasts),data(the[data-phem-toast-data]parts), ananchor(the toast shows next to the element, with thesideandside-offsetvalues and a[data-phem-toast-arrow]part) and aviewport(thenamevalue of thephem-toastelement that shows it). A click on adata-phem-toast-showelement shows its toast at once. Theloadingtype is new.Phem\Toasthas the new options. See docs/controllers.md. - A drawer of
phem-dialogopens with a swipe from the edge of the screen: the newswipeAreapart. The newvirtual-keyboardvalue gives the popup the height of the keyboard of the device in--drawer-keyboard-inset. The newphem-drawer-providercontroller gives the page an indent while a drawer in it is open (data-activeand--drawer-swipe-progress).phem-dialogdispatchesphem-dialog:open,phem-dialog:closeandphem-dialog:swipe, and theviewportandbackdropparts get--drawer-swipe-progressduring 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-menuhas several triggers, asphem-popover: thetriggerparts and the detached triggers withdata-phem-menu-for. While a menu that is not modal is open, a press on another trigger moves it there. Theviewportpart shows a copy of the<template data-payload>of thedata-phem-menu-payloadof the trigger, thetrigger-idvalue is theidof the active trigger, and theopenaction takes atriggerIdparam. Each trigger gets its ownaria-expanded. A menu with aninputpart filters the items of itslistpart, with the newemptyandclearparts, thedata-labelattribute of an item, and the newauto-highlightandfiltervalues. The arrow keys move the highlight while the input keeps the focus. See docs/controllers.md.phem-dialoghas several triggers, asphem-popover: thetriggerparts and the detached triggers withdata-phem-dialog-for, for example an item of a menu. Each trigger gets its ownaria-expanded, thepayloadpart shows thedata-phem-dialog-payloadof the trigger, thetrigger-idvalue is itsid, and theopenaction takes atriggerIdparam. The newconfirm-closevalue 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 newfinal-focusvalue gives the focus to an element after the close. See docs/controllers.md.- A preview card of
phem-popover(open-on-hoverwith 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. Theopenaction does not move the focus into a preview card. See docs/controllers.md. phem-popoverhas several triggers, asphem-tooltip: thetriggerparts and the detached triggers withdata-phem-popover-for. A click on another trigger moves the open popup. Theviewportpart shows a copy of the<template data-payload>of thedata-phem-popover-payloadof the trigger, so a payload can have markup (also in a tooltip). Thetrigger-idvalue is the state of the active trigger, and theopenaction takes atriggerIdparam. Each trigger gets its ownaria-expanded. See docs/controllers.md.phem-tooltiphas several triggers, as the detached triggers of a Base UI tooltip: thetriggerparts, and the elements anywhere in the page withdata-phem-tooltip-forand theidof the controller element. The popup moves to the trigger under the pointer or with the focus, and itsviewportpart shows thedata-phem-tooltip-payloadof that trigger, withdata-current,data-previousanddata-activation-directionfor an animation. The popup gets--popup-widthand--popup-height. Theopenandtrigger-idvalues are the state, and theshowaction takes atriggerIdparam. See docs/controllers.md.phem-comboboxhas the highlight values of the Base UI Autocomplete:auto-highlighttakesalways(an open list always has a highlight),keep-highlightkeeps the highlight when the pointer leaves the items, andhighlight-item-on-hover="false"stops the highlight on hover. A combobox with nopopuppart has an inline list that is always open (a command palette). Thegridvalue makes the list a grid ofrowparts, with the arrow keys of a grid. See docs/controllers.md.phemcpasses 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-comboboxcan be in the popup, as the Input inside the Popup of a Base UI combobox: atriggeropens the popup with the focus in the input, avaluepart that is not an input shows the label of the selection or itsplaceholder, and a choice gives the focus back to the trigger. See docs/controllers.md. - A
groupofphem-comboboxgets the name of its newgroupLabelpart (aria-labelledby), as the GroupLabel of a Base UI combobox. Before, a group had no name. - The
valuepart ofphem-selecttakes adata-phem-select-templatefor two values or more ({first} (+{others} more)), anddata-phem-select-markupto show a copy of the markup of the selected item, as thechildrenfunction of a Base UISelect.Value. See docs/controllers.md. phem-otp-fieldhas anormalizevalue (uppercaseorlowercase) that changes the accepted characters before the state, as thenormalizeValueprop of a Base UI OTP field.- A fallback of
phem-avatarwithdata-phem-avatar-delayuses its own delay, as thedelayprop of a Base UIAvatar.Fallback. Render it withhidden: it does not show before the controller connects. See docs/controllers.md. - A link tab (
<a href>) ofphem-tabsopens 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-groupwith adata-valueinside 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-accordionwithdata-phem-accordion-hidden-until-found, or ofphem-collapsiblewithdata-phem-collapsible-hidden-until-found, hashidden="until-found"when it is closed, as thehiddenUntilFoundprop of a Base UI panel. Before, only thehiddenUntilFoundvalue of the root did this.
0.4.9 (2026-11-17)#
- Breaking:
$e->toast(),Toasts::show()andnew Toast()give a toast with no type by default, as in Base UI: the toast gets nodata-type. Before, the default wasToastType::Info. GiveToastType::Info, or callToasts::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 sendcontextmenuafter 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 withmax-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 offr-FR): inen-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-tabsis 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
indicatorofphem-tabskeeps 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-slidergives the focus to the thumb with no focus ring. A single thumb getsz-index: 1only during the press. In a range, the thumb of the press getsz-index: 2and the thumb of the last changez-index: 1. phem-scroll-arearemovesdata-scrollingat 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-fielddoes 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-fielddoes 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 sendsphem-number-field:commitwith the reasonkeyboard. Before, the reason wasinput-blur. - Breaking: the input of a
phem-number-fieldgetsinputmode="numeric"(on iOSdecimalwith aminof 0 or more, elsetext). Before, it wasdecimal. - Breaking: the first step of a
phem-number-fieldwith no value goes to 0 in the limits (minwhenminis more than 0,maxwhenmaxis 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 frommin), so ArrowUp gave 1 and ArrowDown gave -1. phem-number-fieldtakes 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-fieldlocks 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-fieldgettype="text"(orpasswordwithmask).phem-otp-field:completecomes 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-fieldwaits 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 getsrole="group"andaria-labelledby, and the slots getautocorrect,enterkeyhintandmaxlengthon the first slot.- Breaking An open panel of
phem-collapsibleandphem-accordionhas theautosize in--collapsible-panel-heightand--collapsible-panel-width(--accordion-panel-heightand--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 incalc(), inmax-heightor in a keyframe of an open panel must change: use them only inheight(orwidth), and put the closed size on[data-starting-style]and[data-ending-style]. - The header of a closed
phem-accordionitem getsdata-closed, also after the morph of an event. Before, it got onlydata-openwhen its item was open. - Breaking:
phem-toastputs a new toast first in the DOM, as Base UI. Tab goes to the newest toast first, and--toast-indexis 0 for the first toast.phem.cssshows the stack withflex-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-indexand--toast-offset-y. - Breaking: A
phem-toasttoast with no type, or with a type that is notinfo,success,warningorerror, has nodata-type. Before, it haddata-type="info". A toast of$e->toast()andPhem\Toastsstill hasdata-type="info"by default. - Breaking:
Phem\Toast::$typeis nullable.Toast::fromDetail()gives anulltype for a detail with no type, or with a type that the controller does not know, as thephem-toastcontroller does. Before, it gaveToastType::Info. SoassertToast($message, ToastType::Info)fails for such a toast, andToast::detail()has notypekey for a toast with no type. - The time of a
phem-toasttoast 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-toasttoast keeps the axis of its first move, and the toast follows the pointer with no transition. The toast getsdata-swipe-directionat 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-toasttoast. Escape still moves the focus, also after a mouse click on the toast. The close button getsaria-hidden="true"while the stack is not expanded and the button has no focus. - Breaking:
phem-comboboxwith no selection (the defaultselectionModenone, an Autocomplete) and noautoHighlightopens 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. Thesingleselection mode and themultiplevalue 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. Thesingleselection 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 thebothandinlinemodes 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 theclearpart, or the second Escape) keeps the popup closed. Before, theinputevent of the clear opened it. phem-comboboxgivesaria-haspopup="listbox"anddata-list-emptyto the input. Atriggerpart getsaria-haspopup="listbox",aria-expanded,data-popup-open, andaria-controlswhile the popup is open. AninputGrouppart getsrole="group"anddata-popup-open. The attributes stay through the morph.- Breaking: the popup of a preview card (
phem-popoverwithopen-on-hoverand a link trigger) no longer getsaria-hidden="true", as in Base UI. A screen reader can read the card in the reading order of the page. Its links and fields keeptabindex="-1". Putaria-hidden="true"in the markup of the popup to keep the old behavior. - Breaking:
phem-tooltipcloses 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 getsdata-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, aclosepart, a click outside) now usespreventScroll, 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 withclose-on-clickand thecloseaction 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-widthand--positioner-heightvariables areautoat rest. They have px values only during the size transition from one item to another, and go back toautowhen thewidthorheighttransition 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-menugivesdata-opento thenav, the lists and the arrow while an item is open,data-sideanddata-alignto the popup in a positioner, andtabindex="-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()andunposition()takemirrorelements, which get thedata-sideand thedata-alignof the popup.Popup(phem_popup.js) takes amirroroption.phem-menu,phem-context-menuandphem-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 listoverflow-y: autoandmin-height: 0in a popup withdisplay: flex; flex-direction: column(in a:not([hidden])rule, not in thestyleattribute). 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, notcollisionPadding. The trigger of a popup over it getsdata-popup-side="bottom", notnone. 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 getstabindex="0", and the other itemstabindex="-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-menuopens 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. Aclicklistener that callspreventDefault()on the trigger no longer stops the open: cancel thepointerdown. ArrowUp on a closed trigger no longer opens the menu on its last item. A closed trigger has noaria-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 getstabindex="0", and the popup of a submenu getsdata-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-menukeeps 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 getsdata-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 ofdisabled, 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:disabledstyle or a test ofbutton.disabledfor the lock with[aria-disabled="true"]. phem-formselects 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. Withdata-turbo-action="replace", the jump replaces the history entry. Before, Turbo loaded the page again and the focus went to<body>. phem:pollkeeps 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-instantgives 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 withdata-instantchanged 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
alignstartorendand no arrow gets--transform-originat its aligned edge (0%or100%, 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-menuandphem-selectstarts 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
eventoption ofdismissable()andPopup("pointerdown"closes a popup at the pointerdown outside, with each button),collision: "context"inplace(), theresetMsandfromoptions ofTypeahead, theleaveList()helper and thesettle()export ofphem_transition.js. No controller uses them yet. - Tab in a modal
phem-dialoggoes from the last element of the dialog to the first one, and Shift+Tab goes back, as in Base UI. Before, onlymodal="trap-focus"kept the focus in the dialog: Tab in ashowModal()dialog went from its last element to the browser. - A drawer (
phem-dialogwithswipeDirection) gives the focus to its popup on open, unless an element in it hasautofocus. Before, the first button got the focus and showed a focus ring. - The trigger of an open
phem-dialoggetsaria-controls. - A press on the backdrop of a
phem-dialogdoes 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-popovergives 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-fieldis 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-menulist goes to the next element of the page, and the menu closes. Before, the focus went into the content of the viewport again. phem-fieldshows 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 withphem:bind. Before, the field showed as valid.- The
errorpart of the server in aphem-fieldshows the errors of the browser after the user changes the value. Before, a cleared control showed novalueMissingmessage after a server error. In a field with a part of the server, anerrorpart with nodata-matchno 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-comboboxkeeps 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 withtabindex="-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.jsgives theleftor thetopof 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-comboboxandphem-dialoggive the popupdata-openanddata-starting-stylebeforeshowPopover()andshowModal(). Before, the browser computed the open styles first, so the popup (and the::backdropof a dialog) showed with no animation. phem-collapsibleandphem-accordionmeasure the content of a panel with no alignment (justify-content,align-items,align-content,justify-items), as Base UI. Before, a panel withjustify-content: flex-endgot--collapsible-panel-height: 0px, and showed nothing.phem-toastmeasures the height of the content of a toast (its height withheight: auto) for--toast-heightand--toast-frontmost-height, and removes--toast-frontmost-heightfrom the element when no toast remains, as Base UI. Before, with the CSSheight: 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-tooltipis only visual, as the Tooltip of Base UI v1.9.0: the popup gets norole="tooltip", and the trigger gets noaria-describedby. For a description that a screen reader reads, give the popup anidandrole="tooltip", and give the triggeraria-describedby, in the markup. - Breaking The
emptypart ofphem-comboboxis a live region that stays in the page, as the Empty part of Base UI: it getsrole="status",aria-live="polite"andaria-atomic="true", and it has its content only when the list has no item. The controller does not sethiddenon it: removehiddenfrom the markup of the part, and use:emptyto remove its padding. - Breaking In
phem-menu, the keys and the pointer go to an item witharia-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 withdisabled, 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 (theloopFocusvalue isfalseby 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 ofpixelSensitivitypixels, as in Base UI. Before, it was one step for eachpixelSensitivitypixels. The virtual cursor has its center at the pointer, and a newteleportDistancevalue keeps it near the scrub area. The scrub area getsrole="presentation", andphem.cssstops 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-popovergives 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 withopenOnHovercloses it after thecloseDelayvalue 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 getsdata-instant="focus"(an open by the focus) anddata-instant="dismiss"(Escape). - Breaking
phem-toastmakes its element a landmark and each toast a dialog, as in Base UI. The element getsrole="region",aria-label(the newlabelvalue, "Notifications"),tabindex="-1",aria-atomicandaria-relevant. A toast getsrole="dialog",tabindex="0",aria-modal="false",aria-labelledbyandaria-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-xand--toast-swipe-movement-y(0pxwith no swipe). The markdata-phem-toast-liveis nowdata-phem-toast-owned. - New
phem-buttoncontroller: Enter and Space click an element that is not a<button>, as a Base UI button withnativeButton={false}. A button witharia-disabled="true"does nothing. - More behavior of the Base UI v1.9.0 components. A modal
phem-menuthat the pointer opened does not lock the page. A menu popup getsdata-instant="click"(Enter or Space) anddata-instant="dismiss"(Escape), and a menu of aphem-menubargetsdata-instant="group"for an arrow key, the focus out and the open of another menu.phem-comboboxwith thesingleselection mode gives the input and thevaluepart the selection of the server render, and opens with the highlight on the selected item, in view.phem-dialoggives the focus to the popup after an open with a touch. A drawer gets--drawer-frontmost-height, anddata-nested-drawer-swipingduring the swipe of a drawer in it, which does not move the drawer around it.phem-accordiongivesdata-disabledto the parts of an item with a disabled trigger, anddata-orientationto its element and its panels. The element ofphem-collapsiblegetsdata-starting-styleanddata-ending-style. Enter toggles a switch ofphem-toggle. The viewport ofphem-scroll-areagetstabindex="0"only when it scrolls. See docs/controllers.md.
0.4.3 (2026-11-15)#
- Breaking
phem-accordiondoes 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). Setdata-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. Aclearpart hashiddenwhen there is nothing to clear. A press on aclearpart 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-basekit.phem-comboboxhas aselectionModevalue (single: one selected item withdata-selected, avaluepart for a form, no free text, and all the items when the popup opens with the label of the selection), anopenOnInputClickvalue, and aninputGrouppart that is the anchor of the popup. A modalphem-dialoglocks the scroll of the page. A mouse press in acontentpart of a drawer selects its text, anddata-phem-swipe-ignorestops a swipe.phem-accordionhas aheaderpart withdata-open, and its parts getdata-index. The triggers ofphem-popoverandphem-context-menugetdata-pressed.phem-menubargivesdata-instant="group"to the popups when it goes from one menu to another.phem-selecthas alabelpart that names the trigger and gives it the focus on a click. The position has thecollision-padding-inlineandflipvalues.phem-fieldvalidates on Enter in an<input>control. A limited toast getsinert, and the title, the description and the close button of a toast getdata-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'), thetitleargument of thePhem\Toastsmethods, andtitlein the detail of thephem:toastevent.phem-toastshows 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]) getsdata-behindanddata-expanded, as theToast.TitleandToast.Contentof Base UI.assertToast()takes atitleargument. See docs/controllers.md. phem-menuandphem-context-menukeep 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 withrole="menuitemcheckbox"changes itsaria-checked. A click on an item withrole="menuitemradio"checks it and unchecks the other radio items of its group. The item getsdata-checkedordata-unchecked, and sendsphem-menu:changewith{ checked, value }. The state stays after the morph of an event, unless the server render gives a newaria-checked. An item with anonClickhandler 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-togglelinks a<span role="checkbox">orrole="switch"to the<label>around it (aria-labelledby, orariaLabelledByElementswhen the label has no id), so a screen reader names it.phem-popoverlinks atitle, adescriptionand a popup with no id with element references, asphem-dialogdoes. Aphem-toggle-groupin aphem-toolbarleaves the arrow keys and the tab order to the toolbar, when its items are toolbar items.phem-select,phem-menu,phem-context-menuandphem-comboboxhighlight 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 getaria-hidden="true", so the check mark is not in the name. A popover keeps thearia-labelof its popup. In a toolbar, a toggle group takes thedata-orientationof 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
keyor 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 thearia-controlsof the number field buttons and thearia-activedescendantof a combobox with keyed items.phem_number.jsuses thelink()ofphem_aria.js. See docs/controllers.md.
0.4.0 (2026-11-15)#
- Fixes after a review of the new controllers.
phem-comboboxwith an inlinemodesends the text of the user for a bound input, not the label of the highlighted item (a field can give phem its value inphemValue). 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 getsdata-phem-value(the server value), so a reset gives it back.trap-focusskips the hidden fields. A drawer with snap points takes thestyleof the server after the morph. The controllers share the ARIA links inphem_aria.js. phemcgives E068 for a class or a function with a reserved name of PHP, such asclass Switchorfunction List(). PHP cannot declare it, so the error came only when PHP loaded the file. See docs/compiler.md.- A field with an optional
Boundprop (?Bound $value = null) can have its ownvalue, orcheckedfor a checkbox or a radio button, next tophem:bind. The field renders it only when the prop is null, as thedefaultValueof a UI kit input. A bound field ignores it. Before,phemcgave E033. See docs/forms.md. phem-navigation-menugivesdata-instantto 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-groupandphem-toggle-groupgive theirvalueto aphem-toggleitem that connects after them. Before, the item took its first state from its input or itsaria-checkedwhen it connected, and the group lost a checked value of the server render.phem-menu,phem-context-menu,phem-tooltip,phem-comboboxandphem-collapsiblegive noidto a part. Before, they gave anidto a popup, a group label, a list, an option or a panel with noid. The morph of an event removed this id, because the server render did not have it, soaria-controls,aria-labelledby,aria-describedbyandaria-activedescendantpointed to an id that was not on the page. Now the controller uses the element references of ARIA (ariaControlsElements,ariaLabelledByElements,ariaDescribedByElementsandariaActiveDescendantElement) for a part with noid. A part with anidfrom 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 sameid. See docs/controllers.md.- The state value of a built-in controller (for example the
openvalue ofphem-dialog, or thevalueofphem-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 aninputorchangeevent) is now dirty, sophem:bindandphem:livesend its value. See docs/controllers.md. - New
phem-fieldandphem-formcontrollers, as Base UI Field, Fieldset, Form and Input. A field links itslabel,control,descriptionanderrorparts, and validates the control with the constraint validation of the browser in theonSubmit,onBluroronChangemode (validationDebounceTime). Anerrorpart withdata-matchshows for oneValidityStatekey, and an error with no text gets thevalidationMessage. All the parts getdata-valid,data-invalid,data-dirty,data-touched,data-filled,data-focusedanddata-disabled. A server error (a control that the server renders witharia-invalid="true", asphem:binddoes) stays until the user changes the value.phem-formaddsnovalidate, stops an invalid submit before itsonSubmithandler sends the event, and focuses the first invalid control. - New
phem-otp-fieldcontroller, 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. ThevalidationType(numeric,alpha,alphanumeric,none),mask,autoSubmit,disabled,readOnlyandrequiredvalues,autocomplete="one-time-code"on the first slot, anddata-completewhen all the slots have a value. - Add the
phem-togglecontroller: a toggle button (aria-pressed,data-pressed), a switch or a checkbox (role="switch"orrole="checkbox",aria-checked,data-checked,data-unchecked), with thechecked,indeterminate,disabled,readOnlyandrequiredvalues. A click, a label and Space toggle it. Theinputtarget keeps a checkbox or a hidden input for forms (name,value,uncheckedValue,form), and theindicatortarget gets the state and the open and close animations. See docs/controllers.md. phem-checkbox-groupworks withphem-togglecheckboxes, for the items and the parent. It has avaluevalue (the values of the checked items) and anallValuesvalue (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 dispatchesphem-checkbox-group:change. See docs/controllers.md.- Add the
phem-toggle-groupcontroller: a group of toggle buttons with onevaluestate (the values of the pressed items),multiple,orientation,loopFocusanddisabled, and a roving focus with the arrow keys, Home and End. An item can be aphem-togglebutton. Each change dispatchesphem-toggle-group:change. See docs/controllers.md. - The new
phem-toolbarcontroller gives a row ofitemparts (buttons, links, inputs) one tab stop. The arrow keys of theorientationvalue, Home and End move the focus, with theloopFocusvalue. In a text input, the arrow keys move the caret until it is at the edge of the text. An item witharia-disabled="true", an item of a disabledgroup, or an item of a toolbar with thedisabledvalue stays in the focus order, but a click on it does nothing. The parts getrole="toolbar",role="group",role="separator",aria-orientationanddata-orientation. See docs/controllers.md. - The new
phem-radio-groupcontroller makes a radio group from elements that are not native inputs:role="radiogroup",role="radio"items witharia-checked,data-checkedanddata-unchecked, and anindicatorpart with the animations. Thevaluevalue 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. Thedisabled,readOnlyandrequiredvalues set the ARIA and the data attributes. Aninputpart (a hidden input or native radio inputs) gets the value and sendsinputandchange, and the controller dispatchesphem-radio-group:change. See docs/controllers.md. - The new
phem-avatarcontroller hides theimagepart until it loads, and shows thefallbackpart while the image is not loaded, after thedelayvalue. An image in the cache shows at once, and a newsrcloads the image again. The image getsdata-loadinganddata-error, and each change of the status (idle,loading,loaded,error) dispatchesphem-avatar:status. See docs/controllers.md. - The new
phem-number-fieldcontroller 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 forsmallStep, Shift forlargeStep), 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 thelocaleandformatvalues (Intl.NumberFormat). A hidden input gets the raw value. The value stays after the morph. See docs/controllers.md. - The new
phem-slidercontroller 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 thevaluepart shows the values withIntl.NumberFormat. The values stay after the morph. See docs/controllers.md. - New
phem-scroll-areacontroller: 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 getshidden, unless it hasdata-keep-mounted. The parts getdata-has-overflow-x/-y,data-overflow-x-start/-end,data-overflow-y-start/-end,data-scrollinganddata-hovering, and the--scroll-area-thumb-*,--scroll-area-corner-*and--scroll-area-overflow-*CSS variables. TheoverflowEdgeThresholdvalue sets the distance before an edge attribute shows. The scroll position and the state stay after the morph. See docs/controllers.md. - New
phem-selectcontroller: a button that opens a list of options, as the Select of Base UI. Thevaluevalue is the state (a JSON array withmultiple), and thevaluepart shows the label of the selected item or itsplaceholder(data-placeholder). WithalignItemWithTrigger(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, themodal,disabled,readOnly,requiredandloopFocusvalues, anddata-popup-open/data-pressedon the trigger. Aninputpart (an<input>or a<select>) gets the value and sendsinputandchangeevents, and the controller dispatchesphem-select:change. The value and the open popup stay after the morph. See docs/controllers.md. phem-menusendsphem-menu:openandphem-menu:close, and its trigger getsdata-pressedwhile the menu is open, as in Base UI (not the trigger of a submenu).open("first")andopen("last")open the menu with the focus on the first or on the last item. In a verticalphem-menubar, ArrowRight opens the menu and its popup goes on theinline-endside. See docs/controllers.md.- New
phem-menubarcontroller (Base UI Menubar): a bar ofphem-menumenus with one tab stop. The arrow keys of theorientationvalue move between the triggers, Home and End go to the first and to the last trigger, andloopFocusgoes 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. Themodalvalue (the default) locks the page and keeps the pointer events of the menubar. Thedisabledvalue opens no menu. The menubar getsrole="menubar",aria-orientation,data-orientation,data-modalanddata-has-submenu-open. See docs/controllers.md. - New
phem-navigation-menucontroller (Base UI NavigationMenu): the triggers of a list open their content in one shared popup, with the pointer (delayandcloseDelay, 50 ms) and with a click. With aviewportpart, the open content moves into the viewport, and goes back to its item when it closes and before a morph. The popup gets--popup-widthand--popup-height(the positioner--positioner-widthand--positioner-height) for a transition of the size, and the contents getdata-activation-direction. The arrow keys move between the triggers and the links of the list, ArrowDown opens a content, and Escape closes it. Thevaluevalue is the state. A link witharia-current="page"getsdata-active. See docs/controllers.md. - A
phem-popoverwithopenOnHoverand 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 thedelay, and the focus out closes it after thecloseDelay. The link stays the only part for the keyboard and a screen reader: it gets noaria-haspopupandaria-expanded, the popup getsaria-hidden="true"and no role, and its links and fields gettabindex="-1". See docs/controllers.md. phem-dialoghas the parts and the values of Base UI Dialog, AlertDialog and Drawer. ThedisablePointerDismissalvalue keeps an alert dialog open on a tap on the backdrop: only Escape closes it. Themodalvalue:falseopens the dialog withshow()(the page stays active, and Escape and a press outside close it), andtrap-focusalso keeps Tab in the dialog. Thebackdroppart opens and closes with the dialog, and a<dialog>as theviewportpart holds thepopuppart (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 thesnapPointsvalue: thesnapPointvalue is the state, and the popup gets--drawer-snap-point-offset,--drawer-heightanddata-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-yand--drawer-swipe-progress(before--dialog-swipe-*), and the new--drawer-swipe-strength. The popup of a drawer always hasdata-swipe-direction, and a swipe that closes it givesdata-swipe-dismiss. A drawer in a drawer givesdata-nested-drawer-openand--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 tothis.text(10). Before, it compiled to a Twig functiontext(), and the render failed withUnknown "text" function. A method hides a Twig function with the same name, exceptrender(). A handler call (onClick={{ remove(item) }}) does not change.phemcgives E067 for a call of a private method. See docs/syntax.md. - A
Boundprop can be optional:?Bound $value = null. When the tag of the child has nophem:bind,phem:bind={{ value }}binds nothing, and the field is a plain field. Before, the render failed with aTypeErrorinPhemRuntime::bind().phem:error={{ value }}renders nothing for a null prop. See docs/forms.md. - Breaking The default toast styles of
phem.cssapply only to a part with noclassattribute: thephem-toastcontainer,[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 andphem.cssis not. A toast with a class now hides withdata-limitedand moves with the swipe variables only with the styles of the app. See docs/styling.md. - Breaking The state of
phem-tabsis now theactivevalue: the value of the selected tab, not its index. Replacedata-phem-tabs-index-value="1"with the value of the tab. The value of a tab and of a panel is itsdata-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 noactivevalue, the first tab that is not disabled is selected. A tab and its panel need noidnow: with no id, the controller links them withariaControlsElementsandariaLabelledByElements, so a function component can render the tabs with no id. See docs/controllers.md. phem-comboboxcan filter in the browser a list that the server renders one time: set thefiltervalue tocontainsorstarts-with. The match ignores the case and the accents (Intl.Collator, with thelocalevalue). An item that does not match getshidden, agrouppart with no visible item too, and thelimitvalue shows only the first matches. The newmodevalue (list,both,inline,none) is thearia-autocompleteof the input: withbothandinline, 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 itsinputandchangeevents, and the text stays through the morph. The popup getsaria-busywhile 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>.phemcgives 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 afterand).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 anHtmlslot stays E031. See docs/syntax.md.
0.3.24 (2026-11-13)#
phem:announceon 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 inmount(). 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 anotherphem:announceelement is part of the outer text.ComponentTester::assertAnnounced()also sees these texts.phemcgives E032 for a text value ofphem: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 inrender(), 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
HandlerCallMiddlewareinterface gives a middleware the arguments of the call in the markup. A Closure or an Expression key of#[RateLimit]now gets them inargs. - 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 theaccess_controlrules 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 nowphem_event.acme_blog, notacme_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 = 1match/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 aBroadcastChannel: 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, aphem:liveupdate, a load, a poll, anonVisibleevent and an event that pushed arefresh()through an open hub connection send no message. See docs/real-time.md.- The new
phem-themecontroller keeps the choice of the user between a light, a dark and the system theme inlocalStorage, and gives<html>data-theme="light"ordata-theme="dark". The newtheme_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 itsdefaultto the switches. See docs/controllers.md. - More upload work in the browser. The new
phem-image-inputcontroller 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 thanpost_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 aPhem\Upload\DirectUploaderservice, which autoconfiguration finds; the handler gets aPhem\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 ofdata-phem-uploadcount inmax_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_sizeandupload_dir_max_files.ComponentTestersends the files ofdata-phem-uploadas the browser does.clear-filesis a reserved name of a browser event. See docs/forms.md. - The new
phem-scrollspycontroller marks the link of the section in view, for a table of contents: the link getsaria-current="true"anddata-active. A section is current from itsscroll-margin-top, so a click on a link marks the clicked link. The controller dispatchesphem-scrollspy:change. See docs/controllers.md. phem-collapsibletakes apersistvalue: a key for the state inlocalStorage. 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-menuin 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 newphem-context-menucontroller opens a menu at the pointer on a right click or a long press.phem-comboboxtakesmultiple, withchipandchipRemoveparts and their keys.phem-toastexpands the stack on hover (data-expanded,--toast-offset-y) and closes a toast with a swipe (swipeDirection).phem-dialogtakesswipeDirectionfor a drawer that closes with a swipe. A touch swipe needs notouch-action: a touch in another direction scrolls.phem-sortabletells 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-toastelement 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 hasshortcut($key, $modifiers). See docs/events.md. phem:keyandphem:shortcuttake themod+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-countshows the number of characters of a field ({count}/{max},data-overabove the max) or of checked boxes.phem-revealshows and hides the text of a password field.phem-checkbox-groupadds a "select all" box that is checked or indeterminate from its items.phem-accordionopens one item at a time, with the arrow keys between the triggers.phem-dependsshows a panel from the value of a field, and disables the controls of a hidden panel.phem-timeshows a<time datetime>in the time zone and the language of the user, as a relative time that updates, and dispatchesphem-time:reachedwhen 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:liveevents of the fields of onephem:bindproperty that wait in the queue go in one event: a "select all" of 100 checkboxes queues one event, with onephem: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-viewon 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-scrollon 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 thePhem\Announcementsservice put a message in a hidden live region for screen readers, with no toast.ComponentTester::assertAnnounced()checks it in a test.phemcgives E032 for a text value ofphem:scroll-into-view, and for a text other than"end"ofphem: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-popovershows a popup next to its trigger,phem-tooltipa short text on hover and on the focus of the keyboard,phem-menua list of actions with the keyboard of a menu (roving focus, typeahead), andphem-comboboxa list of suggestions that the server gives, with the keyboard in the input.phem-sortablemoves items with the pointer and with the keyboard, also to another list of the samegroup, and calls theonCallhandler of the list with{ id, index, list }. The popups go next to their anchor withside,align, the offsets andcollision-padding, flip and shift in the viewport, and getdata-side,data-align,--anchor-width,--available-heightand--transform-origin. A popup withpopover="manual"shows in the top layer. See docs/controllers.md. - Breaking: the built-in controllers use the conventions of Base UI.
phem-toggleis nowphem-collapsible, with thetriggerandpaneltargets, and no Escape or click outside (usephem-popoverorphem-menufor a dropdown). Thedialogtarget ofphem-dialogis nowpopup, and itstriggerandclosetargets need nodata-action.phem-tabsmoves the focus with the arrow keys and selects with Enter or Space (activate-on-focusgives the old behavior), and takes the orientation from itsorientationvalue in place ofaria-orientation. The toasts have thedata-phem-toast,data-type,data-phem-toast-descriptionanddata-phem-toast-closeattributes in place of thephem-toast-*classes, atemplatetarget for the markup of the app, and alimitvalue.phem-clipboardsetsdata-copiedin place of thecopiedclass. The parts getdata-open,data-closed,data-starting-styleanddata-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, andphem:poll={{ null }}stops it.ComponentTester::visible()andpoll()send the events in a test.phemcchecks the interval (E032), and warns aboutphem:pollwith noonPollandonPollwith nophem:poll(W006). - Call a handler from JavaScript.
onCall={{ move }}runs the handler when JS code dispatches aphem:callevent 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 nobubbles.ComponentTester::call()sends it in a test, andBrowserEventDispatcherrejects the namecall. - Key filters and event modifiers.
phem:key="ctrl+Enter Escape"sends theonKeyDownoronKeyUpevent only for these keys, and the other keys keep their default action.phem:stopkeeps the events of an element and its content from the handlers around it.phem:preventcancels the default action of the event of a handler, such as the visit of a link.phemcchecks the keys (E032), and W006 now also warns aboutphem:keywith no key handler andphem:preventwith no handler.ComponentTester::keyDown()andkeyUp()take the modifiers, and send no event for a key thatphem:keydoes not list.
0.3.17 (2026-11-10)#
- Feeds for long lists: a public
Phem\Feedproperty of a class component, shown withphem: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 callsappend(),prepend(),update(),delete()orreset(), 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 withEntityFinder. A component with a feed runsmount()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.phemcchecks the feed element: E065 (not aFeedproperty, or another place) and E066 (other content than one loop on the feed with one element for each item).ComponentTesterapplies the streams of the feeds and the pushes of a feed. - The internal
Phem\Stream\Streamclass is nowPhem\Stream\TurboStream. Validation::hasError($field):truewhen the field has an error. A template checks it before it shows the error:{% if validation.hasError('email') %}.- Breaking The
Phem\Componenttrait (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 answered400, and the client loaded each boundary alone. - The language server completes
onFocusInandonFocusOut.
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.Cancelledreads a case or a constant,OrderStatus.cases()the cases of an enum, andpath(ProductPage, {product: product})orurl(...)links to a page.phemcchecks 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 afterOrderStatus.and the pages inpath(, with their import. PageUrlGeneratorandRedirectTotake 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:warmupwrites 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 injectsPhem\Toasts($this->toasts->error('…')), with a method for each type. An empty message, or a duration below 0 or aboveToasts::MAX_DURATION(2147483647 ms), throws anInvalidArgumentException.ComponentTester::assertToast()checks a toast of the last action, as thephem-toastcontroller shows it. The error toast of a#[MapForm]without aValidationproperty 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 buildandphemc checkdon'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()andvalid()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 withnew Validation(). The error of the whole component ('') goes only on a submit or withnew Validation(). A path (draft.name) and aBoundprop work too. data-phem-guardasks in a<dialog>of the page:data-phem-guard-dialog="#confirm"gives the selector of the dialog, anddata-phem-guard-acceptthe label of its accept button. The dialog is the same as forphem-confirm. The guard cancels the click of a Turbo link, and after a confirm it visits the link with itsdata-turbo-actionand no second question. Escape, a tap on the backdrop andturbo:before-cacheclose the dialog. A visit of a script or of a Turbo form, no dialog, or a dialog that cannot ask, asks withwindow.confirm(). The question ofbeforeunloadstays the question of the browser.- Fix: a guard whose confirmed visit another
turbo:before-visitlistener cancels asks again. Before, the guard andbeforeunloadasked no more on that page. - Breaking: phemc: an
aria-invalidon a bound field is the error E033, so the build of an app with one fails.phem:bindsetsaria-invalidfrom theValidationproperty: remove the attribute, and show the error withphem:error. For an error that no constraint finds, useValidation::withError().
0.3.14 (2026-11-08)#
- Fix: the
phem-confirmdialog closes on a tap on the backdrop, with no event (phem-dialogtoo), and onturbo: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, andphem:bindbinds 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 aLogicException. - A bound date field shows the date in the format of the
typeof the input (Y-m-dfor<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 aRedirectTo. 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. Themount()of a component that is not a page throws aLogicException. RedirectTogets aheadersargument: 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
RedirectResponsewith 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 theValidationproperty 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),validationGroupsandserializationContext. A call in the markup can't give a value to a#[MapForm]parameter. It needssymfony/serializer. - The errors of a bound field. A bound field with a validation error gets
aria-invalid="true"and the id of the error inaria-describedby, after its own ids. The newphem: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 theidandchildrenprops. The id is<component id>-<field>-error, so the field needs noid. ABoundprop works too: the error is the error of the parent property. - phemc: an invalid
phem:erroris the error E061 (not a#[State]property or aBoundprop, a component with noValidationproperty, an element with anidor content). - Handler arguments in the markup:
onClick={{ pickReason(r) }}runspickReason($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:loadingandphem:progressaccept 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:
mountorrenderpassed 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), notphem_event.<name>. Anaccess_controlrule on a route name (route: ^admin_) now applies to the events of the page and to aPOSTto its URL. Before, a client that the rule denied could send them. - Security:
$e->formtakes 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-keyboardon a link or on the element of an event opens the keyboard of iOS for the field thatphem-autofocusfocuses 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.phemfile 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 getsint $status, theFlattenException $exceptionof 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=/adminfor a section), anderror:dumpwrites 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. Setfalsein 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, asWebTestCase: 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 wasmissing,ignore,only,keyorsandboxed. The page failed at runtime withVariable "missing" does not exist, andphemc checkgave no error. The wordsignore missing,withandonlyare now keywords only after the expression in{% include %},{% embed %}and{% with %}, as in Twig:{% with a ~ only %}readsonly. - Fix: phemc did not pass a local named
with,if,starts,ends,has,someorevery. These words are keywords only in the operatorsstarts with,ends with,has someandhas every:{{ with }}reads$with. - Fix: in
{% if flags b-and 4 %}, phemc readbas a variable and gave an error. It now readsb-and,b-orandb-xoras 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 defaultsession.cookie_domain) on no host, so it did not send the cookie. As a browser, it now ignores an emptyDomain: 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']), onInteractsWithPhemand 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()andfollowRedirect()of a page opened a relative URL onlocalhost. 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<?phpmtag to<?phem: an old<?phpmtag is now an error (E006).
0.3.1 (2026-11-03)#
- Phem needs PHP 8.4 or later (before: 8.5). A
.phpmfile 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/phemstarts at this version (phem/phem/0.3/in symfony/recipes-contrib): it enablesPhemBundle, adds the document of the pages, the first page at/, and thephemcworker ofsymfony 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, anddata-phem-guard).
0.2.6 (2026-11-03)#
- Fix: the Tailwind merger removed the custom values of the theme. For example, with
--text-captionin@theme, a class list withtext-captionand thentext-ink-mutedgavetext-ink-muted: tailwind-merge put the size with the text colors. The newphem.class_merger.tailwind.cssoption reads the custom names of the@themeblocks of the Tailwind entry CSS, and the newphem.class_merger.tailwind.themeoption gives them in the configuration (theme: { text: [caption, price-lg] }). - Live validation of a Symfony form. A handler of
onChangeon the<form>callshandleRequest(), and the view of the form shows the errors of the fields that the user touched only. The form keeps all its errors, soisValid()checks all the fields. The server marks the touched fields withdata-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 whensymfony/formis installed. - Breaking:
onChangeon a<form>gets each key of its text fields. Before, it got the nativechangeevent only (when the user left the field). Addphem:debounce={{ 'blur' }}to keep the old behavior. Aphem:livefield 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->formand the POST data of theRequest), also for a control with theformattribute. 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:bindthat 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-queuecancels (for example withphem-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 itsphem:bindkey (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 typePhem\Validationturns it on for a class component. The bound values of an event touch their fields, and the errors of the touched fields go into theValidation. #[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/phemandsymfony serve. The page routes go into therouting.controllersresource (Symfony 7.4+), so an application needs no routes file. Thetype: phemimport still works. config/preload.phpneeds no change: the container preload file includesphem-preload.phpfrom the build directory.symfony/stimulus-bundleis now required.- Breaking:
phemcdoes not write apreload.phpfile any more. - Compile the
.phpmcomponents 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.phemcreports 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 aPhem\ClassList. Setphem.class_merger.tailwindto 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_keyandphem.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-autofocusandphem-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_sizethrows. In production, the server logs an error. - Breaking:
phemcwrites its output tovar/phem, not tovar/cache/phem, sorm -rf var/cachekeeps 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.phemcreports 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, andrefresh()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()andtoComponent().
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.
.phpmcomponents: class and function components with JSX-like markup and Twig, compiled byphemcto PHP and Twig. Props (#[Prop], rest props), slots,#[State]andPhem\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,
RedirectToand aRedirectResponse. The client morphs the page with Turbo Streams. - Form fields bound to
#[State]properties withphem:bindandphem:live, also in an array path and from a child component. File uploads, withphem: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 bykey.- 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 lsplanguage server, used by the VS Code and PhpStorm plugins and by the Claude Code plugin.