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

Merged
merged 2 commits into from Oct 11, 2013

Conversation

Projects
None yet
2 participants
@dariocravero
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

Fixed the loading order of an app's dependencies.
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

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Oct 11, 2013

Member

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

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

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

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Oct 11, 2013

Contributor

@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?

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Oct 11, 2013

Member

Yeah, there's one alphabetic reason, LOL.

Member

ujifgc commented Oct 11, 2013

Yeah, there's one alphabetic reason, LOL.

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Oct 11, 2013

Member

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

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.

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Oct 11, 2013

Contributor

Sounds good to me :)

Contributor

dariocravero commented Oct 11, 2013

Sounds good to me :)

ujifgc added a commit that referenced this pull request Oct 11, 2013

Merge pull request #1449 from padrino/fix-loading-order
Fixed the loading order of an app's dependencies.

@ujifgc ujifgc merged commit 97e21d8 into master Oct 11, 2013

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