-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[AssetMapper] Adding infos to be forwarded to package maintainers in case of error #19565
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
Conversation
|
||
If you're getting a 404 error, you can contact the package maintainer and ask them to | ||
include `"main":` and `"module":` to the package's `package.json`. | ||
|
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 cut the example in two. Could you group your two additions in a dedicated paragraph ?
And a 404 could have many other reasons, i fear this could be misdirecting :|
@@ -207,6 +212,8 @@ This adds the ``bootstrap`` package to your ``importmap.php`` file:: | |||
such as ``@popperjs/core``. The ``importmap:require`` command will add both the | |||
main package *and* its dependencies. If a package includes a main CSS file, | |||
that will also be added (see :ref:`Handling 3rd-Party CSS <asset-mapper-3rd-party-css>`). | |||
If the associated CSS file isn't added to the importmap, you can contact the package |
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 should be in the "handling 3rd party" section, as this paragraph states "if a packages includes a CSS files".
Yeah, you're right, there is no good place for this currently. So I'd like to reorganize the sections and merge "Importing 3rd Party JavaScript Packages" with "Handling 3rd-Party CSS" and move them downwards, under the CSS section. Reasons:
What do you think? |
As i see it, required JS packages is the main reason to use importmaps. CSS files is just a bonus, for those who want to install them. |
I like this proposal. Two quick comments: (1) This:
maybe can be reworded as follows to make it more clear:
(2) Do we have a reference for the Thanks. |
@javiereguiluz OK, but where to put it? What do you think about merging the two sections (see above)? @smnandre No matter what people are using it for: I think handling local files should be explained first, to make people understand the basics. |
I'm just stating a fact: AssetMapper may be for local CSS files first.. But ImportMap is a tool made for 3rd party scripts / dependencies first. |
Thanks Thomas! This is now merged. I reworded and changed the location a bit as mentioned in the discussion. See 64eb515 |
Page: https://symfony.com/doc/6.4/frontend/asset_mapper.html#importing-3rd-party-javascript-packages
Closes #19558
Thanks to @tofsjonas for figuring this out at tofsjonas/sortable#68
You might say it's not the job of the Symfony docs to tell JavaScript package maintainers how to set up their packages.
But: With so many packages out there, I doubt that importing them will always work. So instead of leaving Symfony users back frustrated, I think it's better to tell them what they can do. And that it's not AssetMapper's fault that it didn't work out.