chore: remove asset-mapper, install vite-bundle and ux-react

This commit is contained in:
thibaud-leclere
2026-03-28 13:11:09 +01:00
parent 8af386bd5c
commit bd3996f4a9
15 changed files with 240 additions and 244 deletions

7
.gitignore vendored
View File

@@ -1,4 +1,3 @@
###> symfony/framework-bundle ###
/.env.local
/.env.local.php
@@ -13,10 +12,4 @@
/phpunit.xml
/.phpunit.cache/
###< phpunit/phpunit ###
###> symfony/asset-mapper ###
/public/assets/
/assets/vendor/
###< symfony/asset-mapper ###
/.idea/

View File

@@ -1,10 +0,0 @@
import './stimulus_bootstrap.js';
/*
* Welcome to your app's main JavaScript file!
*
* This file will be included onto the page via the importmap() Twig function,
* which should already be in your base.html.twig.
*/
import './styles/app.css';
console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉');

View File

@@ -0,0 +1,5 @@
import React from 'react';
export default function (props) {
return <div>Hello {props.fullName}</div>;
}

View File

@@ -1,9 +0,0 @@
body {
background-color: skyblue;
font-family: 'Noto Sans', sans-serif;
}
#actors td {
width: 16px;
height: 16px;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

22
assets/vendor/installed.php vendored Normal file
View File

@@ -0,0 +1,22 @@
<?php return array (
'@hotwired/stimulus' =>
array (
'version' => '3.2.2',
'dependencies' =>
array (
),
'extraFiles' =>
array (
),
),
'@hotwired/turbo' =>
array (
'version' => '7.3.0',
'dependencies' =>
array (
),
'extraFiles' =>
array (
),
),
);

View File

@@ -10,10 +10,10 @@
"doctrine/doctrine-bundle": "^3.2",
"doctrine/doctrine-migrations-bundle": "^4.0",
"doctrine/orm": "^3.6",
"pentatrion/vite-bundle": "^8.2",
"phpdocumentor/reflection-docblock": "^6.0",
"phpstan/phpdoc-parser": "^2.3",
"symfony/asset": "8.0.*",
"symfony/asset-mapper": "8.0.*",
"symfony/cache": "8.0.*",
"symfony/console": "8.0.*",
"symfony/doctrine-messenger": "8.0.*",
@@ -38,6 +38,7 @@
"symfony/string": "8.0.*",
"symfony/translation": "8.0.*",
"symfony/twig-bundle": "8.0.*",
"symfony/ux-react": "^2.34",
"symfony/ux-turbo": "^2.32",
"symfony/validator": "8.0.*",
"symfony/web-link": "8.0.*",
@@ -79,8 +80,7 @@
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"importmap:install": "symfony-cmd"
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"

301
composer.lock generated
View File

@@ -4,85 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c7440a2e3322d18c43b59a7aa236524b",
"content-hash": "b7a68491821af0428e8aaf05764167ac",
"packages": [
{
"name": "composer/semver",
"version": "3.4.4",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
"reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95",
"reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"symfony/phpunit-bridge": "^3 || ^7"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"Composer\\Semver\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nils Adermann",
"email": "naderman@naderman.de",
"homepage": "http://www.naderman.de"
},
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
},
{
"name": "Rob Bast",
"email": "rob.bast@gmail.com",
"homepage": "http://robbast.nl"
}
],
"description": "Semver library that offers utilities, version constraint parsing and validation.",
"keywords": [
"semantic",
"semver",
"validation",
"versioning"
],
"support": {
"irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/semver/issues",
"source": "https://github.com/composer/semver/tree/3.4.4"
},
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
}
],
"time": "2025-08-20T19:15:30+00:00"
},
{
"name": "doctrine/collections",
"version": "2.5.1",
@@ -1366,6 +1289,67 @@
],
"time": "2026-01-02T08:56:05+00:00"
},
{
"name": "pentatrion/vite-bundle",
"version": "v8.2.4",
"source": {
"type": "git",
"url": "https://github.com/lhapaipai/vite-bundle.git",
"reference": "80a5391af3a924597d65e7c81a4b28d212fea5fe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/lhapaipai/vite-bundle/zipball/80a5391af3a924597d65e7c81a4b28d212fea5fe",
"reference": "80a5391af3a924597d65e7c81a4b28d212fea5fe",
"shasum": ""
},
"require": {
"php": "^8.0",
"symfony/asset": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"symfony/config": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"symfony/http-client": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.9",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-symfony": "^1.3",
"phpunit/phpunit": "^9.5",
"symfony/phpunit-bridge": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"symfony/web-link": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0"
},
"type": "symfony-bundle",
"autoload": {
"psr-4": {
"Pentatrion\\ViteBundle\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Hugues Tavernier",
"email": "hugues.tavernier@protonmail.com"
}
],
"description": "Vite integration for your Symfony app",
"keywords": [
"bundle",
"symfony",
"vite",
"vitejs"
],
"support": {
"issues": "https://github.com/lhapaipai/vite-bundle/issues",
"source": "https://github.com/lhapaipai/vite-bundle/tree/v8.2.4"
},
"time": "2026-03-22T11:41:50+00:00"
},
{
"name": "phpdocumentor/reflection-common",
"version": "2.2.0",
@@ -1965,87 +1949,6 @@
],
"time": "2025-08-04T07:36:47+00:00"
},
{
"name": "symfony/asset-mapper",
"version": "v8.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/asset-mapper.git",
"reference": "87c12734877c97ac7274ad145592a2c7efcfa34f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/asset-mapper/zipball/87c12734877c97ac7274ad145592a2c7efcfa34f",
"reference": "87c12734877c97ac7274ad145592a2c7efcfa34f",
"shasum": ""
},
"require": {
"composer/semver": "^3.0",
"php": ">=8.4",
"symfony/filesystem": "^7.4|^8.0",
"symfony/http-client": "^7.4|^8.0"
},
"require-dev": {
"symfony/asset": "^7.4|^8.0",
"symfony/browser-kit": "^7.4|^8.0",
"symfony/console": "^7.4|^8.0",
"symfony/event-dispatcher-contracts": "^3.0",
"symfony/finder": "^7.4|^8.0",
"symfony/framework-bundle": "^7.4|^8.0",
"symfony/http-foundation": "^7.4|^8.0",
"symfony/http-kernel": "^7.4|^8.0",
"symfony/process": "^7.4|^8.0",
"symfony/runtime": "^7.4|^8.0",
"symfony/web-link": "^7.4|^8.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\AssetMapper\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Maps directories of assets & makes them available in a public directory with versioned filenames.",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/asset-mapper/tree/v8.0.3"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2025-12-19T10:01:18+00:00"
},
{
"name": "symfony/cache",
"version": "v8.0.3",
@@ -6803,6 +6706,86 @@
],
"time": "2025-12-05T14:08:45+00:00"
},
{
"name": "symfony/ux-react",
"version": "v2.34.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/ux-react.git",
"reference": "42ee2b86e3af8493e4a008ebe2af166c2c3d4d05"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/ux-react/zipball/42ee2b86e3af8493e4a008ebe2af166c2c3d4d05",
"reference": "42ee2b86e3af8493e4a008ebe2af166c2c3d4d05",
"shasum": ""
},
"require": {
"php": ">=8.1",
"symfony/stimulus-bundle": "^2.9.1"
},
"require-dev": {
"symfony/asset-mapper": "^6.3|^7.0|^8.0",
"symfony/finder": "^5.4|^6.0|^7.0|^8.0",
"symfony/framework-bundle": "^5.4|^6.0|^7.0|^8.0",
"symfony/phpunit-bridge": "^5.4|^6.0|^7.0|^8.0",
"symfony/twig-bundle": "^5.4|^6.0|^7.0|^8.0",
"symfony/var-dumper": "^5.4|^6.0|^7.0|^8.0"
},
"type": "symfony-bundle",
"extra": {
"thanks": {
"url": "https://github.com/symfony/ux",
"name": "symfony/ux"
}
},
"autoload": {
"psr-4": {
"Symfony\\UX\\React\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Titouan Galopin",
"email": "galopintitouan@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Integration of React in Symfony",
"homepage": "https://symfony.com",
"keywords": [
"symfony-ux"
],
"support": {
"source": "https://github.com/symfony/ux-react/tree/v2.34.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2026-03-21T22:29:11+00:00"
},
{
"name": "symfony/ux-turbo",
"version": "v2.32.0",

View File

@@ -13,4 +13,5 @@ return [
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Symfony\UX\React\ReactBundle::class => ['all' => true],
];

View File

@@ -1,11 +0,0 @@
framework:
asset_mapper:
# The paths to make available to the asset mapper.
paths:
- assets/
missing_import_mode: strict
when@prod:
framework:
asset_mapper:
missing_import_mode: warn

View File

@@ -280,7 +280,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
* }>,
* },
* asset_mapper?: bool|array{ // Asset Mapper configuration
* enabled?: bool|Param, // Default: true
* enabled?: bool|Param, // Default: false
* paths?: array<string, scalar|null|Param>,
* excluded_patterns?: list<scalar|null|Param>,
* exclude_dotfiles?: bool|Param, // If true, any files starting with "." will be excluded from the asset mapper. // Default: true
@@ -1455,6 +1455,10 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
* generate_final_classes?: bool|Param, // Default: true
* generate_final_entities?: bool|Param, // Default: false
* }
* @psalm-type ReactConfig = array{
* controllers_path?: scalar|null|Param, // The path to the directory where React controller components are stored - relevant only when using symfony/asset-mapper. // Default: "%kernel.project_dir%/assets/react/controllers"
* name_glob?: list<scalar|null|Param>,
* }
* @psalm-type ConfigType = array{
* imports?: ImportsConfig,
* parameters?: ParametersConfig,
@@ -1468,6 +1472,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
* twig_extra?: TwigExtraConfig,
* security?: SecurityConfig,
* monolog?: MonologConfig,
* react?: ReactConfig,
* "when@dev"?: array{
* imports?: ImportsConfig,
* parameters?: ParametersConfig,
@@ -1484,6 +1489,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
* security?: SecurityConfig,
* monolog?: MonologConfig,
* maker?: MakerConfig,
* react?: ReactConfig,
* },
* "when@prod"?: array{
* imports?: ImportsConfig,
@@ -1498,6 +1504,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
* twig_extra?: TwigExtraConfig,
* security?: SecurityConfig,
* monolog?: MonologConfig,
* react?: ReactConfig,
* },
* "when@test"?: array{
* imports?: ImportsConfig,
@@ -1513,6 +1520,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
* twig_extra?: TwigExtraConfig,
* security?: SecurityConfig,
* monolog?: MonologConfig,
* react?: ReactConfig,
* },
* ...<string, ExtensionType|array{ // extra keys must follow the when@%env% pattern or match an extension alias
* imports?: ImportsConfig,

View File

@@ -1,28 +0,0 @@
<?php
/**
* Returns the importmap for this application.
*
* - "path" is a path inside the asset mapper system. Use the
* "debug:asset-map" command to see the full list of paths.
*
* - "entrypoint" (JavaScript only) set to true for any module that will
* be used as an "entrypoint" (and passed to the importmap() Twig function).
*
* The "importmap:require" command can be used to add new entries to this file.
*/
return [
'app' => [
'path' => './assets/app.js',
'entrypoint' => true,
],
'@hotwired/stimulus' => [
'version' => '3.2.2',
],
'@symfony/stimulus-bundle' => [
'path' => './vendor/symfony/stimulus-bundle/assets/dist/loader.js',
],
'@hotwired/turbo' => [
'version' => '7.3.0',
],
];

View File

@@ -35,6 +35,15 @@
"migrations/.gitignore"
]
},
"pentatrion/vite-bundle": {
"version": "8.2",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "main",
"version": "6.5",
"ref": "3a6673f248f8fc1dd364dadfef4c5b381d1efab6"
}
},
"phpunit/phpunit": {
"version": "12.5",
"recipe": {
@@ -50,21 +59,6 @@
"bin/phpunit"
]
},
"symfony/asset-mapper": {
"version": "8.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "6.4",
"ref": "5ad1308aa756d58f999ffbe1540d1189f5d7d14a"
},
"files": [
"assets/app.js",
"assets/styles/app.css",
"config/packages/asset_mapper.yaml",
"importmap.php"
]
},
"symfony/console": {
"version": "8.0",
"recipe": {
@@ -270,6 +264,18 @@
"templates/base.html.twig"
]
},
"symfony/ux-react": {
"version": "2.34",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "2.9",
"ref": "e970076b31d602ae6e2106cf91a82c7e1f7ddff2"
},
"files": [
"assets/react/controllers/Hello.jsx"
]
},
"symfony/ux-turbo": {
"version": "2.32",
"recipe": {

View File

@@ -8,7 +8,6 @@
{% endblock %}
{% block javascripts %}
{% block importmap %}{{ importmap('app') }}{% endblock %}
{% endblock %}
</head>
<body>