Skip to content

Adding UX React, Svelte, Vue recipes #1213

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 21, 2023

Conversation

weaverryan
Copy link
Member

Q A
License MIT
Doc issue/PR None

Some manual things don't need to be manual anymore.

@github-actions
Copy link

github-actions bot commented Jun 7, 2023

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-1213/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1213/index.json
  2. Install the package(s) related to this recipe:

    composer req 'symfony/flex:^1.16'
    composer req 'symfony/ux-react:^2.9' 'symfony/ux-svelte:^2.9' 'symfony/ux-vue:^2.9'
  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-react

2.8 vs 2.9
diff --git a/symfony/ux-react/2.9/assets/react/controllers/Hello.jsx b/symfony/ux-react/2.9/assets/react/controllers/Hello.jsx
new file mode 100644
index 0000000..54fe368
--- /dev/null
+++ b/symfony/ux-react/2.9/assets/react/controllers/Hello.jsx
@@ -0,0 +1,5 @@
+import React from 'react';
+
+export default function (props) {
+    return <div>Hello {props.fullName}</div>;
+}
diff --git a/symfony/ux-react/2.8/manifest.json b/symfony/ux-react/2.9/manifest.json
index be0ff74..444d845 100644
--- a/symfony/ux-react/2.8/manifest.json
+++ b/symfony/ux-react/2.9/manifest.json
@@ -1,5 +1,40 @@
 {
     "bundles": {
         "Symfony\\UX\\React\\ReactBundle": ["all"]
-    }
+    },
+    "copy-from-recipe": {
+        "assets/": "assets/"
+    },
+    "conflict": {
+        "symfony/webpack-encore-bundle": "<2.0",
+        "symfony/flex": "<1.20.0 || >=2.0.0,<2.3.0"
+    },
+    "add-lines": [
+        {
+            "file": "webpack.config.js",
+            "content": "\n    .enableReactPreset()",
+            "position": "after_target",
+            "target": ".splitEntryChunks()"
+        },
+        {
+            "file": "assets/app.js",
+            "content": "import { registerReactControllerComponents } from '@symfony/ux-react';",
+            "position": "top",
+            "warn_if_missing": true
+        },
+        {
+            "file": "assets/app.js",
+            "content": "registerReactControllerComponents(require.context('./react/controllers', true, /\\.(j|t)sx?$/));",
+            "position": "bottom",
+            "warn_if_missing": true,
+            "requires": "symfony/webpack-encore-bundle"
+        },
+        {
+            "file": "assets/app.js",
+            "content": "registerReactControllerComponents();",
+            "position": "bottom",
+            "warn_if_missing": true,
+            "requires": "symfony/asset-mapper"
+        }
+    ]
 }

symfony/ux-svelte

2.8 vs 2.9
diff --git a/symfony/ux-svelte/2.9/assets/svelte/controllers/Hello.svelte b/symfony/ux-svelte/2.9/assets/svelte/controllers/Hello.svelte
new file mode 100644
index 0000000..3499af4
--- /dev/null
+++ b/symfony/ux-svelte/2.9/assets/svelte/controllers/Hello.svelte
@@ -0,0 +1,5 @@
+<script>
+    export let name = "Svelte";
+</script>
+
+<div>Hello {name}</div>
diff --git a/symfony/ux-svelte/2.8/manifest.json b/symfony/ux-svelte/2.9/manifest.json
index 7c82371..c5e3457 100644
--- a/symfony/ux-svelte/2.8/manifest.json
+++ b/symfony/ux-svelte/2.9/manifest.json
@@ -1,5 +1,40 @@
 {
     "bundles": {
         "Symfony\\UX\\Svelte\\SvelteBundle": ["all"]
-    }
+    },
+    "copy-from-recipe": {
+        "assets/": "assets/"
+    },
+    "conflict": {
+        "symfony/webpack-encore-bundle": "<2.0",
+        "symfony/flex": "<1.20.0 || >=2.0.0,<2.3.0"
+    },
+    "add-lines": [
+        {
+            "file": "webpack.config.js",
+            "content": "\n    .enableSvelte()",
+            "position": "after_target",
+            "target": ".splitEntryChunks()"
+        },
+        {
+            "file": "assets/app.js",
+            "content": "import { registerSvelteControllerComponents } from '@symfony/ux-svelte';",
+            "position": "top",
+            "warn_if_missing": true
+        },
+        {
+            "file": "assets/app.js",
+            "content": "registerSvelteControllerComponents(require.context('./svelte/controllers', true, /\\.svelte$/));",
+            "position": "bottom",
+            "warn_if_missing": true,
+            "requires": "symfony/webpack-encore-bundle"
+        },
+        {
+            "file": "assets/app.js",
+            "content": "registerSvelteControllerComponents();",
+            "position": "bottom",
+            "warn_if_missing": true,
+            "requires": "symfony/asset-mapper"
+        }
+    ]
 }

symfony/ux-vue

2.8 vs 2.9
diff --git a/symfony/ux-vue/2.9/assets/vue/controllers/Hello.vue b/symfony/ux-vue/2.9/assets/vue/controllers/Hello.vue
new file mode 100644
index 0000000..2812aa4
--- /dev/null
+++ b/symfony/ux-vue/2.9/assets/vue/controllers/Hello.vue
@@ -0,0 +1,9 @@
+<template>
+    <div>Hello {{ name }}!</div>
+</template>
+
+<script setup>
+    defineProps({
+        name: String
+    });
+</script>
diff --git a/symfony/ux-vue/2.8/manifest.json b/symfony/ux-vue/2.9/manifest.json
index 9010c6f..2682a62 100644
--- a/symfony/ux-vue/2.8/manifest.json
+++ b/symfony/ux-vue/2.9/manifest.json
@@ -1,5 +1,40 @@
 {
     "bundles": {
         "Symfony\\UX\\Vue\\VueBundle": ["all"]
-    }
+    },
+    "copy-from-recipe": {
+        "assets/": "assets/"
+    },
+    "conflict": {
+        "symfony/webpack-encore-bundle": "<2.0",
+        "symfony/flex": "<1.20.0 || >=2.0.0,<2.3.0"
+    },
+    "add-lines": [
+        {
+            "file": "webpack.config.js",
+            "content": "\n    .enableVueLoader()",
+            "position": "after_target",
+            "target": ".splitEntryChunks()"
+        },
+        {
+            "file": "assets/app.js",
+            "content": "import { registerVueControllerComponents } from '@symfony/ux-vue';",
+            "position": "top",
+            "warn_if_missing": true
+        },
+        {
+            "file": "assets/app.js",
+            "content": "registerVueControllerComponents(require.context('./vue/controllers', true, /\\.vue$/));",
+            "position": "bottom",
+            "warn_if_missing": true,
+            "requires": "symfony/webpack-encore-bundle"
+        },
+        {
+            "file": "assets/app.js",
+            "content": "registerVueControllerComponents();",
+            "position": "bottom",
+            "warn_if_missing": true,
+            "requires": "symfony/asset-mapper"
+        }
+    ]
 }

@weaverryan weaverryan marked this pull request as ready for review June 7, 2023 19:28
@weaverryan weaverryan changed the title [WIP] Adding UX React, Svelte, Vue recipes Adding UX React, Svelte, Vue recipes Jun 7, 2023
@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) June 7, 2023 19:48
@weaverryan
Copy link
Member Author

This is ready for review!

@weaverryan
Copy link
Member Author

weaverryan commented Jun 13, 2023

Post-merge, I'll simplify the docs for the affected UX packages.

@fabpot fabpot disabled auto-merge June 21, 2023 06:32
@fabpot fabpot merged commit 0235b31 into symfony:main Jun 21, 2023
@weaverryan weaverryan deleted the react-vue-svelte-recipes branch June 21, 2023 13:27
weaverryan added a commit to weaverryan/ux that referenced this pull request Jun 26, 2023
weaverryan added a commit to weaverryan/ux that referenced this pull request Jun 28, 2023
weaverryan added a commit to symfony/ux that referenced this pull request Jun 28, 2023
This PR was squashed before being merged into the 2.x branch.

Discussion
----------

Updating documentation for newly merged recipes

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Tickets       | None
| License       | MIT

See symfony/recipes#1213

Commits
-------

cf6a9bd Updating documentation for newly merged recipes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants