-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[AssetMapper] Describe the shape of importmaps #62064
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
base: 8.1
Are you sure you want to change the base?
Conversation
c62ae9e to
f64565f
Compare
f64565f to
37e0b5c
Compare
d939f9d to
9975f5d
Compare
GromNaN
left a comment
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.
We need a test that calls this function to be explicit about its intended use.
ImportMap::config()importmap() function
9975f5d to
1e850ce
Compare
Good idea, PR updated! |
1e850ce to
1506d44
Compare
GromNaN
left a comment
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.
About the test: this is already tested - when testing the generated importmap.php files.
Ok for the code execution, but we don't analyze the importmap.php file with psalm. We don't validate that the array matches the array-shape.
One of this files can be updated:
- https://github.com/nicolas-grekas/symfony/blob/1506d4402e7dfc1a14c23eee3485a5569eb20691/src/Symfony/Component/AssetMapper/Tests/Fixtures/importmap.php
- https://github.com/nicolas-grekas/symfony/blob/1506d4402e7dfc1a14c23eee3485a5569eb20691/src/Symfony/Component/AssetMapper/Tests/Fixtures/importmaps/importmap.php
1506d44 to
cf576c9
Compare
|
👍 I updated both |
|
How things will behave if a project has a Related to https://github.com/symfony/flex/blob/f356aa35f3cf3d2f46c31d344c1098eb2d260426/src/PackageJsonSynchronizer.php#L260-L318, I don't think Flex will be able to parse this |
And you're right. Status: needs work |
importmap() functioncf576c9 to
017293b
Compare
I fixed this by not wrapping in a function call. This now uses an inline Status: needs review |
GromNaN
left a comment
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.
Tooling will be improved to support this.
This should improve the discoverability of the entries in the
importmap.phpfile.