Skip to content

Commit 0235b31

Browse files
authored
Merge pull request #1213 from weaverryan/react-vue-svelte-recipes
Adding UX React, Svelte, Vue recipes
2 parents 107c303 + ed822fe commit 0235b31

File tree

9 files changed

+154
-0
lines changed

9 files changed

+154
-0
lines changed

symfony/ux-react/2.8/manifest.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"bundles": {
3+
"Symfony\\UX\\React\\ReactBundle": ["all"]
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import React from 'react';
2+
3+
export default function (props) {
4+
return <div>Hello {props.fullName}</div>;
5+
}

symfony/ux-react/2.9/manifest.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"bundles": {
3+
"Symfony\\UX\\React\\ReactBundle": ["all"]
4+
},
5+
"copy-from-recipe": {
6+
"assets/": "assets/"
7+
},
8+
"conflict": {
9+
"symfony/webpack-encore-bundle": "<2.0",
10+
"symfony/flex": "<1.20.0 || >=2.0.0,<2.3.0"
11+
},
12+
"add-lines": [
13+
{
14+
"file": "webpack.config.js",
15+
"content": "\n .enableReactPreset()",
16+
"position": "after_target",
17+
"target": ".splitEntryChunks()"
18+
},
19+
{
20+
"file": "assets/app.js",
21+
"content": "import { registerReactControllerComponents } from '@symfony/ux-react';",
22+
"position": "top",
23+
"warn_if_missing": true
24+
},
25+
{
26+
"file": "assets/app.js",
27+
"content": "registerReactControllerComponents(require.context('./react/controllers', true, /\\.(j|t)sx?$/));",
28+
"position": "bottom",
29+
"warn_if_missing": true,
30+
"requires": "symfony/webpack-encore-bundle"
31+
},
32+
{
33+
"file": "assets/app.js",
34+
"content": "registerReactControllerComponents();",
35+
"position": "bottom",
36+
"warn_if_missing": true,
37+
"requires": "symfony/asset-mapper"
38+
}
39+
]
40+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"bundles": {
3+
"Symfony\\UX\\Svelte\\SvelteBundle": ["all"]
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script>
2+
export let name = "Svelte";
3+
</script>
4+
5+
<div>Hello {name}</div>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"bundles": {
3+
"Symfony\\UX\\Svelte\\SvelteBundle": ["all"]
4+
},
5+
"copy-from-recipe": {
6+
"assets/": "assets/"
7+
},
8+
"conflict": {
9+
"symfony/webpack-encore-bundle": "<2.0",
10+
"symfony/flex": "<1.20.0 || >=2.0.0,<2.3.0"
11+
},
12+
"add-lines": [
13+
{
14+
"file": "webpack.config.js",
15+
"content": "\n .enableSvelte()",
16+
"position": "after_target",
17+
"target": ".splitEntryChunks()"
18+
},
19+
{
20+
"file": "assets/app.js",
21+
"content": "import { registerSvelteControllerComponents } from '@symfony/ux-svelte';",
22+
"position": "top",
23+
"warn_if_missing": true
24+
},
25+
{
26+
"file": "assets/app.js",
27+
"content": "registerSvelteControllerComponents(require.context('./svelte/controllers', true, /\\.svelte$/));",
28+
"position": "bottom",
29+
"warn_if_missing": true,
30+
"requires": "symfony/webpack-encore-bundle"
31+
},
32+
{
33+
"file": "assets/app.js",
34+
"content": "registerSvelteControllerComponents();",
35+
"position": "bottom",
36+
"warn_if_missing": true,
37+
"requires": "symfony/asset-mapper"
38+
}
39+
]
40+
}

symfony/ux-vue/2.8/manifest.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"bundles": {
3+
"Symfony\\UX\\Vue\\VueBundle": ["all"]
4+
}
5+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<div>Hello {{ name }}!</div>
3+
</template>
4+
5+
<script setup>
6+
defineProps({
7+
name: String
8+
});
9+
</script>

symfony/ux-vue/2.9/manifest.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"bundles": {
3+
"Symfony\\UX\\Vue\\VueBundle": ["all"]
4+
},
5+
"copy-from-recipe": {
6+
"assets/": "assets/"
7+
},
8+
"conflict": {
9+
"symfony/webpack-encore-bundle": "<2.0",
10+
"symfony/flex": "<1.20.0 || >=2.0.0,<2.3.0"
11+
},
12+
"add-lines": [
13+
{
14+
"file": "webpack.config.js",
15+
"content": "\n .enableVueLoader()",
16+
"position": "after_target",
17+
"target": ".splitEntryChunks()"
18+
},
19+
{
20+
"file": "assets/app.js",
21+
"content": "import { registerVueControllerComponents } from '@symfony/ux-vue';",
22+
"position": "top",
23+
"warn_if_missing": true
24+
},
25+
{
26+
"file": "assets/app.js",
27+
"content": "registerVueControllerComponents(require.context('./vue/controllers', true, /\\.vue$/));",
28+
"position": "bottom",
29+
"warn_if_missing": true,
30+
"requires": "symfony/webpack-encore-bundle"
31+
},
32+
{
33+
"file": "assets/app.js",
34+
"content": "registerVueControllerComponents();",
35+
"position": "bottom",
36+
"warn_if_missing": true,
37+
"requires": "symfony/asset-mapper"
38+
}
39+
]
40+
}

0 commit comments

Comments
 (0)