Changelog

New features, bug fixes, performances and security improvements.

2.17.0
2024-04-23

2.17.0 : New UX Icons Package

Hey UX-ers!

This is a big release - lots of new features to Twig/Live Components and the first release of UX Icons! With UX Icons, comes a beautiful icon search on ux.symfony.com!

Live Components

Twig Components

Icons

Chart.js

Autocomplete

  • Command make:autocomplete-field output a doc compliant class by @lucbu in #1699
  • Use choice_value in the WrappedEntityTypeAutocompleter in EntityAutocompleteField by @jakubtobiasz in #1723

Turbo

Lazy Image

New Contributors

Full Changelog: v2.16.0 -> v2.17.0

2.16.0
2024-02-29

2.16.0 : Live Components is Stable 🥳

Hi UX'ers!

This release is the first that declares Live Components as stable 🎆! This means that it is now protected by our backwards compatibility promise. However, there are some BC breaks in LiveComponents that will affect most projects. See https://github.com/symfony/ux/blob/2.x/src/LiveComponent/CHANGELOG.md#2160

In addition, this release has a number of fun features & fixes.

Live Components

  • LiveComponents is now stable and no longer experimental 🥳

  • [BC BREAK] The data-action-name attribute behavior was removed in favor of using Stimulus "action parameters" and data-live-action-param. This is a breaking change if you were using the data-action-name attribute directly in your templates. #1418

    To upgrade your application, follow these changes:

    <button
        data-action="live#action"
    -     data-action-name="debounce(300)|save"
    +     data-live-action-param="debounce(300)|save"
    >Save</button>
    

    To pass arguments to an action, also use the Stimulus "action parameters" syntax:

    <button
        data-action="live#action"
    -      data-action-name="addItem(id={{ item.id }}, itemName=CustomItem)"
    +      data-live-action-param="addItem"
    +      data-live-id-param="{{ item.id }}"
    +      data-live-item-name-param="CustomItem"
    >Add Item</button>
    

    Additionally, the prevent modifier (e.g. prevent|save) was removed. Replace this with the standard Stimulus :prevent action option:

    <button
    -     data-action="live#action
    +     data-action="live#action:prevent"
    -     data-action-name="prevent|save"
    +     data-live-action-param="save"
     >Save</button>
    
  • [BC BREAK] The data-event attribute was removed in favor of using Stimulus "action parameters": rename data-event to data-live-event-param. Additionally, if you were passing arguments to the event name, use action parameter attributes for those as well - e.g. data-live-foo-param="bar". #1418

  • Reverted setting ignoreActiveValue: true in Idiomorph #1548

  • New placeholder macro to generate defer/lazy skeleton #1532

  • improve TestLiveComponent::actingAs() #1461

  • Drop Twig 2 support #1436

  • Add better error message when hydrating dates #1431

  • Store TemplateMap in build_dir #1525

Twig Component

  • Introduce CVA to style TwigComponent #1416
  • Drop Twig 2 support #1436
  • Fix full context is stored in profiler #1552

Autocomplete

Translator

  • Increase version range of intl-messageformat to ^10.5.11, in order to see a faster implementation of ICU messages parsing. #1443

New Contributors

Full Changelog: v2.15.0 -> v2.16.0

Have fun!

2.15.0
2024-02-20

v2.15.0 - LiveComponents & Autocomplete improvements & more

Hi UX'ers!

This release contains a mixture of new features and important bug fixes, especially LiveComponents & Autocomplete, which were discovered after the morphing library change in 2.14.0.

Autocomplete

Add doctrine/orm 3 support #1468

  • Allow passing extra options to the autocomplete fields #1322
  • Fix 2 bugs where TomSelect would reset when not necessary #1502
  • Add one missing German translation #1521

Chartjs

  • Remove restriction that prevented Chart.js 3.9 #1518

LiveComponent

  • [BC BREAK] The data-live-id attribute was changed to id #1484
  • Fixed child handling bug during re-rendering introduced with the new morphing library in 2.14.0 #1484
  • Fix bug where the active input would maintain its value, but lose its cursor position #1501
  • Restrict Twig 3.9 for now #1486

Turbo

  • Add Turbo 8 support #1476
  • Fix missing use statement used during broadcast #1475

TwigComponent

  • Add the ability to render specific attributes from the attributes variable #1442
  • Restrict Twig 3.9 for now #1486
  • Build reproducible TemplateMap to fix possible post-deploy breakage #1497

New Contributors

Full Changelog: v2.14.2 -> v2.15.0

Have fun!

2.14.2
2024-02-07

Fixing Turbo support for newer Doctrine

Hi UX'ers!

This release fixes a regression in the Live Component testing utilities.

Turbo

StimulusBundle

  • [StimulusBundle] UxPackageReader class doesn't support projects with varied structures using Composer with custom directory structure by @yobrx in #1467

New Contributors

Full Changelog: v2.14.1 -> v2.14.2

Have fun!

2.14.1
2024-02-03

Fix regression in Live Component testing tools

Hi UX'ers!

This release fixes a regression in the Live Component testing utilities.

Live Component

  • fix: use method from metadata for live component test helper by @daFish in #1434

StimulusBundle

  • Handles Windows directory separator when normalizing controller names by @tamcy in #1444

ux.symfony.com

New Contributors

Full Changelog: v2.14.0 -> v2.14.1

Have fun!

2.14.0
2024-01-30

Features & Fixed for LiveComponent, TwigComponent & other packages

Hi UX'ers!

A beautiful release with a set of features across several packages. 100+ commits, from 19 contributors 🔥 .

TwigComponent

  • Make ComponentAttributes traversable/countable
  • Fixed lexing some {# twig comments #} with HTML Twig syntax
  • Fix various usages of deprecated Twig code

LiveComponent

  • Add support for URL binding in LiveProp
  • DOM morphing changed from morphdom to idiomorph
  • Allow multiple LiveListener attributes on a single method
  • Requests to LiveComponent are sent as POST by default
  • Add method prop to AsLiveComponent to still allow GET requests, usage: #[AsLiveComponent(method: 'get')]
  • Add a new urlReferenceType parameter to AsLiveComponent, which allows to generate different type URL (e.g. absolute) for the component Ajax calls
  • The symfony/serializer dependency is now optional
  • Added a data-skip-morph attribute to allow skipping morphing of an element (the element's attributes will be morphed, but its inner HTML will be overwritten instead of morphed)
  • Added an entry to the packages' package.json file so that @symfony/ux-live-component will appear in the user's importmap.php file if using AssetMapper. This will allow using the JavaScript from the package without extra setup.
  • Fixed edge-case rendering bug where a 2nd Ajax request might start before the 1st finished processing
  • Fix usage of {% embed %} with {% block %} in <twig:> components
  • Fixed data-loading not working when on root element of a component
  • Fixed error when class attributes contained a space at start or end
  • Fixed loading directives being matched in a child component

Autocomplete

  • Fixed behavior of Autocomplete when the underlying select or option elements were modified to hopefully, more reliably, reset the autocomplete instance. This is particularly important with LiveComponents.
  • Add support for the render.loading_more Tom Select Virtual Scroll option (loading_more_text)
  • Avoid losing the selected options when the Stimulus component is disconnected and reconnected to the DOM.
  • Added tom-select/dist/css/tom-select.bootstrap4.css to autoimport - this will cause this to appear in your controllers.json file by default, but disabled see.

StimulusBundle

  • Added Typescript controllers support

ChartJs

  • Add support for Chart.js version 4

Full Changelog: v2.13.3 -> v2.14.0

New Contributors

Have fun!

2.13.3
2024-01-30

Various minor bug fixes

Hi UX'ers!

A bug fix release. Nice!

TwigComponent

  • Merge data-action in ComponentAttributes #1288
  • Fix DataCollector return types #1297

LiveComponent

  • Fix date object hydration for custom format #1295
  • Allow trailing coma in "props" tags #1298
  • Fix BatchActionController redirection #1301

StimulusBundle

  • Remove stimulus.asset_mapper.loader_javascript_compiler when no asset-mapper

Full Changelog: v2.13.2 -> v2.13.3

New Contributors

Have fun!

2.13.2
2023-11-11

v2.13.2 Revert change to type: module

Hi UX'ers!

In 2.13.0, all UX JavaScript packages changed to type: module. This had unintended side effects in certain environments / setups. This release reverts that change. See #1268.

Full Changelog: v2.13.1 -> v2.13.2

Have fun!

2.13.1
2023-11-09

v2.13.1: Fix chart.js but with type: module

Hi UX'ers!

This release fixes a but in ux-chart.js. We changed the package to type: 'module', but due to some inconsistencies with the chart.js library, that can't be done quite yet. We've reverted for now.

What's Changed

Full Changelog: v2.13.0 -> v2.13.1

Have fun!

2.13.0
2023-11-08

v2.13.0: Lazy/Deferred components, Symfony 7 support & more

Hi UX People!

This is a big release that contains new features across the components! It's the result of 156 commits from 29 different contributors! Note there is an edge-case BC BREAK in StimulusBundle if you were using action parameters in an unexpected way.

All Components

  • Add Symfony 7 support.
  • Change JavaScript package to type: module

Autocomplete

  • Add new BaseEntityAutocompleteType
  • Drop symfony 5.4 support.

TwigComponent

  • Added configuration to separate your components into different "namespaces"
  • Add outerScope variable reach variables from the parent template of an "embedded" component.
  • Deprecate calling ComponentTemplateFinder constructor without directory argument.
  • Add profiler integration: TwigComponentDataCollector and debug toolbar templates
  • Add search feature in debug:twig-component command.
  • Fix inconsistencies with how {% component %}/<twig:component> syntaxes are rendered vs component(): PostRenderEvent is now dispatched & the template resolution happens at runtime.
  • Fix priority of passed in props vs default props with anonymous components.
  • Add Symfony 7 support.
  • TwigPreLexer: improve performance.
  • Fix twig:lint bug with anonymous component tag.

LIveComponent

  • Add deferred/lazy rendering of Live Components.
  • Fix option tag synchronization.
  • Handle array-like objects when working with checkboxes.
  • Normalize "true" & "false" model values
  • Fix DTO hydration from phpdoc typehints.
  • Fix instantiating LiveComponentMetadata multiple times.
  • Throwing an error when setting an invalid model name.

StimulusBundle

  • Normalize parameters names given to twig helper 'stimulus_action()'. BC Break: previously, parameters given in camelCase (eg. bigCrocodile) were incorrectly registered by the controller as flatcase (event.params.bigcrocodile). This was fixed, which means they are now correctly registered as camelCase (event.params.bigCrocodile).
  • Added AssetMapper 6.4 support.
  • Add Symfony 7 support.
  • Fix missing double dash in namespaced Stimulus outlets.
  • Change JavaScript package to type: module

Svelte

  • Add support for Svelte 4.

New Contributors

Full Changelog: v2.12.0 -> v2.13.0

2.12.0
2023-09-22

v2.12.0 LiveComponent DTO support & much more

Hi UX People!

This release contains a basket-load of goodness.

TwigComponent

  • Added a debug:twig-component command.
  • Fixed bad exception when the error comes from a Twig template.
  • Fixed deprecation with TemplateCacheWarmer return type.

LiveComponent

  • Add support for (de)hydrating DTO classes in LiveProp.
  • Fixed emit() method of TestLiveComponent to properly test events.
  • Add actingAs() to TestLiveComponent.
  • Fixed rendering bug when using Chrome's translation feature.
  • Add onUpdated() hook for LiveProp.
  • Fix support for Alpine.js & live components.

TogglePassword

  • Added default values for the Stimulus controller values.

New Contributors

Full Changelog: v2.11.2 -> v2.12.0

Have fun!

2.11.2
2023-09-11

ux-autocomplete security release + LiveComponent bugs

Hi!

This release contains an important security release for symfony/ux-autocomplete: https://symfony.com/blog/cve-2023-41336-symfony-ux-autocomplete-prevent-injection-of-invalid-entity-ids-for-autocomplete-fields

If you are using symfony/ux-autocomplete, you should upgrade immediately:

composer update symfony/ux-autocomplete

Other changes:

LiveComponents

  • [bug] Only consider Live components in InterceptChildComponentRenderSubscriber by @sneakyvv in #1097
  • [bug] Don't store ux_live_component URLs in setTargetPath of the security component by @gbere in #1096

New Contributors

Full Changes: v2.11.1 -> v2.11.2

2.11.1
2023-09-07

v2.11.1 - Twig & Live Component bug fixes

Hi UX'ers!

A small release to address a few bug fixes:

What's Changed

  • [LiveComponent] Add priority to PreDehydrate & PostHydrate hooks by @sneakyvv in #1074
  • [LiveComponent] Use display:revert for data-loading style by @norkunas in #1079
  • [TwigComponent][LiveComponent] Fix Live embedded component within namespaced template by @sneakyvv in #1082
  • [TwigComponent][LiveComponent] Fix DataModelPropsSubscriber for embedded components by @sneakyvv in #1093

Full Changes: v2.11.0 -> v2.11.1

Have fun!

2.11.0
2023-08-28

v2.11.0: TogglePassword Component, Anonymous Twig Components + more!

Hi UX People!

This release contains a bucketload of good stuff:

New Component!

  • UX Toggle Password: add "hide/show" links to toggle the password to plain-text!

TwigComponent

  • Support ...spread operator with html syntax (requires Twig 3.7.0 or higher)
  • Add support for anonymous Twig components.
  • Add RenderedComponent::crawler() and toString() methods.
  • Allow a block outside a Twig component to be available inside via outerBlocks.
  • Fix <twig:component> syntax where an attribute is set to an empty value.

LiveComponent

  • Add helper for testing live components.
  • Add initial file upload support.
  • Respect data-turbo="false" when handling redirects.
  • Fix checksum calculation for deeply nested data.

New Contributors

Full Changes: v2.10.0 -> v2.11.0

2.10.0
2023-07-06

v2.10.0

Hi UX People!

This release contains various new features and big fixes:

BC Breaks

  • [LiveComponent] A BC break was made to ComponentWithFormTrait in #967: some methods were renamed.

Features

  • [All] bump to php >=8.1 everywhere by @bendavies in #946
  • [TwigComponent] Support passing blocks to nested embedded components by @sneakyvv in #920
  • [TwigComponent] add test helper by @kbond in #821
  • [LiveComponent] resetForm() method to get a fresh form by @weaverryan in #884
  • [LiveComponent] Method Name changes in ComponentWithFormTrait + expanded docs by @weaverryan in #967
  • [Autocomplete] When min chars is not set, keep loading after initial load by @weaverryan in #919
  • Stimulus controllers: allow to define outlets by @jmsche in #942

Bug Fixes

  • Fix Doctrine Persistence deprecation by @jmsche in #918
  • [Live] Removing docs showing the proxied component by @weaverryan in #926
  • [TwigComponent] Fix opening of default block inside an open twig block by @sneakyvv in #892
  • [TwigComponent] Ignore verbatim block during Prelexing by @WebMamba in #949
  • [TwigComponent] Fix escaping stimulus attributes by @1ed in #969
  • [LiveComponent] Working around issue where FormView is passed to the component by @weaverryan in #943
  • [Turbo] Fixing a bug where saving a proxy would not trigger Broadcasts by @weaverryan in #951
  • [Live] Fixing bug with data-action="live#update" and inside clickable elements by @weaverryan in #950
  • [Translator] generate unique constants name (fix #938) by @Kocal in #945
  • [StimulusBundle] Fix controller name conversion by @jon-ht in #953
  • [StimulusBundle] Fixing bug where new custom controllers were not seen due to cache by @weaverryan in #964

Full Changes: v2.9.1 -> v2.10.0

2.9.1
2023-05-31

Various compatibility bug fixes

Hi UX people!

This release fixes several bugs with the 2.9.0 release that caused problems when updating.

  • More precisely initializing services/config for asset mapper by @weaverryan in #911
  • [LiveComponent] Fix array valued checkboxes change event handling by @welcoMattic in #910
  • [StimulusBundle] Marking only the AssetMapper integration as experimental by @weaverryan in #908
  • [TwigComponent] Fix breaking (deprecation instead) when using .add() + StimulusBundle by @weaverryan in #914

Upgrading

Like with version 2.9.0, if you're upgrading from a 2.8 or earlier, you may get this error after running composer update:

Uncaught Exception: The service "chartjs.twig_extension" has a dependency on a non-existent service "stimulus.helper"

To fix this, run composer update one more time. The problem is, after the first update, Symfony Flex may not properly add StimulusBundle to config/bundles.php. After the 2nd update, it should be added, and the error will go away. See #907.

Diff: v2.9.0 -> v2.9.1

Cheers!

2.9.0
2023-05-29

New StimulusBundle + AssetMapper Support

Hi UX people!

This release includes significant, but lower-level changes:

A) A new StimulusBundle was added! This is the new home for the {{ stimulus_controller() }}, {{ stimulus_action() }} and {{ stimulus_target() }} Twig functions that were previously part of WebpackEncoreBundle. These functions work the same as before, though the internals of how they do their job was improved.

B) Several UX packages (e.g. ux/chartjs) that previously relied on WebpackEncoreBundle internally now rely on StimulusBundle. Though, you shouldn't notice any difference.

C) Support for Symfony 6.3's new AssetMapper component were added to all packages.

In addition to this, several bugs were fixed in TwigComponent's new HTML syntax, LiveComponent and Chart.js.

Upgrading

Due to a bug in Symfony Flex, when upgrading your dependencies, you may get an error like:

Uncaught Exception: The service "chartjs.twig_extension" has a dependency on a non-existent service "stimulus.helper"

To fix this, run composer update one more time. The problem is, after the first update, Symfony Flex may not properly add StimulusBundle to config/bundles.php. After the 2nd update, it should be added, and the error will go away. See #907.

Diff: v2.8.1 -> v2.9.0

Cheers!

2.8.1
2023-05-16

Collection of bug fixes across LiveComponents, TwigComponents, Chartjs

Hi UX people!

This release contains a number of nice bug fixes across several components:

ChartJs

  • [Bug] Adding a better way to register Chartjs plugins by @weaverryan in #870

TwigComponent

  • [Bug] Fix lexer to escape attribute name when it contains dashes by @norkunas in #837
  • [Bug] Ignore twig comments when prelexing by @WebMamba in #842
  • [Bug] fixing issue with files finishing with comments by @WebMamba in #847
  • [Bug] Fix lexer to escape truthy attribute names by @norkunas in #848
  • [Bug] Fixing bug where traditional blocks aren't handled correctly by @weaverryan in #859

LiveComponent

  • [Bug] Throw clear error when using union types for LiveProps by @sneakyvv in #856
  • [Bug] Fixing bug with ComponentWithFormTrait and empty collections by @weaverryan in #857
  • [Bug] Smarter form trait data extracting by @weaverryan in #866
  • [Bug] Upping priority on LiveComponentSubscriber by @weaverryan in #868

Diff: v2.8.0 -> v2.8.1

Happy UX'ing!

2.8.0
2023-05-03

2 new components, Twig HTML Syntax + Big Live Updates

Hi UX people!

This is a BIG release full of a new Twig component HTML syntax (<twig:Component/>), massive live components updates and various other items.

  • 2 new components: ux-translator and ux-svelte!
  • LiveComponents: new smart rendering system, better handling for LiveProp data types, emit() to other components + much more - see the full CHANGELOG
  • TwigComponents: new <twig:ComponentName/> HTML syntax and other improvements - CHANGELOG
  • Chartjs: Chart now smartly re-renders if any Stimulus values passed to it change CHANGELOG
  • Autocomplete: Added support for optiongroup & updating of the smart select when the underlying options change - CHANGELOG.

Diff: v2.7.1 -> v2.8.0

Cheers!

2.7.1
2023-01-25

Fixing missing CSS files in packages

Hi UX people!

This release fixes a problem where some packages were missing their associated CSS files, do to an overeager .gitattributes setting. That's it - nice and simple.

Diff: v2.7.0 -> v2.7.1

Cheers!