From dded1264a4133709c8648d8f2acae9b91c0c36b9 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Tue, 3 Feb 2026 22:43:43 +0100 Subject: [PATCH] Drop Biome.js for oxfmt and oxlint --- .doctor-rst.yaml | 40 +- .github/ISSUE_TEMPLATE/1-bug_report.md | 6 +- .github/ISSUE_TEMPLATE/2-feature_request.md | 1 - .github/ISSUE_TEMPLATE/3-documentation.md | 2 - .github/ISSUE_TEMPLATE/config.yml | 6 +- .github/PULL_REQUEST_TEMPLATE.md | 16 +- .github/generate-dist-files-size-diff.mjs | 101 ++-- .github/workflows/app-tests.yaml | 130 ++--- .github/workflows/browser-tests.yml | 18 +- .github/workflows/code-quality.yaml | 230 ++++---- .../dist-files-size-diff-comment.yaml | 42 +- .github/workflows/dist-files-size-diff.yaml | 126 ++--- .github/workflows/dist-files-unbuilt.yaml | 52 +- .github/workflows/functional-tests.yml | 46 +- .github/workflows/release-on-npm.yaml | 78 +-- .github/workflows/unit-tests.yaml | 118 ++--- .oxfmtrc.json | 22 + .oxlintrc.json | 25 + CONTRIBUTING.md | 55 +- README.md | 8 +- apps/e2e/assets/app.js | 2 +- apps/e2e/assets/bootstrap.js | 4 +- .../controllers/csrf_protection_controller.js | 22 +- apps/e2e/assets/svelte/build.mjs | 23 +- apps/e2e/assets/translator.js | 4 +- apps/e2e/assets/vue/controllers/Hello.js | 4 +- apps/e2e/compose.override.yaml | 9 +- apps/e2e/compose.yaml | 51 +- .../translations/messages+intl-icu.fr.yaml | 2 +- apps/encore/assets/app.js | 2 +- apps/encore/assets/bootstrap.js | 8 +- .../controllers/csrf_protection_controller.js | 24 +- apps/encore/assets/translator.js | 4 +- apps/encore/assets/vue/controllers/Hello.vue | 6 +- apps/encore/compose.override.yaml | 9 +- apps/encore/compose.yaml | 51 +- apps/encore/webpack.config.js | 25 +- babel.config.js | 4 +- bin/build_package.ts | 16 +- bin/get_browsers.mjs | 14 +- package.json | 9 +- playwright.config.base.ts | 13 +- pnpm-lock.yaml | 283 ++++++---- pnpm-workspace.yaml | 24 +- .../.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Autocomplete/.symfony.bundle.yaml | 6 +- src/Autocomplete/CHANGELOG.md | 131 ++--- src/Autocomplete/README.md | 8 +- src/Autocomplete/assets/README.md | 11 +- src/Autocomplete/assets/package.json | 4 +- src/Chartjs/.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Chartjs/.symfony.bundle.yaml | 6 +- src/Chartjs/CHANGELOG.md | 70 +-- src/Chartjs/README.md | 8 +- src/Chartjs/assets/README.md | 11 +- src/Chartjs/assets/package.json | 4 +- .../.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Cropperjs/.symfony.bundle.yaml | 6 +- src/Cropperjs/CHANGELOG.md | 48 +- src/Cropperjs/README.md | 8 +- src/Cropperjs/assets/README.md | 11 +- src/Cropperjs/assets/package.json | 4 +- src/Dropzone/.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Dropzone/.symfony.bundle.yaml | 6 +- src/Dropzone/CHANGELOG.md | 36 +- src/Dropzone/README.md | 8 +- src/Dropzone/assets/README.md | 11 +- src/Dropzone/assets/package.json | 4 +- src/Dropzone/assets/src/style.css | 2 +- src/Icons/.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Icons/.symfony.bundle.yaml | 6 +- src/Icons/CHANGELOG.md | 24 +- src/Icons/README.md | 8 +- .../.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/LazyImage/.symfony.bundle.yaml | 6 +- src/LazyImage/CHANGELOG.md | 48 +- src/LazyImage/README.md | 12 +- src/LazyImage/assets/README.md | 11 +- src/LazyImage/assets/package.json | 4 +- .../.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/LiveComponent/.symfony.bundle.yaml | 6 +- src/LiveComponent/CHANGELOG.md | 498 +++++++++--------- src/LiveComponent/README.md | 8 +- src/LiveComponent/assets/README.md | 11 +- .../assets/dist/live_controller.js | 2 +- src/LiveComponent/assets/package.json | 4 +- .../src/Component/plugins/LoadingPlugin.ts | 2 +- src/LiveComponent/assets/src/live.css | 6 +- src/Map/.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Map/.symfony.bundle.yaml | 6 +- src/Map/CHANGELOG.md | 87 +-- src/Map/README.md | 8 +- src/Map/assets/README.md | 8 +- .../assets/dist/abstract_map_controller.d.ts | 12 +- .../assets/dist/abstract_map_controller.js | 6 +- src/Map/assets/package.json | 4 +- src/Map/assets/src/abstract_map_controller.ts | 108 +++- src/Map/src/Bridge/Google/CHANGELOG.md | 23 +- src/Map/src/Bridge/Google/README.md | 25 +- src/Map/src/Bridge/Google/assets/README.md | 11 +- .../Google/assets/dist/map_controller.d.ts | 6 +- .../Google/assets/dist/map_controller.js | 27 +- src/Map/src/Bridge/Google/assets/package.json | 4 +- .../Google/assets/src/map_controller.ts | 40 +- src/Map/src/Bridge/Leaflet/CHANGELOG.md | 28 +- src/Map/src/Bridge/Leaflet/README.md | 35 +- src/Map/src/Bridge/Leaflet/assets/README.md | 11 +- .../Leaflet/assets/dist/map_controller.d.ts | 6 +- .../Leaflet/assets/dist/map_controller.js | 26 +- .../src/Bridge/Leaflet/assets/package.json | 4 +- .../Leaflet/assets/src/map_controller.ts | 26 +- src/Notify/.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Notify/.symfony.bundle.yaml | 6 +- src/Notify/CHANGELOG.md | 30 +- src/Notify/README.md | 8 +- src/Notify/assets/README.md | 11 +- src/Notify/assets/package.json | 4 +- src/React/.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/React/.symfony.bundle.yaml | 6 +- src/React/CHANGELOG.md | 43 +- src/React/README.md | 8 +- src/React/assets/README.md | 11 +- src/React/assets/package.json | 4 +- .../.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/StimulusBundle/.symfony.bundle.yaml | 6 +- src/StimulusBundle/CHANGELOG.md | 40 +- src/StimulusBundle/README.md | 6 +- src/StimulusBundle/assets/README.md | 8 +- src/StimulusBundle/assets/package.json | 4 +- src/Svelte/.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Svelte/.symfony.bundle.yaml | 6 +- src/Svelte/CHANGELOG.md | 20 +- src/Svelte/README.md | 8 +- src/Svelte/assets/README.md | 11 +- src/Svelte/assets/package.json | 4 +- src/Swup/.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Swup/.symfony.bundle.yaml | 6 +- src/Swup/CHANGELOG.md | 48 +- src/Swup/README.md | 8 +- src/Swup/assets/README.md | 11 +- src/Swup/assets/package.json | 4 +- .../.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/TogglePassword/.symfony.bundle.yaml | 6 +- src/TogglePassword/CHANGELOG.md | 16 +- src/TogglePassword/README.md | 24 +- src/TogglePassword/assets/README.md | 11 +- src/TogglePassword/assets/package.json | 4 +- src/Toolkit/.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Toolkit/CHANGELOG.md | 26 +- src/Toolkit/CONTRIBUTING.md | 4 + src/Toolkit/README.md | 6 +- src/Toolkit/kits/shadcn/INSTALL.md | 3 +- .../controllers/accordion_controller.js | 2 +- .../controllers/alert_dialog_controller.js | 5 +- .../assets/controllers/dialog_controller.js | 7 +- .../assets/controllers/tooltip_controller.js | 26 +- .../.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Translator/.symfony.bundle.yaml | 6 +- src/Translator/CHANGELOG.md | 44 +- src/Translator/README.md | 8 +- src/Translator/assets/README.md | 11 +- .../assets/dist/translator_controller.d.ts | 11 +- src/Translator/assets/package.json | 4 +- src/Translator/assets/src/types.d.ts | 11 +- src/Turbo/.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Turbo/.symfony.bundle.yaml | 6 +- src/Turbo/CHANGELOG.md | 82 +-- src/Turbo/CONTRIBUTING.md | 12 +- src/Turbo/README.md | 8 +- src/Turbo/assets/README.md | 11 +- src/Turbo/assets/package.json | 4 +- src/Turbo/docker-compose.yml | 25 +- src/Turbo/tests/app/assets/app.js | 6 +- .../.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/TwigComponent/.symfony.bundle.yaml | 6 +- src/TwigComponent/CHANGELOG.md | 182 +++---- src/TwigComponent/README.md | 8 +- src/Typed/.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Typed/.symfony.bundle.yaml | 6 +- src/Typed/CHANGELOG.md | 24 +- src/Typed/README.md | 8 +- src/Typed/assets/README.md | 11 +- src/Typed/assets/package.json | 4 +- src/Vue/.github/PULL_REQUEST_TEMPLATE.md | 3 +- .../.github/workflows/close-pull-request.yml | 30 +- src/Vue/.symfony.bundle.yaml | 6 +- src/Vue/CHANGELOG.md | 34 +- src/Vue/README.md | 8 +- src/Vue/assets/README.md | 11 +- src/Vue/assets/package.json | 4 +- test/playwright-helpers.ts | 6 +- vitest.config.base.mjs | 5 +- 211 files changed, 2651 insertions(+), 2347 deletions(-) create mode 100644 .oxfmtrc.json create mode 100644 .oxlintrc.json diff --git a/.doctor-rst.yaml b/.doctor-rst.yaml index b90f9eff3..1efaa7d5c 100644 --- a/.doctor-rst.yaml +++ b/.doctor-rst.yaml @@ -2,17 +2,17 @@ rules: american_english: ~ argument_variable_must_match_type: ~ avoid_repetetive_words: ~ -# be_kind_to_newcomers: ~ + # be_kind_to_newcomers: ~ blank_line_after_anchor: ~ -# blank_line_after_colon: ~ + # blank_line_after_colon: ~ blank_line_after_directive: ~ -# blank_line_after_filepath_in_code_block: ~ -# blank_line_after_filepath_in_php_code_block: ~ -# blank_line_after_filepath_in_twig_code_block: ~ -# blank_line_after_filepath_in_xml_code_block: ~ -# blank_line_after_filepath_in_yaml_code_block: ~ + # blank_line_after_filepath_in_code_block: ~ + # blank_line_after_filepath_in_php_code_block: ~ + # blank_line_after_filepath_in_twig_code_block: ~ + # blank_line_after_filepath_in_xml_code_block: ~ + # blank_line_after_filepath_in_yaml_code_block: ~ blank_line_before_directive: ~ -# composer_dev_option_at_the_end: ~ + # composer_dev_option_at_the_end: ~ composer_dev_option_not_at_the_end: ~ correct_code_block_directive_based_on_the_content: ~ deprecated_directive_major_version: @@ -27,10 +27,10 @@ rules: ensure_order_of_code_blocks_in_configuration_block: ~ extend_abstract_admin: ~ extend_abstract_controller: ~ -# extend_controller: ~ + # extend_controller: ~ extension_xlf_instead_of_xliff: ~ -# filename_uses_dashes_only: ~ -# filename_uses_underscores_only: ~ + # filename_uses_dashes_only: ~ + # filename_uses_underscores_only: ~ final_admin_classes: ~ final_admin_extension_classes: ~ forbidden_directives: @@ -38,7 +38,7 @@ rules: - '.. index::' indention: ~ kernel_instead_of_app_kernel: ~ -# line_length: ~ + # line_length: ~ lowercase_as_in_use_statements: ~ max_blank_lines: max: 2 @@ -46,7 +46,7 @@ rules: no_admin_yaml: ~ no_app_bundle: ~ no_app_console: ~ -# no_bash_prompt: ~ + # no_bash_prompt: ~ no_blank_line_after_filepath_in_code_block: ~ no_blank_line_after_filepath_in_php_code_block: ~ no_blank_line_after_filepath_in_twig_code_block: ~ @@ -56,25 +56,25 @@ rules: no_composer_phar: ~ no_composer_req: ~ no_config_yaml: ~ -# no_contraction: ~ + # no_contraction: ~ no_directive_after_shorthand: ~ no_explicit_use_of_code_block_php: ~ no_inheritdoc_in_code_examples: ~ no_merge_conflict: ~ no_namespace_after_use_statements: ~ no_php_open_tag_in_code_block_php_directive: ~ -# no_php_prefix_before_bin_console: ~ -# no_php_prefix_before_composer: ~ -# no_space_before_self_xml_closing_tag: ~ + # no_php_prefix_before_bin_console: ~ + # no_php_prefix_before_composer: ~ + # no_space_before_self_xml_closing_tag: ~ only_backslashes_in_namespace_in_php_code_block: ~ only_backslashes_in_use_statements_in_php_code_block: ~ ordered_use_statements: ~ -# php_open_tag_in_code_block_php_directive: ~ + # php_open_tag_in_code_block_php_directive: ~ php_prefix_before_bin_console: ~ replace_code_block_types: ~ replacement: ~ short_array_syntax: ~ -# space_before_self_xml_closing_tag: ~ + # space_before_self_xml_closing_tag: ~ space_between_label_and_link_in_doc: ~ space_between_label_and_link_in_ref: ~ string_replacement: ~ @@ -83,7 +83,7 @@ rules: unused_links: ~ use_deprecated_directive_instead_of_versionadded: ~ use_https_xsd_urls: ~ -# use_named_constructor_without_new_keyword_rule: ~ + # use_named_constructor_without_new_keyword_rule: ~ valid_inline_highlighted_namespaces: ~ valid_use_statements: ~ versionadded_directive_major_version: diff --git a/.github/ISSUE_TEMPLATE/1-bug_report.md b/.github/ISSUE_TEMPLATE/1-bug_report.md index 36713b354..018a6ffa3 100644 --- a/.github/ISSUE_TEMPLATE/1-bug_report.md +++ b/.github/ISSUE_TEMPLATE/1-bug_report.md @@ -4,7 +4,6 @@ about: Report a bug in existing features title: '' labels: ['Bug'] assignees: '' - --- - - - diff --git a/.github/ISSUE_TEMPLATE/2-feature_request.md b/.github/ISSUE_TEMPLATE/2-feature_request.md index ca32d4ee6..289e1b099 100644 --- a/.github/ISSUE_TEMPLATE/2-feature_request.md +++ b/.github/ISSUE_TEMPLATE/2-feature_request.md @@ -4,5 +4,4 @@ about: Suggest ideas for new features or enhancements title: '' labels: ['RFC'] assignees: '' - --- diff --git a/.github/ISSUE_TEMPLATE/3-documentation.md b/.github/ISSUE_TEMPLATE/3-documentation.md index 712f63603..2ebf327d1 100644 --- a/.github/ISSUE_TEMPLATE/3-documentation.md +++ b/.github/ISSUE_TEMPLATE/3-documentation.md @@ -4,6 +4,4 @@ about: Help us improve the documentation! title: '' labels: 'docs' assignees: '' - --- - diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 664ba6626..c66dd9fca 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: true contact_links: - - name: 🛟 Support / help - url: https://ux.symfony.com/support - about: Ask your questions about Symfony UX + - name: 🛟 Support / help + url: https://ux.symfony.com/support + about: Ask your questions about Symfony UX diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index de37b03b3..4c11e56da 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,11 +1,11 @@ -| Q | A -| -------------- | --- -| Bug fix? | yes/no -| New feature? | yes/no -| Deprecations? | yes/no -| Documentation? | yes/no -| Issues | Fix #... -| License | MIT +| Q | A | +| -------------- | ------------------------------------------------------------------------------------------------------------------------ | +| Bug fix? | yes/no | +| New feature? | yes/no | +| Deprecations? | yes/no | +| Documentation? | yes/no | +| Issues | Fix #... | +| License | MIT | @@ -46,7 +47,8 @@ $this->assertComponentNotDispatchBrowserEvent($render, 'another-browser:event'); ## 2.27.0 -- Add events assertions in `InteractsWithLiveComponents`: +- Add events assertions in `InteractsWithLiveComponents`: + ```php $testComponent = $this->createLiveComponent(name: 'MyComponent'); @@ -65,51 +67,51 @@ $this->assertComponentNotEmitEvent($render, 'another-event'); ## 2.26.0 -- `LiveProp`: Pass the property name as second parameter of the `modifier` callable -- Add compatibility layer to fix deprecation with `Symfony\Component\PropertyInfo\PropertyInfoExtractor::getTypes()`. - If you use PHP 8.2 or higher, we recommend you to update dependency `symfony/property-info` to at least 7.1.0 +- `LiveProp`: Pass the property name as second parameter of the `modifier` callable +- Add compatibility layer to fix deprecation with `Symfony\Component\PropertyInfo\PropertyInfoExtractor::getTypes()`. + If you use PHP 8.2 or higher, we recommend you to update dependency `symfony/property-info` to at least 7.1.0 ## 2.25.0 -- Add support for [Symfony UID](https://symfony.com/doc/current/components/uid.html) hydration/dehydration -- `ComponentWithFormTrait` now correctly checks for a `TranslatableInterface` placeholder for `` elements +- Fix `LiveComponentHydrator::hydrateValue()` to hydrate null values ## 2.23.0 -- Allow configuring the secret used to compute fingerprints and checksums. -- Prevent `__component` property to be serialized when called `JSON.stringify()` +- Allow configuring the secret used to compute fingerprints and checksums. +- Prevent `__component` property to be serialized when called `JSON.stringify()` ## 2.22.0 -- Remove CSRF tokens - rely on same-origin/CORS instead +- Remove CSRF tokens - rely on same-origin/CORS instead ## 2.19.0 -- Add `submitForm()` to `TestLiveComponent`. -- Add `live_action` Twig function +- Add `submitForm()` to `TestLiveComponent`. +- Add `live_action` Twig function ## 2.18.0 -- Add parameter to `TestLiveComponent::call()` to add files to the request +- Add parameter to `TestLiveComponent::call()` to add files to the request ## 2.17.0 -- Add `modifier` option in `LiveProp` so options can be modified at runtime. -- Fix collections hydration with serializer in LiveComponents -- Add `loading` attribute to defer the rendering on the component after the - page is rendered, either when the page loads (`loading="defer"`) or when - the component becomes visible in the viewport (`loading="lazy"`). -- Deprecate the `defer` attribute. -- Add `UrlMapping` configuration object for URL bindings in LiveComponents +- Add `modifier` option in `LiveProp` so options can be modified at runtime. +- Fix collections hydration with serializer in LiveComponents +- Add `loading` attribute to defer the rendering on the component after the + page is rendered, either when the page loads (`loading="defer"`) or when + the component becomes visible in the viewport (`loading="lazy"`). +- Deprecate the `defer` attribute. +- Add `UrlMapping` configuration object for URL bindings in LiveComponents ## 2.16.0 -- 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 +- 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: @@ -145,100 +147,100 @@ $this->assertComponentNotEmitEvent($render, 'another-event'); >Save ``` -- [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 +- [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 +- 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 ## 2.15.0 -- [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 +- [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 ## 2.14.1 -- Fixed a regression in the testing tools related to the default HTTP - method change +- Fixed a regression in the testing tools related to the default HTTP + method change ## 2.14.0 -- [BC BREAK] DOM morphing changed from `morphdom` to `idiomorph`. As this is - a different morphing library, there may be some edge cases where the - morphing behavior is different. -- Add support for URL binding in `LiveProp` -- 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 `` 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 +- [BC BREAK] DOM morphing changed from `morphdom` to `idiomorph`. As this is + a different morphing library, there may be some edge cases where the + morphing behavior is different. +- Add support for URL binding in `LiveProp` +- 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 `` 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 ## 2.13.2 -- Revert "Change JavaScript package to `type: module`" +- Revert "Change JavaScript package to `type: module`" ## 2.13.0 -- Add deferred/lazy rendering of Live Components. -- Fix option tag synchronization. -- Handle array-like objects when working with checkboxes. -- Add Symfony 7 support. -- Normalize "true" & "false" model values -- Fix DTO hydration from phpdoc typehints. -- Fix instantiating LiveComponentMetadata multiple times. -- Change JavaScript package to `type: module`. -- Throwing an error when setting an invalid model name. +- Add deferred/lazy rendering of Live Components. +- Fix option tag synchronization. +- Handle array-like objects when working with checkboxes. +- Add Symfony 7 support. +- Normalize "true" & "false" model values +- Fix DTO hydration from phpdoc typehints. +- Fix instantiating LiveComponentMetadata multiple times. +- Change JavaScript package to `type: module`. +- Throwing an error when setting an invalid model name. ## 2.12.0 -- Add support for (de)hydrating DTO classes in `LiveProp`. -- Fixed `emit()` method of `TestLiveComponent` to properly test events. -- Add `actionAs()` to `TestLiveComponent`. -- Fixed rendering bug when using Chrome's translation feature. -- Add `onUpdated()` hook for `LiveProp`. -- Fix support for Alpine.js & live components. +- Add support for (de)hydrating DTO classes in `LiveProp`. +- Fixed `emit()` method of `TestLiveComponent` to properly test events. +- Add `actionAs()` to `TestLiveComponent`. +- Fixed rendering bug when using Chrome's translation feature. +- Add `onUpdated()` hook for `LiveProp`. +- Fix support for Alpine.js & live components. ## 2.11.0 -- 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. +- 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. ## 2.9.0 -- Add support for symfony/asset-mapper +- Add support for symfony/asset-mapper ## 2.8.1 -- Increased the priority of `LiveComponentSubscriber` `ControllerEvent` from - 0 to 10 to fix incompatibility with SensioFrameworkExtraBundle. +- Increased the priority of `LiveComponentSubscriber` `ControllerEvent` from + 0 to 10 to fix incompatibility with SensioFrameworkExtraBundle. ## 2.8.0 -- [BC BREAK]: The `exposed` option was changed to `writable` in `LiveProp`: +- [BC BREAK]: The `exposed` option was changed to `writable` in `LiveProp`: ```diff -#[LiveProp(exposed: ['email', 'plainPassword'])] @@ -246,83 +248,83 @@ $this->assertComponentNotEmitEvent($render, 'another-event'); public User $user; ``` -- [BC BREAK]: `LiveProp` values are no longer automatically (de)hydrated - through Symfony's serializer. Use `LiveProp(useSerializerForHydration: true)` - to activate this. Also, a `serializationContext` option was added to - `LiveProp`. +- [BC BREAK]: `LiveProp` values are no longer automatically (de)hydrated + through Symfony's serializer. Use `LiveProp(useSerializerForHydration: true)` + to activate this. Also, a `serializationContext` option was added to + `LiveProp`. -- [BC BREAK]: Child components are no longer automatically re-rendered when - a parent component re-renders and the value of one of the props passed to - the child has changed. Pass `acceptUpdatesFromParent: true` to any `LiveProp` - on the child component to re-enable this behavior. +- [BC BREAK]: Child components are no longer automatically re-rendered when + a parent component re-renders and the value of one of the props passed to + the child has changed. Pass `acceptUpdatesFromParent: true` to any `LiveProp` + on the child component to re-enable this behavior. -- Non-persisted entity objects can now be used with `LiveProp`: it will be - serialized using the serializer. +- Non-persisted entity objects can now be used with `LiveProp`: it will be + serialized using the serializer. -- Better support for using arrays with `LiveProp`. +- Better support for using arrays with `LiveProp`. -- Smart rendering system! If you have JavaScript that makes changes to - the DOM inside a live component, those changes will now be _kept_ when - the component is re-rendered. This has limitations - see the documentation. +- Smart rendering system! If you have JavaScript that makes changes to + the DOM inside a live component, those changes will now be _kept_ when + the component is re-rendered. This has limitations - see the documentation. -- You can now `emit()` events to communicate between components. +- You can now `emit()` events to communicate between components. -- You can now dispatch DOM/browser events from components. +- You can now dispatch DOM/browser events from components. -- Boolean checkboxes are now supported. Of a checkbox does **not** have a - `value` attribute, then the associated `LiveProp` will be set to a boolean - when the input is checked/unchecked. +- Boolean checkboxes are now supported. Of a checkbox does **not** have a + `value` attribute, then the associated `LiveProp` will be set to a boolean + when the input is checked/unchecked. -- A `format` option was added to `LiveProp` to control how `DateTime` - properties are (de)hydrated. +- A `format` option was added to `LiveProp` to control how `DateTime` + properties are (de)hydrated. -- Added support for setting `writable` to a property that is an object - (previously, only scalar values were supported). The object is passed - through the serializer. +- Added support for setting `writable` to a property that is an object + (previously, only scalar values were supported). The object is passed + through the serializer. -- Invalid data sent by the user is now handled in a robust way. Previously, - if the user sent invalid data (e.g. a string for a `LiveProp` that has - an `int` type), the component update would break. Now, if the new data - cannot be hydrated onto the object during a re-render, the last valid - value is used. +- Invalid data sent by the user is now handled in a robust way. Previously, + if the user sent invalid data (e.g. a string for a `LiveProp` that has + an `int` type), the component update would break. Now, if the new data + cannot be hydrated onto the object during a re-render, the last valid + value is used. -- When using `ValidatableComponentTrait`, a new `_errors` variable is sent - to the template, which is easier to use! +- When using `ValidatableComponentTrait`, a new `_errors` variable is sent + to the template, which is easier to use! -- Several bug fixes to parent - child components - see #700. +- Several bug fixes to parent - child components - see #700. -- Fixed handling of boolean attributes to a component - see #710. +- Fixed handling of boolean attributes to a component - see #710. -- Fixed performance calculating component fingerprint for large components. +- Fixed performance calculating component fingerprint for large components. ## 2.7.0 -- [BC BREAK]: The "key" used to load the controller in your `assets/controllers.json` - file changed from `typed` to `live`. Update your `assets/controllers.json` - file to change this key. +- [BC BREAK]: The "key" used to load the controller in your `assets/controllers.json` + file changed from `typed` to `live`. Update your `assets/controllers.json` + file to change this key. -- Add a strategy for adding a Stimulus controller to a Twig component - #589. +- Add a strategy for adding a Stimulus controller to a Twig component - #589. -- Added a new `getCompontent()` function in JavaScript as the best way to find - a Component object for a given element. +- Added a new `getCompontent()` function in JavaScript as the best way to find + a Component object for a given element. -- Fixed various bugs related to child component handling - #596 +- Fixed various bugs related to child component handling - #596 -- Added a new `route` parameter to `AsLiveComponent`, which allows to choose - another route for Ajax calls. +- Added a new `route` parameter to `AsLiveComponent`, which allows to choose + another route for Ajax calls. -- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from - installing. +- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from + installing. -- TypeScript types are now included. +- TypeScript types are now included. -- Added new `response:error` JavaScript component hook for custom handling Ajax errors - #587. +- Added new `response:error` JavaScript component hook for custom handling Ajax errors - #587. ## 2.6.0 -- [BC BREAK]: The path to `live_component.xml` changed _and_ the import now - MUST have a `prefix`: you should update your route import accordingly (the - name of the route also changed to `ux_live_component`): +- [BC BREAK]: The path to `live_component.xml` changed _and_ the import now + MUST have a `prefix`: you should update your route import accordingly (the + name of the route also changed to `ux_live_component`): ```diff # config/routes/ux_live_component.yaml @@ -332,21 +334,21 @@ live_component: + prefix: /_components ``` -- Removed `Content-Type` header when returning the empty response redirect. -- Fixed bug when re-rendering SVG's (.#557) +- Removed `Content-Type` header when returning the empty response redirect. +- Fixed bug when re-rendering SVG's (.#557) ## 2.5.0 -- [BEHAVIOR CHANGE] Previously, Ajax calls could happen in parallel (if - you changed a model then triggered an action before the model update Ajax - call finished, the action Ajax call would being in parallel). Now, if - an Ajax call is currently happening, any future requests will wait until - it finishes. Then, all queued changes (potentially multiple model updates - or actions) will be sent all at once on the next request. +- [BEHAVIOR CHANGE] Previously, Ajax calls could happen in parallel (if + you changed a model then triggered an action before the model update Ajax + call finished, the action Ajax call would being in parallel). Now, if + an Ajax call is currently happening, any future requests will wait until + it finishes. Then, all queued changes (potentially multiple model updates + or actions) will be sent all at once on the next request. -- [BEHAVIOR CHANGE] Fields with `data-model` will now have their `value` set - automatically when the component initially loads and re-renders. For example, - previously you needed to manually set the value in your component template: +- [BEHAVIOR CHANGE] Fields with `data-model` will now have their `value` set + automatically when the component initially loads and re-renders. For example, + previously you needed to manually set the value in your component template: ```twig @@ -361,63 +363,63 @@ live_component: ``` -- [BEHAVIOR CHANGE] The way that child components re-render when a parent re-renders - has changed, but shouldn't be drastically different. Child components will now - avoid re-rendering if no "input" to the component changed _and_ will maintain - any writable `LiveProp` values after the re-render. Also, the re-render happens - in a separate Ajax call after the parent has finished re-rendering. +- [BEHAVIOR CHANGE] The way that child components re-render when a parent re-renders + has changed, but shouldn't be drastically different. Child components will now + avoid re-rendering if no "input" to the component changed _and_ will maintain + any writable `LiveProp` values after the re-render. Also, the re-render happens + in a separate Ajax call after the parent has finished re-rendering. -- [BEHAVIOR CHANGE] If a model is updated, but the new value is equal to the old - one, a re-render will now be avoided. +- [BEHAVIOR CHANGE] If a model is updated, but the new value is equal to the old + one, a re-render will now be avoided. -- [BEHAVIOR CHANGE] Priority of `DoctrineObjectNormalizer` changed from 100 to -100 - so that any custom normalizers are used before trying `DoctrineObjectNormalizer`. +- [BEHAVIOR CHANGE] Priority of `DoctrineObjectNormalizer` changed from 100 to -100 + so that any custom normalizers are used before trying `DoctrineObjectNormalizer`. -- [BC BREAK] The `live:update-model` and `live:render` events are not longer - dispatched. You can now use the "hook" system directly on the `Component` object/ +- [BC BREAK] The `live:update-model` and `live:render` events are not longer + dispatched. You can now use the "hook" system directly on the `Component` object/ -- [BC BREAK] The `LiveComponentHydrator::dehydrate()` method now returns a - `DehydratedComponent` object. +- [BC BREAK] The `LiveComponentHydrator::dehydrate()` method now returns a + `DehydratedComponent` object. -- Added a new JavaScript `Component` object, which is attached to the `__component` - property of all root component elements. +- Added a new JavaScript `Component` object, which is attached to the `__component` + property of all root component elements. -- the ability to add `data-loading` behavior, which is only activated - when a specific **action** is triggered - e.g. `Loading`. +- the ability to add `data-loading` behavior, which is only activated + when a specific **action** is triggered - e.g. `Loading`. -- Added the ability to add `data-loading` behavior, which is only activated - when a specific **model** has been updated - e.g. `Loading`. +- Added the ability to add `data-loading` behavior, which is only activated + when a specific **model** has been updated - e.g. `Loading`. -- Unexpected Ajax errors are now displayed in a modal to ease debugging! #467. +- Unexpected Ajax errors are now displayed in a modal to ease debugging! #467. -- Fixed bug where sometimes a live component was broken after hitting "Back: - in your browser - #436. +- Fixed bug where sometimes a live component was broken after hitting "Back: + in your browser - #436. ## 2.4.0 -- [BC BREAK] Previously, the `id` attribute was used with `morphdom` as the - "node id" when updating the DOM after a render. This has changed to - `data-live-id`. This is useful when maintaining the correct order of a list - of elements. +- [BC BREAK] Previously, the `id` attribute was used with `morphdom` as the + "node id" when updating the DOM after a render. This has changed to + `data-live-id`. This is useful when maintaining the correct order of a list + of elements. -- [BC BREAK] If using `LiveCollectionType`, the name of the remove field changed - from `button_delete_prototype` to `button_delete` and the add field changed - from `button_add_prototype` to `button_add`. Additionally, the `allow_add` - and `allow_delete` default values were changed from `false` to `true`. +- [BC BREAK] If using `LiveCollectionType`, the name of the remove field changed + from `button_delete_prototype` to `button_delete` and the add field changed + from `button_add_prototype` to `button_add`. Additionally, the `allow_add` + and `allow_delete` default values were changed from `false` to `true`. -- [BEHAVIOR CHANGE] If an action Ajax call is still processing and a - model update occurs, the component will _no_ longer re-render. The - model will be updated internally, but not re-rendered (so, any - model updates would effectively have the `|norender` modifier). See #419. +- [BEHAVIOR CHANGE] If an action Ajax call is still processing and a + model update occurs, the component will _no_ longer re-render. The + model will be updated internally, but not re-rendered (so, any + model updates would effectively have the `|norender` modifier). See #419. ## 2.3.0 -- [BC BREAK] The `data-action="live#update"` attribute must now be - removed from **nearly** all elements. This is because LiveComponents - now automatically listens to the `input` event on all elements - with a `data-model` attribute and updates the data. If you previously - used `data-action="change->live#update"` to list on the `change` - event, now you should use the `on(change)` modifier inside `data-model`. +- [BC BREAK] The `data-action="live#update"` attribute must now be + removed from **nearly** all elements. This is because LiveComponents + now automatically listens to the `input` event on all elements + with a `data-model` attribute and updates the data. If you previously + used `data-action="change->live#update"` to list on the `change` + event, now you should use the `on(change)` modifier inside `data-model`. ```twig @@ -432,9 +434,9 @@ live_component: > ``` -- [BC BREAK] The `live#updateDefer` action was removed entirely. - Now, to update a model without triggering a re-render, use the - `norender` modifier for `data-model`: +- [BC BREAK] The `live#updateDefer` action was removed entirely. + Now, to update a model without triggering a re-render, use the + `norender` modifier for `data-model`: ```twig @@ -449,13 +451,13 @@ live_component: > ``` -- [BC BREAK] The `name` attribute is no longer automatically used to - update a model when a parent component has `data-action="change->live#update"`. - To make a form's fields behave like "model" fields (but using the - `name` attribute instead of `data-model`) you need to add a `data-model` - attribute to the `
` element around your fields (NOTE: the - new attribute is automatically added to your `form` element when - using `ComponentWithFormTrait`): +- [BC BREAK] The `name` attribute is no longer automatically used to + update a model when a parent component has `data-action="change->live#update"`. + To make a form's fields behave like "model" fields (but using the + `name` attribute instead of `data-model`) you need to add a `data-model` + attribute to the `` element around your fields (NOTE: the + new attribute is automatically added to your `form` element when + using `ComponentWithFormTrait`): ```twig @@ -475,72 +477,72 @@ live_component: ## 2.2.0 -- The bundle now properly exposes a `live` controller, which can be - imported via your `assets/controllers.json` file (like any other - UX package). Previously, the controller needed to be imported and - registered with Stimulus directly (usually in your `assets/bootstrap.js` - file). That is no longer needed. +- The bundle now properly exposes a `live` controller, which can be + imported via your `assets/controllers.json` file (like any other + UX package). Previously, the controller needed to be imported and + registered with Stimulus directly (usually in your `assets/bootstrap.js` + file). That is no longer needed. -- Add a generic `LiveCollectionType` and `LiveCollectionTrait` -- Allow to disable CSRF per component +- Add a generic `LiveCollectionType` and `LiveCollectionTrait` +- Allow to disable CSRF per component ## 2.1.0 -- Your component's live "data" is now send over Ajax as a JSON string. - Previously data was sent as pure query parameters or as pure POST data. - However, this made it impossible to keep certain data types, like - distinguishing between `null` and `''`. This has no impact on end-users. +- Your component's live "data" is now send over Ajax as a JSON string. + Previously data was sent as pure query parameters or as pure POST data. + However, this made it impossible to keep certain data types, like + distinguishing between `null` and `''`. This has no impact on end-users. -- Added `data-live-ignore` attribute. If included in an element, that element - will not be updated on re-render. +- Added `data-live-ignore` attribute. If included in an element, that element + will not be updated on re-render. -- `ComponentWithFormTrait` no longer has a `setForm()` method. But there - is also no need to call it anymore. To pass an already-built form to - your component, pass it as a `form` var to `component()`. If you have - a custom `mount()`, you no longer need to call `setForm()` or anything else. +- `ComponentWithFormTrait` no longer has a `setForm()` method. But there + is also no need to call it anymore. To pass an already-built form to + your component, pass it as a `form` var to `component()`. If you have + a custom `mount()`, you no longer need to call `setForm()` or anything else. -- The Live Component AJAX endpoints now return HTML in all situations - instead of JSON. +- The Live Component AJAX endpoints now return HTML in all situations + instead of JSON. -- Ability to send live action arguments to backend +- Ability to send live action arguments to backend -- [BC BREAK] Remove `init_live_component()` twig function, use `{{ attributes }}` instead: +- [BC BREAK] Remove `init_live_component()` twig function, use `{{ attributes }}` instead: ```diff -
+
``` -- [BC BREAK] Replace property hydration system with `symfony/serializer` normalizers. This - is a BC break if you've created custom hydrators. They'll need to be converted to - normalizers. +- [BC BREAK] Replace property hydration system with `symfony/serializer` normalizers. This + is a BC break if you've created custom hydrators. They'll need to be converted to + normalizers. -- [BC BREAK] Rename `BeforeReRender` attribute to `PreReRender`. +- [BC BREAK] Rename `BeforeReRender` attribute to `PreReRender`. ## 2.0.0 -- Support for `stimulus` version 2 was removed and support for `@hotwired/stimulus` - version 3 was added. See the [@symfony/stimulus-bridge CHANGELOG](https://github.com/symfony/stimulus-bridge/blob/main/CHANGELOG.md#300) - for more details. +- Support for `stimulus` version 2 was removed and support for `@hotwired/stimulus` + version 3 was added. See the [@symfony/stimulus-bridge CHANGELOG](https://github.com/symfony/stimulus-bridge/blob/main/CHANGELOG.md#300) + for more details. -- Require live components have a default action (`__invoke()` by default) to enable - controller annotations/attributes (ie `@Security/@Cache`). Added `DefaultActionTrait` - helper. +- Require live components have a default action (`__invoke()` by default) to enable + controller annotations/attributes (ie `@Security/@Cache`). Added `DefaultActionTrait` + helper. -- When a model is updated, a new `live:update-model` event is dispatched. Parent - components (in a parent-child component setup) listen to this and automatically - try to update any model with a matching name. A `data-model-map` was also added - to map child component model names to a parent - see #113. +- When a model is updated, a new `live:update-model` event is dispatched. Parent + components (in a parent-child component setup) listen to this and automatically + try to update any model with a matching name. A `data-model-map` was also added + to map child component model names to a parent - see #113. -- Child components are now re-rendered if the parent components passes new data - to the child when rendering - see #113. +- Child components are now re-rendered if the parent components passes new data + to the child when rendering - see #113. -- Minimum PHP version was bumped to 8.0 so that PHP 8 attributes could be used. +- Minimum PHP version was bumped to 8.0 so that PHP 8 attributes could be used. -- The `LiveComponentInterface` was dropped and replaced by the `AsLiveComponent` attribute, - which extends the new `AsTwigComponent` from the TwigComponent library. All - other annotations (e.g. `@LiveProp` and `@LiveAction`) were also replaced by - PHP 8 attributes. +- The `LiveComponentInterface` was dropped and replaced by the `AsLiveComponent` attribute, + which extends the new `AsTwigComponent` from the TwigComponent library. All + other annotations (e.g. `@LiveProp` and `@LiveAction`) were also replaced by + PHP 8 attributes. Before: @@ -618,4 +620,4 @@ final class NotificationComponent ## Pre-Release -- The LiveComponent library was introduced! +- The LiveComponent library was introduced! diff --git a/src/LiveComponent/README.md b/src/LiveComponent/README.md index 06c7d1001..358f2d6c4 100644 --- a/src/LiveComponent/README.md +++ b/src/LiveComponent/README.md @@ -25,10 +25,10 @@ Help Symfony by [sponsoring][3] its development! ## Resources -- [Documentation](https://symfony.com/bundles/ux-live-component/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-live-component/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) [1]: https://symfony.com/backers [2]: https://mercure.rocks diff --git a/src/LiveComponent/assets/README.md b/src/LiveComponent/assets/README.md index 179cc831d..0059299f9 100644 --- a/src/LiveComponent/assets/README.md +++ b/src/LiveComponent/assets/README.md @@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-live-component](https://packagist.org/packa This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-live-component](https://packagist.org/packages/symfony/ux-live-component) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. +We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-live-component](https://packagist.org/packages/symfony/ux-live-component) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-live-component](https://packagist.org/packages/symfony/ux-live-component) PHP package version: + ```shell composer require symfony/ux-live-component:2.23.0 npm add @symfony/ux-live-component@2.23.0 @@ -18,7 +19,7 @@ npm add @symfony/ux-live-component@2.23.0 ## Resources -- [Documentation](https://symfony.com/bundles/ux-live-component/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-live-component/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/LiveComponent/assets/dist/live_controller.js b/src/LiveComponent/assets/dist/live_controller.js index a4d4ba7b2..a17fb3ea8 100644 --- a/src/LiveComponent/assets/dist/live_controller.js +++ b/src/LiveComponent/assets/dist/live_controller.js @@ -2503,7 +2503,7 @@ var LoadingPlugin_default = class { } getLoadingDirectives(component, element) { const loadingDirectives = []; - let matchingElements = [...Array.from(element.querySelectorAll("[data-loading]"))]; + let matchingElements = Array.from(element.querySelectorAll("[data-loading]")); matchingElements = matchingElements.filter((elt) => elementBelongsToThisComponent(elt, component)); if (element.hasAttribute("data-loading")) { matchingElements = [element, ...matchingElements]; diff --git a/src/LiveComponent/assets/package.json b/src/LiveComponent/assets/package.json index 0fae34510..3a3b9a9f9 100644 --- a/src/LiveComponent/assets/package.json +++ b/src/LiveComponent/assets/package.json @@ -25,9 +25,7 @@ "test": "pnpm run test:unit && pnpm run test:browser", "test:unit": "../../../bin/unit_test_package.sh .", "test:browser": "playwright test", - "test:browser:ui": "playwright test --ui", - "check": "biome check", - "ci": "biome ci" + "test:browser:ui": "playwright test --ui" }, "symfony": { "controllers": { diff --git a/src/LiveComponent/assets/src/Component/plugins/LoadingPlugin.ts b/src/LiveComponent/assets/src/Component/plugins/LoadingPlugin.ts index de52293dc..29d26fef0 100644 --- a/src/LiveComponent/assets/src/Component/plugins/LoadingPlugin.ts +++ b/src/LiveComponent/assets/src/Component/plugins/LoadingPlugin.ts @@ -173,7 +173,7 @@ export default class implements PluginInterface { getLoadingDirectives(component: Component, element: HTMLElement | SVGElement) { const loadingDirectives: ElementLoadingDirectives[] = []; - let matchingElements = [...Array.from(element.querySelectorAll('[data-loading]'))]; + let matchingElements = Array.from(element.querySelectorAll('[data-loading]')); // ignore elements which are inside a nested "live" component matchingElements = matchingElements.filter((elt) => elementBelongsToThisComponent(elt, component)); diff --git a/src/LiveComponent/assets/src/live.css b/src/LiveComponent/assets/src/live.css index 015d5552f..68579f276 100644 --- a/src/LiveComponent/assets/src/live.css +++ b/src/LiveComponent/assets/src/live.css @@ -1,5 +1,5 @@ -[data-loading=""], -[data-loading="show"], -[data-loading*="|show"] { +[data-loading=''], +[data-loading='show'], +[data-loading*='|show'] { display: none; } diff --git a/src/Map/.github/PULL_REQUEST_TEMPLATE.md b/src/Map/.github/PULL_REQUEST_TEMPLATE.md index df3b474b4..887284ece 100644 --- a/src/Map/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/Map/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/src/Map/.github/workflows/close-pull-request.yml b/src/Map/.github/workflows/close-pull-request.yml index 57e4e3fb0..8150a6a6a 100644 --- a/src/Map/.github/workflows/close-pull-request.yml +++ b/src/Map/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/src/Map/.symfony.bundle.yaml b/src/Map/.symfony.bundle.yaml index 6d9a74acb..5662042f8 100644 --- a/src/Map/.symfony.bundle.yaml +++ b/src/Map/.symfony.bundle.yaml @@ -1,3 +1,3 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" +branches: ['2.x'] +maintained_branches: ['2.x'] +doc_dir: 'doc' diff --git a/src/Map/CHANGELOG.md b/src/Map/CHANGELOG.md index a6a0ee616..73a748f51 100644 --- a/src/Map/CHANGELOG.md +++ b/src/Map/CHANGELOG.md @@ -2,33 +2,34 @@ ## 2.32 -- Add `Map::removeAllMarkers()`, `Map::removeAllPolygons()`, `Map::removeAllPolylines()`, `Map::removeAllCircles()` and `Map::removeAllRectangles()` methods +- Add `Map::removeAllMarkers()`, `Map::removeAllPolygons()`, `Map::removeAllPolylines()`, `Map::removeAllCircles()` and `Map::removeAllRectangles()` methods ## 2.31 -- Add `fitBoundsToMarkers` parameter to `ux_map()` Twig function +- Add `fitBoundsToMarkers` parameter to `ux_map()` Twig function ## 2.30 -- Ensure compatibility with PHP 8.5 -- Deprecate option `title` from `Polygon`, `Polyline`, `Rectangle` and `Circle` in favor of `infoWindow` +- Ensure compatibility with PHP 8.5 +- Deprecate option `title` from `Polygon`, `Polyline`, `Rectangle` and `Circle` in favor of `infoWindow` ## 2.29.0 -- Add Symfony 8 support -- Add `Cluster` class and `ClusteringAlgorithmInterface` with two implementations `GridClusteringAlgorithm` and `MortonClusteringAlgorithm` +- Add Symfony 8 support +- Add `Cluster` class and `ClusteringAlgorithmInterface` with two implementations `GridClusteringAlgorithm` and `MortonClusteringAlgorithm` ## 2.28 -- Add `minZoom` and `maxZoom` options to `Map` to set the minimum and maximum zoom levels +- Add `minZoom` and `maxZoom` options to `Map` to set the minimum and maximum zoom levels ## 2.27 -- The `fitBoundsToMarkers` option is not overridden anymore when using the `Map` LiveComponent, but now respects the value you defined. - You may encounter unwanted behavior when adding/removing elements to the map. - To use the previous behavior, you must call `$this->getMap()->fitBoundsToMarkers(false)` in your LiveComponent's live actions +- The `fitBoundsToMarkers` option is not overridden anymore when using the `Map` LiveComponent, but now respects the value you defined. + You may encounter unwanted behavior when adding/removing elements to the map. + To use the previous behavior, you must call `$this->getMap()->fitBoundsToMarkers(false)` in your LiveComponent's live actions + +- Add support for creating `Circle` by passing a `Point` and a radius (in meters) to the `Circle` constructor, e.g.: -- Add support for creating `Circle` by passing a `Point` and a radius (in meters) to the `Circle` constructor, e.g.: ```php $map->addCircle(new Circle( center: new Point(48.856613, 2.352222), // Paris @@ -36,7 +37,8 @@ $map->addCircle(new Circle( )); ``` -- Add support for creating `Rectangle` by passing two `Point` instances to the `Rectangle` constructor, e.g.: +- Add support for creating `Rectangle` by passing two `Point` instances to the `Rectangle` constructor, e.g.: + ```php $map->addRectangle(new Rectangle( southWest: new Point(48.856613, 2.352222), // Paris @@ -44,8 +46,9 @@ $map->addRectangle(new Rectangle( )); ``` -- Deprecate property `rawOptions` from `ux:map:*:before-create` events, in favor of `bridgeOptions` instead. -- Map options can now be configured and overridden through the `ux:map:pre-connect` event: +- Deprecate property `rawOptions` from `ux:map:*:before-create` events, in favor of `bridgeOptions` instead. +- Map options can now be configured and overridden through the `ux:map:pre-connect` event: + ```js this.element.addEventListener('ux:map:pre-connect', (event) => { // Override the map center and zoom @@ -61,11 +64,13 @@ this.element.addEventListener('ux:map:pre-connect', (event) => { }; }); ``` -- Add `extra` data support to `Map`, which can be accessed in `ux:map:pre-connect` and `ux:map:connect` events + +- Add `extra` data support to `Map`, which can be accessed in `ux:map:pre-connect` and `ux:map:connect` events ## 2.26 -- Add support for creating `Polygon` with holes, by passing an array of `array` as `points` parameter to the `Polygon` constructor, e.g.: +- Add support for creating `Polygon` with holes, by passing an array of `array` as `points` parameter to the `Polygon` constructor, e.g.: + ```php // Draw a polygon with a hole in it, on the French map $map->addPolygon(new Polygon(points: [ @@ -89,43 +94,43 @@ $map->addPolygon(new Polygon(points: [ ## 2.25 -- Downgrade PHP requirement from 8.3 to 8.1 +- Downgrade PHP requirement from 8.3 to 8.1 ## 2.24 -- Installing the package in a Symfony app using Flex won't add the `@symfony/ux-map` dependency to the `package.json` file anymore. -- Add `Icon` to customize a `Marker` icon (URL or SVG content) -- Add parameter `id` to `Marker`, `Polygon` and `Polyline` constructors -- Add method `Map::removeMarker(string|Marker $markerOrId)` -- Add method `Map::removePolygon(string|Polygon $polygonOrId)` -- Add method `Map::removePolyline(string|Polyline $polylineOrId)` +- Installing the package in a Symfony app using Flex won't add the `@symfony/ux-map` dependency to the `package.json` file anymore. +- Add `Icon` to customize a `Marker` icon (URL or SVG content) +- Add parameter `id` to `Marker`, `Polygon` and `Polyline` constructors +- Add method `Map::removeMarker(string|Marker $markerOrId)` +- Add method `Map::removePolygon(string|Polygon $polygonOrId)` +- Add method `Map::removePolyline(string|Polyline $polylineOrId)` ## 2.23 -- Add `DistanceUnit` to represent distance units (`m`, `km`, `miles`, `nmi`) and - ease conversion between units. -- Add `DistanceCalculatorInterface` interface and three implementations: - `HaversineDistanceCalculator`, `SphericalCosineDistanceCalculator` and `VincentyDistanceCalculator`. -- Add `CoordinateUtils` helper, to convert decimal coordinates (`43.2109`) in DMS (`56° 78' 90"`) +- Add `DistanceUnit` to represent distance units (`m`, `km`, `miles`, `nmi`) and + ease conversion between units. +- Add `DistanceCalculatorInterface` interface and three implementations: + `HaversineDistanceCalculator`, `SphericalCosineDistanceCalculator` and `VincentyDistanceCalculator`. +- Add `CoordinateUtils` helper, to convert decimal coordinates (`43.2109`) in DMS (`56° 78' 90"`) ## 2.22 -- Add method `Symfony\UX\Map\Renderer\AbstractRenderer::tapOptions()`, to allow Renderer to modify options before rendering a Map. -- Add `ux_map.google_maps.default_map_id` configuration to set the Google ``Map ID`` -- Add `ComponentWithMapTrait` to ease maps integration in [Live Components](https://symfony.com/bundles/ux-live-component/current/index.html) -- Add `Polyline` support +- Add method `Symfony\UX\Map\Renderer\AbstractRenderer::tapOptions()`, to allow Renderer to modify options before rendering a Map. +- Add `ux_map.google_maps.default_map_id` configuration to set the Google `Map ID` +- Add `ComponentWithMapTrait` to ease maps integration in [Live Components](https://symfony.com/bundles/ux-live-component/current/index.html) +- Add `Polyline` support ## 2.20 -- Deprecate `render_map` Twig function (will be removed in 2.21). Use - `ux_map` or the `` Twig component instead. -- Add `ux_map` Twig function (replaces `render_map` with a more flexible - interface) -- Add `` Twig component -- The importmap entry `@symfony/ux-map/abstract-map-controller` can be removed - from your importmap, it is no longer needed. -- Add `Polygon` support +- Deprecate `render_map` Twig function (will be removed in 2.21). Use + `ux_map` or the `` Twig component instead. +- Add `ux_map` Twig function (replaces `render_map` with a more flexible + interface) +- Add `` Twig component +- The importmap entry `@symfony/ux-map/abstract-map-controller` can be removed + from your importmap, it is no longer needed. +- Add `Polygon` support ## 2.19 -- Component added +- Component added diff --git a/src/Map/README.md b/src/Map/README.md index 60864148b..086e1d6c5 100644 --- a/src/Map/README.md +++ b/src/Map/README.md @@ -7,7 +7,7 @@ https://github.com/symfony/ux to create issues or submit pull requests. ## Resources -- [Documentation](https://symfony.com/bundles/ux-map/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-map/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Map/assets/README.md b/src/Map/assets/README.md index df8d4de9f..f9b6ce8a2 100644 --- a/src/Map/assets/README.md +++ b/src/Map/assets/README.md @@ -6,7 +6,7 @@ This package is private and is not intended to be published on npm or installed. ## Resources -- [Documentation](https://symfony.com/bundles/ux-map/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-map/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Map/assets/dist/abstract_map_controller.d.ts b/src/Map/assets/dist/abstract_map_controller.d.ts index 42e76498f..63043bd85 100644 --- a/src/Map/assets/dist/abstract_map_controller.d.ts +++ b/src/Map/assets/dist/abstract_map_controller.d.ts @@ -158,27 +158,27 @@ declare abstract class export_default; }): BridgeMap; protected abstract doFitBoundsToMarkers(): void; - protected abstract doCreateMarker({ definition }: { + protected abstract doCreateMarker({ definition, }: { definition: MarkerDefinition; }): BridgeMarker; protected abstract doRemoveMarker(marker: BridgeMarker): void; - protected abstract doCreatePolygon({ definition }: { + protected abstract doCreatePolygon({ definition, }: { definition: PolygonDefinition; }): BridgePolygon; protected abstract doRemovePolygon(polygon: BridgePolygon): void; - protected abstract doCreatePolyline({ definition }: { + protected abstract doCreatePolyline({ definition, }: { definition: PolylineDefinition; }): BridgePolyline; protected abstract doRemovePolyline(polyline: BridgePolyline): void; - protected abstract doCreateCircle({ definition }: { + protected abstract doCreateCircle({ definition, }: { definition: CircleDefinition; }): BridgeCircle; protected abstract doRemoveCircle(circle: BridgeCircle): void; - protected abstract doCreateRectangle({ definition }: { + protected abstract doCreateRectangle({ definition, }: { definition: RectangleDefinition; }): BridgeRectangle; protected abstract doRemoveRectangle(rectangle: BridgeRectangle): void; diff --git a/src/Map/assets/dist/abstract_map_controller.js b/src/Map/assets/dist/abstract_map_controller.js index 9e91d689a..2bb9b5b50 100644 --- a/src/Map/assets/dist/abstract_map_controller.js +++ b/src/Map/assets/dist/abstract_map_controller.js @@ -31,7 +31,11 @@ var abstract_map_controller_default = class extends Controller { this.createPolygon = this.createDrawingFactory("polygon", this.polygons, this.doCreatePolygon.bind(this)); this.createPolyline = this.createDrawingFactory("polyline", this.polylines, this.doCreatePolyline.bind(this)); this.createCircle = this.createDrawingFactory("circle", this.circles, this.doCreateCircle.bind(this)); - this.createRectangle = this.createDrawingFactory("rectangle", this.rectangles, this.doCreateRectangle.bind(this)); + this.createRectangle = this.createDrawingFactory( + "rectangle", + this.rectangles, + this.doCreateRectangle.bind(this) + ); this.map = this.doCreateMap({ definition: mapDefinition }); this.markersValue.forEach((definition) => { this.createMarker({ definition }); diff --git a/src/Map/assets/package.json b/src/Map/assets/package.json index ea9d1304a..d21be0066 100644 --- a/src/Map/assets/package.json +++ b/src/Map/assets/package.json @@ -22,9 +22,7 @@ "build": "tsx ../../../bin/build_package.ts .", "watch": "tsx ../../../bin/build_package.ts . --watch", "test": "pnpm run test:unit", - "test:unit": "../../../bin/unit_test_package.sh .", - "check": "biome check", - "ci": "biome ci" + "test:unit": "../../../bin/unit_test_package.sh ." }, "symfony": { "needsPackageAsADependency": false, diff --git a/src/Map/assets/src/abstract_map_controller.ts b/src/Map/assets/src/abstract_map_controller.ts index cc41de086..2afe6fc82 100644 --- a/src/Map/assets/src/abstract_map_controller.ts +++ b/src/Map/assets/src/abstract_map_controller.ts @@ -282,11 +282,31 @@ export default abstract class< protected infoWindows: Array = []; private isConnected = false; - private createMarker: ({ definition }: { definition: MarkerDefinition }) => BridgeMarker; - private createPolygon: ({ definition }: { definition: PolygonDefinition }) => BridgePolygon; - private createPolyline: ({ definition }: { definition: PolylineDefinition }) => BridgePolyline; - private createCircle: ({ definition }: { definition: CircleDefinition }) => BridgeCircle; - private createRectangle: ({ definition }: { definition: RectangleDefinition }) => BridgeRectangle; + private createMarker: ({ + definition, + }: { + definition: MarkerDefinition; + }) => BridgeMarker; + private createPolygon: ({ + definition, + }: { + definition: PolygonDefinition; + }) => BridgePolygon; + private createPolyline: ({ + definition, + }: { + definition: PolylineDefinition; + }) => BridgePolyline; + private createCircle: ({ + definition, + }: { + definition: CircleDefinition; + }) => BridgeCircle; + private createRectangle: ({ + definition, + }: { + definition: RectangleDefinition; + }) => BridgeRectangle; protected abstract dispatchEvent(name: string, payload: Record): void; @@ -306,7 +326,11 @@ export default abstract class< this.createPolygon = this.createDrawingFactory('polygon', this.polygons, this.doCreatePolygon.bind(this)); this.createPolyline = this.createDrawingFactory('polyline', this.polylines, this.doCreatePolyline.bind(this)); this.createCircle = this.createDrawingFactory('circle', this.circles, this.doCreateCircle.bind(this)); - this.createRectangle = this.createDrawingFactory('rectangle', this.rectangles, this.doCreateRectangle.bind(this)); + this.createRectangle = this.createDrawingFactory( + 'rectangle', + this.rectangles, + this.doCreateRectangle.bind(this) + ); this.map = this.doCreateMap({ definition: mapDefinition }); this.markersValue.forEach((definition) => { @@ -418,27 +442,51 @@ export default abstract class< //endregion //region Abstract factory methods to be implemented by the concrete classes, they are specific to the map provider - protected abstract doCreateMap({ definition }: { definition: MapDefinition }): BridgeMap; + protected abstract doCreateMap({ + definition, + }: { + definition: MapDefinition; + }): BridgeMap; protected abstract doFitBoundsToMarkers(): void; - protected abstract doCreateMarker({ definition }: { definition: MarkerDefinition }): BridgeMarker; + protected abstract doCreateMarker({ + definition, + }: { + definition: MarkerDefinition; + }): BridgeMarker; protected abstract doRemoveMarker(marker: BridgeMarker): void; - protected abstract doCreatePolygon({ definition }: { definition: PolygonDefinition }): BridgePolygon; + protected abstract doCreatePolygon({ + definition, + }: { + definition: PolygonDefinition; + }): BridgePolygon; protected abstract doRemovePolygon(polygon: BridgePolygon): void; - protected abstract doCreatePolyline({ definition }: { definition: PolylineDefinition }): BridgePolyline; + protected abstract doCreatePolyline({ + definition, + }: { + definition: PolylineDefinition; + }): BridgePolyline; protected abstract doRemovePolyline(polyline: BridgePolyline): void; - protected abstract doCreateCircle({ definition }: { definition: CircleDefinition }): BridgeCircle; + protected abstract doCreateCircle({ + definition, + }: { + definition: CircleDefinition; + }): BridgeCircle; protected abstract doRemoveCircle(circle: BridgeCircle): void; - protected abstract doCreateRectangle({ definition }: { definition: RectangleDefinition }): BridgeRectangle; + protected abstract doCreateRectangle({ + definition, + }: { + definition: RectangleDefinition; + }): BridgeRectangle; protected abstract doRemoveRectangle(rectangle: BridgeRectangle): void; @@ -454,11 +502,31 @@ export default abstract class< //endregion //region Private APIs - private createDrawingFactory(type: 'marker', draws: typeof this.markers, factory: typeof this.doCreateMarker): typeof this.doCreateMarker; - private createDrawingFactory(type: 'polygon', draws: typeof this.polygons, factory: typeof this.doCreatePolygon): typeof this.doCreatePolygon; - private createDrawingFactory(type: 'polyline', draws: typeof this.polylines, factory: typeof this.doCreatePolyline): typeof this.doCreatePolyline; - private createDrawingFactory(type: 'circle', draws: typeof this.circles, factory: typeof this.doCreateCircle): typeof this.doCreateCircle; - private createDrawingFactory(type: 'rectangle', draws: typeof this.rectangles, factory: typeof this.doCreateRectangle): typeof this.doCreateRectangle; + private createDrawingFactory( + type: 'marker', + draws: typeof this.markers, + factory: typeof this.doCreateMarker + ): typeof this.doCreateMarker; + private createDrawingFactory( + type: 'polygon', + draws: typeof this.polygons, + factory: typeof this.doCreatePolygon + ): typeof this.doCreatePolygon; + private createDrawingFactory( + type: 'polyline', + draws: typeof this.polylines, + factory: typeof this.doCreatePolyline + ): typeof this.doCreatePolyline; + private createDrawingFactory( + type: 'circle', + draws: typeof this.circles, + factory: typeof this.doCreateCircle + ): typeof this.doCreateCircle; + private createDrawingFactory( + type: 'rectangle', + draws: typeof this.rectangles, + factory: typeof this.doCreateRectangle + ): typeof this.doCreateRectangle; private createDrawingFactory< Factory extends | typeof this.doCreateMarker @@ -467,7 +535,11 @@ export default abstract class< | typeof this.doCreateCircle | typeof this.doCreateRectangle, Draw extends ReturnType, - >(type: 'marker' | 'polygon' | 'polyline' | 'circle' | 'rectangle', draws: globalThis.Map, Draw>, factory: Factory): Factory { + >( + type: 'marker' | 'polygon' | 'polyline' | 'circle' | 'rectangle', + draws: globalThis.Map, Draw>, + factory: Factory + ): Factory { const eventBefore = `${type}:before-create`; const eventAfter = `${type}:after-create`; diff --git a/src/Map/src/Bridge/Google/CHANGELOG.md b/src/Map/src/Bridge/Google/CHANGELOG.md index bcaec6f16..abcc56a4f 100644 --- a/src/Map/src/Bridge/Google/CHANGELOG.md +++ b/src/Map/src/Bridge/Google/CHANGELOG.md @@ -2,23 +2,24 @@ ## 2.31 -- Display a warning when trying to define `bridgeOptions.content` for a `Marker` that already has an `Icon` +- Display a warning when trying to define `bridgeOptions.content` for a `Marker` that already has an `Icon` ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.27 -- Fix `InfoWindow` compatibility with new `Circle` and `Rectangle` supported elements. +- Fix `InfoWindow` compatibility with new `Circle` and `Rectangle` supported elements. This fix led to a refactoring that can impact the `InfoWindow` position when used with `Polygon` or `Polyline`, because their shapes are too complex. Instead, listen to the `ux:map:info-window:before-create` event to set the position manually. + ```js this.element.addEventListener('ux:map:info-window:before-create', (event) => { const { google, element, definition } = event.detail; @@ -35,21 +36,21 @@ ## 2.25 -- Downgrade PHP requirement from 8.3 to 8.1 +- Downgrade PHP requirement from 8.3 to 8.1 ## 2.22 -- Add support for configuring a default Map ID -- Add argument `$defaultMapId` to `Symfony\UX\Map\Bridge\Google\Renderer\GoogleRendererFactory` constructor -- Add argument `$defaultMapId` to `Symfony\UX\Map\Bridge\Google\Renderer\GoogleRenderer` constructor +- Add support for configuring a default Map ID +- Add argument `$defaultMapId` to `Symfony\UX\Map\Bridge\Google\Renderer\GoogleRendererFactory` constructor +- Add argument `$defaultMapId` to `Symfony\UX\Map\Bridge\Google\Renderer\GoogleRenderer` constructor ## 2.20 ### BC Breaks -- Renamed importmap entry `@symfony/ux-google-map/map-controller` to `@symfony/ux-google-map`, - you will need to update your importmap. +- Renamed importmap entry `@symfony/ux-google-map/map-controller` to `@symfony/ux-google-map`, + you will need to update your importmap. ## 2.19 -- Bridge added +- Bridge added diff --git a/src/Map/src/Bridge/Google/README.md b/src/Map/src/Bridge/Google/README.md index 9b6e5baa9..529661710 100644 --- a/src/Map/src/Bridge/Google/README.md +++ b/src/Map/src/Bridge/Google/README.md @@ -35,7 +35,7 @@ UX_MAP_DSN=google://GOOGLE_MAPS_API_KEY@default?libraries[]=geometry&libraries[] Available options: | Option | Description | Default | -|-------------|------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------| +| ----------- | ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | | `id` | The id of the script tag | `__googleMapsScriptId` | | `language` | Force language, see [list of supported languages](https://developers.google.com/maps/faq#languagesupport) specified in the browser | The user's preferred language | | `region` | Unicode region subtag identifiers compatible with [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) | | @@ -102,6 +102,7 @@ $googleOptions = (new GoogleOptions()) // Add the custom options to the map $map->options($googleOptions); ``` + ## Use cases Below are some common or advanced use cases when using a map. @@ -111,17 +112,18 @@ Below are some common or advanced use cases when using a map. A common use case is to customize the marker. You can listen to the `ux:map:marker:before-create` event to customize the marker before it is created. Assuming you have a map with a custom controller: + ```twig {{ ux_map(map, {'data-controller': 'my-map' }) }} ``` You can create a Stimulus controller to customize the markers before they are created: + ```js // assets/controllers/my_map_controller.js -import {Controller} from "@hotwired/stimulus"; +import { Controller } from '@hotwired/stimulus'; -export default class extends Controller -{ +export default class extends Controller { connect() { this.element.addEventListener('ux:map:marker:before-create', this._onMarkerBeforeCreate); } @@ -137,22 +139,23 @@ export default class extends Controller const { definition, google } = event.detail; // 1. To use a custom image for the marker - const beachFlagImg = document.createElement("img"); + const beachFlagImg = document.createElement('img'); // Note: instead of using a hardcoded URL, you can use the `extra` parameter from `new Marker()` (PHP) and access it here with `definition.extra`. - beachFlagImg.src = "https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png"; - definition.bridgeOptions = { - content: beachFlagImg - } + beachFlagImg.src = + 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png'; + definition.bridgeOptions = { + content: beachFlagImg, + }; // 2. To use a custom glyph for the marker const pinElement = new google.maps.marker.PinElement({ // Note: instead of using a hardcoded URL, you can use the `extra` parameter from `new Marker()` (PHP) and access it here with `definition.extra`. glyph: new URL('https://maps.gstatic.com/mapfiles/place_api/icons/v2/museum_pinlet.svg'), - glyphColor: "white", + glyphColor: 'white', }); definition.bridgeOptions = { content: pinElement.element, - } + }; } } ``` diff --git a/src/Map/src/Bridge/Google/assets/README.md b/src/Map/src/Bridge/Google/assets/README.md index 77ba33358..eaa7ab9e4 100644 --- a/src/Map/src/Bridge/Google/assets/README.md +++ b/src/Map/src/Bridge/Google/assets/README.md @@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-google-map](https://packagist.org/packages/ This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-google-map](https://packagist.org/packages/symfony/ux-google-map) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. +We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-google-map](https://packagist.org/packages/symfony/ux-google-map) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-google-map](https://packagist.org/packages/symfony/ux-google-map) PHP package version: + ```shell composer require symfony/ux-google-map:2.23.0 npm add @symfony/ux-google-map@2.23.0 @@ -18,7 +19,7 @@ npm add @symfony/ux-google-map@2.23.0 ## Resources -- [Documentation](https://github.com/symfony/ux/tree/2.x/src/Map/src/Bridge/Google) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://github.com/symfony/ux/tree/2.x/src/Map/src/Bridge/Google) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Map/src/Bridge/Google/assets/dist/map_controller.d.ts b/src/Map/src/Bridge/Google/assets/dist/map_controller.d.ts index b99e97482..0f822b7af 100644 --- a/src/Map/src/Bridge/Google/assets/dist/map_controller.d.ts +++ b/src/Map/src/Bridge/Google/assets/dist/map_controller.d.ts @@ -11,7 +11,7 @@ declare class export_default extends AbstractMapController): void; - protected doCreateMap({ definition }: { + protected doCreateMap({ definition, }: { definition: MapDefinition; }): google.maps.Map; protected doCreateMarker({ definition, }: { @@ -26,7 +26,7 @@ declare class export_default extends AbstractMapController; }): google.maps.Polyline; protected doRemovePolyline(polyline: google.maps.Polyline): void; - protected doCreateCircle({ definition }: { + protected doCreateCircle({ definition, }: { definition: CircleDefinition; }): google.maps.Circle; protected doRemoveCircle(circle: google.maps.Circle): void; @@ -40,7 +40,7 @@ declare class export_default extends AbstractMapController { this.createMarker({ definition }); @@ -230,7 +234,9 @@ var map_controller_default = class extends abstract_map_controller_default { detail: payload }); } - doCreateMap({ definition }) { + doCreateMap({ + definition + }) { const { center, zoom, minZoom, maxZoom, options, bridgeOptions = {} } = definition; options.zoomControl = typeof options.zoomControlOptions !== "undefined"; options.mapTypeControl = typeof options.mapTypeControlOptions !== "undefined"; @@ -261,9 +267,13 @@ var map_controller_default = class extends abstract_map_controller_default { } if (icon) { if (Object.prototype.hasOwnProperty.call(bridgeOptions, "content")) { - console.warn('[Symfony UX Map] Defining "bridgeOptions.content" for a marker with a custom icon is not supported and will be ignored.'); + console.warn( + '[Symfony UX Map] Defining "bridgeOptions.content" for a marker with a custom icon is not supported and will be ignored.' + ); } else if (Object.prototype.hasOwnProperty.call(rawOptions, "content")) { - console.warn('[Symfony UX Map] Defining "rawOptions.content" for a marker with a custom icon is not supported and will be ignored.'); + console.warn( + '[Symfony UX Map] Defining "rawOptions.content" for a marker with a custom icon is not supported and will be ignored.' + ); } this.doCreateIcon({ definition: icon, element: marker }); } @@ -314,7 +324,9 @@ var map_controller_default = class extends abstract_map_controller_default { doRemovePolyline(polyline) { polyline.setMap(null); } - doCreateCircle({ definition }) { + doCreateCircle({ + definition + }) { const { "@id": _id, center, radius, title, infoWindow, rawOptions = {}, bridgeOptions = {} } = definition; const circle = new _google.maps.Circle({ center, @@ -416,7 +428,10 @@ var map_controller_default = class extends abstract_map_controller_default { } return content; } - doCreateIcon({ definition, element }) { + doCreateIcon({ + definition, + element + }) { const { type, width, height } = definition; if (type === IconTypes.Svg) { element.content = parser.parseFromString(definition.html, "image/svg+xml").documentElement; diff --git a/src/Map/src/Bridge/Google/assets/package.json b/src/Map/src/Bridge/Google/assets/package.json index f7db5a980..b48e31bdb 100644 --- a/src/Map/src/Bridge/Google/assets/package.json +++ b/src/Map/src/Bridge/Google/assets/package.json @@ -21,9 +21,7 @@ "watch": "tsx ../../../../../../bin/build_package.ts . --watch", "test": "pnpm run test:browser", "test:browser": "playwright test", - "test:browser:ui": "playwright test --ui", - "check": "biome check", - "ci": "biome ci" + "test:browser:ui": "playwright test --ui" }, "symfony": { "controllers": { diff --git a/src/Map/src/Bridge/Google/assets/src/map_controller.ts b/src/Map/src/Bridge/Google/assets/src/map_controller.ts index ca055c046..50798ba1d 100644 --- a/src/Map/src/Bridge/Google/assets/src/map_controller.ts +++ b/src/Map/src/Bridge/Google/assets/src/map_controller.ts @@ -65,7 +65,10 @@ export default class extends AbstractMapController< google.maps.RectangleOptions, google.maps.Rectangle > { - declare providerOptionsValue: Pick; + declare providerOptionsValue: Pick< + LoaderOptions, + 'apiKey' | 'id' | 'language' | 'region' | 'nonce' | 'retries' | 'url' | 'version' | 'libraries' + >; declare map: google.maps.Map; @@ -151,7 +154,11 @@ export default class extends AbstractMapController< }); } - protected doCreateMap({ definition }: { definition: MapDefinition }): google.maps.Map { + protected doCreateMap({ + definition, + }: { + definition: MapDefinition; + }): google.maps.Map { const { center, zoom, minZoom, maxZoom, options, bridgeOptions = {} } = definition; // We assume the following control options are enabled if their options are set @@ -191,9 +198,13 @@ export default class extends AbstractMapController< if (icon) { if (Object.prototype.hasOwnProperty.call(bridgeOptions, 'content')) { - console.warn('[Symfony UX Map] Defining "bridgeOptions.content" for a marker with a custom icon is not supported and will be ignored.'); + console.warn( + '[Symfony UX Map] Defining "bridgeOptions.content" for a marker with a custom icon is not supported and will be ignored.' + ); } else if (Object.prototype.hasOwnProperty.call(rawOptions, 'content')) { - console.warn('[Symfony UX Map] Defining "rawOptions.content" for a marker with a custom icon is not supported and will be ignored.'); + console.warn( + '[Symfony UX Map] Defining "rawOptions.content" for a marker with a custom icon is not supported and will be ignored.' + ); } this.doCreateIcon({ definition: icon, element: marker }); @@ -270,7 +281,11 @@ export default class extends AbstractMapController< polyline.setMap(null); } - protected doCreateCircle({ definition }: { definition: CircleDefinition }): google.maps.Circle { + protected doCreateCircle({ + definition, + }: { + definition: CircleDefinition; + }): google.maps.Circle { const { '@id': _id, center, radius, title, infoWindow, rawOptions = {}, bridgeOptions = {} } = definition; const circle = new _google.maps.Circle({ @@ -336,7 +351,12 @@ export default class extends AbstractMapController< element, }: { definition: Omit, 'position'>; - element: google.maps.marker.AdvancedMarkerElement | google.maps.Polygon | google.maps.Polyline | google.maps.Circle | google.maps.Rectangle; + element: + | google.maps.marker.AdvancedMarkerElement + | google.maps.Polygon + | google.maps.Polyline + | google.maps.Circle + | google.maps.Rectangle; }): google.maps.InfoWindow { const { headerContent, content, opened, autoClose, rawOptions = {}, bridgeOptions = {} } = definition; @@ -421,7 +441,13 @@ export default class extends AbstractMapController< return content; } - protected doCreateIcon({ definition, element }: { definition: Icon; element: google.maps.marker.AdvancedMarkerElement }): void { + protected doCreateIcon({ + definition, + element, + }: { + definition: Icon; + element: google.maps.marker.AdvancedMarkerElement; + }): void { const { type, width, height } = definition; if (type === IconTypes.Svg) { diff --git a/src/Map/src/Bridge/Leaflet/CHANGELOG.md b/src/Map/src/Bridge/Leaflet/CHANGELOG.md index 7e9c057b0..4a39d3756 100644 --- a/src/Map/src/Bridge/Leaflet/CHANGELOG.md +++ b/src/Map/src/Bridge/Leaflet/CHANGELOG.md @@ -2,40 +2,40 @@ ## 2.31 -- Display a warning when trying to define `bridgeOptions.icon` for a `Marker` that already has an `Icon` +- Display a warning when trying to define `bridgeOptions.icon` for a `Marker` that already has an `Icon` ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.27 -- Add `attributionControl` and `attributionControlOptions` to `LeafletOptions`, - to configure [attribution control](https://leafletjs.com/reference.html#map-attributioncontrol) and its options -- Add `zoomControl` and `zoomControlOptions` to `LeafletOptions`, - to configure [zoom control](https://leafletjs.com/reference.html#map-zoomcontrol) and its options +- Add `attributionControl` and `attributionControlOptions` to `LeafletOptions`, + to configure [attribution control](https://leafletjs.com/reference.html#map-attributioncontrol) and its options +- Add `zoomControl` and `zoomControlOptions` to `LeafletOptions`, + to configure [zoom control](https://leafletjs.com/reference.html#map-zoomcontrol) and its options ## 2.26 -- Using `new LeafletOptions(tileLayer: false)` will now disable the default `TileLayer`. - Useful when using a custom tiles layer rendering engine not configurable with `L.tileLayer().addTo(map)` method - (e.g.: [Esri/esri-leaflet-vector](https://github.com/Esri/esri-leaflet-vector)) +- Using `new LeafletOptions(tileLayer: false)` will now disable the default `TileLayer`. + Useful when using a custom tiles layer rendering engine not configurable with `L.tileLayer().addTo(map)` method + (e.g.: [Esri/esri-leaflet-vector](https://github.com/Esri/esri-leaflet-vector)) ## 2.25 -- Downgrade PHP requirement from 8.3 to 8.1 +- Downgrade PHP requirement from 8.3 to 8.1 ## 2.20 ### BC Breaks -- Renamed importmap entry `@symfony/ux-leaflet-map/map-controller` to `@symfony/ux-leaflet-map`, - you will need to update your importmap. +- Renamed importmap entry `@symfony/ux-leaflet-map/map-controller` to `@symfony/ux-leaflet-map`, + you will need to update your importmap. ## 2.19 -- Bridge added +- Bridge added diff --git a/src/Map/src/Bridge/Leaflet/README.md b/src/Map/src/Bridge/Leaflet/README.md index aea175313..5ae7f7d7d 100644 --- a/src/Map/src/Bridge/Leaflet/README.md +++ b/src/Map/src/Bridge/Leaflet/README.md @@ -72,17 +72,18 @@ Below are some common or advanced use cases when using a map. A common use case is to customize the marker. You can listen to the `ux:map:marker:before-create` event to customize the marker before it is created. Assuming you have a map with a custom controller: + ```twig {{ ux_map(map, {'data-controller': 'my-map' }) }} ``` You can create a Stimulus controller to customize the markers before they are created: + ```js // assets/controllers/my_map_controller.js -import {Controller} from "@hotwired/stimulus"; +import { Controller } from '@hotwired/stimulus'; -export default class extends Controller -{ +export default class extends Controller { connect() { this.element.addEventListener('ux:map:marker:before-create', this._onMarkerBeforeCreate); } @@ -99,19 +100,19 @@ export default class extends Controller // Use a custom icon for the marker const redIcon = L.icon({ - // Note: instead of using a hardcoded URL, you can use the `extra` parameter from `new Marker()` (PHP) and access it here with `definition.extra`. - iconUrl: 'https://leafletjs.com/examples/custom-icons/leaf-red.png', - shadowUrl: 'https://leafletjs.com/examples/custom-icons/leaf-shadow.png', - iconSize: [38, 95], // size of the icon - shadowSize: [50, 64], // size of the shadow - iconAnchor: [22, 94], // point of the icon which will correspond to marker's location - shadowAnchor: [4, 62], // the same for the shadow - popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor - }) + // Note: instead of using a hardcoded URL, you can use the `extra` parameter from `new Marker()` (PHP) and access it here with `definition.extra`. + iconUrl: 'https://leafletjs.com/examples/custom-icons/leaf-red.png', + shadowUrl: 'https://leafletjs.com/examples/custom-icons/leaf-shadow.png', + iconSize: [38, 95], // size of the icon + shadowSize: [50, 64], // size of the shadow + iconAnchor: [22, 94], // point of the icon which will correspond to marker's location + shadowAnchor: [4, 62], // the same for the shadow + popupAnchor: [-3, -76], // point from which the popup should open relative to the iconAnchor + }); definition.bridgeOptions = { - icon: redIcon, - } + icon: redIcon, + }; } } ``` @@ -135,6 +136,7 @@ $leafletOptions = (new LeafletOptions()) ### Unable to find `leaflet/dist/leaflet.min.css` file when using Webpack Encore When using Webpack Encore with the Leaflet bridge, you may encounter the following error: + ``` Module build failed: Module not found: "./node_modules/.pnpm/file+vendor+symfony+ux-leaflet-map+assets_@hotwired+stimulus@3.0.0_leaflet@1.9.4/node_modules/@symfony/ux-leaflet-map/dist/map_controller.js" contains a reference to the file "leaflet/dist/leaflet.min.css". @@ -152,10 +154,11 @@ The correct path is `leaflet/dist/leaflet.css`, but it is not possible to fix it with the Symfony AssetMapper component. As a workaround, you can configure Webpack Encore to add an alias for the `leaflet/dist/leaflet.min.css` file: + ```js Encore.addAliases({ - 'leaflet/dist/leaflet.min.css': 'leaflet/dist/leaflet.css', -}) + 'leaflet/dist/leaflet.min.css': 'leaflet/dist/leaflet.css', +}); ``` ## Resources diff --git a/src/Map/src/Bridge/Leaflet/assets/README.md b/src/Map/src/Bridge/Leaflet/assets/README.md index 3f1d7abcb..6d2eb8703 100644 --- a/src/Map/src/Bridge/Leaflet/assets/README.md +++ b/src/Map/src/Bridge/Leaflet/assets/README.md @@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-leaflet-map](https://packagist.org/packages This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-leaflet-map](https://packagist.org/packages/symfony/ux-leaflet-map) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. +We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-leaflet-map](https://packagist.org/packages/symfony/ux-leaflet-map) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-leaflet-map](https://packagist.org/packages/symfony/ux-leaflet-map) PHP package version: + ```shell composer require symfony/ux-leaflet-map:2.23.0 npm add @symfony/ux-leaflet-map@2.23.0 @@ -18,7 +19,7 @@ npm add @symfony/ux-leaflet-map@2.23.0 ## Resources -- [Documentation](https://github.com/symfony/ux/tree/2.x/src/Map/src/Bridge/Google) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://github.com/symfony/ux/tree/2.x/src/Map/src/Bridge/Google) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Map/src/Bridge/Leaflet/assets/dist/map_controller.d.ts b/src/Map/src/Bridge/Leaflet/assets/dist/map_controller.d.ts index 3a27c9a86..e86da4696 100644 --- a/src/Map/src/Bridge/Leaflet/assets/dist/map_controller.d.ts +++ b/src/Map/src/Bridge/Leaflet/assets/dist/map_controller.d.ts @@ -35,11 +35,11 @@ declare class export_default extends AbstractMapController; }): L.Marker; protected doRemoveMarker(marker: L.Marker): void; - protected doCreatePolygon({ definition }: { + protected doCreatePolygon({ definition, }: { definition: PolygonDefinition; }): L.Polygon; protected doRemovePolygon(polygon: L.Polygon): void; - protected doCreatePolyline({ definition }: { + protected doCreatePolyline({ definition, }: { definition: PolylineDefinition; }): L.Polyline; protected doRemovePolyline(polyline: L.Polyline): void; @@ -47,7 +47,7 @@ declare class export_default extends AbstractMapController; }): L.Circle; protected doRemoveCircle(circle: L.Circle): void; - protected doCreateRectangle({ definition }: { + protected doCreateRectangle({ definition, }: { definition: RectangleDefinition; }): L.Rectangle; protected doRemoveRectangle(rectangle: L.Rectangle): void; diff --git a/src/Map/src/Bridge/Leaflet/assets/dist/map_controller.js b/src/Map/src/Bridge/Leaflet/assets/dist/map_controller.js index f44fd13fc..ebc0145ca 100644 --- a/src/Map/src/Bridge/Leaflet/assets/dist/map_controller.js +++ b/src/Map/src/Bridge/Leaflet/assets/dist/map_controller.js @@ -31,7 +31,11 @@ var abstract_map_controller_default = class extends Controller { this.createPolygon = this.createDrawingFactory("polygon", this.polygons, this.doCreatePolygon.bind(this)); this.createPolyline = this.createDrawingFactory("polyline", this.polylines, this.doCreatePolyline.bind(this)); this.createCircle = this.createDrawingFactory("circle", this.circles, this.doCreateCircle.bind(this)); - this.createRectangle = this.createDrawingFactory("rectangle", this.rectangles, this.doCreateRectangle.bind(this)); + this.createRectangle = this.createDrawingFactory( + "rectangle", + this.rectangles, + this.doCreateRectangle.bind(this) + ); this.map = this.doCreateMap({ definition: mapDefinition }); this.markersValue.forEach((definition) => { this.createMarker({ definition }); @@ -239,9 +243,13 @@ var map_controller_default = class extends abstract_map_controller_default { } if (icon2) { if (Object.prototype.hasOwnProperty.call(bridgeOptions, "icon")) { - console.warn('[Symfony UX Map] Defining "bridgeOptions.icon" for a marker with a custom icon is not supported and will be ignored.'); + console.warn( + '[Symfony UX Map] Defining "bridgeOptions.icon" for a marker with a custom icon is not supported and will be ignored.' + ); } else if (Object.prototype.hasOwnProperty.call(rawOptions, "icon")) { - console.warn('[Symfony UX Map] Defining "rawOptions.icon" for a marker with a custom icon is not supported and will be ignored.'); + console.warn( + '[Symfony UX Map] Defining "rawOptions.icon" for a marker with a custom icon is not supported and will be ignored.' + ); } this.doCreateIcon({ definition: icon2, element: marker2 }); } @@ -250,7 +258,9 @@ var map_controller_default = class extends abstract_map_controller_default { doRemoveMarker(marker2) { marker2.remove(); } - doCreatePolygon({ definition }) { + doCreatePolygon({ + definition + }) { const { "@id": _id, points, title, infoWindow, rawOptions = {}, bridgeOptions = {} } = definition; const polygon2 = L.polygon(points, { ...rawOptions, ...bridgeOptions }).addTo(this.map); if (title) { @@ -264,7 +274,9 @@ var map_controller_default = class extends abstract_map_controller_default { doRemovePolygon(polygon2) { polygon2.remove(); } - doCreatePolyline({ definition }) { + doCreatePolyline({ + definition + }) { const { "@id": _id, points, title, infoWindow, rawOptions = {}, bridgeOptions = {} } = definition; const polyline2 = L.polyline(points, { ...rawOptions, ...bridgeOptions }).addTo(this.map); if (title) { @@ -292,7 +304,9 @@ var map_controller_default = class extends abstract_map_controller_default { doRemoveCircle(circle2) { circle2.remove(); } - doCreateRectangle({ definition }) { + doCreateRectangle({ + definition + }) { const { "@id": _id, southWest, northEast, title, infoWindow, rawOptions = {}, bridgeOptions = {} } = definition; const rectangle2 = L.rectangle( [ diff --git a/src/Map/src/Bridge/Leaflet/assets/package.json b/src/Map/src/Bridge/Leaflet/assets/package.json index 4a492eddc..07ec28121 100644 --- a/src/Map/src/Bridge/Leaflet/assets/package.json +++ b/src/Map/src/Bridge/Leaflet/assets/package.json @@ -21,9 +21,7 @@ "watch": "tsx ../../../../../../bin/build_package.ts . --watch", "test": "pnpm run test:browser", "test:browser": "playwright test", - "test:browser:ui": "playwright test --ui", - "check": "biome check", - "ci": "biome ci" + "test:browser:ui": "playwright test --ui" }, "symfony": { "controllers": { diff --git a/src/Map/src/Bridge/Leaflet/assets/src/map_controller.ts b/src/Map/src/Bridge/Leaflet/assets/src/map_controller.ts index b42d2d389..0277550b0 100644 --- a/src/Map/src/Bridge/Leaflet/assets/src/map_controller.ts +++ b/src/Map/src/Bridge/Leaflet/assets/src/map_controller.ts @@ -155,9 +155,13 @@ export default class extends AbstractMapController< if (icon) { if (Object.prototype.hasOwnProperty.call(bridgeOptions, 'icon')) { - console.warn('[Symfony UX Map] Defining "bridgeOptions.icon" for a marker with a custom icon is not supported and will be ignored.'); + console.warn( + '[Symfony UX Map] Defining "bridgeOptions.icon" for a marker with a custom icon is not supported and will be ignored.' + ); } else if (Object.prototype.hasOwnProperty.call(rawOptions, 'icon')) { - console.warn('[Symfony UX Map] Defining "rawOptions.icon" for a marker with a custom icon is not supported and will be ignored.'); + console.warn( + '[Symfony UX Map] Defining "rawOptions.icon" for a marker with a custom icon is not supported and will be ignored.' + ); } this.doCreateIcon({ definition: icon, element: marker }); @@ -170,7 +174,11 @@ export default class extends AbstractMapController< marker.remove(); } - protected doCreatePolygon({ definition }: { definition: PolygonDefinition }): L.Polygon { + protected doCreatePolygon({ + definition, + }: { + definition: PolygonDefinition; + }): L.Polygon { const { '@id': _id, points, title, infoWindow, rawOptions = {}, bridgeOptions = {} } = definition; const polygon = L.polygon(points, { ...rawOptions, ...bridgeOptions }).addTo(this.map); @@ -193,7 +201,11 @@ export default class extends AbstractMapController< polygon.remove(); } - protected doCreatePolyline({ definition }: { definition: PolylineDefinition }): L.Polyline { + protected doCreatePolyline({ + definition, + }: { + definition: PolylineDefinition; + }): L.Polyline { const { '@id': _id, points, title, infoWindow, rawOptions = {}, bridgeOptions = {} } = definition; const polyline = L.polyline(points, { ...rawOptions, ...bridgeOptions }).addTo(this.map); @@ -239,7 +251,11 @@ export default class extends AbstractMapController< circle.remove(); } - protected doCreateRectangle({ definition }: { definition: RectangleDefinition }): L.Rectangle { + protected doCreateRectangle({ + definition, + }: { + definition: RectangleDefinition; + }): L.Rectangle { const { '@id': _id, southWest, northEast, title, infoWindow, rawOptions = {}, bridgeOptions = {} } = definition; const rectangle = L.rectangle( diff --git a/src/Notify/.github/PULL_REQUEST_TEMPLATE.md b/src/Notify/.github/PULL_REQUEST_TEMPLATE.md index df3b474b4..887284ece 100644 --- a/src/Notify/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/Notify/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/src/Notify/.github/workflows/close-pull-request.yml b/src/Notify/.github/workflows/close-pull-request.yml index 57e4e3fb0..8150a6a6a 100644 --- a/src/Notify/.github/workflows/close-pull-request.yml +++ b/src/Notify/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/src/Notify/.symfony.bundle.yaml b/src/Notify/.symfony.bundle.yaml index 6d9a74acb..5662042f8 100644 --- a/src/Notify/.symfony.bundle.yaml +++ b/src/Notify/.symfony.bundle.yaml @@ -1,3 +1,3 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" +branches: ['2.x'] +maintained_branches: ['2.x'] +doc_dir: 'doc' diff --git a/src/Notify/CHANGELOG.md b/src/Notify/CHANGELOG.md index fd7a27c09..3f8ad03f8 100644 --- a/src/Notify/CHANGELOG.md +++ b/src/Notify/CHANGELOG.md @@ -2,45 +2,45 @@ ## 2.32 -- Add support for MercureBundle ^0.4.1 and Mercure ^0.7.0 +- Add support for MercureBundle ^0.4.1 and Mercure ^0.7.0 ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.24.0 -- Added `options` to Notification +- Added `options` to Notification ## 2.13.2 -- Revert "Change JavaScript package to `type: module`" +- Revert "Change JavaScript package to `type: module`" ## 2.13.0 -- Add Symfony 7 support. -- Change JavaScript package to `type: module` +- Add Symfony 7 support. +- Change JavaScript package to `type: module` ## 2.9.0 -- Add support for symfony/asset-mapper +- Add support for symfony/asset-mapper -- Replace `symfony/webpack-encore-bundle` by `symfony/stimulus-bundle` in dependencies +- Replace `symfony/webpack-encore-bundle` by `symfony/stimulus-bundle` in dependencies ## 2.7.0 -- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from - installing. +- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from + installing. -- TypeScript types are now included. +- TypeScript types are now included. ## 2.6.0 -- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make - sure the path in your `package.json` file is updated accordingly. +- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make + sure the path in your `package.json` file is updated accordingly. -- The directory structure of the bundle was updated to match modern best-practices. +- The directory structure of the bundle was updated to match modern best-practices. diff --git a/src/Notify/README.md b/src/Notify/README.md index 68029ad47..374371ee0 100644 --- a/src/Notify/README.md +++ b/src/Notify/README.md @@ -24,10 +24,10 @@ Help Symfony by [sponsoring][3] its development! ## Resources -- [Documentation](https://symfony.com/bundles/ux-notify/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-notify/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) [1]: https://symfony.com/backers [2]: https://mercure.rocks diff --git a/src/Notify/assets/README.md b/src/Notify/assets/README.md index c33802857..d3dde68b7 100644 --- a/src/Notify/assets/README.md +++ b/src/Notify/assets/README.md @@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-notify](https://packagist.org/packages/symf This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-notify](https://packagist.org/packages/symfony/ux-notify) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. +We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-notify](https://packagist.org/packages/symfony/ux-notify) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-notify](https://packagist.org/packages/symfony/ux-notify) PHP package version: + ```shell composer require symfony/ux-notify:2.23.0 npm add @symfony/ux-notify@2.23.0 @@ -18,7 +19,7 @@ npm add @symfony/ux-notify@2.23.0 ## Resources -- [Documentation](https://symfony.com/bundles/ux-notify/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-notify/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Notify/assets/package.json b/src/Notify/assets/package.json index da799c711..e072fb457 100644 --- a/src/Notify/assets/package.json +++ b/src/Notify/assets/package.json @@ -20,9 +20,7 @@ "test": "pnpm run test:unit && pnpm run test:browser", "test:unit": "../../../bin/unit_test_package.sh .", "test:browser": "playwright test", - "test:browser:ui": "playwright test --ui", - "check": "biome check", - "ci": "biome ci" + "test:browser:ui": "playwright test --ui" }, "symfony": { "controllers": { diff --git a/src/React/.github/PULL_REQUEST_TEMPLATE.md b/src/React/.github/PULL_REQUEST_TEMPLATE.md index df3b474b4..887284ece 100644 --- a/src/React/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/React/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/src/React/.github/workflows/close-pull-request.yml b/src/React/.github/workflows/close-pull-request.yml index 57e4e3fb0..8150a6a6a 100644 --- a/src/React/.github/workflows/close-pull-request.yml +++ b/src/React/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/src/React/.symfony.bundle.yaml b/src/React/.symfony.bundle.yaml index 6d9a74acb..5662042f8 100644 --- a/src/React/.symfony.bundle.yaml +++ b/src/React/.symfony.bundle.yaml @@ -1,3 +1,3 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" +branches: ['2.x'] +maintained_branches: ['2.x'] +doc_dir: 'doc' diff --git a/src/React/CHANGELOG.md b/src/React/CHANGELOG.md index e3c058a78..2f36df9f1 100644 --- a/src/React/CHANGELOG.md +++ b/src/React/CHANGELOG.md @@ -2,26 +2,27 @@ ## 2.33 -- Add support for React 19. +- Add support for React 19. Dependencies `react` and `react-dom` need to be updated together to version `^19.0` if you want to use React 19. ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.28.0 -- [BC BREAK] By modernizing our building tools, the file `dist/render_controller.js` now does not contain any useless - code related to `development` environment. +- [BC BREAK] By modernizing our building tools, the file `dist/render_controller.js` now does not contain any useless + code related to `development` environment. This file is now smaller and faster to load, but the imported module changed from `react-dom` to `react-dom/client`: - You **are not impacted** if you are using the Symfony AssetMapper and Symfony Flex, or Webpack Encore. - You **are impacted** if you are using the Symfony AssetMapper but **not** Symfony Flex, you need to : + ```shell php bin/console importmap:remove react-dom php bin/console importmap:require react-dom/client @@ -29,44 +30,44 @@ ## 2.26.0 -- Improve error handling when resolving a React component +- Improve error handling when resolving a React component ## 2.21.0 -- Add `permanent` option to the `react_component` Twig function, to prevent the - _unmounting_ when the component is deconnected and immediately re-connected +- Add `permanent` option to the `react_component` Twig function, to prevent the + _unmounting_ when the component is deconnected and immediately re-connected ## 2.13.2 -- Revert "Change JavaScript package to `type: module`" +- Revert "Change JavaScript package to `type: module`" ## 2.13.0 -- Add Symfony 7 support. -- Change JavaScript package to `type: module` +- Add Symfony 7 support. +- Change JavaScript package to `type: module` ## 2.9.0 -- Add support for symfony/asset-mapper +- Add support for symfony/asset-mapper -- Replace `symfony/webpack-encore-bundle` by `symfony/stimulus-bundle` in dependencies +- Replace `symfony/webpack-encore-bundle` by `symfony/stimulus-bundle` in dependencies -- Minimum PHP version is now 8.1 +- Minimum PHP version is now 8.1 ## 2.7.0 -- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from - installing. +- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from + installing. -- TypeScript types are now included. +- TypeScript types are now included. ## 2.6.0 -- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make - sure the path in your `package.json` file is updated accordingly. +- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make + sure the path in your `package.json` file is updated accordingly. -- The directory structure of the bundle was updated to match modern best-practices. +- The directory structure of the bundle was updated to match modern best-practices. ## 2.2 -- Component added +- Component added diff --git a/src/React/README.md b/src/React/README.md index 11dc2b3d3..f4aca0279 100644 --- a/src/React/README.md +++ b/src/React/README.md @@ -20,10 +20,10 @@ Help Symfony by [sponsoring][3] its development! ## Resources -- [Documentation](https://symfony.com/bundles/ux-react/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-react/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) [1]: https://symfony.com/backers [2]: https://mercure.rocks diff --git a/src/React/assets/README.md b/src/React/assets/README.md index 9bae2e4fa..a5bd54397 100644 --- a/src/React/assets/README.md +++ b/src/React/assets/README.md @@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-react](https://packagist.org/packages/symfo This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-react](https://packagist.org/packages/symfony/ux-react) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. +We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-react](https://packagist.org/packages/symfony/ux-react) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-react](https://packagist.org/packages/symfony/ux-react) PHP package version: + ```shell composer require symfony/ux-react:2.23.0 npm add @symfony/ux-react@2.23.0 @@ -18,7 +19,7 @@ npm add @symfony/ux-react@2.23.0 ## Resources -- [Documentation](https://symfony.com/bundles/ux-react/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-react/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/React/assets/package.json b/src/React/assets/package.json index 773767479..ae39d3741 100644 --- a/src/React/assets/package.json +++ b/src/React/assets/package.json @@ -28,9 +28,7 @@ "test": "pnpm run test:unit && pnpm run test:browser", "test:unit": "../../../bin/unit_test_package.sh .", "test:browser": "playwright test", - "test:browser:ui": "playwright test --ui", - "check": "biome check", - "ci": "biome ci" + "test:browser:ui": "playwright test --ui" }, "symfony": { "controllers": { diff --git a/src/StimulusBundle/.github/PULL_REQUEST_TEMPLATE.md b/src/StimulusBundle/.github/PULL_REQUEST_TEMPLATE.md index df3b474b4..887284ece 100644 --- a/src/StimulusBundle/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/StimulusBundle/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/src/StimulusBundle/.github/workflows/close-pull-request.yml b/src/StimulusBundle/.github/workflows/close-pull-request.yml index 57e4e3fb0..8150a6a6a 100644 --- a/src/StimulusBundle/.github/workflows/close-pull-request.yml +++ b/src/StimulusBundle/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/src/StimulusBundle/.symfony.bundle.yaml b/src/StimulusBundle/.symfony.bundle.yaml index 6d9a74acb..5662042f8 100644 --- a/src/StimulusBundle/.symfony.bundle.yaml +++ b/src/StimulusBundle/.symfony.bundle.yaml @@ -1,3 +1,3 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" +branches: ['2.x'] +maintained_branches: ['2.x'] +doc_dir: 'doc' diff --git a/src/StimulusBundle/CHANGELOG.md b/src/StimulusBundle/CHANGELOG.md index 87395460a..75f084f3f 100644 --- a/src/StimulusBundle/CHANGELOG.md +++ b/src/StimulusBundle/CHANGELOG.md @@ -2,53 +2,53 @@ ## 2.33 -- Change AssetMapper `excluded_patterns` from `**/controllers.json` to `*/controllers.json` +- Change AssetMapper `excluded_patterns` from `**/controllers.json` to `*/controllers.json` ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.20.1 -- Normalize Stimulus controller name in event name +- Normalize Stimulus controller name in event name ## 2.14.2 -- Fix bug with finding UX Packages with non-standard project structure +- Fix bug with finding UX Packages with non-standard project structure ## 2.14.1 -- Fixed bug with Stimulus controllers in subdirectories on Windows +- Fixed bug with Stimulus controllers in subdirectories on Windows ## 2.14.0 -- Added Typescript controllers support +- Added Typescript controllers support ## 2.13.2 -- Revert "Change JavaScript package to `type: module`" +- Revert "Change JavaScript package to `type: module`" ## 2.13.0 -- 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` +- 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` ## 2.10.0 -- Handle Stimulus outlets +- Handle Stimulus outlets ## 2.9.0 -- Introduce the bundle +- Introduce the bundle diff --git a/src/StimulusBundle/README.md b/src/StimulusBundle/README.md index a18ddf091..3a58b4cee 100644 --- a/src/StimulusBundle/README.md +++ b/src/StimulusBundle/README.md @@ -2,9 +2,9 @@ This bundle adds integration between Symfony, Stimulus and Symfony UX: -- A) Twig `stimulus_*` functions & filters to add Stimulus controllers, actions & targets in your templates; -- B) Integration with Symfony UX & AssetMapper; -- C) A helper service to build the Stimulus data attributes and use them in your services. +- A) Twig `stimulus_*` functions & filters to add Stimulus controllers, actions & targets in your templates; +- B) Integration with Symfony UX & AssetMapper; +- C) A helper service to build the Stimulus data attributes and use them in your services. [Read the documentation][1] diff --git a/src/StimulusBundle/assets/README.md b/src/StimulusBundle/assets/README.md index 41bdf682b..59d993556 100644 --- a/src/StimulusBundle/assets/README.md +++ b/src/StimulusBundle/assets/README.md @@ -9,7 +9,7 @@ Read more at [symfony/ux#2708](https://github.com/symfony/ux/issues/2708). ## Resources -- [Documentation](https://symfony.com/bundles/StimulusBundle/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/StimulusBundle/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/StimulusBundle/assets/package.json b/src/StimulusBundle/assets/package.json index 22f9226f7..303f813af 100644 --- a/src/StimulusBundle/assets/package.json +++ b/src/StimulusBundle/assets/package.json @@ -18,9 +18,7 @@ "build": "tsx ../../../bin/build_package.ts .", "watch": "tsx ../../../bin/build_package.ts . --watch", "test": "pnpm run test:unit && pnpm run test:browser", - "test:unit": "../../../bin/unit_test_package.sh .", - "check": "biome check", - "ci": "biome ci" + "test:unit": "../../../bin/unit_test_package.sh ." }, "symfony": { "needsPackageAsADependency": false, diff --git a/src/Svelte/.github/PULL_REQUEST_TEMPLATE.md b/src/Svelte/.github/PULL_REQUEST_TEMPLATE.md index df3b474b4..887284ece 100644 --- a/src/Svelte/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/Svelte/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/src/Svelte/.github/workflows/close-pull-request.yml b/src/Svelte/.github/workflows/close-pull-request.yml index 57e4e3fb0..8150a6a6a 100644 --- a/src/Svelte/.github/workflows/close-pull-request.yml +++ b/src/Svelte/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/src/Svelte/.symfony.bundle.yaml b/src/Svelte/.symfony.bundle.yaml index 6d9a74acb..5662042f8 100644 --- a/src/Svelte/.symfony.bundle.yaml +++ b/src/Svelte/.symfony.bundle.yaml @@ -1,3 +1,3 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" +branches: ['2.x'] +maintained_branches: ['2.x'] +doc_dir: 'doc' diff --git a/src/Svelte/CHANGELOG.md b/src/Svelte/CHANGELOG.md index 5461c672c..28f3149d7 100644 --- a/src/Svelte/CHANGELOG.md +++ b/src/Svelte/CHANGELOG.md @@ -2,30 +2,30 @@ ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.13.2 -- Revert "Change JavaScript package to `type: module`" +- Revert "Change JavaScript package to `type: module`" ## 2.13.0 -- Add support for Svelte 4. -- Add Symfony 7 support. -- Change JavaScript package to `type: module` +- Add support for Svelte 4. +- Add Symfony 7 support. +- Change JavaScript package to `type: module` ## 2.9.0 -- Add support for symfony/asset-mapper +- Add support for symfony/asset-mapper -- Replace `symfony/webpack-encore-bundle` by `symfony/stimulus-bundle` in dependencies +- Replace `symfony/webpack-encore-bundle` by `symfony/stimulus-bundle` in dependencies -- Minimum PHP version is now 8.1 +- Minimum PHP version is now 8.1 ## 2.8.0 -- Introduce the package +- Introduce the package diff --git a/src/Svelte/README.md b/src/Svelte/README.md index 6be9dbfc5..2d664faab 100644 --- a/src/Svelte/README.md +++ b/src/Svelte/README.md @@ -8,7 +8,7 @@ https://github.com/symfony/ux to create issues or submit pull requests. ## Resources -- [Documentation](https://symfony.com/bundles/ux-svelte/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-svelte/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Svelte/assets/README.md b/src/Svelte/assets/README.md index 9a2cc3751..f6ee1ece1 100644 --- a/src/Svelte/assets/README.md +++ b/src/Svelte/assets/README.md @@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-svelte](https://packagist.org/packages/symf This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-svelte](https://packagist.org/packages/symfony/ux-svelte) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. +We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-svelte](https://packagist.org/packages/symfony/ux-svelte) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-svelte](https://packagist.org/packages/symfony/ux-svelte) PHP package version: + ```shell composer require symfony/ux-svelte:2.23.0 npm add @symfony/ux-svelte@2.23.0 @@ -18,7 +19,7 @@ npm add @symfony/ux-svelte@2.23.0 ## Resources -- [Documentation](https://symfony.com/bundles/ux-svelte/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-svelte/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Svelte/assets/package.json b/src/Svelte/assets/package.json index 3831314e7..0c4ef4e83 100644 --- a/src/Svelte/assets/package.json +++ b/src/Svelte/assets/package.json @@ -19,9 +19,7 @@ "test": "pnpm run test:unit && pnpm run test:browser", "test:unit": "../../../bin/unit_test_package.sh .", "test:browser": "playwright test", - "test:browser:ui": "playwright test --ui", - "check": "biome check", - "ci": "biome ci" + "test:browser:ui": "playwright test --ui" }, "symfony": { "controllers": { diff --git a/src/Swup/.github/PULL_REQUEST_TEMPLATE.md b/src/Swup/.github/PULL_REQUEST_TEMPLATE.md index df3b474b4..887284ece 100644 --- a/src/Swup/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/Swup/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/src/Swup/.github/workflows/close-pull-request.yml b/src/Swup/.github/workflows/close-pull-request.yml index 57e4e3fb0..8150a6a6a 100644 --- a/src/Swup/.github/workflows/close-pull-request.yml +++ b/src/Swup/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/src/Swup/.symfony.bundle.yaml b/src/Swup/.symfony.bundle.yaml index 6d9a74acb..5662042f8 100644 --- a/src/Swup/.symfony.bundle.yaml +++ b/src/Swup/.symfony.bundle.yaml @@ -1,3 +1,3 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" +branches: ['2.x'] +maintained_branches: ['2.x'] +doc_dir: 'doc' diff --git a/src/Swup/CHANGELOG.md b/src/Swup/CHANGELOG.md index be03306f3..f69205dcd 100644 --- a/src/Swup/CHANGELOG.md +++ b/src/Swup/CHANGELOG.md @@ -2,57 +2,57 @@ ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.26.0 -- Deprecate the package +- Deprecate the package ## 2.13.2 -- Revert "Change JavaScript package to `type: module`" +- Revert "Change JavaScript package to `type: module`" ## 2.13.0 -- Change JavaScript package to `type: module` +- Change JavaScript package to `type: module` ## 2.9.0 -- A SwupBundle was added - which allows for integration with symfony/asset-mapper. +- A SwupBundle was added - which allows for integration with symfony/asset-mapper. -- Add support for symfony/asset-mapper +- Add support for symfony/asset-mapper ## 2.7.0 -- The JavaScript events now bubble up. +- The JavaScript events now bubble up. -- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from - installing. +- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from + installing. -- TypeScript types are now included. +- TypeScript types are now included. ## 2.6.0 -- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make - sure the path in your `package.json` file is updated accordingly. +- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make + sure the path in your `package.json` file is updated accordingly. ## 2.0 -- Support for `stimulus` version 2 was removed and support for `@hotwired/stimulus` - version 3 was added. See the [@symfony/stimulus-bridge CHANGELOG](https://github.com/symfony/stimulus-bridge/blob/main/CHANGELOG.md#300) - for more details. -- All options were changed from `data-` attributes to Stimulus values. See - The README for updated instructions. -- Added a new `swup:pre-connect` event. -- Support added for Symfony 6. +- Support for `stimulus` version 2 was removed and support for `@hotwired/stimulus` + version 3 was added. See the [@symfony/stimulus-bridge CHANGELOG](https://github.com/symfony/stimulus-bridge/blob/main/CHANGELOG.md#300) + for more details. +- All options were changed from `data-` attributes to Stimulus values. See + The README for updated instructions. +- Added a new `swup:pre-connect` event. +- Support added for Symfony 6. ## 1.3 -- [DEPENDENCY CHANGE] `swup` (and a few themes/plugins) is no longer included - automatically (#93), but `symfony/flex` will automatically add all the - required libraries your `package.json` file when upgrading. Additionally - `symfony/flex` 1.13 or higher is now required if installed. +- [DEPENDENCY CHANGE] `swup` (and a few themes/plugins) is no longer included + automatically (#93), but `symfony/flex` will automatically add all the + required libraries your `package.json` file when upgrading. Additionally + `symfony/flex` 1.13 or higher is now required if installed. diff --git a/src/Swup/README.md b/src/Swup/README.md index 63d9d6522..e0248f1a5 100644 --- a/src/Swup/README.md +++ b/src/Swup/README.md @@ -131,10 +131,10 @@ Help Symfony by [sponsoring][3] its development! ## Resources -- [Documentation](https://symfony.com/bundles/ux-swup/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-swup/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) [1]: https://symfony.com/backers [2]: https://mercure.rocks diff --git a/src/Swup/assets/README.md b/src/Swup/assets/README.md index e1c6cfb68..423e43266 100644 --- a/src/Swup/assets/README.md +++ b/src/Swup/assets/README.md @@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-swup](https://packagist.org/packages/symfon This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-swup](https://packagist.org/packages/symfony/ux-swup) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. +We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-swup](https://packagist.org/packages/symfony/ux-swup) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-swup](https://packagist.org/packages/symfony/ux-swup) PHP package version: + ```shell composer require symfony/ux-swup:2.23.0 npm add @symfony/ux-swup@2.23.0 @@ -18,7 +19,7 @@ npm add @symfony/ux-swup@2.23.0 ## Resources -- [Documentation](https://symfony.com/bundles/ux-swup/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-swup/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Swup/assets/package.json b/src/Swup/assets/package.json index a40178e24..1e9fa2f6f 100644 --- a/src/Swup/assets/package.json +++ b/src/Swup/assets/package.json @@ -18,9 +18,7 @@ "build": "tsx ../../../bin/build_package.ts .", "watch": "tsx ../../../bin/build_package.ts . --watch", "test": "pnpm run test:unit", - "test:unit": "../../../bin/unit_test_package.sh .", - "check": "biome check", - "ci": "biome ci" + "test:unit": "../../../bin/unit_test_package.sh ." }, "symfony": { "controllers": { diff --git a/src/TogglePassword/.github/PULL_REQUEST_TEMPLATE.md b/src/TogglePassword/.github/PULL_REQUEST_TEMPLATE.md index df3b474b4..887284ece 100644 --- a/src/TogglePassword/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/TogglePassword/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/src/TogglePassword/.github/workflows/close-pull-request.yml b/src/TogglePassword/.github/workflows/close-pull-request.yml index 57e4e3fb0..8150a6a6a 100644 --- a/src/TogglePassword/.github/workflows/close-pull-request.yml +++ b/src/TogglePassword/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/src/TogglePassword/.symfony.bundle.yaml b/src/TogglePassword/.symfony.bundle.yaml index 6d9a74acb..5662042f8 100644 --- a/src/TogglePassword/.symfony.bundle.yaml +++ b/src/TogglePassword/.symfony.bundle.yaml @@ -1,3 +1,3 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" +branches: ['2.x'] +maintained_branches: ['2.x'] +doc_dir: 'doc' diff --git a/src/TogglePassword/CHANGELOG.md b/src/TogglePassword/CHANGELOG.md index 3b8b5965b..a0d459cbf 100644 --- a/src/TogglePassword/CHANGELOG.md +++ b/src/TogglePassword/CHANGELOG.md @@ -2,29 +2,29 @@ ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.29.0 -- Deprecate the package +- Deprecate the package ## 2.13.2 -- Revert "Change JavaScript package to `type: module`" +- Revert "Change JavaScript package to `type: module`" ## 2.13.0 -- Add Symfony 7 support. -- Change JavaScript package to `type: module` +- Add Symfony 7 support. +- Change JavaScript package to `type: module` ## 2.12.0 -- Added default values for the Stimulus controller values. +- Added default values for the Stimulus controller values. ## 2.11.0 -- Introduce component! +- Introduce component! diff --git a/src/TogglePassword/README.md b/src/TogglePassword/README.md index e2311852b..30f727a52 100644 --- a/src/TogglePassword/README.md +++ b/src/TogglePassword/README.md @@ -6,6 +6,7 @@ To keep the same functionality in your Symfony application, follow these migration steps: 1. Remove the `symfony/ux-toggle-password` package from your project: + ```bash composer remove symfony/ux-toggle-password ``` @@ -16,7 +17,8 @@ composer remove symfony/ux-toggle-password > These files are provided as a reference. > You can customize them to fit your needs, and even simplify the implementation if you don't need all the features. - - `src/Form/Extension/TogglePasswordTypeExtension.php` +- `src/Form/Extension/TogglePasswordTypeExtension.php` + ```php {{ block('password_widget') }}
{%- endblock toggle_password_widget -%} ``` - - `assets/controllers/toggle_password_controller.js` + +- `assets/controllers/toggle_password_controller.js` + ```javascript import { Controller } from '@hotwired/stimulus'; import '../styles/toggle_password.css'; @@ -196,7 +202,9 @@ export default class extends Controller { } } ``` - - `assets/styles/toggle_password.css` + +- `assets/styles/toggle_password.css` + ```css .toggle-password-container { position: relative; @@ -248,10 +256,10 @@ Help Symfony by [sponsoring][3] its development! ## Resources -- [Documentation](https://symfony.com/bundles/ux-toggle-password/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-toggle-password/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) [1]: https://symfony.com/backers [2]: https://mercure.rocks diff --git a/src/TogglePassword/assets/README.md b/src/TogglePassword/assets/README.md index b9c383d78..c932f556d 100644 --- a/src/TogglePassword/assets/README.md +++ b/src/TogglePassword/assets/README.md @@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-toggle-password](https://packagist.org/pack This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-toggle-password](https://packagist.org/packages/symfony/ux-toggle-password) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. +We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-toggle-password](https://packagist.org/packages/symfony/ux-toggle-password) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-toggle-password](https://packagist.org/packages/symfony/ux-toggle-password) PHP package version: + ```shell composer require symfony/ux-toggle-password:2.23.0 npm add @symfony/ux-toggle-password@2.23.0 @@ -18,7 +19,7 @@ npm add @symfony/ux-toggle-password@2.23.0 ## Resources -- [Documentation](https://symfony.com/bundles/ux-toggle-password/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-toggle-password/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/TogglePassword/assets/package.json b/src/TogglePassword/assets/package.json index cfa3f73b4..7a385f001 100644 --- a/src/TogglePassword/assets/package.json +++ b/src/TogglePassword/assets/package.json @@ -21,9 +21,7 @@ "build": "tsx ../../../bin/build_package.ts .", "watch": "tsx ../../../bin/build_package.ts . --watch", "test": "pnpm run test:unit", - "test:unit": "../../../bin/unit_test_package.sh .", - "check": "biome check", - "ci": "biome ci" + "test:unit": "../../../bin/unit_test_package.sh ." }, "symfony": { "controllers": { diff --git a/src/Toolkit/.github/PULL_REQUEST_TEMPLATE.md b/src/Toolkit/.github/PULL_REQUEST_TEMPLATE.md index df3b474b4..887284ece 100644 --- a/src/Toolkit/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/Toolkit/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/src/Toolkit/.github/workflows/close-pull-request.yml b/src/Toolkit/.github/workflows/close-pull-request.yml index 57e4e3fb0..8150a6a6a 100644 --- a/src/Toolkit/.github/workflows/close-pull-request.yml +++ b/src/Toolkit/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/src/Toolkit/CHANGELOG.md b/src/Toolkit/CHANGELOG.md index 2deb84b1c..8b7dc9ab8 100644 --- a/src/Toolkit/CHANGELOG.md +++ b/src/Toolkit/CHANGELOG.md @@ -2,22 +2,22 @@ ## 2.33.0 -- [Shadcn] Add `accordion` recipe -- [Shadcn] Add `tooltip` recipe -- [Shadcn] Rework templates of `alert` recipe -- [Shadcn] Rework templates of `avatar` recipe -- [Shadcn] Rework templates of `badge` recipe -- [Shadcn] Rework templates of `button` recipe -- [Shadcn] Rework templates of `card` recipe -- [Shadcn] Rework templates of `input-group` recipe -- [Shadcn] Rework templates of `table` recipe -- [Shadcn] Rework templates of `textarea` recipe -- [Shadcn] Add `Alert:Action` component +- [Shadcn] Add `accordion` recipe +- [Shadcn] Add `tooltip` recipe +- [Shadcn] Rework templates of `alert` recipe +- [Shadcn] Rework templates of `avatar` recipe +- [Shadcn] Rework templates of `badge` recipe +- [Shadcn] Rework templates of `button` recipe +- [Shadcn] Rework templates of `card` recipe +- [Shadcn] Rework templates of `input-group` recipe +- [Shadcn] Rework templates of `table` recipe +- [Shadcn] Rework templates of `textarea` recipe +- [Shadcn] Add `Alert:Action` component ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.25 -- Package added +- Package added diff --git a/src/Toolkit/CONTRIBUTING.md b/src/Toolkit/CONTRIBUTING.md index d8606b175..0eefd33d0 100644 --- a/src/Toolkit/CONTRIBUTING.md +++ b/src/Toolkit/CONTRIBUTING.md @@ -7,6 +7,7 @@ Due to its nature, the Symfony UX Toolkit requires a specific setup to develop a First, ensure you have followed the [Symfony UX's Contribution Guide](https://github.com/symfony/ux/blob/2.x/CONTRIBUTING.md) to set up your fork of the main repository, install dependencies, etc. Then, install the UX Toolkit dependencies: + ```shell # src/Toolkit composer install @@ -17,6 +18,7 @@ composer install Currently, kits can only be previewed through the Symfony UX Website. Installation instructions can be found in the [Symfony UX Website's `README.md`](https://github.com/symfony/ux/tree/2.x/ux.symfony.com). Then, run the following commands from the `ux.symfony.com/` directory: + ```shell # Link local UX packages php ../link @@ -26,6 +28,7 @@ symfony serve -d ``` When the server is running, you can access: + - The UX Toolkit homepage at https://127.0.0.1:9044/toolkit - The list of available kits at https://127.0.0.1:9044/toolkit#kits - A dedicated section for each kit, e.g., https://127.0.0.1:9044/toolkit/kits/shadcn for the Shadcn UI Kit @@ -65,6 +68,7 @@ The Twig code examples are rendered in an isolated environment. The rendered output is then compared to stored snapshots to ensure that the kit's recipes work as expected. To update the snapshots, run the following command from the `src/Toolkit/` directory: + ```shell # Remove existing snapshots (may be useful if some Twig code examples were removed) rm -fr tests/Functional/__snapshots__ diff --git a/src/Toolkit/README.md b/src/Toolkit/README.md index c9759f334..b1fac557f 100644 --- a/src/Toolkit/README.md +++ b/src/Toolkit/README.md @@ -10,6 +10,6 @@ https://github.com/symfony/ux to create issues or submit pull requests. ## Resources -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Toolkit/kits/shadcn/INSTALL.md b/src/Toolkit/kits/shadcn/INSTALL.md index db11d0852..7cb279456 100644 --- a/src/Toolkit/kits/shadcn/INSTALL.md +++ b/src/Toolkit/kits/shadcn/INSTALL.md @@ -7,6 +7,7 @@ Please note that not every Shadcn UI component is available in this kit, but we ## Requirements This kit requires TailwindCSS to work: + - If you use Symfony AssetMapper, you can install TailwindCSS with the [TailwindBundle](https://symfony.com/bundles/TailwindBundle/current/index.html), - If you use Webpack Encore, you can follow the [TailwindCSS installation guide for Symfony](https://tailwindcss.com/docs/installation/framework-guides/symfony) @@ -15,7 +16,7 @@ This kit requires TailwindCSS to work: Modify the file `assets/styles/app.css` with the following content: ```css -@import "tailwindcss"; +@import 'tailwindcss'; @custom-variant dark (&:is(.dark *)); diff --git a/src/Toolkit/kits/shadcn/accordion/assets/controllers/accordion_controller.js b/src/Toolkit/kits/shadcn/accordion/assets/controllers/accordion_controller.js index 403615225..30ab2da23 100644 --- a/src/Toolkit/kits/shadcn/accordion/assets/controllers/accordion_controller.js +++ b/src/Toolkit/kits/shadcn/accordion/assets/controllers/accordion_controller.js @@ -159,7 +159,7 @@ export default class extends Controller { * @returns {boolean} */ #isDisabled(item) { - return item.hasAttribute('disabled') + return item.hasAttribute('disabled'); } /** diff --git a/src/Toolkit/kits/shadcn/alert-dialog/assets/controllers/alert_dialog_controller.js b/src/Toolkit/kits/shadcn/alert-dialog/assets/controllers/alert_dialog_controller.js index 5a673eb25..1ef9345e6 100644 --- a/src/Toolkit/kits/shadcn/alert-dialog/assets/controllers/alert_dialog_controller.js +++ b/src/Toolkit/kits/shadcn/alert-dialog/assets/controllers/alert_dialog_controller.js @@ -1,7 +1,6 @@ import { Controller } from '@hotwired/stimulus'; export default class extends Controller { - static targets = ['trigger', 'dialog']; async open() { @@ -11,7 +10,7 @@ export default class extends Controller { if (this.dialogTarget.getAnimations().length > 0) { this.dialogTarget.addEventListener('transitionend', () => { this.triggerTarget.setAttribute('aria-expanded', 'true'); - }) + }); } else { this.triggerTarget.setAttribute('aria-expanded', 'true'); } @@ -25,7 +24,7 @@ export default class extends Controller { if (this.dialogTarget.getAnimations().length > 0) { this.dialogTarget.addEventListener('transitionend', () => { this.triggerTarget.setAttribute('aria-expanded', 'false'); - }) + }); } else { this.triggerTarget.setAttribute('aria-expanded', 'false'); } diff --git a/src/Toolkit/kits/shadcn/dialog/assets/controllers/dialog_controller.js b/src/Toolkit/kits/shadcn/dialog/assets/controllers/dialog_controller.js index 1c740895c..38e0479b6 100644 --- a/src/Toolkit/kits/shadcn/dialog/assets/controllers/dialog_controller.js +++ b/src/Toolkit/kits/shadcn/dialog/assets/controllers/dialog_controller.js @@ -1,7 +1,6 @@ import { Controller } from '@hotwired/stimulus'; export default class extends Controller { - static targets = ['trigger', 'dialog']; open() { @@ -11,7 +10,7 @@ export default class extends Controller { if (this.dialogTarget.getAnimations().length > 0) { this.dialogTarget.addEventListener('transitionend', () => { this.triggerTarget.setAttribute('aria-expanded', 'true'); - }) + }); } else { this.triggerTarget.setAttribute('aria-expanded', 'true'); } @@ -20,7 +19,7 @@ export default class extends Controller { closeOnClickOutside({ target }) { if (target === this.dialogTarget) { - this.close() + this.close(); } } @@ -31,7 +30,7 @@ export default class extends Controller { if (this.dialogTarget.getAnimations().length > 0) { this.dialogTarget.addEventListener('transitionend', () => { this.triggerTarget.setAttribute('aria-expanded', 'false'); - }) + }); } else { this.triggerTarget.setAttribute('aria-expanded', 'false'); } diff --git a/src/Toolkit/kits/shadcn/tooltip/assets/controllers/tooltip_controller.js b/src/Toolkit/kits/shadcn/tooltip/assets/controllers/tooltip_controller.js index e2c443217..50fa0a28a 100644 --- a/src/Toolkit/kits/shadcn/tooltip/assets/controllers/tooltip_controller.js +++ b/src/Toolkit/kits/shadcn/tooltip/assets/controllers/tooltip_controller.js @@ -8,7 +8,7 @@ export default class extends Controller { wrapperSelector: String, contentSelector: String, arrowSelector: String, - } + }; static targets = ['trigger']; connect() { @@ -90,24 +90,24 @@ export default class extends Controller { let arrowTop = null; switch (this.side) { case 'left': - wrapperLeft = triggerRect.left - contentRect.width - (arrowRect.width / 2) - this.sideOffset; - wrapperTop = triggerRect.top - (contentRect.height / 2) + (triggerRect.height / 2); - arrowTop = contentRect.height / 2 - (arrowRect.height / 2); + wrapperLeft = triggerRect.left - contentRect.width - arrowRect.width / 2 - this.sideOffset; + wrapperTop = triggerRect.top - contentRect.height / 2 + triggerRect.height / 2; + arrowTop = contentRect.height / 2 - arrowRect.height / 2; break; case 'top': - wrapperLeft = triggerRect.left - (contentRect.width / 2) + (triggerRect.width / 2); - wrapperTop = triggerRect.top - contentRect.height - (arrowRect.height / 2) - this.sideOffset; - arrowLeft = contentRect.width / 2 - (arrowRect.width / 2); + wrapperLeft = triggerRect.left - contentRect.width / 2 + triggerRect.width / 2; + wrapperTop = triggerRect.top - contentRect.height - arrowRect.height / 2 - this.sideOffset; + arrowLeft = contentRect.width / 2 - arrowRect.width / 2; break; case 'right': - wrapperLeft = triggerRect.right + (arrowRect.width / 2) + this.sideOffset; - wrapperTop = triggerRect.top - (contentRect.height / 2) + (triggerRect.height / 2); - arrowTop = contentRect.height / 2 - (arrowRect.height / 2); + wrapperLeft = triggerRect.right + arrowRect.width / 2 + this.sideOffset; + wrapperTop = triggerRect.top - contentRect.height / 2 + triggerRect.height / 2; + arrowTop = contentRect.height / 2 - arrowRect.height / 2; break; case 'bottom': - wrapperLeft = triggerRect.left - (contentRect.width / 2) + (triggerRect.width / 2); - wrapperTop = triggerRect.bottom + (arrowRect.height / 2) + this.sideOffset; - arrowLeft = contentRect.width / 2 - (arrowRect.width / 2); + wrapperLeft = triggerRect.left - contentRect.width / 2 + triggerRect.width / 2; + wrapperTop = triggerRect.bottom + arrowRect.height / 2 + this.sideOffset; + arrowLeft = contentRect.width / 2 - arrowRect.width / 2; break; } diff --git a/src/Translator/.github/PULL_REQUEST_TEMPLATE.md b/src/Translator/.github/PULL_REQUEST_TEMPLATE.md index df3b474b4..887284ece 100644 --- a/src/Translator/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/Translator/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/src/Translator/.github/workflows/close-pull-request.yml b/src/Translator/.github/workflows/close-pull-request.yml index 57e4e3fb0..8150a6a6a 100644 --- a/src/Translator/.github/workflows/close-pull-request.yml +++ b/src/Translator/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/src/Translator/.symfony.bundle.yaml b/src/Translator/.symfony.bundle.yaml index 6d9a74acb..5662042f8 100644 --- a/src/Translator/.symfony.bundle.yaml +++ b/src/Translator/.symfony.bundle.yaml @@ -1,3 +1,3 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" +branches: ['2.x'] +maintained_branches: ['2.x'] +doc_dir: 'doc' diff --git a/src/Translator/CHANGELOG.md b/src/Translator/CHANGELOG.md index ab0daedde..927d6224e 100644 --- a/src/Translator/CHANGELOG.md +++ b/src/Translator/CHANGELOG.md @@ -2,7 +2,7 @@ ## 2.32 -- **[BC BREAK]** Refactor API to use string-based translation keys instead of generated constants. +- **[BC BREAK]** Refactor API to use string-based translation keys instead of generated constants. Translation keys are now simple strings instead of TypeScript constants. The main advantages are: @@ -13,6 +13,7 @@ - And you can still get autocompletion and type-safety :rocket: **Before:** + ```typescript import { trans } from '@symfony/ux-translator'; import { SYMFONY_GREAT } from '@app/translations'; @@ -21,6 +22,7 @@ ``` **After:** + ```typescript import { createTranslator } from '@symfony/ux-translator'; import { messages } from '../var/translations/index.js'; @@ -38,6 +40,7 @@ for further reducing bundle size. **For AssetMapper users:** You can remove the following entries from your `importmap.php`: + ```php '@app/translations' => [ 'path' => './var/translations/index.js', @@ -49,56 +52,57 @@ **Note:** This is a breaking change, but the UX Translator component is still experimental. -- **[BC BREAK]** Refactor `TranslationsDumper` to accept configuration options via `dump()` method parameters, instead of constructor arguments or method calls: - - Removed `$dumpDir` and `$dumpTypeScript` constructor arguments - - Removed `TranslationsDumper::addIncludedDomain()` and `TranslationsDumper::addExcludedDomain()` methods +- **[BC BREAK]** Refactor `TranslationsDumper` to accept configuration options via `dump()` method parameters, + instead of constructor arguments or method calls: + - Removed `$dumpDir` and `$dumpTypeScript` constructor arguments + - Removed `TranslationsDumper::addIncludedDomain()` and `TranslationsDumper::addExcludedDomain()` methods **Note:** This is a breaking change, but the UX Translator component is still experimental. -- Add configuration `ux_translator.dump_typescript` to enable/disable TypeScript types dumping, - default to `true`. Generating TypeScript types is useful when developing, - but not in production when using the AssetMapper (which does not use these types). +- Add configuration `ux_translator.dump_typescript` to enable/disable TypeScript types dumping, + default to `true`. Generating TypeScript types is useful when developing, + but not in production when using the AssetMapper (which does not use these types). -- Add `keys_patterns` configuration option to filter dumped translations by key patterns (e.g., `app.*`, `!*.internal`) +- Add `keys_patterns` configuration option to filter dumped translations by key patterns (e.g., `app.*`, `!*.internal`) ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.22.0 -- Support both the Symfony format (`fr_FR`) and W3C specification (`fr-FR`) for locale subcodes. +- Support both the Symfony format (`fr_FR`) and W3C specification (`fr-FR`) for locale subcodes. ## 2.20.0 -- Add `throwWhenNotFound` function to configure the behavior when a translation is not found. +- Add `throwWhenNotFound` function to configure the behavior when a translation is not found. ## 2.19.0 -- Add configuration to filter dumped translations by domain. +- Add configuration to filter dumped translations by domain. ## 2.16.0 -- Increase version range of `intl-messageformat` to `^10.5.11`, in order to see - a faster implementation of ICU messages parsing. #1443 +- Increase version range of `intl-messageformat` to `^10.5.11`, in order to see + a faster implementation of ICU messages parsing. #1443 ## 2.13.2 -- Revert "Change JavaScript package to `type: module`" +- Revert "Change JavaScript package to `type: module`" ## 2.13.0 -- Add Symfony 7 support. -- Change JavaScript package to `type: module` +- Add Symfony 7 support. +- Change JavaScript package to `type: module` ## 2.9.0 -- Add support for symfony/asset-mapper +- Add support for symfony/asset-mapper ## 2.8.0 -- Component added +- Component added diff --git a/src/Translator/README.md b/src/Translator/README.md index efa99f52f..cb4bb06e0 100644 --- a/src/Translator/README.md +++ b/src/Translator/README.md @@ -10,7 +10,7 @@ https://github.com/symfony/ux to create issues or submit pull requests. ## Resources -- [Documentation](https://symfony.com/bundles/ux-translator/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-translator/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Translator/assets/README.md b/src/Translator/assets/README.md index f8c9ed24d..c16675749 100644 --- a/src/Translator/assets/README.md +++ b/src/Translator/assets/README.md @@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-translator](https://packagist.org/packages/ This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-translator](https://packagist.org/packages/symfony/ux-translator) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. +We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-translator](https://packagist.org/packages/symfony/ux-translator) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-translator](https://packagist.org/packages/symfony/ux-translator) PHP package version: + ```shell composer require symfony/ux-translator:2.23.0 npm add @symfony/ux-translator@2.23.0 @@ -18,7 +19,7 @@ npm add @symfony/ux-translator@2.23.0 ## Resources -- [Documentation](https://symfony.com/bundles/ux-translator/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-translator/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Translator/assets/dist/translator_controller.d.ts b/src/Translator/assets/dist/translator_controller.d.ts index c98285d5e..13679cc59 100644 --- a/src/Translator/assets/dist/translator_controller.d.ts +++ b/src/Translator/assets/dist/translator_controller.d.ts @@ -9,11 +9,12 @@ type ParametersType = Record | NoParametersType; type RemoveIntlIcuSuffix = T extends `${infer U}+intl-icu` ? U : T; type DomainsOf = M extends Message ? keyof Translations : never; type LocaleOf = M extends Message ? Locale : never; -type ParametersOf = M extends Message - ? Translations[D] extends { parameters: infer Parameters } - ? Parameters - : never - : never; +type ParametersOf = + M extends Message + ? Translations[D] extends { parameters: infer Parameters } + ? Parameters + : never + : never; interface Message { translations: { diff --git a/src/Translator/assets/package.json b/src/Translator/assets/package.json index 1d4c0126d..5135af513 100644 --- a/src/Translator/assets/package.json +++ b/src/Translator/assets/package.json @@ -20,9 +20,7 @@ "test": "pnpm run test:unit && pnpm run test:browser", "test:unit": "../../../bin/unit_test_package.sh .", "test:browser": "playwright test", - "test:browser:ui": "playwright test --ui", - "check": "biome check", - "ci": "biome ci" + "test:browser:ui": "playwright test --ui" }, "symfony": { "importmap": { diff --git a/src/Translator/assets/src/types.d.ts b/src/Translator/assets/src/types.d.ts index 51d657780..2d4d2608b 100644 --- a/src/Translator/assets/src/types.d.ts +++ b/src/Translator/assets/src/types.d.ts @@ -9,11 +9,12 @@ export type ParametersType = Record | NoParamete export type RemoveIntlIcuSuffix = T extends `${infer U}+intl-icu` ? U : T; export type DomainsOf = M extends Message ? keyof Translations : never; export type LocaleOf = M extends Message ? Locale : never; -export type ParametersOf = M extends Message - ? Translations[D] extends { parameters: infer Parameters } - ? Parameters - : never - : never; +export type ParametersOf = + M extends Message + ? Translations[D] extends { parameters: infer Parameters } + ? Parameters + : never + : never; export interface Message { translations: { diff --git a/src/Turbo/.github/PULL_REQUEST_TEMPLATE.md b/src/Turbo/.github/PULL_REQUEST_TEMPLATE.md index df3b474b4..887284ece 100644 --- a/src/Turbo/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/Turbo/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/src/Turbo/.github/workflows/close-pull-request.yml b/src/Turbo/.github/workflows/close-pull-request.yml index 57e4e3fb0..8150a6a6a 100644 --- a/src/Turbo/.github/workflows/close-pull-request.yml +++ b/src/Turbo/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/src/Turbo/.symfony.bundle.yaml b/src/Turbo/.symfony.bundle.yaml index 6d9a74acb..5662042f8 100644 --- a/src/Turbo/.symfony.bundle.yaml +++ b/src/Turbo/.symfony.bundle.yaml @@ -1,3 +1,3 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" +branches: ['2.x'] +maintained_branches: ['2.x'] +doc_dir: 'doc' diff --git a/src/Turbo/CHANGELOG.md b/src/Turbo/CHANGELOG.md index b779a0c16..8ba85f34b 100644 --- a/src/Turbo/CHANGELOG.md +++ b/src/Turbo/CHANGELOG.md @@ -2,76 +2,76 @@ ## 2.32 -- Add support for MercureBundle ^0.4.1 and Mercure ^0.7.0 +- Add support for MercureBundle ^0.4.1 and Mercure ^0.7.0 ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.24.0 -- Add Twig Extensions for `meta` tags -- Add support for authentication to the EventSource via `turbo_stream_listen` +- Add Twig Extensions for `meta` tags +- Add support for authentication to the EventSource via `turbo_stream_listen` ## 2.22.0 -- Add `` component -- Add `` component -- Add support for custom actions in `TurboStream` and `TurboStreamResponse` -- Add support for providing multiple mercure topics to `turbo_stream_listen` +- Add `` component +- Add `` component +- Add support for custom actions in `TurboStream` and `TurboStreamResponse` +- Add support for providing multiple mercure topics to `turbo_stream_listen` ## 2.21.0 -- Add `Helper/TurboStream::append()` et al. methods -- Add `TurboStreamResponse` -- Add `` components +- Add `Helper/TurboStream::append()` et al. methods +- Add `TurboStreamResponse` +- Add `` components ## 2.19.0 -- Fix Doctrine proxies are not Broadcasted #3139 +- Fix Doctrine proxies are not Broadcasted #3139 ## 2.15.0 -- Add Turbo 8 support #1476 -- Fix missing `use` statement used during broadcast #1475 +- Add Turbo 8 support #1476 +- Fix missing `use` statement used during broadcast #1475 ## 2.14.2 -- Fix using old `ClassUtils` class that's not used in newer versions of Doctrine +- Fix using old `ClassUtils` class that's not used in newer versions of Doctrine ## 2.13.2 -- Revert "Change JavaScript package to `type: module`" +- Revert "Change JavaScript package to `type: module`" ## 2.13.0 -- Add Symfony 7 support. -- Change JavaScript package to `type: module` +- Add Symfony 7 support. +- Change JavaScript package to `type: module` ## 2.9.0 -- Minimum PHP version is now 8.1 +- Minimum PHP version is now 8.1 -- Add support for symfony/asset-mapper +- Add support for symfony/asset-mapper -- Replace `symfony/webpack-encore-bundle` by `symfony/stimulus-bundle` in dependencies +- Replace `symfony/webpack-encore-bundle` by `symfony/stimulus-bundle` in dependencies ## 2.7.0 -- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from - installing. +- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from + installing. -- TypeScript types are now included. +- TypeScript types are now included. ## 2.6.1 -- The `symfony/ux-turbo-mercure` package was abandoned and moved into this package. - If you were previously using `symfony/ux-turbo-mercure`, you can remove it - and only install mecure-bundle: +- The `symfony/ux-turbo-mercure` package was abandoned and moved into this package. + If you were previously using `symfony/ux-turbo-mercure`, you can remove it + and only install mecure-bundle: ``` composer require symfony/mercure-bundle @@ -84,22 +84,22 @@ ## 2.6.0 -- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make - sure the path in your `package.json` file is updated accordingly. +- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make + sure the path in your `package.json` file is updated accordingly. -- The directory structure of the bundle was updated to match modern best-practices. +- The directory structure of the bundle was updated to match modern best-practices. ## 2.3 -- The `Broadcast` attribute can now be repeated, this is convenient to render several Turbo Streams Twig templates for the same change +- The `Broadcast` attribute can now be repeated, this is convenient to render several Turbo Streams Twig templates for the same change ## 2.2 -- The topics defined in the `Broadcast` attribute now support expression language when prefixed with `@=`. +- The topics defined in the `Broadcast` attribute now support expression language when prefixed with `@=`. ## 2.1 -- `TurboStreamResponse` and `AddTurboStreamFormatSubscriber` have been removed, use native content negotiation instead: +- `TurboStreamResponse` and `AddTurboStreamFormatSubscriber` have been removed, use native content negotiation instead: ```php use Symfony\UX\Turbo\TurboBundle; @@ -123,13 +123,13 @@ ## 2.0 -- Support for `stimulus` version 2 was removed and support for `@hotwired/stimulus` - version 3 was added. See the [@symfony/stimulus-bridge CHANGELOG](https://github.com/symfony/stimulus-bridge/blob/main/CHANGELOG.md#300) - for more details. -- Support added for Symfony 6 -- `@hotwired/turbo` version bumped to stable 7.0. +- Support for `stimulus` version 2 was removed and support for `@hotwired/stimulus` + version 3 was added. See the [@symfony/stimulus-bridge CHANGELOG](https://github.com/symfony/stimulus-bridge/blob/main/CHANGELOG.md#300) + for more details. +- Support added for Symfony 6 +- `@hotwired/turbo` version bumped to stable 7.0. ## 1.3 -- Package introduced! The new `symfony/ux-turbo` and `symfony/ux-turbo-mercure` - were introduced. +- Package introduced! The new `symfony/ux-turbo` and `symfony/ux-turbo-mercure` + were introduced. diff --git a/src/Turbo/CONTRIBUTING.md b/src/Turbo/CONTRIBUTING.md index bc4c29ac1..581d9eee2 100644 --- a/src/Turbo/CONTRIBUTING.md +++ b/src/Turbo/CONTRIBUTING.md @@ -21,12 +21,12 @@ Start the test app: ## Convenient endpoints: -- `http://localhost:8000`: basic features -- `http://localhost:8000/chat`: chat using Turbo Streams -- `http://localhost:8000/books`: broadcast -- `http://localhost:8000/authors`: broadcast -- `http://localhost:8000/artists`: broadcast -- `http://localhost:8000/songs`: broadcast +- `http://localhost:8000`: basic features +- `http://localhost:8000/chat`: chat using Turbo Streams +- `http://localhost:8000/books`: broadcast +- `http://localhost:8000/authors`: broadcast +- `http://localhost:8000/artists`: broadcast +- `http://localhost:8000/songs`: broadcast ## Run tests diff --git a/src/Turbo/README.md b/src/Turbo/README.md index 538794fc2..84a488174 100644 --- a/src/Turbo/README.md +++ b/src/Turbo/README.md @@ -48,10 +48,10 @@ vendor/bin/simple-phpunit ## Resources -- [Documentation](https://symfony.com/bundles/ux-turbo/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-turbo/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) [1]: https://symfony.com/backers [2]: https://mercure.rocks diff --git a/src/Turbo/assets/README.md b/src/Turbo/assets/README.md index 69e57cac1..7185efa47 100644 --- a/src/Turbo/assets/README.md +++ b/src/Turbo/assets/README.md @@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-turbo](https://packagist.org/packages/symfo This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-turbo](https://packagist.org/packages/symfony/ux-turbo) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. +We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-turbo](https://packagist.org/packages/symfony/ux-turbo) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-turbo](https://packagist.org/packages/symfony/ux-turbo) PHP package version: + ```shell composer require symfony/ux-turbo:2.23.0 npm add @symfony/ux-turbo@2.23.0 @@ -18,7 +19,7 @@ npm add @symfony/ux-turbo@2.23.0 ## Resources -- [Documentation](https://symfony.com/bundles/ux-turbo/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-turbo/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Turbo/assets/package.json b/src/Turbo/assets/package.json index 31a2fa6ea..e9ce38d7a 100644 --- a/src/Turbo/assets/package.json +++ b/src/Turbo/assets/package.json @@ -25,9 +25,7 @@ "test": "pnpm run test:unit && pnpm run test:browser", "test:unit": "../../../bin/unit_test_package.sh .", "test:browser": "playwright test", - "test:browser:ui": "playwright test --ui", - "check": "biome check", - "ci": "biome ci" + "test:browser:ui": "playwright test --ui" }, "symfony": { "controllers": { diff --git a/src/Turbo/docker-compose.yml b/src/Turbo/docker-compose.yml index 1aa530ae3..d2866eb0b 100644 --- a/src/Turbo/docker-compose.yml +++ b/src/Turbo/docker-compose.yml @@ -1,14 +1,15 @@ services: -###> symfony/mercure-bundle ### - mercure: - image: dunglas/mercure - ports: - - 3000:3000 - environment: - SERVER_NAME: ':3000' - MERCURE_PUBLISHER_JWT_KEY: '!ChangeMe!' - MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeMe!' - MERCURE_EXTRA_DIRECTIVES: | - anonymous - cors_origins * + ###> symfony/mercure-bundle ### + mercure: + image: dunglas/mercure + ports: + - 3000:3000 + environment: + SERVER_NAME: ':3000' + MERCURE_PUBLISHER_JWT_KEY: '!ChangeMe!' + MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeMe!' + MERCURE_EXTRA_DIRECTIVES: | + anonymous + cors_origins * + ###< symfony/mercure-bundle ### diff --git a/src/Turbo/tests/app/assets/app.js b/src/Turbo/tests/app/assets/app.js index 3e6d848ae..4f131665f 100644 --- a/src/Turbo/tests/app/assets/app.js +++ b/src/Turbo/tests/app/assets/app.js @@ -7,10 +7,10 @@ * file that was distributed with this source code. */ -import { Application } from "@hotwired/stimulus"; -import TurboStreamMercureController from "@symfony/ux-turbo/dist/turbo_stream_controller"; +import { Application } from '@hotwired/stimulus'; +import TurboStreamMercureController from '@symfony/ux-turbo/dist/turbo_stream_controller'; const application = Application.start(); -application.register("symfony--ux-turbo--mercure-turbo-stream", TurboStreamMercureController); +application.register('symfony--ux-turbo--mercure-turbo-stream', TurboStreamMercureController); console.log('test app initialized'); diff --git a/src/TwigComponent/.github/PULL_REQUEST_TEMPLATE.md b/src/TwigComponent/.github/PULL_REQUEST_TEMPLATE.md index df3b474b4..887284ece 100644 --- a/src/TwigComponent/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/TwigComponent/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/src/TwigComponent/.github/workflows/close-pull-request.yml b/src/TwigComponent/.github/workflows/close-pull-request.yml index 57e4e3fb0..8150a6a6a 100644 --- a/src/TwigComponent/.github/workflows/close-pull-request.yml +++ b/src/TwigComponent/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/src/TwigComponent/.symfony.bundle.yaml b/src/TwigComponent/.symfony.bundle.yaml index 6d9a74acb..5662042f8 100644 --- a/src/TwigComponent/.symfony.bundle.yaml +++ b/src/TwigComponent/.symfony.bundle.yaml @@ -1,3 +1,3 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" +branches: ['2.x'] +maintained_branches: ['2.x'] +doc_dir: 'doc' diff --git a/src/TwigComponent/CHANGELOG.md b/src/TwigComponent/CHANGELOG.md index c2065acd6..bd44d906d 100644 --- a/src/TwigComponent/CHANGELOG.md +++ b/src/TwigComponent/CHANGELOG.md @@ -2,162 +2,162 @@ ## 2.32 -- Add option `profiler.collect_components` to control component data collection - in the profiler (enabled in debug mode by default) -- Add support for using directory name as component name for anonymous components +- Add option `profiler.collect_components` to control component data collection + in the profiler (enabled in debug mode by default) +- Add support for using directory name as component name for anonymous components ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.25.2 -- Fix `ComponentAttributes` rendering when using `StimulusAttributes` as default attributes +- Fix `ComponentAttributes` rendering when using `StimulusAttributes` as default attributes ## 2.25.1 -- [SECURITY] `ComponentAttributes` now requires a `Twig\Runtime\EscaperRuntime` - instance as second argument -- Remove `HtmlAttributeEscaperInterface`, `TwigHtmlAttributeEscaper` and `ComponentAttributesFactory` +- [SECURITY] `ComponentAttributes` now requires a `Twig\Runtime\EscaperRuntime` + instance as second argument +- Remove `HtmlAttributeEscaperInterface`, `TwigHtmlAttributeEscaper` and `ComponentAttributesFactory` ## 2.25.0 -- [SECURITY] Make `ComponentAttributes` responsible for attribute escaping ensuring - consistent and secure HTML output across all rendering contexts -- Deprecate not passing an `HtmlAttributeEscaperInterface` to the `ComponentAttributes` - constructor +- [SECURITY] Make `ComponentAttributes` responsible for attribute escaping ensuring + consistent and secure HTML output across all rendering contexts +- Deprecate not passing an `HtmlAttributeEscaperInterface` to the `ComponentAttributes` + constructor ## 2.20.0 -- Add Anonymous Component support for 3rd-party bundles #2019 -- Deprecate `cva` Twig function in favor of [`html_cva` from `twig/html-extra`](https://twig.symfony.com/html_cva) #2144 +- Add Anonymous Component support for 3rd-party bundles #2019 +- Deprecate `cva` Twig function in favor of [`html_cva` from `twig/html-extra`](https://twig.symfony.com/html_cva) #2144 ## 2.17.0 -- Add nested attribute support #1405 +- Add nested attribute support #1405 ## 2.16.0 -- Introduce CVA to style TwigComponent #1416 -- Drop Twig 2 support #1436 -- Fix full context is stored in profiler #1552 -- Add CVA (Class variant authority) integration #1416 +- Introduce CVA to style TwigComponent #1416 +- Drop Twig 2 support #1436 +- Fix full context is stored in profiler #1552 +- Add CVA (Class variant authority) integration #1416 ## 2.15.0 -- 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 +- 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 ## 2.14.0 -- Make `ComponentAttributes` traversable/countable -- Fixed lexing some `{# twig comments #}` with HTML Twig syntax -- Fix various usages of deprecated Twig code +- Make `ComponentAttributes` traversable/countable +- Fixed lexing some `{# twig comments #}` with HTML Twig syntax +- Fix various usages of deprecated Twig code ## 2.13.0 -- [BC BREAK] Add component metadata to `PreMountEvent` and `PostMountEvent` -- 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 %}`/`` 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. +- [BC BREAK] Add component metadata to `PreMountEvent` and `PostMountEvent` +- 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 %}`/`` 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. ## 2.12.0 -- Added a `debug:twig-component` command. -- Fixed bad exception when the error comes from a Twig template. -- Fixed deprecation with `TemplateCacheWarmer` return type. +- Added a `debug:twig-component` command. +- Fixed bad exception when the error comes from a Twig template. +- Fixed deprecation with `TemplateCacheWarmer` return type. ## 2.11.0 -- 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 `` syntax where an attribute is set to an empty value. -- Add component debug command for TwigComponent and LiveComponent. +- 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 `` syntax where an attribute is set to an empty value. +- Add component debug command for TwigComponent and LiveComponent. ## 2.9.0 -- The `ComponentAttributes::defaults()` method now accepts any iterable argument. - The `ComponentAttributes::add()` method has been deprecated. To add a Stimulus - controller to the attributes, use `{{ attributes.defaults(stimulus_controller('...')) }}`. +- The `ComponentAttributes::defaults()` method now accepts any iterable argument. + The `ComponentAttributes::add()` method has been deprecated. To add a Stimulus + controller to the attributes, use `{{ attributes.defaults(stimulus_controller('...')) }}`. ## 2.8.0 -- Add new HTML syntax for rendering components: `` -- `true` attribute values now render just the attribute name, `false` excludes it entirely. -- Add helpers for testing components. -- The first argument to `AsTwigComponent` is now optional and defaults to the class name. -- Allow passing a FQCN to `ComponentFactory` methods. +- Add new HTML syntax for rendering components: `` +- `true` attribute values now render just the attribute name, `false` excludes it entirely. +- Add helpers for testing components. +- The first argument to `AsTwigComponent` is now optional and defaults to the class name. +- Allow passing a FQCN to `ComponentFactory` methods. ## 2.7.0 -- `PreMount` and `PostMount` hooks can now return nothing. +- `PreMount` and `PostMount` hooks can now return nothing. ## 2.5 -- [BC BREAK] The `PreRenderEvent` namespace was changed from `Symfony\UX\TwigComponent\EventListener` - to `Symfony\UX\TwigComponent\Event`. +- [BC BREAK] The `PreRenderEvent` namespace was changed from `Symfony\UX\TwigComponent\EventListener` + to `Symfony\UX\TwigComponent\Event`. -- Add new autowireable `ComponentRendererInterface` +- Add new autowireable `ComponentRendererInterface` -- Added `PostRenderEvent` and `PreCreateForRenderEvent` which are dispatched just - before or after a component is rendered. +- Added `PostRenderEvent` and `PreCreateForRenderEvent` which are dispatched just + before or after a component is rendered. -- Added `PostMountEvent` and `PreMountEvent` which are dispatched just before - or after the component's data is mounted. +- Added `PostMountEvent` and `PreMountEvent` which are dispatched just before + or after the component's data is mounted. -- Added Twig template namespaces - #460. +- Added Twig template namespaces - #460. ## 2.2 -- Allow to pass stringable object as non mapped component attribute. -- Add _embedded_ components. -- Allow `ExposeInTemplate` to be used on public component methods. +- Allow to pass stringable object as non mapped component attribute. +- Add _embedded_ components. +- Allow `ExposeInTemplate` to be used on public component methods. ## 2.1 -- Make public component properties available directly in the template (`{{ prop }}` vs `{{ this.prop }}`). +- Make public component properties available directly in the template (`{{ prop }}` vs `{{ this.prop }}`). -- Add `PreMount` priority parameter. +- Add `PreMount` priority parameter. -- Add `PostMount` hook component hook to intercept extra props. +- Add `PostMount` hook component hook to intercept extra props. -- Add attributes system that takes extra props passed to `component()` and converts them - into a `ComponentAttributes` object available in your template as `attributes`. +- Add attributes system that takes extra props passed to `component()` and converts them + into a `ComponentAttributes` object available in your template as `attributes`. -- Add `PreRenderEvent` to intercept/manipulate twig template/variables before rendering. +- Add `PreRenderEvent` to intercept/manipulate twig template/variables before rendering. -- Add `ExposeInTemplate` attribute to make non-public properties available in component - templates directly. +- Add `ExposeInTemplate` attribute to make non-public properties available in component + templates directly. -- Add _Computed Properties_ system. +- Add _Computed Properties_ system. ## 2.0.0 -- Support for `stimulus` version 2 was removed and support for `@hotwired/stimulus` - version 3 was added. See the [@symfony/stimulus-bridge CHANGELOG](https://github.com/symfony/stimulus-bridge/blob/main/CHANGELOG.md#300) - for more details. +- Support for `stimulus` version 2 was removed and support for `@hotwired/stimulus` + version 3 was added. See the [@symfony/stimulus-bridge CHANGELOG](https://github.com/symfony/stimulus-bridge/blob/main/CHANGELOG.md#300) + for more details. -- Minimum PHP version was bumped to 8.0 so that PHP 8 attributes could be used. +- Minimum PHP version was bumped to 8.0 so that PHP 8 attributes could be used. -- The `ComponentInterface` was dropped and replaced by the `AsTwigComponent` attribute. - The `getComponentName()` was replaced by a `name` argument to the attribute. +- The `ComponentInterface` was dropped and replaced by the `AsTwigComponent` attribute. + The `getComponentName()` was replaced by a `name` argument to the attribute. Before: @@ -189,13 +189,13 @@ class AlertComponent } ``` -- If you're using a version _lower_ than Symfony 5.3, you will need - to manually tag all component services with `twig.component`. This is - because Symfony 5.3 introduces autoconfiguration for PHP 8 attributes, - which this library leverages. +- If you're using a version _lower_ than Symfony 5.3, you will need + to manually tag all component services with `twig.component`. This is + because Symfony 5.3 introduces autoconfiguration for PHP 8 attributes, + which this library leverages. -- The template for a component can now be controlled via the `template` argument - to the `AsTwigComponent` attribute: +- The template for a component can now be controlled via the `template` argument + to the `AsTwigComponent` attribute: ```php use Symfony\UX\TwigComponent\Attribute\AsTwigComponent; @@ -209,4 +209,4 @@ class AlertComponent ## Pre-Release -- The TwigComponent library was introduced! +- The TwigComponent library was introduced! diff --git a/src/TwigComponent/README.md b/src/TwigComponent/README.md index 0ee4e1dbb..28dfb06a0 100644 --- a/src/TwigComponent/README.md +++ b/src/TwigComponent/README.md @@ -24,10 +24,10 @@ Help Symfony by [sponsoring][3] its development! ## Resources -- [Documentation](https://symfony.com/bundles/ux-twig-component/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-twig-component/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) [1]: https://symfony.com/backers [2]: https://mercure.rocks diff --git a/src/Typed/.github/PULL_REQUEST_TEMPLATE.md b/src/Typed/.github/PULL_REQUEST_TEMPLATE.md index df3b474b4..887284ece 100644 --- a/src/Typed/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/Typed/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/src/Typed/.github/workflows/close-pull-request.yml b/src/Typed/.github/workflows/close-pull-request.yml index 57e4e3fb0..8150a6a6a 100644 --- a/src/Typed/.github/workflows/close-pull-request.yml +++ b/src/Typed/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/src/Typed/.symfony.bundle.yaml b/src/Typed/.symfony.bundle.yaml index 6d9a74acb..5662042f8 100644 --- a/src/Typed/.symfony.bundle.yaml +++ b/src/Typed/.symfony.bundle.yaml @@ -1,3 +1,3 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" +branches: ['2.x'] +maintained_branches: ['2.x'] +doc_dir: 'doc' diff --git a/src/Typed/CHANGELOG.md b/src/Typed/CHANGELOG.md index 24af60584..e2c9d0934 100644 --- a/src/Typed/CHANGELOG.md +++ b/src/Typed/CHANGELOG.md @@ -2,38 +2,38 @@ ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.26.0 -- Deprecate the package +- Deprecate the package ## 2.13.2 -- Revert "Change JavaScript package to `type: module`" +- Revert "Change JavaScript package to `type: module`" ## 2.13.0 -- Change JavaScript package to `type: module` +- Change JavaScript package to `type: module` ## 2.9.0 -- A TypedBundle was added - which allows for integration with symfony/asset-mapper. +- A TypedBundle was added - which allows for integration with symfony/asset-mapper. -- Add support for symfony/asset-mapper +- Add support for symfony/asset-mapper ## 2.7.0 -- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from - installing. +- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from + installing. -- TypeScript types are now included. +- TypeScript types are now included. ## 2.6.0 -- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make - sure the path in your `package.json` file is updated accordingly. +- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make + sure the path in your `package.json` file is updated accordingly. diff --git a/src/Typed/README.md b/src/Typed/README.md index 17352bc94..7a95f9972 100644 --- a/src/Typed/README.md +++ b/src/Typed/README.md @@ -141,10 +141,10 @@ Help Symfony by [sponsoring][3] its development! ## Resources -- [Documentation](https://symfony.com/bundles/ux-typed/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-typed/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) [1]: https://symfony.com/backers [2]: https://mercure.rocks diff --git a/src/Typed/assets/README.md b/src/Typed/assets/README.md index 8fe4c263f..cfc6f4d1a 100644 --- a/src/Typed/assets/README.md +++ b/src/Typed/assets/README.md @@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-typed](https://packagist.org/packages/symfo This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-typed](https://packagist.org/packages/symfony/ux-typed) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. +We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-typed](https://packagist.org/packages/symfony/ux-typed) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-typed](https://packagist.org/packages/symfony/ux-typed) PHP package version: + ```shell composer require symfony/ux-typed:2.23.0 npm add @symfony/ux-typed@2.23.0 @@ -18,7 +19,7 @@ npm add @symfony/ux-typed@2.23.0 ## Resources -- [Documentation](https://symfony.com/bundles/ux-typed/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-typed/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Typed/assets/package.json b/src/Typed/assets/package.json index c54a2b8fc..8ebd37e51 100644 --- a/src/Typed/assets/package.json +++ b/src/Typed/assets/package.json @@ -18,9 +18,7 @@ "build": "tsx ../../../bin/build_package.ts .", "watch": "tsx ../../../bin/build_package.ts . --watch", "test": "pnpm run test:unit", - "test:unit": "../../../bin/unit_test_package.sh .", - "check": "biome check", - "ci": "biome ci" + "test:unit": "../../../bin/unit_test_package.sh ." }, "symfony": { "controllers": { diff --git a/src/Vue/.github/PULL_REQUEST_TEMPLATE.md b/src/Vue/.github/PULL_REQUEST_TEMPLATE.md index df3b474b4..887284ece 100644 --- a/src/Vue/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/Vue/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/src/Vue/.github/workflows/close-pull-request.yml b/src/Vue/.github/workflows/close-pull-request.yml index 57e4e3fb0..8150a6a6a 100644 --- a/src/Vue/.github/workflows/close-pull-request.yml +++ b/src/Vue/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/src/Vue/.symfony.bundle.yaml b/src/Vue/.symfony.bundle.yaml index 6d9a74acb..5662042f8 100644 --- a/src/Vue/.symfony.bundle.yaml +++ b/src/Vue/.symfony.bundle.yaml @@ -1,3 +1,3 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" +branches: ['2.x'] +maintained_branches: ['2.x'] +doc_dir: 'doc' diff --git a/src/Vue/CHANGELOG.md b/src/Vue/CHANGELOG.md index 85639bcc9..4f784629f 100644 --- a/src/Vue/CHANGELOG.md +++ b/src/Vue/CHANGELOG.md @@ -2,49 +2,49 @@ ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.13.2 -- Revert "Change JavaScript package to `type: module`" +- Revert "Change JavaScript package to `type: module`" ## 2.13.0 -- Add Symfony 7 support. -- Change JavaScript package to `type: module` +- Add Symfony 7 support. +- Change JavaScript package to `type: module` ## 2.9.0 -- Replace `symfony/webpack-encore-bundle` by `symfony/stimulus-bundle` in dependencies +- Replace `symfony/webpack-encore-bundle` by `symfony/stimulus-bundle` in dependencies -- Add support for symfony/asset-mapper +- Add support for symfony/asset-mapper -- Minimum PHP version is now 8.1 +- Minimum PHP version is now 8.1 ## 2.7.0 -- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from - installing. +- Add `assets/src` to `.gitattributes` to exclude source TypeScript files from + installing. -- TypeScript types are now included. +- TypeScript types are now included. ## 2.6.0 -- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make - sure the path in your `package.json` file is updated accordingly. +- [BC BREAK] The `assets/` directory was moved from `Resources/assets/` to `assets/`. Make + sure the path in your `package.json` file is updated accordingly. -- The directory structure of the bundle was updated to match modern best-practices. +- The directory structure of the bundle was updated to match modern best-practices. ## 2.5 -- Added support for lazily-loaded Vue components - #482. +- Added support for lazily-loaded Vue components - #482. -- Added `vue:before-mount` JavaScript event - #444. +- Added `vue:before-mount` JavaScript event - #444. ## 2.4 -- Component added +- Component added diff --git a/src/Vue/README.md b/src/Vue/README.md index d58dd8b22..851f3cffb 100644 --- a/src/Vue/README.md +++ b/src/Vue/README.md @@ -20,10 +20,10 @@ Help Symfony by [sponsoring][3] its development! ## Resources -- [Documentation](https://symfony.com/bundles/ux-vue/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-vue/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) [1]: https://symfony.com/backers [2]: https://mercure.rocks diff --git a/src/Vue/assets/README.md b/src/Vue/assets/README.md index 493594078..c94283b5d 100644 --- a/src/Vue/assets/README.md +++ b/src/Vue/assets/README.md @@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-vue](https://packagist.org/packages/symfony This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-vue](https://packagist.org/packages/symfony/ux-vue) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. +We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-vue](https://packagist.org/packages/symfony/ux-vue) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-vue](https://packagist.org/packages/symfony/ux-vue) PHP package version: + ```shell composer require symfony/ux-vue:2.23.0 npm add @symfony/ux-vue@2.23.0 @@ -18,7 +19,7 @@ npm add @symfony/ux-vue@2.23.0 ## Resources -- [Documentation](https://symfony.com/bundles/ux-vue/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-vue/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/src/Vue/assets/package.json b/src/Vue/assets/package.json index 3ad3c6555..f4cb79ec9 100644 --- a/src/Vue/assets/package.json +++ b/src/Vue/assets/package.json @@ -20,9 +20,7 @@ "test": "pnpm run test:unit && pnpm run test:browser", "test:unit": "../../../bin/unit_test_package.sh .", "test:browser": "playwright test", - "test:browser:ui": "playwright test --ui", - "check": "biome check", - "ci": "biome ci" + "test:browser:ui": "playwright test --ui" }, "symfony": { "controllers": { diff --git a/test/playwright-helpers.ts b/test/playwright-helpers.ts index 1b2c70510..6d7353929 100644 --- a/test/playwright-helpers.ts +++ b/test/playwright-helpers.ts @@ -4,12 +4,12 @@ import * as fs from 'fs'; export function getSymfonyKernelVersionId(): number { const kernelPath = path.join(import.meta.dirname, '../apps/e2e/vendor/symfony/http-kernel/Kernel.php'); if (!fs.existsSync(kernelPath)) { - throw new Error(`Unable to read Symfony Kernel version ID, the file "${kernelPath}" does not exist.`) + throw new Error(`Unable to read Symfony Kernel version ID, the file "${kernelPath}" does not exist.`); } - const match = fs.readFileSync(kernelPath, 'utf8').match((/VERSION_ID = (\d+)/)); + const match = fs.readFileSync(kernelPath, 'utf8').match(/VERSION_ID = (\d+)/); if (match === null) { - throw new Error(`Unable to extract Symfony Kernel version ID.`) + throw new Error(`Unable to extract Symfony Kernel version ID.`); } return Number(match[1]); diff --git a/vitest.config.base.mjs b/vitest.config.base.mjs index ea6bc9b1e..00022f1a4 100644 --- a/vitest.config.base.mjs +++ b/vitest.config.base.mjs @@ -17,10 +17,7 @@ import path from 'node:path'; export default defineConfig({ test: { - include: [ - './test/unit/**/*.{test,spec}.(ts|tsx)', - './test/**/*.unit.{test,spec}.(ts|tsx)', - ], + include: ['./test/unit/**/*.{test,spec}.(ts|tsx)', './test/**/*.unit.{test,spec}.(ts|tsx)'], environment: 'jsdom', setupFiles: [path.join(import.meta.dirname, 'test', 'setup.js')], },