Page MenuHomePhabricator

Add a class to the <html> element with the current Codex version
Open, Needs TriagePublic

Description

As we were figuring out how to handle T312594, which required style changes in both Codex and Vector, @Jdlrobson suggested we add a class to the <html> element specific to the current version of Codex (e.g. codex-v-[version]). That way, applications could write styles that target a specific version, avoiding breaking changes like the ones introduced in this particular case.

We'd like to explore this idea, and implement the solution inside MediaWiki if possible. The codex package could export a VERSION variable, and MediaWIki could grab that version number and add the CSS class.

Event Timeline

I'm not the biggest fan of this idea. Caching issues are problematic, but further polluting the root classes doesn't sound like the best way forward to me. Imagine we gonna end up with version classes of every library or extension.
Current state is horrifying to me from dev experience to orient what's going on:

image.png (194×2 px, 93 KB)

and Vector 2022:
image.png (190×2 px, 98 KB)

Current state is horrifying to me from dev experience to orient what's going on:

The issue is we have too many features flags/preferences, but this seems off-topic (we're working on reducing these by shipping features).

I'm not the biggest fan of this idea. Caching issues are problematic, but further polluting the root classes doesn't sound like the best way forward to me

What would you suggest instead? Perhaps Codex elements themselves could be versioned somehow? It's not just about caching it's about risk. As we swap out incompatible Codex versions we risk UI regressions without a better strategy for clients e.g. Vector using server side rendering to manage the transition from one version to another.

ldelench_wmf moved this task from Inbox to Needs Refinement on the Design-System-Team board.
egardner raised the priority of this task from Medium to Needs Triage.Oct 2 2023, 9:15 PM
egardner moved this task from Needs Refinement to Backlog on the Design-System-Team board.