mi6 / ic-ui-kit

Intelligence Community UI Kit (based on StencilJS)
MIT License
25 stars 27 forks source link

Suggestion: Move from barrel files to absolute imports #2619

Open evenstensberg opened 1 week ago

evenstensberg commented 1 week ago

Summary

Barrel files often makes optimisations and performance worse. This project should move from barrel files to absolute imports to improve performance and readability for components.

πŸ’¬ Description

See above

πŸ’° Use value

πŸ“ Acceptance Criteria

Given removal of barrel files When building the components Then it should improve load times and performance

✏ Designs

N/A

β€―πŸ§Ύ Guidance

Additional info

N/A

evenstensberg commented 1 week ago

I think this should be in v3 as it’s a breaking change.

MI6-255 commented 1 week ago

Thanks for the suggestion. Would you be able to share examples of where this would change in our codebase please?

evenstensberg commented 1 week ago

You export the web components individually and then include the exports in index.js.

This means that the files exported individually should be accessed directly from their folders without the barrel file (index.js)

It’s a bundler issue, so I’ve sent a message in the stencil discord to figure out how it could work.