8000 Adding `importmap_polyfill` by ThomasLandauer · Pull Request #18537 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content
< 8000 div class="d-flex flex-column flex-md-row flex-items-start flex-md-items-center">

Adding importmap_polyfill #18537

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 3 commits into from
Closed

Conversation

ThomasLandauer
Copy link
Contributor
@ThomasLandauer ThomasLandauer commented Jul 7, 2023

Page: https://symfony.com/doc/current/frontend/asset_mapper.html

Please doublecheck the YAML syntax - the info is taken from symfony/symfony#50912 (comment)

Closes: symfony/symfony#50912

Please doublecheck - the info is taken from symfony/symfony#50912 (comment)

.. code-block:: html
.. code-block:: yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should have the configuration block for all supported formats, like elsewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't know the other formats' syntax :-( But starting with YAML is certainly better than nothing...

@@ -289,17 +289,25 @@ Preloading and Initializing "app.js"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In addition to the importmap, the ``{{ importmap() }}`` Twig function also renders
an `ES module shim`_ and a few other things, like a set of "preloads":
an `ES module shim`_. You can disable this in your ``config/packages/asset_mapper.yaml``
configuration file:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably also document the fact that we can customize the source of the shim, not just disabling it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it as comment inside the code block. Not very elegant - I have to admit ;-)

<link rel="modulepreload" href="/assets/app-4e986c1a2318dd050b1d47db8d856278.js">
<link rel="modulepreload" href="/assets/duck-1b7a64b3b3d31219c262cf72521a5267.js">

This is a performance optimization and you can learn more about below
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep this in the same paragraph than before instead of moving the code block in the middle of the explanation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm not sure what you mean. And (more important) I can't quite imagine what it will finally look like, just by looking at GitHub's diff.
So maybe merge it as-is, then you move it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When moving the existing code block, you split the existing paragraph in 2, putting the code block in the middle.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you want me to move the <link rel="modulepreload"... code block down after "learn more about below in Performance: Add Preloading."?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a different idea:

A) Add all of this to a new section under Configuration Options instead of here - https://github.com/symfony/symfony-docs/blob/91be2224cb6e6d62d643a546618d054a5e80dfe0/frontend/asset_mapper.rst#configuration-options

B) Leave this section unchanged, except change the top to point to that config section

In addition to the importmap, the ``{{ importmap() }}`` Twig function also renders
an `ES module shim`_ (see the :ref:`config-importmap-polyfill <polyfill config>` and
a few other things, like a set of "preloads":

(below, above the new section, you'd add .. _config-importmap-polyfill: so that the above :ref:works.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I opened a new PR: #18554

@javiereguiluz javiereguiluz added this to the 6.3 milestone Jul 10, 2023
ThomasLandauer added a commit to ThomasLandauer/symfony-docs that referenced this pull request Jul 12, 2023
javiereguiluz added a commit that referenced this pull request Jul 13, 2023
…auer)

This PR was merged into the 6.
8000
3 branch.

Discussion
----------

Adding `importmap_polyfill` (second attempt)

As requested at #18537 (comment)

Closes #18537

Commits
-------

f95a507 Adding `importmap_polyfill` (second attempt)
@javiereguiluz
Copy link
Member

Closing as fixed in #18554. Thank you all for the contribution and the reviews.

@ThomasLandauer ThomasLandauer deleted the patch-17 branch July 13, 2023 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0