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

remove dependency on ember-cli-head #167

Closed
MelSumner opened this issue Aug 14, 2020 · 7 comments · Fixed by #168
Closed

remove dependency on ember-cli-head #167

MelSumner opened this issue Aug 14, 2020 · 7 comments · Fixed by #168
Labels
breaking this will be a breaking change, and a new major version should be released
Milestone

Comments

@MelSumner
Copy link
Contributor

MelSumner commented Aug 14, 2020

TODO: Change ember-page-title to remove the ember-cli-head requirement (for both SSR and in browser)
Teams will have to add the ember-cli-head addon if they want the functionality from both.

This will unblock the related RFC

We'll need to create a new release and do a major version bump.

Notes:
After this is finished, update RFC 645 to add both ember-page-title and ember-cli-head as dev dependencies of apps.

@MelSumner MelSumner added the breaking this will be a breaking change, and a new major version should be released label Aug 14, 2020
@MelSumner MelSumner added this to the v6.0 milestone Aug 14, 2020
@knownasilya
Copy link
Contributor

Any tips on how to approach this? Manually update the title?

@buschtoens
Copy link
Contributor

What about fastboot? 🤔

@MelSumner
Copy link
Contributor Author

@knownasilya that's a good question- I'm going to try to look at it today, but maybe @rwjblue has some advice if he can get to it before me.

@rwjblue
Copy link
Member

rwjblue commented Aug 18, 2020

We don't need ember-cli-head in order to support FastBoot. The scenarios that we need to care about are:

  • client side render (no rehydration)
  • client side render (rehydrating prior)
  • server side render

Both of the client side renders can be accommodated by manipulating document.title directly.

The server side render can be manipulated by setting .title on the internal/private SimpleDOM document. For example, like this:

let document = owner.lookup('service:-document');
let titleEl = document.createElement('title');
let titleContents = document.createTextNode('whatever the title contents should be');
titleEl.appendChild(titleContents);
document.head.appendChild(titleEl);

@rwjblue
Copy link
Member

rwjblue commented Aug 18, 2020

For more context, the service:-document thing is passed through here, and it is basically either going to be the normal global document instance or the FastBoot created SimpleDOM.Document (see here for some inline docs and where that BootOptions is built in FastBoot).

@raido
Copy link
Contributor

raido commented Aug 21, 2020

Just letting know that I am experimenting implementing this. Having some Fastboot issues for few test cases. If I cannot resolve them I'll open draft PR for help.

@raido
Copy link
Contributor

raido commented Aug 22, 2020

Here's a draft PR - #168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking this will be a breaking change, and a new major version should be released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants