Skip to content

Commit 6d5b678

Browse files
committed
minor #8107 Adding Assetic versus Encore document (weaverryan)
This PR was squashed before being merged into the 3.3 branch (closes #8107). Discussion ---------- Adding Assetic versus Encore document This is a commonly asked questions... so let's make it perfectly clear :). Commits ------- 8f3a170 fixing links in table cd9f3cd fixing bad link 00ea1a3 Adding Assetic versus Encore document
2 parents 4c2a37d + 8f3a170 commit 6d5b678

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
@@ -62,18 +62,28 @@ Guides
6262
* :doc:`Adding custom loaders & plugins </frontend/encore/custom-loaders-plugins>`
6363
* :doc:`Advanced Webpack Configuration </frontend/encore/advanced-config>`
6464

65-
Troubleshooting
66-
...............
65+
Issues & Questions
66+
..................
6767

6868
* :doc:`FAQ & Common Issues </frontend/encore/faq>`
69+
* :doc:`/frontend/encore/versus-assetic`
6970

7071
Full API
7172
........
7273

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

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

7888
.. toctree::
7989
: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 </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)