-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Changes from 3 commits
9abaee3
4dd3f16
c0c4ad2
4fe225f
efa7638
ad34308
c6fc372
fb54a90
0e95871
a681986
385d810
bd55e8e
7a4c391
721b188
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,44 @@ | ||
Managing CSS and JavaScript | ||
=========================== | ||
|
||
.. admonition:: Screencast | ||
:class: screencast | ||
|
||
Do you prefer video tutorials? Check out the `Webpack Encore screencast series`_. | ||
|
||
Symfony ships with a pure-JavaScript library - called Webpack Encore - that makes | ||
it a joy to work with CSS and JavaScript. You can use it, use something else, or | ||
create static CSS and JS files in your ``public/`` directory directly and | ||
include them in your templates. | ||
Symfony Frontend Tools | ||
====================== | ||
|
||
Symfony ships with two different options for handling the CSS and JavaScript in | ||
your app: | ||
|
||
* :ref:`Webpack Encore <frontend-webpack-encore>` is a powerful tool build with Node | ||
on top of `Webpack`_ that allows you to write modern CSS & JavaScript and handle | ||
things like JSX (React), Vur or TypeScript. It's the recommended option for | ||
new Symfony apps. | ||
|
||
* :ref:`Asset Mapper <frontend-asset-mapper>`, is a production-ready simpler alternative | ||
to Webpack Encore that runs entirely in PHP. It's currently experimental. | ||
|
||
Overall, `Asset Mapper` is powerful & simpler, but doesn't support certain | ||
features like JSX or TypeScript: | ||
|
||
========================================= ================= ================= | ||
Encore AssetMapper | ||
========================================= ================= ================= | ||
Production Ready? yes yes | ||
Stable? yes 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-extras>` | ||
Supports JSX, Vue? yes no | ||
Supports TypeScript yes no | ||
========================================= ================= ================= | ||
|
||
.. _frontend-webpack-encore: | ||
|
||
Webpack Encore | ||
-------------- | ||
|
||
.. admonition:: Screencast | ||
:class: screencast | ||
weaverryan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Do you prefer video tutorials? Check out the `Webpack Encore screencast series`_. | ||
|
||
`Webpack Encore`_ is a simpler way to integrate `Webpack`_ into your application. | ||
It *wraps* Webpack, giving you a clean & powerful API for bundling JavaScript modules, | ||
pre-processing CSS & JS and compiling and minifying assets. Encore gives you professional | ||
|
@@ -84,26 +107,44 @@ Full API | |
|
||
* `Full API`_ | ||
|
||
.. _frontend-asset-mapper: | ||
|
||
Asset Mapper | ||
------------ | ||
|
||
Asset Mapper 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. | ||
Asset Mapper is currently experimental. | ||
|
||
* :doc:`Install AssetMapper </frontend/asset_mapper/installation>` | ||
* :doc:`Using AssetMapper </frontend/asset_mapper/usage>` | ||
* :doc:`Handling CSS </frontend/asset_mapper/css>` | ||
* :doc:`FAQ & Common Issues </frontend/asset_mapper/faq>` | ||
|
||
Symfony UX Components | ||
--------------------- | ||
|
||
* :doc:`/frontend/ux` | ||
|
||
.. include:: /frontend/_ux-libraries.rst.inc | ||
|
||
Other Front-End Articles | ||
------------------------ | ||
|
||
* :doc:`/frontend/create_ux_bundle` | ||
* :doc:`/frontend/custom_version_strategy` | ||
|
||
.. toctree:: | ||
:hidden: | ||
:glob: | ||
|
||
frontend/encore/installation | ||
frontend/encore/simple-example | ||
frontend/encore/* | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:glob: | ||
|
||
frontend/asset_mapper/installation | ||
frontend/asset_mapper/usage | ||
frontend/asset_mapper/* | ||
frontend/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The bottom of https://symfony.com/doc/current/frontend.html is currently "wonky". I think the intention was for the the first, So, I reduced this to just ONE There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fun fact, including documents in a toctree entry is no longer relevant with the PHP based parser IIRC There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That IS a fun fact, thank you! |
||
|
||
.. _`Webpack Encore`: https://www.npmjs.com/package/@symfony/webpack-encore | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This document is now a bit more important than before. On https://symfony.com/doc/current/index.html, I don't think we link to it at all. After we merge this, we probably should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Webpack Encore" is linking to it. We should probably do the same as with Security and call it "Introduction"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I added some TODO to the PR description for post-merge changes to the main documentation page.