Remove components index file #4739
Merged
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.
WHY are these changes introduced?
Follow up to #4735.
Importing components from the index file leads to performance slowdowns in tests, per this web decision doc. The conclusion in web was that components should be directly imported rather than via an index and that component indexes should be deleted. Let's do that in polaris too.
#4735 fixed up all cases in tests that imported from the components index.
This PR finishes the job - replacing imports in source code, and removing the components index file.
WHAT is this pull request doing?
export * from './components';insrc/index.tswith the contents ofsrc/components/index.tssrc/components/index.tsHow to 🎩
Tests/TS pass.
Compare the result of running
console.log(Object.keys(require('./build/cjs/index.js')).join('\n'));against a build on main and this branch and note that they contain the same exports. The ordering has changed very slightly but this has no impact on what is available