sonata-project / SonataAdminBundle

The missing Symfony Admin Generator
https://docs.sonata-project.org/projects/SonataAdminBundle
MIT License
2.11k stars 1.26k forks source link

Roadmap to Webpack Encore #7049

Closed jordisala1991 closed 3 years ago

jordisala1991 commented 3 years ago

Feature Request

We recently moved to NPM to handle all the dependencies of our code: https://github.com/sonata-project/SonataAdminBundle/pull/7034

First Round

VincentLanglet commented 3 years ago

It's not clear to me: If this big to-do-list couldn't be finished (quickly/in time), what is required for a new alpha or the stable version ?

jordisala1991 commented 3 years ago

Would be nice for the stable version, but not mandatory. To be noted that some of this will break bc, so if we do it after the stable, will need to be done for 5.0.

For example:

Is it mandatory to have admin lte v3 to release sonata admin v4 stable? Not to me, it would be nice but not mandatory. If we don't get there in time, it will have to wait for 5.0 (or done in a bc way)

VincentLanglet commented 3 years ago

Is it mandatory to have admin lte v3 to release sonata admin v4 stable? Not to me, it would be nice but not mandatory.

If I remember correctly, Admin-lte v3 seems to be a huge change because it will use bootstrap 4 instead of 3. So all the css written in the admin pages by the developper will need to be rewritten. There is already a lot of change for the v4. So IMHO it's better to do it for the v5.

I'm ok to release the stable v4 in 1-2 month and to release the v5 at the end of the year. We should release a new major every year after the v4 to avoid this situation again.

jordisala1991 commented 3 years ago

Im okay with not upgrading admin-lte for v4.

This issue is about making changes that bring value and not blocking releases or try to upgrade a lot of things in a single PR.

jordisala1991 commented 3 years ago

We have a problem with this dependency: Eonasdan dateTime picker

It is installed here (previously it was on core-bundle), but the date form types are actually in https://github.com/sonata-project/form-extensions/tree/1.x/src/Type (they were previously on core-bundle too)

We have at least 3 solutions here:

The only thing with the third option is that we need to configure webpack encore there too.

Edit: To be noted that the eonasdan-bootstrap-datetimepicker is deprecated for tempusdominus-bootstrap-4, but that should be another story because it requires bootstrap 4 and we are not there yet.

wdyt? Maybe there are other options I didn't thought about. @sonata-project/contributors

haivala commented 3 years ago

I have installed bootsratp 4 for the front of my project with webpack and I'm using "tempusdominus-bootstrap-4": "^5.1.2" with

            ->add('deliveryDate', DatePickerType::class, [
                'required' => false,
                'widget' => 'single_text',
                'html5' => true,
                'format' => 'd.M.y',
                'attr' => [
                    'data-toggle'=>"datetimepicker",
                    'data-target'=>"#castingbundle_actorrequest_deliveryDate"
                ],
                'datepicker_use_button' => false,
                'dp_days_of_week_disabled' => [0,6],
                'dp_min_date'              => $date->format('Y-m-d\TH:i:s'),
                'dp_use_current'             => false,
                'dp_show_today' => true,
                'dp_max_date' => $maxdate->format('Y-m-d\TH:i:s'),
                'dp_pick_date' => true

            ])

and I'm rendering it with {{ form_row(form.deliveryDate) }} And it works.

I don't know if this is helpful for your problem but I'm just pointing out that it works with the picker type

jordisala1991 commented 3 years ago

I have installed bootsratp 4 for the front of my project with webpack and I'm using "tempusdominus-bootstrap-4": "^5.1.2" with

            ->add('deliveryDate', DatePickerType::class, [
                'required' => false,
                'widget' => 'single_text',
                'html5' => true,
                'format' => 'd.M.y',
                'attr' => [
                    'data-toggle'=>"datetimepicker",
                    'data-target'=>"#castingbundle_actorrequest_deliveryDate"
                ],
                'datepicker_use_button' => false,
                'dp_days_of_week_disabled' => [0,6],
                'dp_min_date'              => $date->format('Y-m-d\TH:i:s'),
                'dp_use_current'             => false,
                'dp_show_today' => true,
                'dp_max_date' => $maxdate->format('Y-m-d\TH:i:s'),
                'dp_pick_date' => true

            ])

and I'm rendering it with {{ form_row(form.deliveryDate) }} And it works.

I don't know if this is helpful for your problem but I'm just pointing out that it works with the picker type

What version of eonasdan-bootstrap-datetimepicker do you use?

haivala commented 3 years ago

What version of eonasdan-bootstrap-datetimepicker do you use?

none

jordisala1991 commented 3 years ago

Oh you replaced eonasdan-bootstrap-datetimepicker with tempusdominus-bootstrap-4.

Still I don't know if all options of our base date time types are compatible with that package. (Also to be noted that we are still using bootstrap 3 here because of admin-lte v2).

The problem that I am trying to point out is that we are installing a package that gives a features used in another library and that's a problem when trying to upgrade things.

My fear about upgrading this package is this PR: https://github.com/sonata-project/SonataCoreBundle/pull/149

Edit: Now that I see it, most of the changes comes from the fact that it is using bower and replacing a lot of files that are not ours. Adding a third option...

franmomu commented 3 years ago

can we maybe remove those options from form-extensions and add them from here with a Form Type Extension? like EonasdanDatePickerTypeExtension or something like that.

jordisala1991 commented 3 years ago

can we maybe remove those options from form-extensions and add them from here with a Form Type Extension? like EonasdanDatePickerTypeExtension or something like that.

That could be a good thing to try, but not sure about this: https://github.com/sonata-project/form-extensions/blob/1.x/src/Bridge/Symfony/Resources/views/Form/datepicker.html.twig

If those form-extensions types are suposed to work standalone, I am missing something, because there is a coupling with some javascript but the bridge provides none.

franmomu commented 3 years ago

If those form-extensions types are suposed to work standalone, I am missing something, because there is a coupling with some javascript but the bridge provides none.

oops, I thought the templates were here, in that case I guess we should also override them (and not sure how would look like in form-extensions, maybe they won't exist).

jordisala1991 commented 3 years ago

If we remove those templates from the extension, how does it work when used standalone? Not sure about that.

@sonata-project/contributors wdyt?

jordisala1991 commented 3 years ago

A lot of the work required is already done or on PRs already opened. I just moved some tasks to second priority

VincentLanglet commented 3 years ago

A lot of the work required is already done or on PRs already opened. I just moved some tasks to second priority

We might take all the first round in 4.0 and set 5.0 milestone for the second round :)

wbloszyk commented 3 years ago

A lot of the work required is already done or on PRs already opened. I just moved some tasks to second priority

We might take all the first round in 4.0 and set 5.0 milestone for the second round :)

IMO we should consider integration with webpack encore bundle in 4.0. Then other things from second round can be done in 4.x as experimental another encore build.

jordisala1991 commented 3 years ago

I have listed what Githubissues.

  • Githubissues is a development platform for aggregating issues.