mirror of
https://github.com/symfony/recipes.git
synced 2026-09-18 02:26:31 +03:00
Merge pull request #1213 from weaverryan/react-vue-svelte-recipes
Adding UX React, Svelte, Vue recipes
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Symfony\\UX\\Svelte\\SvelteBundle": ["all"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<script>
|
||||
export let name = "Svelte";
|
||||
</script>
|
||||
|
||||
<div>Hello {name}</div>
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user