8000 Hello AssetMapper Documentation by weaverryan · Pull Request #18370 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Hello AssetMapper Documentation #18370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Prev Previous commit
Next Next commit
Tweaks thanks to Wouter and Javier
  • Loading branch information
weaverryan committed Jun 5, 2023
commit 0e958717dd45ecdfdf6a45d5b362dbad38718692
1 change: 1 addition & 0 deletions deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ setup:
* Add/edit CRON jobs
* Restarting your workers
* :ref:`Building and minifying your assets <how-do-i-deploy-my-encore-assets>` with Webpack Encore
* :ref:`Compile your assets <asset-mapper-deployment>` if you're using the the AssetMapper component
* Pushing assets to a CDN
* On a shared hosting platform using the Apache web server, you may need to
install the :ref:`symfony/apache-pack package <web-server-apache-mod-php>`
Expand Down
36 changes: 22 additions & 14 deletions frontend.rst
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
Symfony Frontend Tools
======================
Introduction
============

Symfony ships with two options for handling the CSS and JavaScript in your app:
Symfony gives you the flexibility to choose any front-end tools you want. This could
be dead-simple - like putting CSS & JS directly in the ``public/`` directory - or
more advanced - like scaffolding your front-end with a tool like Next.js.

However, Symfony *does* come with two powerful option to help you build a modern,
fast frontend, *and* enjoy the process:

* :ref:`Webpack Encore <frontend-webpack-encore>` is a powerful tool built with Node
on top of `Webpack`_ that allows you to write modern CSS & JavaScript and handle
things like JSX (React), Vue or TypeScript. It's the recommended option for
new Symfony applications.
things like JSX (React), Vue or TypeScript.

* :ref:`AssetMapper <frontend-asset-mapper>`, is a production-ready simpler alternative
to Webpack Encore that runs entirely in PHP. It's currently experimental.

========================================== ================= ===================================
========================================== ================= ======================================================
Encore AssetMapper
========================================== ================= ===================================
========================================== ================= ======================================================
Production Ready? yes yes
Stable? yes experimental
Stable? yes :doc:`experimental </contributing/code/experimental>`
Requirements node none: pure PHP
Requires a build step? yes no
Works in all browsers? yes yes
Supports :doc:`Stimulus/UX </frontend/ux>` yes yes
Supports Sass/Tailwind yes :ref:`yes <asset-mapper-tailwind>`
Supports JSX, Vue? yes no
Supports TypeScript yes no
========================================== ================= ===================================
Supports JSX, Vue components? yes no**
Supports TypeScript yes no**
========================================== ================= ======================================================

** You *can* technically use things JSX, Vue or TypeScript with AssetMapper, but
with some caveats: you'll need to use their native tools for pre-compilation
and some things (like Vue single-file components) cannot be compiled down to
pure JavaScript that can be executed by a browser.

.. _frontend-webpack-encore:

Webpack Encore
--------------

.. admonition:: Screencast
:class: screencast
.. screencast::

Do you prefer video tutorials? Check out the `Webpack Encore screencast series`_.

Expand Down Expand Up @@ -111,7 +119,7 @@ AssetMapper
AssetMapper is an alternative to Webpack Encore that runs entirely in PHP
without any complex build steps. It leverages the ``importmap`` feature of
your browser, which is available in all browsers thanks to a polyfill.
AssetMapper is currently experimental.
AssetMapper is currently :doc:`experimental </contributing/code/experimental>`.

:doc:`Read the AssetMapper Documentation </frontend/asset_mapper>`

Expand Down
Loading
0