diff --git a/assets/app.js b/assets/app.js deleted file mode 100644 index 8725cc5..0000000 --- a/assets/app.js +++ /dev/null @@ -1,10 +0,0 @@ -import './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! 🎉'); diff --git a/assets/app.tsx b/assets/app.tsx new file mode 100644 index 0000000..fca53fd --- /dev/null +++ b/assets/app.tsx @@ -0,0 +1,4 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; + +ReactDOM.render(
, document.getElementById('root')); diff --git a/assets/bootstrap.js b/assets/bootstrap.js deleted file mode 100644 index d4e50c9..0000000 --- a/assets/bootstrap.js +++ /dev/null @@ -1,5 +0,0 @@ -import { startStimulusApp } from '@symfony/stimulus-bundle'; - -const app = startStimulusApp(); -// register any custom, 3rd party controllers here -// app.register('some_controller_name', SomeImportedController); diff --git a/assets/controllers.json b/assets/controllers.json deleted file mode 100644 index 29ea244..0000000 --- a/assets/controllers.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "controllers": { - "@symfony/ux-turbo": { - "turbo-core": { - "enabled": true, - "fetch": "eager" - }, - "mercure-turbo-stream": { - "enabled": false, - "fetch": "eager" - } - } - }, - "entrypoints": [] -} diff --git a/assets/controllers/hello_controller.js b/assets/controllers/hello_controller.js deleted file mode 100644 index e847027..0000000 --- a/assets/controllers/hello_controller.js +++ /dev/null @@ -1,16 +0,0 @@ -import { Controller } from '@hotwired/stimulus'; - -/* - * This is an example Stimulus controller! - * - * Any element with a data-controller="hello" attribute will cause - * this controller to be executed. The name "hello" comes from the filename: - * hello_controller.js -> "hello" - * - * Delete this file or adapt it for your use! - */ -export default class extends Controller { - connect() { - this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js'; - } -} diff --git a/assets/styles/app.css b/assets/styles/app.css deleted file mode 100644 index dd6181a..0000000 --- a/assets/styles/app.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - background-color: skyblue; -} diff --git a/package.json b/package.json index e7261ec..40231d8 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,12 @@ "devDependencies": { "@babel/core": "^7.17.0", "@babel/preset-env": "^7.16.0", - "@symfony/webpack-encore": "^4.0.0", + "@babel/preset-react": "^7.24.7", + "@symfony/webpack-encore": "^4.6.1", "core-js": "^3.23.0", "regenerator-runtime": "^0.13.9", + "ts-loader": "^9.5.1", + "typescript": "^5.5.3", "webpack": "^5.74.0", "webpack-cli": "^4.10.0", "webpack-notifier": "^1.15.0" @@ -31,5 +34,9 @@ "tracking", "watchdog", "API" - ] + ], + "dependencies": { + "react": "^18.3.1", + "react-dom": "^18.3.1" + } } diff --git a/src/Controller/HomeController.php b/src/Controller/HomeController.php new file mode 100644 index 0000000..79f3465 --- /dev/null +++ b/src/Controller/HomeController.php @@ -0,0 +1,19 @@ +render('base.html.twig'); + } + + +} \ No newline at end of file diff --git a/templates/base.html.twig b/templates/base.html.twig index b081615..d36780e 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -2,17 +2,15 @@ -