From 4fe7bfb2851611f534eabe842c9b78615ee36c2a Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Mon, 12 Jun 2017 21:47:04 -0400 Subject: [PATCH 1/2] Removing bower, as even they now recommend to use yarn and webpack --- _build/redirection_map | 2 +- frontend/bower.rst | 152 ----------------------------------------- 2 files changed, 1 insertion(+), 153 deletions(-) delete mode 100644 frontend/bower.rst diff --git a/_build/redirection_map b/_build/redirection_map index b9a72a200c7..c0929540fe0 100644 --- a/_build/redirection_map +++ b/_build/redirection_map @@ -162,7 +162,7 @@ /cookbook/form/inherit_data_option /form/inherit_data_option /cookbook/form/unit_testing /form/unit_testing /cookbook/form/use_empty_data /form/use_empty_data -/cookbook/frontend/bower /frontend/bower +/cookbook/frontend/bower /frontend /cookbook/frontend/index /frontend /cookbook/install/unstable_versions /setup/unstable_versions /cookbook/install/bundles /setup/bundles diff --git a/frontend/bower.rst b/frontend/bower.rst deleted file mode 100644 index f8d694b36c7..00000000000 --- a/frontend/bower.rst +++ /dev/null @@ -1,152 +0,0 @@ -.. index:: - single: Front-end; Bower - -Using Bower with Symfony -======================== - -Symfony and all its packages are perfectly managed by Composer. Bower is a -dependency management tool for front-end dependencies, like Bootstrap or -jQuery. As Symfony is purely a back-end framework, it can't help you much with -Bower. Fortunately, it is very easy to use! - -Installing Bower ----------------- - -Bower_ is built on top of `Node.js`_. Make sure you have that installed and -then run: - -.. code-block:: terminal - - $ npm install -g bower - -After this command has finished, run ``bower`` in your terminal to find out if -it's installed correctly. - -.. tip:: - - If you don't want to have NodeJS on your computer, you can also use - BowerPHP_ (an unofficial PHP port of Bower). Beware that this is currently - in beta status. If you're using BowerPHP, use ``bowerphp`` instead of - ``bower`` in the examples. - -Configuring Bower in your Project ---------------------------------- - -Normally, Bower downloads everything into a ``bower_components/`` directory. In -Symfony, only files in the ``web/`` directory are publicly accessible, so you -need to configure Bower to download things there instead. To do that, just -create a ``.bowerrc`` file with a new destination (like ``web/assets/vendor``): - -.. code-block:: json - - { - "directory": "web/assets/vendor/" - } - -.. tip:: - - If you're using a front-end build system like `Gulp`_ or `Grunt`_, then - you can set the directory to whatever you want. Typically, you'll use - these tools to ultimately move all assets into the ``web/`` directory. - -An Example: Installing Bootstrap --------------------------------- - -Believe it or not, but you're now ready to use Bower in your Symfony -application. As an example, you'll now install Bootstrap in your project and -include it in your layout. - -Installing the Dependency -~~~~~~~~~~~~~~~~~~~~~~~~~ - -To create a ``bower.json`` file, just run ``bower init``. Now you're ready to -start adding things to your project. For example, to add Bootstrap_ to your -``bower.json`` and download it, just run: - -.. code-block:: terminal - - $ bower install --save bootstrap - -This will install Bootstrap and its dependencies in ``web/assets/vendor/`` (or -whatever directory you configured in ``.bowerrc``). - -.. seealso:: - - For more details on how to use Bower, check out `Bower documentation`_. - -Including the Dependency in your Template -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Now that the dependencies are installed, you can include bootstrap in your -template like normal CSS/JS: - -.. configuration-block:: - - .. code-block:: html+twig - - {# app/Resources/views/layout.html.twig #} - - - - {# ... #} - - - - - {# ... #} - - - .. code-block:: html+php - - - - - - {# ... #} - - - - - {# ... #} - - -Great job! Your site is now using Bootstrap. You can now easily upgrade -bootstrap to the latest version and manage other front-end dependencies too. - -Should I Git Ignore or Commit Bower Assets? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Currently, you should probably *commit* the assets downloaded by Bower instead -of adding the directory (e.g. ``web/assets/vendor``) to your ``.gitignore`` -file: - -.. code-block:: terminal - - $ git add web/assets/vendor - -Why? Unlike Composer, Bower currently does not have a "lock" feature, which -means that there's no guarantee that running ``bower install`` on a different -server will give you the *exact* assets that you have on other machines. -For more details, read the article `Checking in front-end dependencies`_. - -But, it's very possible that Bower will add a lock feature in the future -(e.g. `bower/bower#1748`_). - -If you don't care too much about having *exact* the same versions, you can only -commit the ``bower.json`` file. Running ``bower install`` will give you the -latest versions within the specified version range of each package in -``bower.json``. Using strict version constraints (e.g. ``1.10.*``) is often -enough to ensure only bringing in compatible versions. - -.. _Bower: http://bower.io -.. _`Node.js`: https://nodejs.org -.. _BowerPHP: https://github.com/Bee-Lab/bowerphp -.. _`Bower documentation`: http://bower.io/ -.. _Bootstrap: http://getbootstrap.com/ -.. _Gulp: http://gulpjs.com/ -.. _Grunt: http://gruntjs.com/ -.. _`Checking in front-end dependencies`: http://addyosmani.com/blog/checking-in-front-end-dependencies/ -.. _`bower/bower#1748`: https://github.com/bower/bower/pull/1748 From 5a7610c1efc11fe7405c7991d253a8d3ee51734c Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 16 Jun 2017 11:58:21 -0400 Subject: [PATCH 2/2] fixing index problem now that there were *no* frontend articles on 2.7 --- frontend.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend.rst b/frontend.rst index ce1253a95b3..d6384a72d33 100644 --- a/frontend.rst +++ b/frontend.rst @@ -1,8 +1,6 @@ Front-end ========= -.. toctree:: - :maxdepth: 1 - :glob: +See the latest version of the docs for frontend tools. Or, see +:doc:`/assetic`. - frontend/*