Skip to content

Conversation

@BPScott
Copy link
Member

@BPScott BPScott commented Nov 26, 2021

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?

  • Fixes a case where a file imported content from the components index
  • Replaces the export * from './components'; in src/index.ts with the contents of src/components/index.ts
  • Deletes src/components/index.ts

How 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

components should be referenced directly rather than from an index file
@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2021

size-limit report

Path Size
cjs 165.74 KB (-0.06% 🔽)
esm 96.38 KB (+0.02% 🔺)
esnext 143.07 KB (+0.02% 🔺)
css 34.34 KB (0%)

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.

2 participants