Skip to content

Commit 00ea1a3

Browse files
committed
Adding Assetic versus Encore document
1 parent c0a172a commit 00ea1a3

File tree

2 files changed

+69
-3
lines changed

2 files changed

+69
-3
lines changed

frontend.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,28 @@ Guides
6161
* :doc:`Adding custom loaders & plugins </frontend/encore/custom-loaders-plugins>`
6262
* :doc:`Advanced Webpack Configuration </frontend/encore/advanced-config>`
6363

64-
Troubleshooting
65-
...............
64+
Issues & Questions
65+
..................
6666

6767
* :doc:`FAQ & Common Issues </frontend/encore/faq>`
68+
* :doc:`/frontend/encore/versus-assetic`
6869

6970
Full API
7071
........
7172

7273
* `Full API`_: https://github.com/symfony/webpack-encore/blob/master/index.js
7374

75+
Assetic
76+
-------
77+
78+
Assetic is a pure PHP library that helps to process & optimize your assets (similar
79+
to Encore). Even though we recommend using Encore, Assetic still works great. For
80+
a comparison, see :doc:`/frontend/encore/versus-assetic`.
81+
82+
For more about Assetic, see :doc:`/assetic`.
83+
7484
Other Front-End Articles
75-
........................
85+
------------------------
7686

7787
.. toctree::
7888
:hidden:

frontend/encore/versus-assetic.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Encore Versus Assetic?
2+
======================
3+
4+
Symfony originally shipped with support for :doc:`Assetic </frontend/assetic>`: a
5+
pure PHP library capable of processing, combining and minifying CSS and JavaScript
6+
files. And while Encore is now the recommended way or processing your assets, Assetic
7+
still works well.
8+
9+
So what are the differences between Assetic and Encore?
10+
11+
+-------------------------+-------------------------------+-------------------------+
12+
| | Assetic | Encore +
13+
+-------------------------+-------------------------------+-------------------------+
14+
| Language | Pure PHP, relies on other | Node.js |
15+
| | language tools for some tasks | |
16+
+-------------------------+-------------------------------+-------------------------+
17+
| Combine assets? | Yes | Yes |
18+
+-------------------------+-------------------------------+-------------------------+
19+
| Minify assets? | Yes (when configured) | Yes (out-of-the-box) |
20+
+-------------------------+-------------------------------+-------------------------+
21+
| Process Sass/Less? | Yes | Yes |
22+
+-------------------------+-------------------------------+-------------------------+
23+
| Loads JS Modules?[1]_ | No | Yes |
24+
+-------------------------+-------------------------------+-------------------------+
25+
| Load CSS Deps in JS?[1] | No | Yes |
26+
+-------------------------+-------------------------------+-------------------------+
27+
| React, Vue.js support? | No[2]_ | Yes |
28+
+-------------------------+-------------------------------+-------------------------+
29+
| Support | Not actively maintained | Actively maintained |
30+
+-------------------------+-------------------------------+-------------------------+
31+
32+
.. [1] JavaScript modules allow you to organize your JavaScript into small files
33+
called modules and import them:
34+
35+
.. code-block:: javascript
36+
37+
// require third-party modules
38+
var $ = require('jquery');
39+
40+
// require your own CoolComponent.js modules
41+
var coolComponent = require('./components/CoolComponent');
42+
43+
Encore (via Webpack) parses these automatically and creates a JavaScript
44+
file that contains all needed dependencies. You can even require CSS or
45+
images.
46+
47+
.. [2] Assetic has outdated support for React.js only. Encore ships with modern
48+
support for React.js, Vue.js, Typescript, etc.
49+
50+
Should I Upgrade from Assetic to Encore
51+
---------------------------------------
52+
53+
If you already have Assetic working in an application, and haven't needed any of
54+
the features that Encore offers over Assetic, continuting to use Assetic is fine.
55+
If you *do* start to need more features, then you might have a business case for
56+
changing to Encore.

0 commit comments

Comments
 (0)