Fastboot compatibility #1

Merged
merged 3 commits into from Feb 10, 2016

Conversation

Projects
None yet
2 participants
@ronco
Owner

ronco commented Feb 4, 2016

Manually construct head component (for fastboot).

Instantiating the component automatically through the container throws an exception under fastboot because a new DomHelper is created which relies upon document.

For full functionality we will also need an index.html placeholder, and updates to ember-fastboot-server to serialize the head component.

@rwjblue

View changes

addon/instance-initializers/head.js
- );
- component.appendTo('head');
+ const componentFactory =
+ instance.__container__.lookupFactory('component:head-content');

This comment has been minimized.

@rwjblue

rwjblue Feb 4, 2016

Collaborator

use instance._lookupFactory instead

@rwjblue

rwjblue Feb 4, 2016

Collaborator

use instance._lookupFactory instead

This comment has been minimized.

@ronco

ronco Feb 4, 2016

Owner

👍

@ronco

ronco Feb 4, 2016

Owner

👍

@rwjblue

View changes

addon/instance-initializers/head.js
+ // explicitly set renderer & domhelper in case we're in fastboot
+ const component = componentFactory.create({
+ renderer,
+ container,

This comment has been minimized.

@rwjblue

rwjblue Feb 4, 2016

Collaborator

This isn't quite right in 2.3.0+.

Would need to do:

const component = componentFactory.create(
  instance.ownerInjection(), 
  {
    renderer,
    _domHelper: renderer._dom
  }
});
@rwjblue

rwjblue Feb 4, 2016

Collaborator

This isn't quite right in 2.3.0+.

Would need to do:

const component = componentFactory.create(
  instance.ownerInjection(), 
  {
    renderer,
    _domHelper: renderer._dom
  }
});
@rwjblue

This comment has been minimized.

Show comment
Hide comment
@rwjblue

rwjblue Feb 4, 2016

Collaborator

Left a few nit-picks, but looks good otherwise.

Collaborator

rwjblue commented Feb 4, 2016

Left a few nit-picks, but looks good otherwise.

@ronco

This comment has been minimized.

Show comment
Hide comment
@ronco

ronco Feb 5, 2016

Owner

Thanks! It'll be a couple days till I can work on this again, but I'll try
to have it all buttoned up before next weeks hangout.
On Thu, Feb 4, 2016 at 4:35 PM Robert Jackson notifications@github.com
wrote:

Left a few nit-picks, but looks good otherwise.


Reply to this email directly or view it on GitHub
#1 (comment).

Owner

ronco commented Feb 5, 2016

Thanks! It'll be a couple days till I can work on this again, but I'll try
to have it all buttoned up before next weeks hangout.
On Thu, Feb 4, 2016 at 4:35 PM Robert Jackson notifications@github.com
wrote:

Left a few nit-picks, but looks good otherwise.


Reply to this email directly or view it on GitHub
#1 (comment).

ronco added some commits Feb 4, 2016

compatability with Ember < 2.3 for non-Fastboot
If FastBoot isn't found in the sandbox go ahead and straightup lookup
the component, this keeps things compatible in older ember versions.

ronco added a commit that referenced this pull request Feb 10, 2016

@ronco ronco merged commit a32b5a0 into master Feb 10, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@ronco ronco deleted the feature/fastboot-compat branch Feb 10, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment