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

add development checks for displayName #2141

Merged
merged 2 commits into from
Jul 16, 2024
Merged

Conversation

mayank99
Copy link
Contributor

@mayank99 mayank99 commented Jul 15, 2024

Changes

Follow-up to #2131, all displayNames are now conditionally added only during development.

While this shouldn't make a big difference in the bundle size, the code is only useful for React developer tools, and does add up over time when there are lots of components, so it's good to not have it in the prod build.

Testing

Manually inspected the build outputs to verify that .displayName assignments are correctly present only in the dev build and removed from the prod build.

Docs

Added patch changeset.

@mayank99 mayank99 self-assigned this Jul 15, 2024
@mayank99 mayank99 requested review from a team as code owners July 15, 2024 16:19
@mayank99 mayank99 requested review from r100-stack and Ben-Pusey-Bentley and removed request for a team July 15, 2024 16:19
Copy link
Contributor

@Ben-Pusey-Bentley Ben-Pusey-Bentley left a comment

Choose a reason for hiding this comment

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

A couple of components, Alert.Message, and ListItem.Content still have their displayName values set in the prod build output.

Copy link
Contributor Author

@mayank99 mayank99 left a comment

Choose a reason for hiding this comment

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

@Ben-Pusey-Bentley Good catch, thanks. Fixed in 61bbc8b.

I did a global "find" in the esm/ folder to verify there are no remaining instances.

@mayank99 mayank99 merged commit 5a8fe68 into main Jul 16, 2024
16 checks passed
@mayank99 mayank99 deleted the mayank/displayName-dev branch July 16, 2024 14:24
@imodeljs-admin imodeljs-admin mentioned this pull request Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants