Symfony与React集成示例:同构渲染与Webpack Encore

Symfony React 沙盒

这个示例展示了如何将 Symfony 与 React 进行整合,实现服务器端与客户端的同构渲染,并使用了 Webpack Encore 进行构建。此外,它还演示了如何利用 Symfony 表单生成 JSON Schema,并在 React 中进行表单渲染和验证。

重点功能:

  • 同构渲染: 提升首屏加载速度和 SEO 优化
  • Webpack Encore 集成: 简化前端资源管理
  • Symfony 表单与 React 集成: 简化表单处理和验证

适用场景:

  • 需要优化首屏加载速度和 SEO 的项目
  • 希望使用 React 进行复杂用户界面开发的项目
  • 需要在 Symfony 和 React 之间共享表单数据的项目

注意:

将 React 与 Symfony 集成并非一定要使用特定的沙盒或 bundle,这个示例主要展示了一些高级功能的实现方式,例如同构渲染、表单集成和 Twig 标签注入组件等。

zip
symfony-react-sandbox-master.zip 预估大小:99个文件
folder
symfony-react-sandbox-master 文件夹
file
.eslintrc 29B
file
external-server.js 2KB
folder
public 文件夹
folder
images 文件夹
file
paella.jpg 24KB
file
carbonara.jpg 24KB
file
2c9ea89a631a24ff09c1b94e120ac523.jpeg 70KB
file
sushi.jpg 24KB
file
falafel.jpg 23KB
folder
build 文件夹
file
manifest.json 833B
file
index.php 1KB
file
yarn.lock 369KB
file
webpack.config.js 823B
folder
src 文件夹
file
Kernel.php 2KB
folder
Controller 文件夹
file
RecipeController.php 2KB
file
ApiController.php 1KB
file
AdminController.php 4KB
folder
.gitignore 文件夹
folder
EventListener 文件夹
file
ImageUploadListener.php 1KB
folder
Entity 文件夹
file
Recipe.php 2KB
folder
.gitignore 文件夹
folder
Repository 文件夹
file
RecipeRepository.php 229B
folder
.gitignore 文件夹
folder
Migrations 文件夹
folder
.gitignore 文件夹
folder
Form 文件夹
folder
Type 文件夹
file
RecipeType.php 986B
folder
DataTransformer 文件夹
file
FileToDataUriTransformer.php 1KB
folder
DataFixtures 文件夹
folder
ORM 文件夹
file
recipes.yml 432B
file
Recipes.php 2KB
folder
.gitignore 文件夹
folder
config 文件夹
file
services.yaml 2KB
file
bundles.php 1KB
folder
jwt 文件夹
file
public.pem 800B
file
private.pem 3KB
folder
packages 文件夹
file
doctrine_migrations.yaml 233B
file
security.yaml 2KB
file
assets.yaml 101B
file
translation.yaml 167B
file
lexik_jwt_authentication.yaml 217B
file
twig.yaml 119B
folder
prod 文件夹
file
doctrine.yaml 882B
file
limenius_react.yaml 114B
file
framework.yaml 496B
folder
test 文件夹
file
framework.yaml 138B
file
doctrine.yaml 885B
file
routing.yaml 54B
file
webpack_encore.yaml 190B
file
limenius_react.yaml 1KB
folder
dev 文件夹
file
routing.yaml 57B
file
routes.yaml 300B
folder
routes 文件夹
file
annotations.yaml 70B
folder
dev 文件夹
file
twig.yaml 93B
file
LICENSE 1KB
folder
assets 文件夹
folder
js 文件夹
folder
common 文件夹
folder
components 文件夹
file
RecipeSearchList.js 1KB
file
Recipe.js 536B
file
RecipeList.js 378B
folder
recipes 文件夹
folder
containers 文件夹
file
Recipes.js 1KB
file
Recipe.js 2KB
folder
startup 文件夹
file
registration.js 119B
file
Entry.js 1KB
file
RecipesApp.js 610B
file
entryPoint.js 128B
folder
recipes-redux 文件夹
folder
constants 文件夹
file
recipesConstants.js 205B
folder
store 文件夹
file
RecipesStore.js 1KB
folder
containers 文件夹
file
recipe.js 1KB
file
root.js 350B
file
recipes.js 961B
folder
actions 文件夹
file
recipesActions.js 724B
folder
reducers 文件夹
file
recipesReducer.js 786B
file
index.js 314B
folder
startup 文件夹
file
registration.js 268B
file
RecipesApp.js 1KB
file
clientSideEntryPoint.js 117B
folder
liform 文件夹
folder
constants 文件夹
file
recipesConstants.js 263B
folder
store 文件夹
file
configureStore.js 1007B
folder
components 文件夹
file
AdminForm.js 2KB
file
Login.js 2KB
file
RecipeList.js 298B
file
App.js 293B
folder
actions 文件夹
file
index.js 2KB
folder
reducers 文件夹
file
recipesReducer.js 847B
file
index.js 388B
folder
startup 文件夹
file
registration.js 264B
file
Admin.js 338B
folder
.gitignore 文件夹
folder
sass 文件夹
file
layout.scss 326B
file
composer.lock 235KB
file
README.md 12KB
file
.env.dist 1KB
file
symfony.lock 9KB
file
webpack.config.serverside.js 662B
folder
translations 文件夹
folder
.gitignore 文件夹
folder
templates 文件夹
folder
admin 文件夹
file
index.html.twig 230B
folder
recipe 文件夹
file
recipe.html.twig 270B
file
home.html.twig 270B
folder
recipe-redux 文件夹
file
recipe.html.twig 153B
file
home.html.twig 153B
file
base.html.twig 2KB
file
.gitignore 345B
folder
bin 文件夹
file
console 1KB
file
package.json 2KB
file
composer.json 2KB
...
zip 文件大小:378.68KB