Skip to content

Conversation

@JonasBa
Copy link
Member

@JonasBa JonasBa commented Nov 19, 2025

Refactor reducer spread or concat operations in a couple places where this might be sensitive

@JonasBa JonasBa requested review from a team as code owners November 19, 2025 19:08
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 19, 2025
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These all seem very reasonable!

Comment on lines -151 to +155
// TODO: result.union(s) when Set.prototype.union is Baseline
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/union
(result, s) => new Set([...result, ...s]),
new Set([])
);
return Object.values(TagFilterData).reduce<Set<string>>((acc, set) => {
for (const tag of set) {
acc.add(tag);
}
return acc;
}, new Set());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at the comment: Set.union is baseline since June 2024. also we could probably run this once instead of having a function that does this?

export const sentryDefaultTags = Object.values(TagFilterData).reduce(
  (result, s) => result.union(s),
  new Set()
);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm probably more conservative than I need to be here tbh, in part because I don't trust our tooling to tell me if this falls into our browserslist or not. Would be great to know if we should be seeing any warnings here or not

@JonasBa JonasBa enabled auto-merge (squash) December 8, 2025 17:55
@JonasBa JonasBa merged commit ac52c44 into master Dec 8, 2025
48 checks passed
@JonasBa JonasBa deleted the jb/complexity/nits branch December 8, 2025 18:06
ryan953 pushed a commit that referenced this pull request Dec 9, 2025
Refactor reducer spread or concat operations in a couple places where
this might be sensitive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants