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

Revert "style: introduce aliasing, sort imports (#511)" #520

Merged
merged 2 commits into from
Jun 17, 2021

Conversation

kwajiehao
Copy link
Contributor

Overview

This PR reverts PR #511, or commit 17276df.

We are reverting PR #511 because we found out that the outputs of craco start and craco build were different, resulting in CSS files being imported in an order different to what is intended.

The workarounds we found online were convoluted and would introduce unnecessary complexity to the repo. Furthermore, we also found a library (react-app-rewire-alias) which can help us achieve aliasing with CRA as an alternative to Craco. In addition to the bug associated with Craco here, Craco is also overkill since it's a powerful tool which helps users to extend their default CRA configs for webpack among other things.

As such, we are reverting this commit and will be attempting to reintroduce aliases at a later date.

A sample of how to use react-app-rewire-alias can be found in the vaccinegovsg repo https://github.com/datagovsg/vaccinegovsg-clinic/blob/dev/frontend/config-overrides.js

References:

This reverts commit 17276df.

We are reverting PR #511 because we found out that the outputs
of `craco start` and `craco build` were different, resulting in
CSS files being imported in an order different to what is intended.

The workarounds we found online were convoluted and would introduce
unnecessary complexity to the repo. Furthermore, we also found
a library (react-app-rewire-alias) which can help us achieve aliasing
with CRA as an alternative to Craco. In addition to the bug associated
with Craco here, Craco is also overkill since it's a powerful tool which
helps users to extend their default CRA configs for webpack among other
things.

As such, we are reverting this commit and will be attempting to
reintroduce aliases at a later date.

A sample of how to use react-app-rewire-alias can be found in the
vaccinegovsg repo https://github.com/datagovsg/vaccinegovsg-clinic/blob/dev/frontend/config-overrides.js

References:
- dilanx/craco#57
- DocSpring/craco-antd#12
@@ -20,7 +17,7 @@ export default class HyperlinkModal extends Component {
}
}

changeHandler = (event) => {
changeHandler(event) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should switch back to arrow function definition because it helps us bind the changeHandler to this automatically.

If we wanted to do away with the arrow function definition, we would have to explicitly write this.handleClick = this.handleClick.bind(this)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed with efcbefc

Copy link
Contributor

@prestonlimlianjie prestonlimlianjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@kwajiehao kwajiehao merged commit 866157d into develop Jun 17, 2021
@kwajiehao kwajiehao deleted the revert-aliasing branch June 17, 2021 11:21
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

2 participants