AdminLTEBundle icon indicating copy to clipboard operation
AdminLTEBundle copied to clipboard

AdminLTEBundle -- The next generation (Brainstorming)

Open tacman opened this issue 4 years ago • 6 comments

With Symfony 6 around the corner and PHP 8 nearly a year old, and Bootstrap now at 5.1, I'd like to brainstorm about a new-and-improved branch of AdminLTEBundle, using the latest versions of Bootstrap and the best practices of Symfony 5.3/6.

Ideas for brainstorming:

  • Drop the internal menu system and only use KnpMenuBundle
  • Drop FOSUserBundle, initially support Symfony's "new" security (enable_authenticator_manager: true)
  • Use Stimulus for menu and other components requiring javascript
  • Use HInclude instead of embedding the controller.
  • Embed recipes now that Flex has gone serverless

I'm sure there are more, but those are some of the things I've done in the past, when working with my fork of this bundle.

Thoughts? I'm definitely interested in helping out with these.

tacman avatar Oct 13 '21 12:10 tacman

My thoughts are a bit different, probably because I come from another background.

Drop the internal menu system and only use KnpMenuBundle

When you build an entirely new bundle, then people will either not upgrade or have massive troubles upgrading. It might be easier to build, but the logic is already in place, so why dropping it?

Use Stimulus for menu and other components requiring javascript

I am against any frontend rendering framework that is not already included in AdminLTE. Instead I'd like to build extension points, so you can easily use eg. Stimulus.

Drop FOSUserBundle, initially support Symfony's "new" security (enable_authenticator_manager: true)

I am totally fine with dropping the FOSUserBundle support. I already dropped it from several of my apps and it works fine with this bundle. So shouldn't be too complicated.

Use HInclude instead of embedding the controller

Controllers are not included since some releases. I removed them, because sub-requests are extremely expensive. Not sure about hinclude, because I never needed & used it.

Embed recipes now that Flex has gone serverless

I read some news about the latest Flex release, but don't have the full picture. Whatever improves DX is good for the bundle!

I think we should add all these improvements to the adminlte-v3 branch and push that forward.

kevinpapst avatar Oct 14 '21 14:10 kevinpapst

I am against any frontend rendering framework that is not already included in AdminLTE.

It's not really a rendering framework. It's just a much cleaner way to incorporate javascript, and since bootstrap 5 drops jQuery, there's no real reason for AdminLTE to require it. But yes, the changes should likely be at at the AdminLTE level, not the AdminLTEBundle level. As it is, the adminlte.js is somewhat difficult to incorporate, as discussed in other threads.

I think we should add all these improvements to the adminlte-v3 branch and push that forward.

Sure, but adminlte-v3 is bootstrap 4, what about pushing these to adminlte-v4 (bootstrap 5, Symfony 5/6)? Obviously, lots of BC changes, but that branch would certainly be for developers who wanted the cutting edge / best practices of the latest Symfony/Bootstrap.

On a related note, I think this component holds a lot of promise: https://github.com/symfony/ux-twig-component for replacing some of the complicated include/embed elements within the AdminLTEBundle layout.

Controllers are not included since some releases. I removed them, because sub-requests are extremely expensive.

HInclude is simply a way to dynamically load part of a page. It's a sub-request, but happens at the browser level. For example, I use it to load the dropdown and user profile in the navbar. The HTML loads the initial layout (so fast and small), then HInclude populates the rest of those elements in the background, usually cached anyway. Inspired by your use of embedding controllers, but with less overhead. https://symfony.com/doc/current/templating/hinclude.html

tacman avatar Oct 14 '21 14:10 tacman

Yeah, I know Stimulus is not like Angular/Vue/FooBar.js. That was just a lazy way of expressing my thoughts about the ever changing world of Javascript frameworks. I am not keen to chase after them, it is already enough work on the backend to stay up to date 😁

What I'd like to avoid though is to use the "latest and greatest shit" out there. Because this normally means blocking a lot of users from using it.

And (here I am going to admit that I am and old-school guy) I am not a fan of building apps, that require Javascript to be enabled. But that is another topic. I think we should try to build extension points, which allows to simply enable certain features (eg. hinclude, stimulus) for everyone who wants to use it. Good idea!

I am fine with building a new bundle version from scratch for a next mayor release. But I am not going to do that on my own. I simply don't have the urge/need for it right now. But I am happy to join and throw in my time to make it available. Because then I would certainly start to use it in my projects.

If we can find a set of basic components and versions that we want to use, we can start thinking about a first tech-demo / prototype. I don't necessarily agree with the "best practices for bundles" and don't think we need to support every LTS version of Symfony (which is good for the community but probably blocks the use of certain features). But Symfony 5 should at least be supported. I wouldn't require PHP 8 yet, but I guess that is not needed as well for a "theme bundle". Not for the sake of using the latest syntactic sugar.

I throw another idea into the room regarding the template: did you ever work with tabler.io ? I really like it and think it offers everything (or even more) that AdminLTE has to offer. It is MIT licensed, stable and maintained: https://preview.tabler.io

kevinpapst avatar Oct 16 '21 09:10 kevinpapst

Wow, I don't know how I missed tabler. Indeed, it does look like it offers everything that AdminLTE does, and is already on Bootstrap 5 with no jQuery dependency.

I agree with building extension points. One approach is to build a demo at the same time the bundle is being developed, the demo shows how to use it. Like you did with AdminLTEBundleDemo. The demo app could be responsible for generating the final pages, and data for JSON consumption, and the bundle itself would contain twig templates that could be included or embedded.

I wish I understood javascript components better. Sigh. But I do think an admin bundle needs to include some javascript (certainly bootstrap's), as does an admin demo. I prefer stimulus because it moves away from adding class names to data elements and then having the js act on those classes, and instead sends values and targets to the js controller.

Anyway, I'll play around with tabler a bit. I'm a little concerned that they reference a "Pro" version, which I think right now is just their email system, but not sure. WIth others (volt, adminkit https://github.com/adminkit/adminkit), the pro version offers more features, but it's harder to develop and open source bundle that works with both. adminkit dropped their nested sidebar menu support on their free version with no notice, and all my sites based on it stopped working. I purchased the pro version, but I couldn't use it in my public repos. Then I had the mess of bootstrap5 with almost everything, and needed an admin theme for the layout.

tacman avatar Oct 16 '21 12:10 tacman

I tried to build a new bundle fir Tabler (with success) and decided to go with it in the future. I am already using the tablet theme for two Jekyll sites and have a good feeling about it.

The migration of existing apps is obviously problematic. Going from Bootstrap 3 to 5 alone needs a lot of adjustments.

Without comments and any docs so far here is a first working draft: https://github.com/kevinpapst/TablerBundle/tree/initial I'd be happy to receive feedback and get help along the way. Install it with composer require kevinpapst/tabler-bundle dev-initial

This comment is also my "official statement", that I am not going to support the v3 of AdminLTE with this bundle. I never liked the way the project took since it transitioned to Colorlib and have no time to maintain it, as I don't need it for myself.

If someone wants to take over: forking the repository and starting from the v3 branch would be the best way to go forward. If I see this repository being actively maintained I would be happy to cross link it from this bundles README.

kevinpapst avatar Oct 25 '21 16:10 kevinpapst

Thanks, Kevin, very exciting!

Is there a project that uses this to see how it's used?

Thanks,

Tac

On Mon, Oct 25, 2021 at 12:26 PM Kevin Papst @.***> wrote:

I tried and decided to go with Tabler in the future. I am already using it for two Jekyll sites and have a good feeling about it.

The migration of existing apps is obviously problematic. Going from Bootstrap 3 to 5 alone needs a lot of adjustments.

Without comments and any docs so far here is a first working draft: https://github.com/kevinpapst/TablerBundle/tree/initial I'd be happy to receive feedback and get help along the way. Install it with composer require kevinpapst/tabler-bundle dev-initial

This comment is also the official statement, that I am not going to support the v3 of AdminLTE with this bundle. I never liked the way the project took since it transitioned to Colorlib and have no time to maintain it, as I donÄt need it for myself.

If someone wants to take over: forking the repository and starting from the v3 branch https://github.com/kevinpapst/AdminLTEBundle/tree/adminlte-v3 would be the best way to go forward. I that would be actively maintained I would be happy to cross link it from the README.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kevinpapst/AdminLTEBundle/issues/170#issuecomment-951095460, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEXIQI7OOD3C3T563X7JSTUIWAKZANCNFSM5F5BQHBA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tacman avatar Oct 25 '21 19:10 tacman