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] Fix URL pattern when importing es-module-shims#53003

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
fabpot merged 1 commit intosymfony:6.4fromhashbanged:fix_52783
Dec 20, 2023

Conversation

@hashbanged
Copy link
Contributor

This fixes a JS console syntax error when importing thees-module-shims polyfills package

QA
Branch?6.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#52783
LicenseMIT

Requiringes-module-shims using AssetMapper causes a trailingexport {t as default}; in the downloaded file. The recommendation in#52783 is to be explicit about checking if the package is the shims/polyfill, and, if so, to use the CSS URL pattern when building the HTTP request for the package. This PR adds a new method for handling this case, and it centralizes the logic for determining if the URL pattern should beURL_PATTERN_DIST|URL_PATTERN_DIST_CSS

Chris53897 reacted with thumbs up emoji
@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.1 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@broadcoder
Copy link

Looks like we had similar ideas:https://github.com/symfony/symfony/compare/6.4...broadcoder:symfony:fix_wrong_esm_loading_for_es_modules_shim_package_in_asset_mapper?diff=unified&w=

I wanted to leave it here, since I also started to work on it until i realised I would need to spend quite some time setting up a proper environment, but maybe you like my idea of having a list of excludes instead of a single case special handling, but very likely your solution to pass also the $entry->type is better than mine, tho :) Thanks for taking care 🙏

returnself::URL_PATTERN_DIST_CSS;
}

if (str_ends_with($path,'.css') || ($type && ImportMapType::CSS ===$type)) {
Copy link
Member

Choose a reason for hiding this comment

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

$type && is useless asnull won't be equal toImportMapType::CSS anyway

hashbanged reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Hi,@broadcoder! If there's a future need for moreURL_PATTERN_DIST_CSS exclusions based on package name, I think that approach makes total sense. I wonder if this is really just a single edge case?@weaverryan or others? If so, it might make sense for me to drop this PR and for you to submit yours. Idon't want to hijack your effort.

Sidenote: pretty sure I spent most of this PR trying to get that method name right, so props to thinking too alike. :)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks,@stof. I removed that null check.

Copy link
Member

@weaverryanweaverryan left a comment

Choose a reason for hiding this comment

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

Minor thing - but looks good. Thank you for this!

@fabpot
Copy link
Member

Thank you@hashbanged.

@fabpotfabpot merged commit5534989 intosymfony:6.4Dec 20, 2023
@hashbanged
Copy link
ContributorAuthor

Thank you, everyone, for the guidance on this.

xabbuh reacted with heart emoji

@hashbangedhashbanged deleted the fix_52783 branchDecember 20, 2023 15:16
This was referencedDec 30, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

@weaverryanweaverryanweaverryan approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

6.4

Development

Successfully merging this pull request may close these issues.

6 participants

@hashbanged@carsonbot@broadcoder@fabpot@weaverryan@stof

[8]ページ先頭

©2009-2025 Movatter.jp