Merge pull request #1213 from weaverryan/react-vue-svelte-recipes

Adding UX React, Svelte, Vue recipes
This commit is contained in:
Fabien Potencier
2023-06-21 08:32:57 +02:00
committed by GitHub
9 changed files with 154 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
{
"bundles": {
"Symfony\\UX\\React\\ReactBundle": ["all"]
}
}
@@ -0,0 +1,5 @@
import React from 'react';
export default function (props) {
return <div>Hello {props.fullName}</div>;
}
+40
View File
@@ -0,0 +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"
}
]
}
+5
View File
@@ -0,0 +1,5 @@
{
"bundles": {
"Symfony\\UX\\Svelte\\SvelteBundle": ["all"]
}
}
@@ -0,0 +1,5 @@
<script>
export let name = "Svelte";
</script>
<div>Hello {name}</div>
+40
View File
@@ -0,0 +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"
}
]
}
+5
View File
@@ -0,0 +1,5 @@
{
"bundles": {
"Symfony\\UX\\Vue\\VueBundle": ["all"]
}
}
@@ -0,0 +1,9 @@
<template>
<div>Hello {{ name }}!</div>
</template>
<script setup>
defineProps({
name: String
});
</script>
+40
View File
@@ -0,0 +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"
}
]
}