recipes icon indicating copy to clipboard operation
recipes copied to clipboard

[symfony/ux-*] add aliases

Open kbond opened this issue 5 months ago • 3 comments

Q A
License MIT
Doc issue/PR n/a

kbond avatar Jun 10 '25 19:06 kbond

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1429/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1429/index.json
    
  2. Install the package(s) related to this recipe:

    composer req symfony/flex
    composer req 'symfony/ux-live-component:^2.6' 'symfony/ux-turbo:^2.20' 'symfony/ux-twig-component:^2.13'
    
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=
    

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. I'm going keep this comment up to date with any updates of the attached patch.

symfony/ux-live-component

2.0 vs 2.6
diff --git a/symfony/ux-live-component/2.0/config/routes/ux_live_component.yaml b/symfony/ux-live-component/2.6/config/routes/ux_live_component.yaml
index e4e401f..e56523a 100644
--- a/symfony/ux-live-component/2.0/config/routes/ux_live_component.yaml
+++ b/symfony/ux-live-component/2.6/config/routes/ux_live_component.yaml
@@ -1,4 +1,5 @@
 live_component:
-    resource: '@LiveComponentBundle/Resources/config/routing/live_component.xml'
-    # uncomment to add localization to your components
-    #prefix: '/{_locale}'
+    resource: '@LiveComponentBundle/config/routes.php'
+    prefix: '/_components'
+    # adjust prefix to add localization to your components
+    #prefix: '/{_locale}/_components'
diff --git a/symfony/ux-live-component/2.0/manifest.json b/symfony/ux-live-component/2.6/manifest.json
index 5a817ee..dac5c07 100644
--- a/symfony/ux-live-component/2.0/manifest.json
+++ b/symfony/ux-live-component/2.6/manifest.json
@@ -2,6 +2,7 @@
     "bundles": {
         "Symfony\\UX\\LiveComponent\\LiveComponentBundle": ["all"]
     },
+    "aliases": ["live-component", "live-components"],
     "copy-from-recipe": {
         "config/": "%CONFIG_DIR%/"
     }

symfony/ux-turbo

2.19 vs 2.20
diff --git a/symfony/ux-turbo/2.19/manifest.json b/symfony/ux-turbo/2.20/manifest.json
index 1fa03bf..c3f7acd 100644
--- a/symfony/ux-turbo/2.19/manifest.json
+++ b/symfony/ux-turbo/2.20/manifest.json
@@ -1,5 +1,18 @@
 {
     "bundles": {
         "Symfony\\UX\\Turbo\\TurboBundle": ["all"]
-    }
+    },
+    "aliases": ["turbo"],
+    "conflict": {
+        "symfony/framework-bundle": "<7.2",
+        "symfony/security-csrf": "<7.2"
+    },
+    "add-lines": [
+        {
+            "file": "config/packages/framework.yaml",
+            "position": "after_target",
+            "target": "        csrf_protection:",
+            "content": "            check_header: true"
+        }
+    ]
 }

github-actions[bot] avatar Jun 10 '25 19:06 github-actions[bot]

Can we add aliases for other UX packages? 😇

Kocal avatar Jun 10 '25 19:06 Kocal

Can we add aliases for other UX packages? 😇

I thought about it but wasn't sure on the others

  • "map" felt to short
  • "translator" - too close to symfony/translation
  • "autocomplete" maybe?

Keep in mind, dropping the symfony/ works: composer require ux-map

kbond avatar Jun 10 '25 19:06 kbond