Skip to content
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

Record instead of Tuple for checkMisspelledPlugin #110151

Closed
wants to merge 2 commits into from

Conversation

prdoyle
Copy link
Contributor

@prdoyle prdoyle commented Jun 25, 2024

I came across this and I wondered if we ought to be moving away from Tuple.

Do people consider this an improvement?

Really, records are just tuples with proper names for the components, plus they support primitive types.

@prdoyle prdoyle added >non-issue :Core/Infra/Plugins Plugin API and infrastructure Team:Core/Infra Meta label for core/infra team labels Jun 25, 2024
@prdoyle prdoyle requested a review from a team as a code owner June 25, 2024 15:05
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@thecoop
Copy link
Member

thecoop commented Jun 26, 2024

I'm not sure this adds much - if it was exposed outside the method, then definitely, but this is just an internal implementation detail. I'm in the middle, with a slight lean towards leave-as-is, given we use Tuple in plenty of other places too.

@ldematte
Copy link
Contributor

I'm in the middle bit leaning slightly towards change-it :) because I really dislike Tuple, they are so opaque with their v1() and v2(). But in this case, the use is very local (you get them and immediately transform them), so they might be OK.

@prdoyle
Copy link
Contributor Author

prdoyle commented Jun 27, 2024

Agreed with @thecoop that this kind of change only makes sense if we also agree that Tuple is sort of deprecated and we start preferring records everywhere. If that's not a position we're willing to take, then this change doesn't make much sense on its own.

@rjernst
Copy link
Member

rjernst commented Jul 5, 2024

if we also agree that Tuple is sort of deprecated

Tuple is used all over in ES. Deprecating that would be a large change on it's own. While I understand the desire for more meaningful names than v1/v2, I don't think such a change would be worthwhile, it's just noise. We can certainly use records as desired on newer code (and even change code in PluginsService/etc to use recoreds in place of Tuple). But mandating/aligning on replacing Tuple doesn't seem worth the time (maybe once we have Valhalla value types, but even then, Tuple could be made a value type).

@prdoyle prdoyle closed this Jul 8, 2024
@prdoyle prdoyle deleted the records-for-misspelled-plugin branch July 8, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Plugins Plugin API and infrastructure >non-issue Team:Core/Infra Meta label for core/infra team v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants