Skip to content
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

Feat: Drop jQuery and bootstrap #75

Open
kl3sk opened this issue Sep 14, 2023 · 10 comments
Open

Feat: Drop jQuery and bootstrap #75

kl3sk opened this issue Sep 14, 2023 · 10 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@kl3sk
Copy link

kl3sk commented Sep 14, 2023

Hello,

I think jQuery can be dropped in favour of vanilla JS.

On the other hand, Bootstrap can be dropped (but used as a separate template or leaving its classes),

last but not least, all assets could be managed by the new (I didn't test yet) Asset mapper.

This could reduce dramatically the size of the bundle to be focused on what it is meat to be "Schedule", and let the user to choose their own strategies.

Note:
Unfortunately Boostrap confirmation is not Bootstrap 5 ready (and may will not). and already use jQuery

But other alternative can be considered like

Thanks

@Chris53897
Copy link
Collaborator

Hi,
i just migrated a project to AssetMapper. It looks good, and i hope it will improve over time.

Idea:
This bundle could run a command to install/update the js dependencies.
php bin/console importmap:require "bootstrap@^4.6.0"

In best case with lazy load as default (Without --preload).
And load the js resource as page specific content.

The main problem that i see, is that projects can have already bootstrap in there project with a different version.

One part of the solution could be the entrypoints mentioned here. But i did not take a closer look.
symfony/symfony#51543

Greetz

@Chris53897
Copy link
Collaborator

I will have a look at the suggested js libs, as soon as if i have some time.
UX-Autoconplete uses Tom-Select. I migrated from Select2 to Tom-Select in a company project.

@kl3sk
Copy link
Author

kl3sk commented Sep 25, 2023

Hello,

Yes I think Tom select is better (I personally use it too). Just try to match your use cases.

UX-autocomplete is for me a good alternative.

@kl3sk
Copy link
Author

kl3sk commented Sep 25, 2023

Hi, i just migrated a project to AssetMapper. It looks good, and i hope it will improve over time.

Idea: This bundle could run a command to install/update the js dependencies. php bin/console importmap:require "bootstrap@^4.6.0"

In best case with lazy load as default (Without --preload). And load the js resource as page specific content.

The main problem that i see, is that projects can have already bootstrap in there project with a different version.

One part of the solution could be the entrypoints mentioned here. But i did not take a closer look. symfony/symfony#51543

Greetz

An other solution could be to have multiple templates (as Symfony do) for either bootstrap 4 and 5 (why not more).
I personally totally override your template to remove every thing I don't need (mostly jQuery) and extend my own "base.html.twig".

Providing a "base" template is not a good way for me. In an other hand it is easier to override 😉.

Because bootstrap confirm is not compatible with Bootstrap5 I try to write my own plugin.

@Chris53897
Copy link
Collaborator

Ryan Weaver works hard to improve the AssetMapper Component. I love it.
But not every user-project will use AssetMapper. And make this optional with an additional version is of course more work, than less.

I am in favour to have less dependencies. But i guess i do not have time to implement this. At least not in the near future. PR's welcome

@Chris53897 Chris53897 added enhancement New feature or request help wanted Extra attention is needed labels Oct 7, 2023
@kl3sk
Copy link
Author

kl3sk commented Jan 13, 2024

Just to try it out, I'm trying to implement AssetMapper in this bundle. Unfortunately, I haven't mastered AssetMapper yet.

If you have any clue on how to do it I'm glad to ear you.

@Chris53897
Copy link
Collaborator

I have integrated it in 2 real projects. But i do not how to use AssetMapper depedencies in Bundles.
Before you start working on this, maybe @weaverryan can help if this is possible in general.

@weaverryan
Copy link

We don't have a clear path yet for bundles to rely on AssetMapper, which is a bummer. The problem is that if a bundle requires symfony/asset-mapper, then if a user doesn't use it, it'll get installed... and the user will end up with importmap.php, etc., and will also now need to run asset-map:compile during deploy. That really sucks - it would be SO handy to use AssetMapper in bundles. But we're not there yet, at least I can't think of a reasonable path yet.

@Chris53897
Copy link
Collaborator

Thanks for the input Ryan and all the work for the AssetMapper-Component.

@kl3sk It is way more simpler to, just add split/copy the templates. One for standalone use (this already exists), and one for integration into an existing layout. Additional some documentation needs to be written, which command are necessary to integrate the external libs with AssetMapper

@kl3sk
Copy link
Author

kl3sk commented Jan 20, 2024

@weaverryan thanks for all your work for the Symfony community.

@Chris53897 I will dive into it when I found some time. Please be patient.

I'll thanks everyone for this great community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants