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

Automatically require any files in app/config/initializers #59

Closed
rwjblue opened this issue Mar 12, 2014 · 8 comments · Fixed by #242
Closed

Automatically require any files in app/config/initializers #59

rwjblue opened this issue Mar 12, 2014 · 8 comments · Fixed by #242

Comments

@rwjblue
Copy link
Member

rwjblue commented Mar 12, 2014

Currently there is no automatic way of getting an initializer to run for you. I'm proposing to have any modules in the registry that start with app/config/initializers be required upon startup within the app.js (and start_app.js testing helper).

I can implement this fairly easily if y'all agree.

@MajorBreakfast
Copy link
Contributor

Excellent idea. Also maybe for handlebars helpers. What about putting them directly into app/initializers?

@rwjblue
Copy link
Member Author

rwjblue commented Mar 12, 2014

It doesn't matter too much to me where they go, just that they get loaded automatically.

That said, I personally would prefer to keep the configuration related things inside config. This might be unduly influenced by my Rails background, so I'll leave the final location up to @stefanpenner.

@HeroicEric
Copy link
Contributor

I like this idea but I'm also coming from a Rails background.

I haven't run into this yet but are there ever situations where you would want to require initializers in a specific order? Would this still be configurable?

@MajorBreakfast
Copy link
Contributor

Initializers have their own ordering mechanism with the "before" and "after" property. Pretty cool actually.

I'm for omitting the config folder because initializers are the config themselves.

@stefanpenner
Copy link
Contributor

@rjackson closing in favor of a PR

@yaymukund
Copy link
Contributor

👍 app/initializers

I tried to naively import an initializer from app.js, which in turn imported app.js and it didn't work.

@zonak
Copy link
Contributor

zonak commented Apr 2, 2014

Any updates on this?

@twokul
Copy link
Contributor

twokul commented Apr 2, 2014

@zonak I'm planning to take a stab at it today

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 a pull request may close this issue.

7 participants