[Horizon] Paging and Angular...

Marek Lyčka marek.lycka at ultimum.io
Wed Sep 11 15:21:27 UTC 2019


Hi all,

> We can't review your patches, because we don't understand them. For the
patches to be merged, we
> need more than one person, so that they can review each other's patches.

Well, yes. That's what I'm trying to address. Even if another person
appeared to review
javascript code, it wouldn't change anything unless he had +2 and +W rights
though. And even then,
it wouldn't be enough, because two +2 are currently expected for the CR
process to go ahead.

> JavaScript is fine. We all know how to write and how to review JavaScript
code, and there doesn't
> have to be much of it — Horizon is not the kind of tool that has to bee
all shiny and animated. It's a tool
> for getting work done.

This isn't about being shiny and animated though. This is about basic
functionality, usability and performance.
I did some stress testing with large datasets [1], and the non-angularized
versions of basic functionality like
sorting, paging and filtering in table panels are either non-existent, not
working at all or basically unusable
(for a multitude of reasons).

Removing them would force reimplementations in pure JQuery and I strongly
suspect that those
implementations would be much messier and cost a considerable amount of
time and effort.

>AngularJS is a problem, because you can't tell what the code does just by
looking
>at the code, and so you can neither review nor fix it.

This is clearly a matter of opinion. I find Angular code easier to deal
with than JQuery spaghetti.

> There has been a lot of work put into mixing Horizon with Angular, but I
disagree that it has solved problems,
> and in fact it has introduced a lot of regressions.

I'm not saying the NG implementations are perfect, but they mostly work
where it counts and can be improved
where they do not.

> Just to take a simple example, the translations are currently broken for
en.AU and en.GB languages,
> and date display is not localized. And nobody cares.

It's difficult for me to judge which features are broken in NG and how much
interest there is in having them
fixed, but they can be fixed once reported. What I can say for sure is that
I keep hitting this issue
because of actual feature requests from actual users. See [2] for an
example. I'm not sure implementing
that in pure JQuery would be nearly as simple as it was in Angular.

> We had automated tests before Angular. There weren't many of them,
because we also didn't have much
> JavaScript code. If I remember correctly, those tests were ripped out
during the Angularization.

Fair enough.

> Arguably, improvements are, on average, impossible to add to Angular

I disagree. Yes, pure JQuery is probably easier when dealing with very
simple things, but once feature
complexity increases beyond the basics, you'll very quickly find the
features offered by the framework
relevant - things like MVC decoupling, browser-side templating, reusable
components, functionality injection etc.
Again, see [2] for an example.

On a side note, some horizon plugins (such as octavia-dashboard) use
Angular extensively. Removing it
would at the very least break them.

Whatever the community decision is though, I feel like it needs to be made
so that related issues
can be addressed with a reasonable expectation of being reviewed and merged.

[1] Networks, Roles and Images in the low thousands
[2] https://review.opendev.org/#/c/618173/

pá 6. 9. 2019 v 18:44 odesílatel Dale Bewley <dale at bewley.net> napsal:

> As an uninformed user I would just like to say Horizon is seen  _as_
> Openstack to new users and I appreciate ever effort to improve it.
>
> Without discounting past work, the Horizon experience leaves much to be
> desired and it colors the perspective on the entire platform.
>
> On Fri, Sep 6, 2019 at 05:01 Radomir Dopieralski <openstack at sheep.art.pl>
> wrote:
>
>>
>>
>> On Fri, Sep 6, 2019 at 11:33 AM Marek Lyčka <marek.lycka at ultimum.io>
>> wrote:
>>
>>> Hi,
>>>
>>> > we need people familiar with Angular and Horizon's ways of using
>>> Angular (which seem to be very
>>> > non-standard) that would be willing to write and review code.
>>> Unfortunately the people who originally
>>> > introduced Angular in Horizon and designed how it is used are no
>>> longer interested in contributing,
>>> > and there don't seem to be any new people able to handle this.
>>>
>>> I've been working with Horizon's Angular for quite some time and don't
>>> mind keeping at it, but
>>> it's useless unless I can get my code merged, hence my original message.
>>>
>>> As far as attracting new developers goes, I think that removing some
>>> barriers to entry couldn't hurt -
>>> seeing commits simply lost to time being one of them. I can see it as
>>> being fairly demoralizing.
>>>
>>
>> We can't review your patches, because we don't understand them. For the
>> patches to be merged, we
>> need more than one person, so that they can review each other's patches.
>>
>>
>>> > Personally, I think that a better long-time strategy would be to
>>> remove all
>>> > Angular-based views from Horizon, and focus on maintaining one
>>> language and one set of tools.
>>>
>>> Removing AngularJS wouldn't remove JavaScript from horizon. We'd still
>>> be left with a home-brewish
>>> framework (which is buggy as is). I don't think removing js completely
>>> is realistic either: we'd lose
>>> functionality and worsen user experience. I think that keeping Angular
>>> is the better alternative:
>>>
>>> 1) A lot of work has already been put into Angularization, solving many
>>> problems
>>> 2) Unlike legacy js, Angular code is covered by automated tests
>>> 3) Arguably, improvments are, on average, easier to add to Angular than
>>> pure js implementations
>>>
>>> Whatever reservations there may be about the current implementation can
>>> be identified and addressed, but
>>> all in all, I think removing it at this point would be counterproductive.
>>>
>>
>> JavaScript is fine. We all know how to write and how to review JavaScript
>> code, and there doesn't
>> have to be much of it — Horizon is not the kind of tool that has to bee
>> all shiny and animated. It's a tool
>> for getting work done. AngularJS is a problem, because you can't tell
>> what the code does just by looking
>> at the code, and so you can neither review nor fix it.
>>
>> There has been a lot of work put into mixing Horizon with Angular, but I
>> disagree that it has solved problems,
>> and in fact it has introduced a lot of regressions. Just to take a simple
>> example, the translations are currently
>> broken for en.AU and en.GB languages, and date display is not localized.
>> And nobody cares.
>>
>> We had automated tests before Angular. There weren't many of them,
>> because we also didn't have much JavaScript code.
>> If I remember correctly, those tests were ripped out during the
>> Angularization.
>>
>> Arguably, improvements are, on average, impossible to add to Angular,
>> because the code makes no sense on its own.
>>
>>
>>

-- 
Marek Lyčka
Linux Developer

Ultimum Technologies s.r.o.
Na Poříčí 1047/26, 11000 Praha 1
Czech Republic

marek.lycka at ultimum.io <stanislav.ulrych at ultimum.io>
*https://ultimum.io <https://ultimum.io/>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20190911/caf7ddbc/attachment-0001.html>


More information about the openstack-discuss mailing list