ember-fastboot / ember-cli-head

Ember Cli Addon for Adding Content to HTML Head
MIT License
98 stars 34 forks source link

suppressBrowserRender should either be renamed or updated #42

Open reidab opened 6 years ago

reidab commented 6 years ago

As of 0.4.0, the suppressBrowserRender option doesn't really do what it says on the tin. Since the instance-initializer no longer injects {{head-layout}}, returning early from it doesn't actually suppress any rendering.

rwjblue commented 6 years ago

cc @rondale-sc

rondale-sc commented 6 years ago

@reidab I think maybe that shouldn't be config anymore. Since the consuming application is responsible now for when head-layout component gets rendered I'd expect to have that logic co-located with the component call.

Something like:

{{#if fastboot.isFastBoot }}
  {{ head-layout }}
{{/if}}

If that is the case we need to update the README to remove suppressBrowserRender as an option. And remove any logic around it.

@rwjblue thoughts?

nolman commented 6 years ago

Just a heads up - we are using this to dynamically select which CSS gets loaded for our app, when we disable the suppressBrowserRender in fastboot when the app rehydrates the css vanishes as everything in {{head-layout}} gets removed. Not sure what the right name for this variable is but it most likely needs to stay around to prevent triggering a CSS reload.

Duder-onomy commented 5 years ago

I have been running into this issue as well. Fastboot+Ember renders the head, along with all of its special bits (meta tags, structured data etc) Ember comes down the pipe and crushes all of those bits.

If I do what @rondale-sc suggests (wrap the {{head-layout}} in a {{fastboot.isFastBoot}} check. It fixes my problem.