Comments (13)
You are right. But Symfony Flex no longer makes assumptions about the app you develop (that's why we don't include a "Welcome Page" or the server:*
commands). So why should we include a utility to manage web assets? It's not needed when developing APIs, web servers, console apps, etc.
from flex.
My 2 cents: Please do not increase the project setup cost and the learning curve height by introducing a requirement for external tools (especially node.js-based setups). Basic asset handling is great and there's nothing against replacing it in a project at will.
from flex.
Perhaps considerable.. should SF offer this (frontend) solution at all? Looking at most of our projects today.. we dont really use/need it anymore since we moved to webpack and frontend specific commands/tasks (think gulp).
For the same reason deprecating templating, classloader and such. We have better tools :)
from flex.
@fabpot with such tools you don't have bundles that expose public assets. Everything is private and compiled by tools and task runners and dumped into the web
dir, most of the time in a place which is covered by a .gitignore
instruction to avoid versioning compiled files.
It's like if you have src/AppBundle/Resources/less/main.less
and you compile it and dump it to web/css/main.css
. Nothing public from the bundle is exposed.
That's what I do for my projects, even for images, I'm using only Gulp with this Gulpfile which uses a simple configuration array and already has all needed preconfigured tasks for most cases, and I even use the copy/paste
command to get data from my node_modules and put them into a specific web directory. This keeps a total control over web assets that can be compiled as we want.
I don't know about webpack, but it is basically the same thing: you specify your sources and dump the modules in the web
directory, so the sources are never public, and anything which should be "source" is always dumped into the web directory to ensure a "production-ready" assets management
from flex.
Agee we can keep the current tooling available for basic asset handling, probably a lot of projects/bundles are using it. But @javiereguiluz has a point we should be able to decouple from it.
A way to do it is to further strip down the framework bundle into smaller bundles, i.e. AssetsBundle
, FormBundle
, etc. That would be a lot more flex ible right?
from flex.
assets:install
has nothing to do with the asset components. It's to install bundle assets under web/
from flex.
@javiereguiluz That's correct. This command could be moved from FrameworkBundle to elsewhere... but where? I didn't find a good place, that's why I kept it here. What we could do is to only enable it when there is at least one bundle with assets, but not sure if this could be practical or even desirable. WDYT?
from flex.
@ro0NL How do you let bundles expose some public assets then?
from flex.
We dont :) well.. our gulp task just scrapes bundles, something like
glob.sync('@(vendor|src)/**/*@(B|b)undle/Resources/public/assets/gulp.config.js')
But you really can do any setup you want. The current assets:install is more or less an opinionated setup, and can also be achieved writing a gulp task.
I'm also thinking to move assets+templates from bundles to the app layer. Without assets:install there's no default strategy available for opensource bundles to reference owned assets in owned templates. But that's exactly one of my goals.. fully separate the view layer. And avoid depending on "global" templates and such...
For webpack, we parse the generated stats.json
that allows us to implement something like
{{ webpack_asset('path/to/assets/in/web', 'filename', 'ext'[, 'sf_asset_package_name']) }}
path/to/assets/in/web
is basically a build directory, where dist files are written to.
from flex.
Same question for routing configuration. For cli-only application routing not needed
from flex.
@Koc the skeleton and the recipes are web-oriented. If you want to create a CLI tool, there is no need for anything. A regular composer req symfony/console is enough.
from flex.
we need doctrine infrstructure and httpplug
from flex.
Closing because this is not simple to fix (where should we move this into?) but it could be fixed in the future as explained by @ro0NL if Symfony code continues splitting the old FrameworkBundle into smaller pieces. Thanks!
from flex.
Related Issues (20)
- Renaming of docker-compose.yaml in compose.yaml : postgresql does'nt work anymore HOT 8
- Unclear problem description when Flex blocks package installation (by `extra.symfony.require` rule) HOT 1
- [Feature] Recipe endpoint for private recipe should not be in the project but in the bundle
- Missing tag for version v1.21.5 ? HOT 3
- Remove importmap entries when uninstalling a package
- ComposerScriptsConfigurator can break "composer.json" filename in patch
- Symfony Flex 1.8.5 is not compatible with Composer 2.7.0
- Symfony Flex fails when using Composer 2.7.0, running as root HOT 7
- Unable to update recipe HOT 5
- PackageJsonSynchronizer is not fail safe HOT 1
- Invalid version string "master.9999999" HOT 2
- Make packages.json synchronization optional
- recipe_template_relative processing is broken for gitlab private recipe
- Remove version tag in compose file as marked as obsolete by lastest docker compose version HOT 3
- Allow organize private recipes in subdirectories HOT 5
- Certificate error https://flex.symfony.com HOT 3
- Suggest adding management of the compose.yml file in addition to docker-compose.yml HOT 1
- Optimized key management to avoid duplication
- Support for local stored recipe files
- Resolving dependencies fails for symfony/psr-http-message-bridge after change of recipe
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flex.