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 jsdelivr import parsing with no imported value#52508

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

Conversation

weaverryan
Copy link
Member

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

Another new import syntax found by@tacman! I think this one is kind of a bug in the library - a module environment should notimport 'foo' (i.e. import a module and not actually use any value), but our job is just to find these, not judge them ;).

FYI - I have an issue on jsdelivr proposing that they create an API endpoint to expose this info, so we don't need to parse it. They agree and already were thinking about this -jsdelivr/jsdelivr#18538 - so this may be something helpful in the future.

Cheers!

monteiro reacted with thumbs up emoji
@stof
Copy link
Member

stof commentedNov 9, 2023

Actually, if the import has side effects, this is a valid usage.

@tacman
Copy link
Contributor

Ithink in this case the side effect is to add the plugin to the global jquery object.

@weaverryan
Copy link
MemberAuthor

Actually, if the import has side effects, this is a valid usage.

You're right. I guess i'm pleading into the void: "Can we please stop causing side effects with modules!!!" :)

@tacman
Copy link
Contributor

I'm no expert, but I also think the idea of explicitly adding the plugin to jquery is better than automatically adding it, even though it's an additional line of code. Because modules don't allow for conditional imports, I don't see how it's possible to selectively add theme-specific plugins.

That is, if there's are select-bs4, select-bs5 and select-tailwind plugins, and merely importing them adds the plugin to jquery, there's no way to say "no, just bs5".

Better, I think would be

importselectBs5from'select-bs5';importselectBs4from'select-bs4';letplugin=(theme=='bs4') ?selectBs4 :selectBs5;$.addPlugin(plugin);

Allan is working on version 2 of datatables, as importmaps and javascript modules become more prominent perhaps he'll allow something like that.

@stof
Copy link
Member

stof commentedNov 9, 2023

@tacman that's something to discuss elsewhere. AssetMapper has to handle JS files as they exist.

@weaverryanweaverryanforce-pushed theasset-mapper-jsdelivr-no-import branch froma789bdf todb7f7eaCompareNovember 9, 2023 18:10
@weaverryanweaverryanforce-pushed theasset-mapper-jsdelivr-no-import branch fromdb7f7ea todc1b27dCompareNovember 10, 2023 02:24
@fabpotfabpot merged commit3128c60 intosymfony:6.4Nov 10, 2023
This was referencedNov 10, 2023
@tacman
Copy link
Contributor

Yes, it's working now, the datatables modules are working. And fontawesome is working when I add those lines, I'm not sure if there's supposed to be a way to simply import.

@weaverryanweaverryan deleted the asset-mapper-jsdelivr-no-import branchNovember 11, 2023 01:31
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@stofstofstof left review comments

Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

[AssetMapper] jQuery plugin fails locally but not remotely
5 participants
@weaverryan@stof@tacman@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp