-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
misc: minor cleanup of audit-details type names #10603
Conversation
} | ||
|
||
export interface OpportunityItem { | ||
/** A more specific table element used for `opportunity` tables. */ | ||
export interface OpportunityItem extends TableItem { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OpportunityItem
was already a TableItem
in tsc's eyes (since it checks using structural typing), this just makes the relationship more explicit. OpportunityItem
exists to let opportunity audits know what properties to include on their table items, while the more generic TableItem
is what details-renderer
knows how to render (regardless of specific keys).
giving it to you @connorjclark since you touched tables last :) |
I know you're not going to like this, but, I feel strongly that this type of change should go into the beta release of a major and not be snuck in in between (or at the very least flagged as an upcoming breaking change in the release notes of the beta as a warning to early testers). It is a change to the structure of details that anyone implementing an alternative renderer (lhci, @mattzeunert @alekseykulikov @benschwarz ) will now have to test against with much less (potentially zero?) lead time. Also if this gets surfaced in PSI (I think it does?) then that strongly warrants a major version breaking change there because this is the shape of the data changing, not just "sorry some performance metrics might change". |
heyyyyyy now. slow down there 🤠 haha but, aside from that I agree this is too 'breaking' of a change to introduce at this point in the dev cycle. One alternative, if we want to land something now, is to add |
That's fine, I was working on some i18n stuff and it felt stupid to be duplicating it across these two details types, so it seemed like a good idea to finally fix the breaking TODO before 6.0 :) It's really good someone maintaining an alternative renderer is on the core team so these problems come up in review, but I guess the frustrating part is we don't have a process established, so e.g. it's not clear to me why it's not feasible to have another beta between now and...a month from now?...when we do the release. I will, however, be bringing up this example forever whenever we discuss whether something should be added to our public interface :)
This seemed like a good idea to me at first, but one thing that still had to be added to this PR was something in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the flexibility! :)
see below for discussion of original PR and why it was dropped.
Instead, minor cleanup of
audit-details
types:ItemValueTypes
should never have been pluralValues
moved to be in line with other table details namesOpportunityItem
relationship withTableItem
clearerbreaking change: two property name changes intable
audit detailsfollow up to #7177 and #7192 (apparently this was a good task for v5 :)We have two table-like audit details --table
andopportunity
-- that just barely differ in their table-ness:their column headings format have different names for two propertiesopportunity
items
(elements) are essentiallytable
items
with extra constraints(the other stuff on the two objects is fine and not involved in table details rendering)
To render the tables, #7192 introduced a function that turnedtable
tables intoopportunity
tables so there could be a single rendering path.So to unify things, it's just a simple rename of the properties in thetable
headings so everyone is happy and we can remove the old unification function (since grown to functions :). It's good housecleaning but also makes ongoing table rendering work simpler...e.g.subRows
had to be added twice, in bothtable
andopportunity
tables.There's a good bit of churn visually in this PR, but it's mostlys/itemType/valueType
ands/text:/label:
. No test or rendering changes. Significant code changes are indetails-render.js
andaudit-details.d.ts
.