Skip to content

Commit

Permalink
Merge branch '7.1' into 7.2
Browse files Browse the repository at this point in the history
* 7.1:
  [Frontend] Add some comments about minifying assets
  • Loading branch information
javiereguiluz committed Oct 25, 2024
2 parents 2965e79 + 37be281 commit aea7997
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
14 changes: 10 additions & 4 deletions frontend.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ Supports `Stimulus/UX`_ yes yes
Supports Sass/Tailwind :ref:`yes <asset-mapper-tailwind>` yes
Supports React, Vue, Svelte? yes :ref:`[1] <ux-note-1>` yes
Supports TypeScript :ref:`yes <asset-mapper-ts>` yes
Removes comments from JavaScript no yes
Removes comments from CSS no no
Removes comments from JavaScript no :ref:`[2] <ux-note-2>` yes
Removes comments from CSS no :ref:`[2] <ux-note-2>` no
Versioned assets always optional
Can update 3rd party packages yes no :ref:`[2] <ux-note-2>`
Can update 3rd party packages yes no :ref:`[3] <ux-note-2>`
================================ ================================== ==========

.. _ux-note-1:
Expand All @@ -49,7 +49,12 @@ be executed by a browser.

.. _ux-note-2:

**[2]** If you use ``npm``, there are update checkers available (e.g. ``npm-check``).
**[2]** You can install the `SensioLabs Minify Bundle`_ to minify CSS/JS code
(and remove all comments) when compiling assets with AssetMapper.

.. _ux-note-3:

**[3]** If you use ``npm``, there are update checkers available (e.g. ``npm-check``).

.. _frontend-asset-mapper:

Expand Down Expand Up @@ -137,3 +142,4 @@ Other Front-End Articles
.. _`Turbo`: https://turbo.hotwired.dev/
.. _`Symfony UX`: https://ux.symfony.com
.. _`API Platform`: https://api-platform.com/
.. _`SensioLabs Minify Bundle`: https://github.com/sensiolabs/minify-bundle
14 changes: 11 additions & 3 deletions frontend/asset_mapper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,16 @@ See :ref:`Optimization <optimization>` for more details.
Does the AssetMapper Component Minify Assets?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Nope! Minifying or compressing assets *is* important, but can be
done by your web server. See :ref:`Optimization <optimization>` for
more details.
Nope! In most cases, this is perfectly fine. The web asset compression performed
by web servers before sending them is usually sufficient. However, if you think
you could benefit from minifying assets (in addition to later compressing them),
you can use the `SensioLabs Minify Bundle`_.

This bundle integrates seamlessly with AssetMapper and minifies all web assets
automatically when running the ``asset-map:compile`` command (as explained in
the :ref:`serving assets in production <asset-mapper-compile-assets>` section).

See :ref:`Optimization <optimization>` for more details.

Is the AssetMapper Component Production Ready? Is it Performant?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -1166,3 +1173,4 @@ command as part of your CI to be warned anytime a new vulnerability is found.
.. _Content Security Policy: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
.. _NelmioSecurityBundle: https://symfony.com/bundles/NelmioSecurityBundle/current/index.html#nonce-for-inline-script-handling
.. _kocal/biome-js-bundle: https://github.com/Kocal/BiomeJsBundle
.. _`SensioLabs Minify Bundle`: https://github.com/sensiolabs/minify-bundle

0 comments on commit aea7997

Please sign in to comment.