Import RadioList and Dropdown by uicore subpath, not the barrel - #156
Open
gcutrini wants to merge 1 commit into
Open
Import RadioList and Dropdown by uicore subpath, not the barrel#156gcutrini wants to merge 1 commit into
gcutrini wants to merge 1 commit into
Conversation
personal-information and lawpay-form each imported a single component from the openstack-uicore-foundation/lib/components barrel, which pulls the whole uicore component set (react-select, react-bootstrap, tables, editors) into the bundle. Import each from its own subpath instead: - RadioList -> lib/components/inputs/radio-list - Dropdown -> lib/components/inputs/dropdown Both are default exports the barrel just re-exports, so behavior is identical. This lets a bundler drop the rest of the barrel, which shrinks the web-component build of this widget substantially.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ref: https://app.clickup.com/t/86bbk4x0m
personal-information and lawpay-form each imported a single component from the
openstack-uicore-foundation/lib/componentsbarrel. Requiring the barrel pulls the entire uicore component set (react-select, react-bootstrap, tables, editors) into any bundle that includes this widget.Switch both to their own subpaths:
RadioList->lib/components/inputs/radio-listDropdown->lib/components/inputs/dropdownBoth are default exports that the barrel simply re-exports, so the imports are exact equivalents and behavior is unchanged. The win is bundle size: a bundler can now drop the rest of the barrel. This matters most when the widget is built as a self-contained web component, where the barrel was dragging the whole component tree into the output.