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

add tree-shaking to exports (#946) #973

Closed
wants to merge 1 commit into from

Conversation

Saifadin
Copy link
Contributor

@Saifadin Saifadin commented Oct 8, 2018

Adding tree-shaking to Formik according to (#946 ). This will allow better bundling for users out there, whenever they only import parts oft he application.

@jaredpalmer input is welcome

@TrySound
Copy link
Collaborator

TrySound commented Oct 8, 2018

@Saifadin Your changes doesn't make the code treeshakable. Default exports does not change anything.

@Saifadin
Copy link
Contributor Author

Saifadin commented Oct 8, 2018

Okay good to know, what exactly does then? Any pointers would be helpful ^^

@TrySound TrySound mentioned this pull request Oct 8, 2018
@TrySound
Copy link
Collaborator

TrySound commented Oct 8, 2018

@TrySound
Copy link
Collaborator

TrySound commented Oct 8, 2018

It's merged. Try to rebase to see results.

@TrySound
Copy link
Collaborator

TrySound commented Oct 8, 2018

@jaredpalmer Why you don't use default exports?

@jaredpalmer
Copy link
Owner

jaredpalmer commented Oct 8, 2018

@TrySound Akin FB Haste, we believe that everything should have a unique name in a codebase. Default exports allow people to name things differently across files which is bad. So we almost exclusively use named exports as they are more explicit and have better autocomplete in TS.

@TrySound
Copy link
Collaborator

TrySound commented Oct 8, 2018

@jaredpalmer Agree. I'm not TS user however still think default exports are quite useless and introduce even more problems like interop between cjs and esm.

oliviertassinari/react-event-listener#79

@jaredpalmer
Copy link
Owner

aside from being a huge breaking change, stylistically this can't be merged. Are there other ways to ensure tree-shaking? Or other bundle optimizations? Should we allow preshaking by altering the builds?

@Saifadin
Copy link
Contributor Author

Saifadin commented Oct 9, 2018

I will give it another try today.

@TrySound
Copy link
Collaborator

TrySound commented Oct 9, 2018

#976

@jaredpalmer
Copy link
Owner

Can i close?

@Saifadin
Copy link
Contributor Author

yes

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.

None yet

3 participants