Re: Admin webcomponents

2021-11-03 Thread Jacob Rief
In the past month, I have written a webcomponent, which encapsulates most of the functionality the Django admin's change view implements. It is very Pythonic/Djangonic in the sense, that it does not require to write any JavaScript, nor HTML. You can just use your Django Form as usual, warp it ins

Re: Admin webcomponents

2020-07-17 Thread '1337 Shadow Hacker' via Django developers (Contributions to Django itself)
Another advantage that I figured while finishing the DAL 4.0 PoC offering the AutocompleteLight WebComponent support in addition to Select2: - easy to template with Example: def render(self, name, value, attrs=None, renderer=None): choice = self.field.queryset.filter(pk=value).first() deck = s

Re: Admin webcomponents

2020-07-12 Thread '1337 Shadow Hacker' via Django developers (Contributions to Django itself)
Hi all, We got a working PoC here: [https://github.com/yourlabs/djwc](https://yourlabs.io/oss/djwc) Advantages: - no more nodejs - no more webpack - no more form.media - as such, much more reusable - no more manual asset management in templates - works with components of any framework that can

Re: Admin webcomponents

2020-07-11 Thread Carlton Gibson
Hi Both. Jon Dufresne (mainly just him) had been doing a super job removing the jQuery dependencies in the admin, and modernising the JS whilst he's at it. It's approaching just "vanilla" JavaScript, all nice and modern, and linted. The blocker here will be Select2 -- we're not going to rewr

Re: Admin webcomponents

2020-07-11 Thread '1337 Shadow Hacker' via Django developers (Contributions to Django itself)
I cannot state how excited I am to see such as seasoned Django hacker as Jacob being up for the task. I believe I'm not the only one who have had, for a long time now, a vision for Django where the effort in the django.contrib.admin becomes usable outside the admin and end up beating Rails on ge

Re: Admin webcomponents

2020-07-10 Thread Jacob Rief
I'm very much in favor of this. Getting rid of jQuery is a very important step to make Django future-prove. In my other (non-legacy) projects, I currently replaced all JavaScript against webcomponents. I actually made good experience with the StencilJS compiler. Compared to Svelte, I really appr

Admin webcomponents

2020-07-10 Thread '1337 Shadow Hacker' via Django developers (Contributions to Django itself)
Hello everybody, Currently, the admin site provides various form fields, and formsets, that depend on JS scripts. These are loaded by form media. Nowadays, webcomponents have made it into standard HTML, all browsers now support: - Custom Elements: https://w3c.github.io/webcomponents/spec/cust