WICG/priority-hints

Converge to a single `group` attribute, with values indicating before and after

Closed this issue · 6 comments

I started playing around with an implementation, and having 3 different attributes raises the question of "what happens if multiple attributes with conflicting values are defined?"

It's also cumbersome to implement and feels kinda clunky...
What if we changes that so that the group attribute would be of a "prefix_group" format, e.g. before_critical, in_visual, after_functional?

It would certainly make the implementation cleaner, and I think usage would be simpler as well: one attribute to feature detect, etc.

WDYT?

cc @addyosmani @KenjiBaheux @jakearchibald

If we follow that pattern we would need to accommodate the fact that e.g. after_critical and before_fonts map to the same internal value and allow both.

Alternatively to the prefix approach, I could also go with a group attribute (critical, fonts, functional, visual, late) and a position attribute (before, after)

Yeah, single attribute makes sense. We don't need 'before'/'after' if they simply map to one of the other values.

"before script" is useful, because it works even if browsers change the priority of scripts.

Having "after critical", "fonts", "before visual" all map to the same value doesn't seem useful.

I'm strongly in favor of a single group attribute. If theres little difference in the before/after for each group value that feels like it would cause unnecessary confusion with minimal benefit.

After discussing a few options for approaches at TPAC, the consensus was that there would be more interest in forging ahead here if we opted for a simpler approach, perhaps using a single attribute that indicated whether a request was low, high or default priority.

We're going to go ahead and explore how far we can get with this simpler approach.

Closing as we (@yoavweiss, @domfarolino, Kenji and I) appear to have converged on a single attribute approach for the initial MVP for priority hints. I'd like to evaluate once we have an implementation ready (WIP) that this offers enough value that we can punt on the notion of groups.