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

Fixed the loading order of an app's dependencies. #1449

Merged
merged 2 commits into from Oct 11, 2013
Merged

Conversation

@dariocravero
Copy link
Contributor

dariocravero commented Oct 11, 2013

If we load apps first, libraries won't be there, hence throwing exceptions at run time.
For example, this can be reproduced with any library that needs to be registered like ScssInitialiazer.
See #1448#issuecomment-26143346. This bug was introduced with this commit

/cc @ujifgc @padrino/core-members

If we load apps first, libraries won't be there, hence throwing
exceptions at run time.
For example, this can be reproduced with any library that needs to be registered like ScssInitialiazer.
See #1448#issuecomment-26143346

Apps not being loaded at the last point makes things like libraries
@ujifgc
Copy link
Member

ujifgc commented Oct 11, 2013

Does it trip here loader.rb#L60 dependency_paths.each{ |path| require_dependencies(path) }?

Can you try broken order with require_dependencies(*dependency_paths)?

@dariocravero
Copy link
Contributor Author

dariocravero commented Oct 11, 2013

@ujifgc that works alright :). I just get informed of the missing constant though which might be a bit annoying for users? See:

  DEBUG -   LOADING (0.0123s) /.../app/app.rb
  ERROR -  NameError: uninitialized constant MyApp::App::ScssInitializer; /.../app/app.rb:3:in `<class:App>'
  DEBUG -   LOADING (0.0123s) /.../lib/mobile_de.rb

Is there any particular reason why you put config/apps.rb on top?

@ujifgc
Copy link
Member

ujifgc commented Oct 11, 2013

Yeah, there's one alphabetic reason, LOL.

@ujifgc
Copy link
Member

ujifgc commented Oct 11, 2013

I think we should keep both fixes: yours with apps.rb on bottom and the launch of circular loader.

…circular loader.
@dariocravero
Copy link
Contributor Author

dariocravero commented Oct 11, 2013

Sounds good to me :)

ujifgc added a commit that referenced this pull request Oct 11, 2013
Fixed the loading order of an app's dependencies.
@ujifgc ujifgc merged commit 97e21d8 into master Oct 11, 2013
1 check failed
1 check failed
default The Travis CI build could not complete due to an error
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.