Replies: 6 comments 3 replies
-
I'm game for it. Anything to simplify the deployment process. |
Beta Was this translation helpful? Give feedback.
-
Yeah, right?! You start out saying "just download php and a database" and end up with "and node and yarn or npm but not both, then run a background process to watch the files while you're developing, unless they're in a bundle, where you have to also reinstall the assets...." I've been playing with AssetMapper a lot. The big step is that it's not compatible with Webpack, so it's not a quick fix. But your code looks like it's going to be straightforward to migrate. |
Beta Was this translation helpful? Give feedback.
-
The pages that only require bootstrap are working nicely -- no build step! https://github.com/tacman/member-directory check out the assetmapper branch and composer install. Can you get fos js routing working on the /map page? It requires running the console command to dump the commands as javascript (not json) then loading the library and of course the routes. I'm pretty sure there's a way to do it, but I haven't figured it out. Discussion at |
Beta Was this translation helpful? Give feedback.
-
I tweaked my branch so that most of the pages work with sqlite, to really simplify the development setup. Now you don't even need to setup a database or run docker. git clone [email protected]:tacman/member-directory.git --branch sy64-with-assetmapper && cd member-directory
echo "DATABASE_URL=sqlite:///%kernel.project_dir%/var/data.db" > .env.local
composer install
bin/console importmap:install
bin/console doctrine:schema:update --force --complete
bin/console doctrine:fixtures:load -n
symfony server:start -d
symfony open:local login as [email protected] (password: testing) and enjoy! TodosIdeally member-directory would support MySQL, Postgres and sqlite. I think the date functions can be refactored to not have a dependency on the DATE_FORMAT function, or really any database-specific functions. dql:
datetime_functions:
convert_tz: DoctrineExtensions\Query\Mysql\ConvertTz
date: DoctrineExtensions\Query\Mysql\Date
date_format: DoctrineExtensions\Query\Mysql\DateFormat The javascript files need to move to importmap, setting entryPoint to true, and changing all the 'require' statements to import. And the packages from packages.json need to be reinstalled as importmap, e.g. bin/console importmap:require gravatar hotkeys-js It looks like you already have FosJsRouting being loaded with the callback in login.html.twig, I commented them out because I wasn't sure how to do it. {# <script src="{{ asset('bundles/fosjsrouting/js/router.min.js') }}"></script>#}
{# <script src="{{ path('fos_js_routing_js', { callback: 'fos.Router.setData' }) }}"></script>#}
{{ importmap('app') }} |
Beta Was this translation helpful? Give feedback.
-
If we really wanted to simplify setup, this repo could include the sqlite file, so that you could download and run without installing the fixtures. That's how the Symfony Demo app works. |
Beta Was this translation helpful? Give feedback.
-
I fixed the date functions (DATE_FORMAT, MONTH and DAY) to use SUBSTRING, which I think is portable across databases. |
Beta Was this translation helpful? Give feedback.
-
This package is a perfect candidate for dropping the build step (webpack encore) and replacing the front end development with AssetMapper.
In Symfony 7 and 6.4, AssetMapper also supports CSS.
There's an issue with installing datatables (DataTables/DataTablesSrc#246) which I hope gets resolved soon, but there are workarounds in the meantime.
I'm working on a stimulus datatables bundle that may interest you, if you are up for migrating this to AssetMapper (in a version 4 branch) I'd be happy to participate.
Beta Was this translation helpful? Give feedback.
All reactions