-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BUGFIX] Pass environment options forward to Engines #14025
Conversation
@@ -499,6 +499,9 @@ function commonSetupRegistry(registry) { | |||
|
|||
registry.injection('view:-outlet', 'namespace', 'application:main'); | |||
|
|||
registry.injection('view', '_environment', '-environment:main'); | |||
registry.injection('route', '_environment', '-environment:main'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These injections should be done in the engine-instance
(because the environment can change per .visit
call).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Updated.
@rwjblue / @trentmwillis is this correct to target master? |
The PR should target master with the commits prefixed with |
This fixes a failing test introduced in the previous test where Engines rendered even though shouldRender was set to false.
b768236
to
d2d6e27
Compare
Updated the commit tags. |
Thanks @trentmwillis! |
Pulled into beta branch, next build should fix for folks... |
Addressing #14015.
There are two commits here. The first simply adds two tests to verify the behavior of
shouldRender: false
in thevisit
API. The latter of those tests failed with an error due to attempting to render when it shouldn't (as described in the issue).The second commit fixes the failing test by passing
-environment:main
from the parent into an EngineInstance. This also resulted in needing to update some tests to setup the registry in an ApplicationInstance that constructs the EngineInstance. I assume this will always happen in a real application, so I figured it made sense to do in the tests.