Skip to content

Commit b1f957f

Browse files
committed
Merge branch '3.4'
* 3.4: removing unnecessary note Re-adding index fixing index problem now that there were *no* frontend articles on 2.7 Removing bower, as even they now recommend to use yarn and webpack [Encore] Fix invalid javascript code Changed link to Capifony cs Fix missing line Update bootstrap.rst resolve_url_loader codeblock did not contain valid javascript Encore tweaks!
2 parents 47024b4 + c3b1795 commit b1f957f

File tree

8 files changed

+31
-179
lines changed

8 files changed

+31
-179
lines changed

_build/redirection_map

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
/cookbook/form/inherit_data_option /form/inherit_data_option
165165
/cookbook/form/unit_testing /form/unit_testing
166166
/cookbook/form/use_empty_data /form/use_empty_data
167-
/cookbook/frontend/bower /frontend/bower
167+
/cookbook/frontend/bower /frontend
168168
/cookbook/frontend/index /frontend
169169
/cookbook/install/unstable_versions /setup/unstable_versions
170170
/cookbook/install/bundles /setup/bundles

deployment.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ Don't forget that deploying your application also involves updating any dependen
198198
(typically via Composer), migrating your database, clearing your cache and
199199
other potential things like pushing assets to a CDN (see `Common Post-Deployment Tasks`_).
200200

201-
.. _`Capifony`: http://capifony.org/
201+
.. _`Capifony`: https://github.com/everzet/capifony
202202
.. _`Capistrano`: http://capistranorb.com/
203203
.. _`sf2debpkg`: https://github.com/liip/sf2debpkg
204204
.. _`Fabric`: http://www.fabfile.org/

frontend.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,18 @@ Other Front-End Articles
6666
........................
6767

6868
.. toctree::
69-
:maxdepth: 1
69+
:hidden:
7070
:glob:
7171

72-
frontend/*
72+
frontend/encore/installation
73+
frontend/encore/simple-example
74+
frontend/encore/*
7375

7476
.. toctree::
75-
:hidden:
77+
:maxdepth: 1
7678
:glob:
7779

78-
frontend/encore/*
80+
frontend/*
7981

8082
.. _`Webpack Encore`: https://www.npmjs.com/package/@symfony/webpack-encore
8183
.. _`Webpack`: https://webpack.js.org/

frontend/bower.rst

Lines changed: 0 additions & 152 deletions
This file was deleted.

frontend/encore/bootstrap.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ a ``global.scss`` file, import it from there:
2121
// assets/css/global.scss
2222
2323
// customize some Bootstrap variables
24-
$brand-primary: darken(#428bca, 20%);
24+
$brand-primary: darken(#428bca, 20%);
2525
2626
// the ~ allows you to reference things in node_modules
2727
@import '~bootstrap-sass/assets/stylesheets/bootstrap';
@@ -41,8 +41,8 @@ this, you can use the ``resolve_url_loader`` option:
4141
4242
// webpack.config.js
4343
Encore
44-
+ enableSassLoader({
45-
+ 'resolve_url_loader' => false
44+
+ .enableSassLoader({
45+
+ resolve_url_loader: false
4646
+ })
4747
;
4848
@@ -79,6 +79,7 @@ Next, make sure to call ``.autoProvidejQuery()`` in your ``webpack.config.js`` f
7979
Encore
8080
// ...
8181
+ .autoProvidejQuery()
82+
;
8283
8384
This is needed because Bootstrap expects jQuery to be available as a global
8485
variable. Now, require bootstrap from any of your JavaScript files:

frontend/encore/installation.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Installation
2-
============
1+
Encore Installation
2+
===================
33

4-
First, make sure you `install Node.js`_ and also the `yarn package manager`_.
4+
First, make sure you `install Node.js`_ and also the `Yarn package manager`_.
55

6-
Then, install Encore into your project with yarn:
6+
Then, install Encore into your project with Yarn:
77

88
.. code-block:: terminal
99
@@ -21,11 +21,11 @@ is also created/updated. When using npm 5, a ``package-lock.json`` file is creat
2121
.. tip::
2222

2323
You should commit ``package.json`` and ``yarn.lock`` (or ``package-lock.json``
24-
if using npm) to version control, but ignore ``node_modules/``.
24+
if using npm 5) to version control, but ignore ``node_modules/``.
2525

2626
Next, create your ``webpack.config.js`` in :doc:`/frontend/encore/simple-example`!
2727

2828
.. _`install Node.js`: https://nodejs.org/en/download/
29-
.. _`yarn package manager`: https://yarnpkg.com/lang/en/docs/install/
29+
.. _`Yarn package manager`: https://yarnpkg.com/lang/en/docs/install/
3030
.. _`npm`: https://www.npmjs.com/
3131
.. _`yarn`: https://yarnpkg.com/

frontend/encore/simple-example.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,16 @@ may want also to :doc:`create a shared entry </frontend/encore/shared-entry>` fo
139139
Requiring CSS Files from JavaScript
140140
-----------------------------------
141141

142-
You can also require CSS files from your JavaScript:
142+
Above, you created an entry called ``app`` that pointed to ``main.js``:
143+
144+
.. code-block:: javascript
145+
146+
Encore
147+
// ...
148+
.addEntry('app', './assets/js/main.js')
149+
;
150+
151+
Once inside ``main.js``, you can even require CSS files:
143152

144153
.. code-block:: javascript
145154
@@ -149,17 +158,8 @@ You can also require CSS files from your JavaScript:
149158
// a CSS file with the same name as the entry js will be output
150159
require('../css/main.scss');
151160
152-
In this case, ``main.js`` is being added to an entry called ``app`` in ``webpack.config.js``:
153-
154-
.. code-block:: javascript
155-
156-
Encore
157-
// ...
158-
.addEntry('app', './assets/js/main.js')
159-
160-
As soon as you require a CSS file, both an ``app.js`` **and** an ``app.css`` file
161-
will be created. You'll need to add a link tag to the ``app.css`` file in your
162-
templates:
161+
Now, both an ``app.js`` **and** an ``app.css`` file will be created. You'll need
162+
to add a link tag to the ``app.css`` file in your templates:
163163

164164
.. code-block:: diff
165165

service_container/import.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ decided to move some configuration to a new file:
7373
// ... some services
7474
7575
To import this file, use the ``imports`` key from a file that *is* loaded:
76+
7677
.. configuration-block::
7778

7879
.. code-block:: yaml

0 commit comments

Comments
 (0)