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

Improve bundling order #1024

Merged
merged 6 commits into from
Feb 21, 2019
Merged

Improve bundling order #1024

merged 6 commits into from
Feb 21, 2019

Conversation

Gnito
Copy link
Contributor

@Gnito Gnito commented Feb 19, 2019

Bundling order with index.js file mitigates problems that might arise when trying to import components
that have circular dependencies to other components.

Note: import-order also affects to the generated CSS bundle file.

Read more from article how-to-fix-nasty-circular-dependency-issues

This is one of the tasks to make the template more consistent so that customization work doesn't end up too deep into problems with their different components and tx processes.


For customizers:
Before you take update from upstream (FTW repository), you should check if you have created new components and figure out where they should be inside src/components/index.js file.

PrimaryButton, SecondaryButton, and InlineTextButton have been changed to use rootClassName when it is appropriate:
https://www.sharetribe.com/docs/guides/how-to-customize-ftw-styles/#styling-responsibility-parent-component-and-its-children

You could just use className prop too (as before), but import-order affects to the generated CSS bundle - so, it's not as safe as using rootClassName.

This means PrimaryButton, SecondaryButton and InlineTextButton.
However, those can still be used as before.
They are changed to use rootClassName for consistency
and protection against future bundling order changes.
They are changed to use rootClassName for consistency
and protection against future bundling order changes.
@Gnito Gnito merged commit 5cecdc9 into master Feb 21, 2019
@Gnito Gnito deleted the improve-bundling-order branch February 21, 2019 16:33
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.

1 participant