From: | Magnus Hagander <magnus(at)hagander(dot)net> |
---|---|
To: | Dave Page <dpage(at)pgadmin(dot)org> |
Cc: | "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>, PostgreSQL WWW <pgsql-www(at)postgresql(dot)org> |
Subject: | Re: Download navigation UX |
Date: | 2020-07-08 15:16:11 |
Message-ID: | CABUevEzJQUDs42vc9XwJ6sgS9y-pLZDpR8LHiFSSfFS8TFf8-w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-www |
On Wed, Jul 8, 2020 at 1:03 PM Dave Page <dpage(at)pgadmin(dot)org> wrote:
>
>
> On Tue, Jul 7, 2020 at 4:55 PM Magnus Hagander <magnus(at)hagander(dot)net>
> wrote:
>
>>
>> On Tue, Jul 7, 2020 at 5:54 PM Jonathan S. Katz <jkatz(at)postgresql(dot)org>
>> wrote:
>>
>>> On 7/7/20 11:53 AM, Dave Page wrote:
>>> >
>>> >
>>> > On Tue, Jul 7, 2020 at 2:15 PM Jonathan S. Katz <jkatz(at)postgresql(dot)org
>>> > <mailto:jkatz(at)postgresql(dot)org>> wrote:
>>> >
>>> > On 7/7/20 6:02 AM, Dave Page wrote:
>>> > > Here's an updated patch (based on Jonathan's update) which
>>> > combines the
>>> > > inline handler patch and removes the inline handlers from the
>>> main
>>> > patch.
>>> >
>>> > Looking good. One comment:
>>> >
>>> > Given there's nothing dynamic about serving the new apt.js /
>>> > download.js, we don't need to serve those dynamically from the
>>> Django
>>> > app. We can just plop them into "/media/js", e.g.
>>> > "/media/js/download.js" and then this becomes:
>>> >
>>> > <script type="text/javascript"
>>> > src="/media/js/download.js?{{gitrev}}"></script>
>>> >
>>> >
>>> > Thanks - committed with that change.
>>>
>>> Awesome, thanks!
>>>
>>
>> I still stand by my review comment that it shouldn't be multiple JS files
>> for such trivial things.
>>
>
> Hmm, for some reason this and a number of your other messages went into
> spam. I wonder what Google is trying to tell me?
>
Probably something far too close to the truth.. :)
They're in separate files because they are setting up event handlers
> specific to each page. I don't know of a way to do that with a shared file
> without jumping through some likely hacky and fragile hoops to allow the
> code to figure out what page it's been called from - i.e. making sure that
> certain DOM IDs are always unique across any pages the shared file is
> called from, and testing for the existence of those IDs to figure out what
> event handlers to setup at runtime.
>
We already do similar in forms.js, though I have to admit a lot less than I
thought we were. I guess I'm getting it slightly confused with other repos.
We *already* have the requirement to keep "certain DOM Ids" unique -- we
use it for CSS. And I really don't see that as any bigger problem than
keeping the filename of the JS file unique.
Having the separate files is certainly an extra download and slightly less
> cacheable (for a few bytes of code), but I think that's outweighed by the
> additional complexity and code that having a single file would require.
>
It's really more the latency than anything else. I'm pretty strongly on the
side of thinking the cost of that is higher than the small amount of
complexity -- I really don't think it would be much. But no, I'm not
strongly *enough* on that side to actually try to produce proper metrics to
prove it :)
--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Page | 2020-07-08 15:56:37 | Re: Download navigation UX |
Previous Message | Dave Page | 2020-07-08 13:20:48 | Re: apt.postgresql.org django app for www.postgresql.org |