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

Change directory structure #2

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@itkrt2y
Contributor

itkrt2y commented Dec 7, 2016

I think that app/packs/javascripts is closer to the Rails way of naming things, rather than app/javascript/packs/. Also, app/packs/javascripts is more future-proof, as it will let us add other assets, for example stylesheets under app/packs/stylesheets/.

@dhh

This comment has been minimized.

Show comment
Hide comment
@dhh

dhh Dec 7, 2016

Member

I'll explain this properly in the README. But the intention is that app/javascript is where all your app-like JS lives. Within that, we just use packs/ as a convention to create entry targets for webpack. So whatever you put in packs/ is what you want to have compiled via webpack as an entry. Every bit of "real code" should just live in app/javascript, like app/javascript/calendar/index.js or whatever.

Member

dhh commented Dec 7, 2016

I'll explain this properly in the README. But the intention is that app/javascript is where all your app-like JS lives. Within that, we just use packs/ as a convention to create entry targets for webpack. So whatever you put in packs/ is what you want to have compiled via webpack as an entry. Every bit of "real code" should just live in app/javascript, like app/javascript/calendar/index.js or whatever.

@dhh dhh closed this Dec 7, 2016

@itkrt2y

This comment has been minimized.

Show comment
Hide comment
@itkrt2y

itkrt2y Dec 7, 2016

Contributor

Thanks, I understand.

Only one more thing, I think it would be better to use plural name like app/javascripts/ than app/javascript/.
What do you think about it? @dhh

Contributor

itkrt2y commented Dec 7, 2016

Thanks, I understand.

Only one more thing, I think it would be better to use plural name like app/javascripts/ than app/javascript/.
What do you think about it? @dhh

@dhh

This comment has been minimized.

Show comment
Hide comment
@dhh

dhh Dec 7, 2016

Member

I went with app/javascript specifically to highlight the difference to app/assets/javascripts. To me, JavaScripts is great when you consider these things just that: A collection of independent scripts. Kinda what we call sprinkles.

But for this, we're building systems, not individual scripts. Kinda like if we did app/ruby rather than app/rubies.

Hope that makes sense.

Member

dhh commented Dec 7, 2016

I went with app/javascript specifically to highlight the difference to app/assets/javascripts. To me, JavaScripts is great when you consider these things just that: A collection of independent scripts. Kinda what we call sprinkles.

But for this, we're building systems, not individual scripts. Kinda like if we did app/ruby rather than app/rubies.

Hope that makes sense.

@itkrt2y

This comment has been minimized.

Show comment
Hide comment
@itkrt2y

itkrt2y Dec 8, 2016

Contributor

OK, now I totally understand. Thanks a lot!

Contributor

itkrt2y commented Dec 8, 2016

OK, now I totally understand. Thanks a lot!

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