Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[AssetMapper] Adding info that always *all* entrypoints are included…#20789

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
javiereguiluz merged 1 commit intosymfony:6.4fromThomasLandauer:patch-12
May 29, 2025

Conversation

ThomasLandauer
Copy link
Contributor

@carsonbotcarsonbot added this to the6.4 milestoneMar 21, 2025
@carsonbotcarsonbot changed the title[AssetMapper]: Adding info that always *all* entrypoints are included…[AssetMapper] : Adding info that always *all* entrypoints are included…Mar 21, 2025
and *not* ``app.js``, pass only ``checkout`` to ``importmap()``.
In this case, still **both** files are added to ``<script type="importmap">``,
but only ``checkout.js`` is executed (via ``<link rel="modulepreload">``).
Copy link
Member

Choose a reason for hiding this comment

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

This is not how they are loaded: see the previous paragraph (script type = module)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I'm not sure what you mean; how would you suggest to change it?

Copy link
Member

Choose a reason for hiding this comment

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

The execution of checkout.js is due to the <script type="module"> generated

(it is explained just a couple of lines before in the page)

To be honest i'm not sure there is much to add in here

Copy link
ContributorAuthor

@ThomasLandauerThomasLandauerMar 21, 2025
edited
Loading

Choose a reason for hiding this comment

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

Oh, I see - I now changed it.

Reason for adding it: I was confused to still seeeverything in importmap. And that issue shows that others are confused too... ;-)

Copy link
Member

Choose a reason for hiding this comment

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

I do agree. Still, not a reason to reexplain what has been said a couple lines before, mixing two very different notions: the entrypoint called, and the composition of the importmap.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

You're referring to this sentence, right?:

By passing both app and checkout, the importmap() function will output the importmap and also add a <script type="module"> tag that loads the app.js file and the checkout.js file.

What I'm missing (and didn't know since yesterday) is the fact that the importmap is just a map with shortcuts ofpossible imports, and seeing an entry there doesn't mean that it's actually loaded.

So what about splitting those two aspects (this one, and theparent() issue) to two separate paragraphs? I could come up with a suggestion, but I have a question here:

Each page can only have oneimportmap, so importmap() must be called exactly once.

Is the bolded "importmap" referring to<script type="importmap"> (i.e. is this some restriction of the HTML standard)? Or is it about Twig's{{ impormap() }}?
=>Who is forbidding to have multiple importmaps?

@OskarStarkOskarStark changed the title[AssetMapper] : Adding info that always *all* entrypoints are included…[AssetMapper] Adding info that always *all* entrypoints are included…Mar 22, 2025
@javiereguiluzjaviereguiluz merged commitaf0a87b intosymfony:6.4May 29, 2025
3 checks passed
@javiereguiluz
Copy link
Member

javiereguiluz commentedMay 29, 2025
edited
Loading

Merged! Thanks Thomas.

I agree with Thomas about this being a bit shocking the first time you use AssetMapper ... but I also agree with Simon about the repetition. So, while merging I did some rewords/tweaks and I also extracted the recommendation about not usingparent() to awarning directive because this is a common pitfall for newcomers. See45c11e5

smnandre reacted with thumbs up emoji

@ThomasLandauerThomasLandauer deleted the patch-12 branchMay 29, 2025 15:02
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@smnandresmnandresmnandre left review comments

Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

4 participants
@ThomasLandauer@javiereguiluz@smnandre@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp