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] Better public without digest#50232

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

Conversation

@weaverryan
Copy link
Member

QA
Branch?6.3
Bug fix?no
New feature?yes
Deprecations?no
TicketsNone
LicenseMIT
Doc PRNot needed

We have aMappedAsset::getPublicPathWithoutDigest() method, which would return something like/assets/file2.js. This, sort of odd method, is super useful, for example, when generating the importmap, where we want to communicate to the browser that when it searches for/assets/file2.js (e.g. because insideassets/file1.js there is animport './file1.js'), here it should use the digested path - e.g.

'/assets/file2.js' => '/assets/file2.1234abcd.js',

Anyway, the way that I calculated this originally was a little sketchy. In truth, we have this info very easily inAssetMapper, so now we pass it in. This also allows an "asset compiler" to figure out which "directory" the final asset will be in, which isn't possible with "public path" as it's still being generated. That little nice detail will be needed in StimulusBundle :).

Cheers!

}

return$this->extensionsMap[$extension];
return$this->extensionsMap[$extension] ??null;
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This is unrelated. I had a file that mentioned a sourcemap - sofoo.js.map - and the system exploded because we didn't know the mime type of.map. The mime type is only important for (A) the dev server to return that asset with the correctContent-Type and (B) for asset compilers, if they rely on the mime type. So I think this is a reasonable thing to do.

stof reacted with thumbs up emoji
@weaverryanweaverryanforce-pushed theasset-mapper-better-public-without-digest branch from11641cb to4dbdca0CompareMay 3, 2023 18:16
@nicolas-grekasnicolas-grekasforce-pushed theasset-mapper-better-public-without-digest branch from4dbdca0 to54ebd6dCompareMay 5, 2023 15:57
@nicolas-grekas
Copy link
Member

Thank you@weaverryan.

@nicolas-grekasnicolas-grekas merged commita0a7524 intosymfony:6.3May 5, 2023
@weaverryanweaverryan deleted the asset-mapper-better-public-without-digest branchMay 5, 2023 16:46
@fabpotfabpot mentioned this pull requestMay 7, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@stofstofstof approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

6.3

Development

Successfully merging this pull request may close these issues.

4 participants

@weaverryan@nicolas-grekas@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp