Skip to content

content(typescript): use path mappings to simplify imports #21

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bovandersteene
Copy link

content(typescript): use path mappings to simplify imports

content(typescript): use path mappings to simplify imports
@d3lm d3lm changed the title content(app): use path mappings to simplify imports content(typescript): use path mappings to simplify imports Dec 13, 2018
@KwintenP
Copy link
Member

Hey Bo,

Thanks for the submission!
I'm a little hesitant to add this as I have been made aware recently that the typescript team does not approve of this usage. You can find an issue with their remarks on the topic here: microsoft/TypeScript#18972 (comment).

@d3lm
Copy link
Member

d3lm commented Dec 14, 2018

Hey @bovandersteene and @KwintenP,

I agree that there are a few edge cases for when path mappings would make sense. It's quite delicate and for libraries I absolutely agree, e.g. for libraries that the Angular CLI or Nx create. But for just shortening paths in your application I think it's not a good idea to introduce math mappings. But then again, if you treat your folders inside your app as "libs" then it could make sense again. So I think it's not that clear when to use path mappings. But this is just my personal opinion. We can for sure discuss this.

@d3lm
Copy link
Member

d3lm commented Dec 17, 2018

Hey @bovandersteene, what do you think about our comments and the comments from the community in the link @KwintenP posted? I am curious what you think about this and whether it makes sense to add such item to the checklist.

@bovandersteene
Copy link
Author

Hey @d3lm and @KwintenP,

I'm personal in favour and should advice to use it for libraries, like you mention in the Angular CLI or Nx.

But you need to be careful with it.

@KwintenP
Copy link
Member

This is what worries me a little in adding this item. I think it is quite hard to get that message out correctly so that everyone will properly get this.

Do you think it is best not to add it in that case @bovandersteene and @d3lm?

@d3lm
Copy link
Member

d3lm commented Jun 23, 2019

@bovandersteene @KwintenP I think this is a good practice and we should go forward with this PR. For Angular apps it makes sense to use path mappings, whereas for node it could cause some issues. I have also asked around on social media and most people agree that path mappings are / should be a best practice that projects should follow.

@bovandersteene
Copy link
Author

@d3lm I think we should go forward with this

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.

3 participants