Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re exports in @material-ui/core/styles from @material-ui/styles #16147

Closed
aditya1906 opened this issue Jun 11, 2019 · 15 comments
Closed

Re exports in @material-ui/core/styles from @material-ui/styles #16147

aditya1906 opened this issue Jun 11, 2019 · 15 comments

Comments

@aditya1906
Copy link
Contributor

aditya1906 commented Jun 11, 2019

In @material-ui/core/styles we export as default from @material-ui/styles For example:
import { ThemeProvider } from '@material-ui/styles';
export default ThemeProvider;

Can we re export it as default like this?
export {ThemeProvider as default} from '@material-ui/styles'

If you are happy with this idea. I'll create a Pull Request with these changes.

@eps1lon
Copy link
Member

eps1lon commented Jun 11, 2019

If this doesn't have any impact other than stylistic I'd rather not change it.

@aditya1906
Copy link
Contributor Author

In some of the docs inline exports have been used maybe we can change the packages to inline exports for consistency.

@aditya1906
Copy link
Contributor Author

So for consistency purpose maybe it is a good idea to change these re exports to an inline re exports

@joshwooding
Copy link
Member

I’m not sure if this is that important, I’m not against the change but it’s definitely low priority and is only stylistic.

@eps1lon
Copy link
Member

eps1lon commented Jun 11, 2019

If it's only stylistic than I'd rather avoid it.

@aditya1906
Copy link
Contributor Author

aditya1906 commented Jun 11, 2019

But why are we re exporting from @material-ui/styles? Cant we use it directly from @material-ui/styles?
In that case we don't need ThemeProvider from @material-ui/core/styles

@eps1lon
Copy link
Member

eps1lon commented Jun 11, 2019

In that case we don't need ThemeProvider from @material-ui/core/styles

This is just there for convenience.

But why are we re exporting from @material-ui/styles? Cant we use it directly from @material-ui/styles?

I don't understand that statement. Those are the exact same paths you mentioned.

@aditya1906
Copy link
Contributor Author

aditya1906 commented Jun 11, 2019

I don't understand that statement. Those are the exact same paths you mentioned.

In the package wherever we have
import { ThemeProvider } from '@material-ui/core/styles'
Why don't we import it directly from @material-ui/styles
import { ThemeProvider } from '@material-ui/styles'

@aditya1906
Copy link
Contributor Author

Since ThemeProvider in /core/styles and /styles are the exact same functions. So why do we need that in core/styles?

@eps1lon
Copy link
Member

eps1lon commented Jun 11, 2019

It is there for convenience. You can follow the git blame to find more context about this change.

@oliviertassinari
Copy link
Member

@aditya1906 Thanks for the proposal, I agree with Sebastian, it won't make a difference.

@aditya1906
Copy link
Contributor Author

👍

@aditya1906
Copy link
Contributor Author

aditya1906 commented Jun 11, 2019

@oliviertassinari if you don't mind can you review #16137?

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 11, 2019

@aditya1906 I'm aware of this pull request. Asking won't change my priorities. Soon or later I will come to it. No rush :)

@aditya1906
Copy link
Contributor Author

👍 No problem

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

No branches or pull requests

4 participants