Skip to content

[LiveComponent] add LiveProp name to modifier function #2652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
09b1d86
[LiveComponent] add LiveProp name to modifier function
jannes-io Mar 23, 2025
208952b
Add Twig Extensions for page refreshes
seb-jean Mar 2, 2025
2197b93
[Map] Make renderer tests way easier to maintain, use snapshots
Kocal Mar 25, 2025
79113fe
chore: Adjust changelog for features moving to 2.24 release
zak39 Apr 1, 2025
67eb6b5
improve setup instructions
dbu Mar 29, 2025
cb989bb
[Notify] Added body, icon, tag ,renotify to controller.js for mercure…
May 17, 2024
1fc98e5
[Icons] Add xmlns attribute to svg icons
Enz000 Mar 27, 2025
adf15e7
[Turbo] Add support for authentication to the EventSource via `turbo_…
Fan2Shrek Dec 12, 2024
cb6054e
Update versions to 2.24.0
Kocal Apr 5, 2025
a25cca5
remove banner
kbond Apr 5, 2025
bda797f
[CI] Fix version bump for npm packages
Kocal Apr 5, 2025
9af4c3e
[CI] Use git diff instead of git status
smnandre Apr 9, 2025
f42d00f
Add .editorconfig, enforce LF line-ending style
Kocal Apr 11, 2025
b68a52f
[Turbo] Minor documentation syntax fixes
seb-jean Apr 11, 2025
898953e
[CI] Adjust tags to "v2.*.*" for NPM auto-releases
Kocal Apr 7, 2025
62978fa
[Icons] improve DX when `symfony/http-client` is not installed
kbond Apr 5, 2025
54da4dd
[LiveComponent] Add uid support for hydration
norkunas Mar 24, 2025
67f9389
[Map] Downgrade PHP requirement from 8.3 to 8.1
Kocal Apr 15, 2025
44dbe5c
Pass topics to mercure if not defined
Fan2Shrek Apr 14, 2025
13dfc84
[LiveComponent] `ComponentWithFormTrait` now correctly checks for a `…
stehled Mar 6, 2025
8233dae
[Autocomplete] Escape `querySelector` dynamic selector with `CSS.esca…
Bartheyrman22 Mar 3, 2025
2392dbf
[StimulusBundle] Make the JS package private
Kocal May 3, 2025
db81f8a
[Toolkit] Adds engine for parsing, downloading and manage components
Halleck45 Mar 7, 2025
03ee49c
[Toolkit] Adds first components
Halleck45 Mar 7, 2025
299ba41
[Toolkit] Updated documentation in order to preview components
Halleck45 Mar 7, 2025
0c32931
[Toolkit] Fine-tune the documentation
Kocal Mar 27, 2025
7990353
[Toolkit] Remove "Grid" component
Kocal Mar 28, 2025
fa8be73
[Toolkit] Open dependencies constraints
Kocal Mar 28, 2025
f2d56ac
[Toolkit] Fix UXToolkitBundle name, refactor DependencyInjection/* in…
Kocal Mar 28, 2025
ec4acbe
[Toolkit] Big refactoring about the registry & kits system, kits arch…
Kocal Mar 31, 2025
42940f8
[Toolkit] Rework all components for Shadcn kit, add more, remove some…
Kocal Apr 10, 2025
7525823
[Toolkit] Rework the documentation
Kocal Mar 31, 2025
284144d
[Toolkit] Remove tales-from-a-dev/twig-tailwind-extra dependency, to …
Kocal Apr 15, 2025
a5f8a57
[Toolkit] Refactor `ToolkitKit` enum to `ToolkitKitId`, leverage desc…
Kocal Apr 16, 2025
0b9bc26
[Toolkit] Add StimulusController support, extract logic to KitSynchro…
Kocal May 1, 2025
c5e763d
[Toolkit] Update version handling in dependencies to use string forma…
Kocal May 2, 2025
d648b2c
[Toolkit] Do not use FileSystem::readFile(), as it has been implement…
Kocal May 2, 2025
134e1eb
[Toolkit] Improve InstallComponentCommand by asking/guessing which Ki…
Kocal May 3, 2025
2368fef
[StimulusBundle] Make the JS package private (for real)
Kocal May 6, 2025
98dec2a
[ToolKit] Add missing Interface suffixes
smnandre May 6, 2025
a0f5379
[Toolkit] Fix deprecation Kernel > 7.3
smnandre May 6, 2025
c9e0f4f
[Toolkit] Remove redundant code in Shadcn kit components
Kocal May 5, 2025
726305e
[Site] Rename CodePreview_Tabs to Toolkit_Tabs, extract Toolkit's doc…
Kocal May 5, 2025
c987f60
[Site] Add manual installation steps for Toolkit kits's components
Kocal May 5, 2025
d2086da
[Site] Fix Terminal component styles, ensure it does not grow, and di…
Kocal May 6, 2025
ae4d71d
[Site] Refactor and use the CodeBlockRenderer::highlightCode() method…
Kocal May 6, 2025
26c44dc
[Docs] Add step to disable `package.json` synchronization while upgra…
Kocal Apr 21, 2025
8cb5384
[Toolkit] Introduce KitContextRunner, to run code in the context of a…
Kocal May 8, 2025
ae50fa4
[Toolkit] Add functional tests to render all Kit components usage cod…
Kocal May 8, 2025
d080144
[Toolkit] Remove documentation about non-existant component AlertDial…
Kocal May 8, 2025
c4dcce6
[Toolkit] Pin symfony/phpunit-bridge to ^7.2 and phpunit to ^9.6.22
Kocal May 8, 2025
087f09c
[Toolkit] Remove checks layers for tales-from-a-dev/twig-tailwind-ext…
Kocal May 8, 2025
1282995
[Toolkit] Minor adjustements on Kit creation command (reword question…
Kocal May 11, 2025
05726a6
[Toolkit] Remove Kit "authors"
Kocal May 11, 2025
7591e98
[Toolkit] Improve descriptions of Shadcn components
Kocal May 11, 2025
fc9d51e
fix: allow LiveComponentHydrator::hydrateValue() to hydrate null values
nikophil May 13, 2025
c88678c
[Toolkit] Update snapshots & fix tests, following #2728
Kocal May 13, 2025
ad75701
[TwigComponent] Fix `loadTemplate` deprecation for Twig >= 3.21
smnandre May 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
; top-most EditorConfig file
root = true

; Unix-style newlines
[*]
charset = utf-8
end_of_line = LF
insert_final_newline = true
trim_trailing_whitespace = true

[*.{php,html,twig}]
indent_style = space
indent_size = 4
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* text=auto eol=lf
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-on-npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release on NPM
on:
push:
tags:
- 'v*.*.*'
- 'v2.*.*'

jobs:
release:
Expand Down Expand Up @@ -32,7 +32,7 @@ jobs:
- run: yarn --immutable

- name: Update version of JS packages
run: yarn workspaces foreach -A version --immediate "${{ env.VERSION }}"
run: yarn workspaces foreach -pA exec "npm version ${{ env.VERSION }} --no-git-tag-version --no-workspaces-update"

- name: Commit changes
run: |
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

- name: Check if JS dist files are current
run: |
if [[ -n $(git status --porcelain) ]]; then
if ! git diff --quiet; then
echo "The Git workspace is unclean! Changes detected:"
git status --porcelain
git diff
Expand Down Expand Up @@ -84,12 +84,6 @@ jobs:
minimum-stability: 'dev'
- php-version: '8.3'
minimum-stability: 'dev'
- component: Map # does not support PHP 8.1
php-version: '8.1'
- component: Map/src/Bridge/Google # does not support PHP 8.1
php-version: '8.1'
- component: Map/src/Bridge/Leaflet # does not support PHP 8.1
php-version: '8.1'
- component: Swup # has no tests
- component: Turbo # has its own workflow (test-turbo.yml)
- component: Typed # has no tests
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/toolkit-kits-cs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Toolkit Kits

on:
push:
paths:
- 'src/Toolkit/kits/**'
pull_request:
paths:
- 'src/Toolkit/kits/**'

jobs:
kits-cs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
php-version: 8.3

- name: Install composer packages
uses: ramsey/composer-install@v3
with:
working-directory: src/Toolkit

- name: Check kits code style
run: php vendor/bin/twig-cs-fixer check kits
working-directory: src/Toolkit
4 changes: 4 additions & 0 deletions src/Autocomplete/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 2.25.0

- Escape `querySelector` dynamic selector with `CSS.escape()` #2663

## 2.23.0

- Deprecate `ExtraLazyChoiceLoader` in favor of `Symfony\Component\Form\ChoiceList\Loader\LazyChoiceLoader`
Expand Down
2 changes: 2 additions & 0 deletions src/Autocomplete/assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ composer require symfony/ux-autocomplete:2.23.0
npm add @symfony/ux-autocomplete@2.23.0
```

**Tip:** Your `package.json` file will be automatically modified by [Flex](https://github.com/symfony/flex) when installing or upgrading a PHP package. To prevent this behavior, ensure to **use at least Flex 1.22.0 or 2.5.0**, and run `composer config extra.symfony.flex.synchronize_package_json false`.

## Resources

- [Documentation](https://symfony.com/bundles/ux-autocomplete/current/index.html)
Expand Down
54 changes: 27 additions & 27 deletions src/Autocomplete/assets/dist/controller.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { Controller } from '@hotwired/stimulus';
import TomSelect from 'tom-select';

/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol */
function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol */


function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}

typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};

var _default_1_instances, _default_1_getCommonConfig, _default_1_createAutocomplete, _default_1_createAutocompleteWithHtmlContents, _default_1_createAutocompleteWithRemoteData, _default_1_stripTags, _default_1_mergeObjects, _default_1_createTomSelect;
Expand Down Expand Up @@ -270,7 +270,7 @@ _default_1_instances = new WeakSet(), _default_1_getCommonConfig = function _def
let orderedOption = null;
for (const [, tomSelectOption] of Object.entries(this.tomSelect.options)) {
if (tomSelectOption.$order === optionOrder) {
orderedOption = parentElement.querySelector(`:scope > option[value="${tomSelectOption[this.tomSelect.settings.valueField]}"]`);
orderedOption = parentElement.querySelector(`:scope > option[value="${CSS.escape(tomSelectOption[this.tomSelect.settings.valueField])}"]`);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Autocomplete/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@symfony/ux-autocomplete",
"description": "JavaScript Autocomplete functionality for Symfony",
"license": "MIT",
"version": "2.23.0",
"version": "2.24.0",
"keywords": [
"symfony-ux"
],
Expand Down
2 changes: 1 addition & 1 deletion src/Autocomplete/assets/src/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export default class extends Controller {
for (const [, tomSelectOption] of Object.entries(this.tomSelect.options)) {
if (tomSelectOption.$order === optionOrder) {
orderedOption = parentElement.querySelector(
`:scope > option[value="${tomSelectOption[this.tomSelect.settings.valueField]}"]`
`:scope > option[value="${CSS.escape(tomSelectOption[this.tomSelect.settings.valueField])}"]`
);

break;
Expand Down
2 changes: 2 additions & 0 deletions src/Chartjs/assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ composer require symfony/ux-chartjs:2.23.0
npm add @symfony/ux-chartjs@2.23.0
```

**Tip:** Your `package.json` file will be automatically modified by [Flex](https://github.com/symfony/flex) when installing or upgrading a PHP package. To prevent this behavior, ensure to **use at least Flex 1.22.0 or 2.5.0**, and run `composer config extra.symfony.flex.synchronize_package_json false`.

## Resources

- [Documentation](https://symfony.com/bundles/ux-chartjs/current/index.html)
Expand Down
2 changes: 1 addition & 1 deletion src/Chartjs/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@symfony/ux-chartjs",
"description": "Chart.js integration for Symfony",
"license": "MIT",
"version": "2.23.0",
"version": "2.24.0",
"keywords": [
"symfony-ux"
],
Expand Down
2 changes: 2 additions & 0 deletions src/Cropperjs/assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ composer require symfony/ux-cropperjs:2.23.0
npm add @symfony/ux-cropperjs@2.23.0
```

**Tip:** Your `package.json` file will be automatically modified by [Flex](https://github.com/symfony/flex) when installing or upgrading a PHP package. To prevent this behavior, ensure to **use at least Flex 1.22.0 or 2.5.0**, and run `composer config extra.symfony.flex.synchronize_package_json false`.

## Resources

- [Documentation](https://symfony.com/bundles/ux-cropperjs/current/index.html)
Expand Down
2 changes: 1 addition & 1 deletion src/Cropperjs/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@symfony/ux-cropperjs",
"description": "Cropper.js integration for Symfony",
"license": "MIT",
"version": "2.23.0",
"version": "2.24.0",
"keywords": [
"symfony-ux"
],
Expand Down
2 changes: 2 additions & 0 deletions src/Dropzone/assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ composer require symfony/ux-dropzone:2.23.0
npm add @symfony/ux-dropzone@2.23.0
```

**Tip:** Your `package.json` file will be automatically modified by [Flex](https://github.com/symfony/flex) when installing or upgrading a PHP package. To prevent this behavior, ensure to **use at least Flex 1.22.0 or 2.5.0**, and run `composer config extra.symfony.flex.synchronize_package_json false`.

## Resources

- [Documentation](https://symfony.com/bundles/ux-dropzone/current/index.html)
Expand Down
2 changes: 1 addition & 1 deletion src/Dropzone/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@symfony/ux-dropzone",
"description": "File input dropzones for Symfony Forms",
"license": "MIT",
"version": "2.23.0",
"version": "2.24.0",
"keywords": [
"symfony-ux"
],
Expand Down
10 changes: 10 additions & 0 deletions src/Icons/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# CHANGELOG

## 2.25.0

- Improve DX when `symfony/http-client` is not installed.

## 2.24.0

- Add `xmlns` attribute to icons downloaded with Iconify, to correctly render icons browser as an external file, in SVG editors, and in files explorers or text editors previews.
It **may breaks your pipeline** if you assert on `ux_icon()` or `<twig:ux:icon>` output in your tests, and forgot [to lock your icons](https://symfony.com/bundles/ux-icons/current/index.html#locking-on-demand-icons).
We recommend you to **lock** your icons **before** upgrading to UX Icons 2.24. We also suggest you to to **force-lock** your icons **after** upgrading to UX Icons 2.24, to add the attribute `xmlns` to your icons already downloaded from Iconify.

## 2.20.0

- Add `aliases` configuration option to define icon alternative names.
Expand Down
56 changes: 0 additions & 56 deletions src/Icons/config/iconify.php

This file was deleted.

39 changes: 39 additions & 0 deletions src/Icons/config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\UX\Icons\Command\ImportIconCommand;
use Symfony\UX\Icons\Command\LockIconsCommand;
use Symfony\UX\Icons\Command\SearchIconCommand;
use Symfony\UX\Icons\Command\WarmCacheCommand;
use Symfony\UX\Icons\IconCacheWarmer;
use Symfony\UX\Icons\Iconify;
use Symfony\UX\Icons\IconRenderer;
use Symfony\UX\Icons\IconRendererInterface;
use Symfony\UX\Icons\Registry\CacheIconRegistry;
use Symfony\UX\Icons\Registry\ChainIconRegistry;
use Symfony\UX\Icons\Registry\IconifyOnDemandRegistry;
use Symfony\UX\Icons\Registry\LocalSvgIconRegistry;
use Symfony\UX\Icons\Twig\IconFinder;
use Symfony\UX\Icons\Twig\UXIconExtension;
Expand Down Expand Up @@ -86,5 +91,39 @@
service('.ux_icons.cache_warmer'),
])
->tag('console.command')

->set('.ux_icons.iconify', Iconify::class)
->args([
service('.ux_icons.cache'),
abstract_arg('endpoint'),
service('http_client')->nullOnInvalid(),
])

->set('.ux_icons.iconify_on_demand_registry', IconifyOnDemandRegistry::class)
->args([
service('.ux_icons.iconify'),
])
->tag('ux_icons.registry', ['priority' => -10])

->set('.ux_icons.command.import', ImportIconCommand::class)
->args([
service('.ux_icons.iconify'),
service('.ux_icons.local_svg_icon_registry'),
])
->tag('console.command')

->set('.ux_icons.command.lock', LockIconsCommand::class)
->args([
service('.ux_icons.iconify'),
service('.ux_icons.local_svg_icon_registry'),
service('.ux_icons.icon_finder'),
])
->tag('console.command')

->set('.ux_icons.command.search', SearchIconCommand::class)
->args([
service('.ux_icons.iconify'),
])
->tag('console.command')
;
};
Loading