question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fastboot initial title render

See original GitHub issue

A repost of #43. The title in the html payload is the initial state and not the final state.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
mminkoffcommented, Nov 24, 2017

That’s correct @Ravenstine but yes it does depend on also using ember-cli-head (and adding setTitle to your route which then sets the title on the headData service.

If you don’t use ember-cli-head then perhaps you’d have to use the method they use to affect what’s in the head - the -in-element helper/component, which seems to be private/undocumented. See here: https://github.com/ronco/ember-cli-head/blob/master/addon/templates/components/head-layout.hbs

1reaction
mminkoffcommented, Nov 20, 2017

I don’t feel quite sure enough about how best to fix this but I believe I’ve identified the problem.

In document-title.js, collectTitleTokens ultimately calls setTitle when it reaches a route with title set. However, it calls the router’s setTitle, which is set when Router is reopened lower down in that module, not the route’s setTitle. I added

  if(self.setTitle && typeof self.setTitle === 'function') {
    self.setTitle(finalTitle);
  }

right before the call to self.router.setTitle and it solved the problem, though perhaps there’s some better option? Please advise and I’ll be happy to submit a pull request.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shoebox - Ember FastBoot
By performing initial renders on the server, your Ember app is accessible to search ... This addon allows you to specify the page...
Read more >
title does not update after initial load · Issue #37 - GitHub
I've inspected headData.title , which is updating properly, but I've no idea why it's not rendered correctly after initial load when property changes....
Read more >
FastBoot network mocking | EmberMap
If we pull up this page in Chrome, we'll see it makes 3 network requests during its initial render : GET /api/v1/sessions/current GET ......
Read more >
FastBoot testing | EmberMap
FastBoot tests are focused on verifying the initial render from your FastBoot-generated HTML. User behavior like following links and filling in forms should ......
Read more >
Where is Fast Boot ™? - Ember.JS
I would like to generate an almost complete page server-side, then render it in the browser and then bind a couple of Ember...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found