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

Create Alias import path for better readability #143

Open
hcho112 opened this issue Jul 25, 2022 · 2 comments
Open

Create Alias import path for better readability #143

hcho112 opened this issue Jul 25, 2022 · 2 comments

Comments

@hcho112
Copy link
Contributor

hcho112 commented Jul 25, 2022

It would help general readability if the import statement read

import { makeFunctionCallSchema } from '@utils/validation/makeFunctionCallModal';

Coming up with aliases for common paths accessed throughout the app will help us reason through code better and avoid 'import hell' while also forcing us to reason through the most proper places to put our code.

What do you think about having aliases for the following folders inside of src/ -> @store/, @ui/, @near/, @config/, @utils/.

One caveat is that we will need to use Craco(preferred) or react-app-rewired instead of react-scripts because react-scripts does not allow for custom webpack configurations.

Originally posted by @roshaans in #134 (comment)

@roshaans
Copy link
Contributor

Fair point about import hell :)

I personally don't like how the folder schema is done now - I feel like it's counterintuitive, but this is how we inherited it. I would prefer to clean it up at some point vs introducing aliases. What do you think @Patrick1904 @judith-Near @hcho112 ?

Originally posted by @marcinbodnar in #134 (comment)

@Patrick1904
Copy link
Contributor

Great initiative @hcho112 and @roshaans - I'd say we should go ahead and make this change now vs later.

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

Successfully merging a pull request may close this issue.

3 participants