Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Proposal: allow individual imports #323

Open
fahad19 opened this issue Jan 31, 2018 · 0 comments
Open

Proposal: allow individual imports #323

fahad19 opened this issue Jan 31, 2018 · 0 comments
Labels

Comments

@fahad19
Copy link

fahad19 commented Jan 31, 2018

Currently

We import components like this:

import { Button } from 'travix-ui-kit';

Proposal

Supporting importing the components individually from top-level imports:

import Button from 'travix-ui-kit/Button';

I would be happy to see named exports for individual components too (this will help in migration keeping backwards compatibility as mention at the bottom):

import { Button } from 'travix-ui-kit/Button';

Why?

If we go ahead with Adaptive Design (see #322) AND use UI-Kit in a server, we don't want to load ALL the components in memory.

Some other not-so-high-prio benefits would include statically analyzing our source code everywhere to figure out unused components that we ship from UI-Kit.

Backwards compatibility

We can still keep backwards compatibility. Just map travix-ui-kit/* to travix-ui-kit as Webpack's externals, and we are good to go.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant