Skip to content

Change directory structure#2

Closed
itkrt2y wants to merge 1 commit into
rails:masterfrom
itkrt2y:change-directory-structure
Closed

Change directory structure#2
itkrt2y wants to merge 1 commit into
rails:masterfrom
itkrt2y:change-directory-structure

Conversation

@itkrt2y

@itkrt2y itkrt2y commented Dec 7, 2016

Copy link
Copy Markdown
Contributor

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

dhh commented Dec 7, 2016

Copy link
Copy Markdown
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.

@dhh dhh closed this Dec 7, 2016
@itkrt2y

itkrt2y commented Dec 7, 2016

Copy link
Copy Markdown
Contributor Author

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

dhh commented Dec 7, 2016

Copy link
Copy Markdown
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.

@itkrt2y

itkrt2y commented Dec 8, 2016

Copy link
Copy Markdown
Contributor Author

OK, now I totally understand. Thanks a lot!

@itkrt2y itkrt2y deleted the change-directory-structure branch December 8, 2016 07:04
guillaumebriday pushed a commit that referenced this pull request Dec 28, 2021
…fest::MissingEntryError (#3232)

* provides two more common errors (fix suggestions) for Webpacker::Manifest::MissingEntryError; see https://stackoverflow.com/questions/52639256/webpackermanifestmissingentryerror

* puts back old veribalge for #4 (was #2)  instead of

* removing reference to npm
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.

2 participants