Releases: symfony/ux
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 withoutdirectory
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 vscomponent()
: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
- @tacman made their first contribution in #1144
- @dsoriano made their first contribution in #1145
- @gregberger made their first contribution in #1148
- @andersonamuller made their first contribution in #1154
- @JoppeDC made their first contribution in #1135
- @gharlan made their first contribution in #1175
- @jakubtobiasz made their first contribution in #1143
- @maelanleborgne made their first contribution in #1196
- @yceruto made their first contribution in #1185
- @norival made their first contribution in #1193
- @rrenteria-dev made their first contribution in #1250
- @TheDutchScorpion made their first contribution in #1251
- @bdujon made their first contribution in #1246
Full Changelog: v2.12.0...v2.13.0
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 ofTestLiveComponent
to properly test events. - Add
actingAs()
toTestLiveComponent
. - Fixed rendering bug when using Chrome's translation feature.
- Add
onUpdated()
hook forLiveProp
. - Fix support for Alpine.js & live components.
TogglePassword
- Added default values for the Stimulus controller values.
New Contributors
- @OskarStark made their first contribution in #1109
- @MirakuSan made their first contribution in #1101
- @StevenRenaux made their first contribution in #1088
- @rdavaillaud made their first contribution in #1134
Full Changelog: v2.11.2...v2.12.0
Have fun!
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
- @andersmateusz made their first contribution in #1100
- @mariecharles made their first contribution in #1058
- @gbere made their first contribution in #1096
Full Changes: v2.11.1...v2.11.2
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
fordata-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!
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()
andtoString()
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
- @youassi made their first contribution in #987
- @ngrie made their first contribution in #993
- @DennisdeBest made their first contribution in #1001
- @gpetraroli made their first contribution in #1011
- @asispts made their first contribution in #1019
- @feymo made their first contribution in #1000
- @leonardsimonse made their first contribution in #1020
- @sponno made their first contribution in #1035
- @yassinefikri made their first contribution in #1040
- @jcrombez made their first contribution in #1054
- @Jasperator made their first contribution in #1067
Full Changes: v2.10.0...v2.11.0
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
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!
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!
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 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 forLiveProp
data types,emit()
to other components + much more - see the full CHANGELOGTwigComponents
: new<twig:ComponentName/>
HTML syntax and other improvements - CHANGELOGChartjs
: Chart now smartly re-renders if any Stimulus values passed to it change CHANGELOGAutocomplete
: Added support foroptiongroup
& updating of the smart select when the underlying options change - CHANGELOG.
Diff: v2.7.1...v2.8.0
Cheers!