Giter Site home page Giter Site logo

ember-cli / ember-page-title Goto Github PK

View Code? Open in Web Editor NEW
187.0 17.0 57.0 7.5 MB

Page title management for Ember.js Apps

Home Page: https://ember-cli.github.io/ember-page-title/

License: Other

JavaScript 60.50% HTML 4.73% Handlebars 1.93% TypeScript 32.84%
ember fastboot addon title

ember-page-title's Introduction

ember-page-title Ember Observer Score CI

This addon provides a helper for changing the title of the page you're on.

Installing via ember-cli

ember install ember-page-title

Compatibility

  • Ember.js v3.28 or above
  • Ember CLI v3.28 or above
  • Node.js v14 or above
Fastboot vs Non-Fastboot Notes

Post Install Setup Notes

As of v3.0.0 this addon maintains the page title by using the <title> tag in your document's <head>. This is necessary for FastBoot compatibility.

Non-fastboot apps should keep the <title> tag in index.html to ensure that the initial page is valid HTML. The title will be removed and replaced when your app boots.

Fastboot apps MUST remove the <title> tag from index.html. As of v6.0.0 this is done automatically if you use ember install ember-page-title to install this addon. Can also be run manually using ember g ember-page-title to update the title if FastBoot is installed.

Digging in

Visit the Docs site

API

{{page-title}} Helper

attribute type default description
separator string " | " Which separator should be displayed after this instance of {{page-title}}
prepend boolean true If the token should be prepended or appended to the list of tokens
replace boolean false Replace all previous elements with the active
front boolean false If the token should always be in the beginning of the resulting title.

The default values for separator, prepend and replace are configurable via config/environment.js:

// config/environment.js

module.exports = function (environment) {
  let ENV = {
    pageTitle: {
      replace: true,
    },
  };

  return ENV;
};

For usage in gts and gjs, the pageTitle helper is exported from the index:

import { pageTitle } from 'ember-page-title';

<template>
  {{pageTitle "About"}}
  
  ...
</template>

page-title Service

If you want to be notified when the page title has been updated, you can extend and override the page-title service and provide your own titleDidUpdate hook. The titleDidUpdate hook receives the new title as its sole argument.

// app/services/page-title.js

import EmberPageTitleService from 'ember-page-title/services/page-title';

export default class PageTitleService extends EmberPageTitleService {
  titleDidUpdate(title) {
    // Do something with the new title.
  }
}

Testing

assert the page title with the supplied getPageTitle test helper:

import { getPageTitle } from 'ember-page-title/test-support';

module('Acceptance | Register Page', function (hooks) {
  setupApplicationTest(hooks);

  test('visiting /register', async function (assert) {
    const registerURL = '/register';
    await visit(registerURL);

    assert.equal(currentURL(), registerURL);
    assert.equal(getPageTitle(), 'Register | Some Website');
  });
});

TypeScript and Glint

If your project uses loose-mode templates, you can merge in the template registry interface provided by ember-page-title,

// <your-app>/types/glint.d.ts
import '@glint/environment-ember-loose';
import '@glint/environment-ember-template-imports';

import type PageTitle from 'ember-page-title/template-registry';

declare module '@glint/environment-ember-loose/registry' {
	export default interface Registry extends PageTitle {
        /* your local loose-mode entries here */
	}
}

Similarly, if you rely on a service registry, you'll want to import ember-page-title's service registry and extend from it.

import type PageTitle from 'ember-page-title/service-registry';

declare module '@ember/service' {
  interface Registry extends PageTitle {
        /* your local service entries here */
  }
}

or, if you wish to manage how the service becomes registered yourself, you may import the service:

import type PageTitle from 'ember-page-title/services/page-title';

Upgrading notes for 5.x to 6.x

  • ember-page-title no longer requires the usage of ember-cli-head. Please remove {{head-layout}} from your application's application.hbs route template.
  • {{title}} has been removed, please rename to {{page-title}}.

Contributing

Contributors are welcome! Please provide a reproducible test case. Details will be worked out on a case-per-case basis. Maintainers will get in touch when they can, so delays are possible. For contribution guidelines, see the code of conduct.

Publishing Documentation

To publish documentation, run the following command:

ember github-pages:commit --message "update documentation"
git push origin gh-pages:gh-pages

ember-page-title's People

Contributors

ahmadsoe avatar aklkv avatar begedin avatar bertdeblock avatar boris-petrov avatar buschtoens avatar chriskrycho avatar chrislopresto avatar cvx avatar deanmarano avatar defraz avatar dependabot[bot] avatar ef4 avatar eflanagan0 avatar efx avatar erkie avatar fotinakis avatar greenkeeper[bot] avatar jrjohnson avatar kategengler avatar knownasilya avatar melsumner avatar nullvoxpopuli avatar raido avatar rlivsey avatar ronco avatar scottkidder avatar sergeastapov avatar tim-evans avatar topaxi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-page-title's Issues

Using title within a template

Sorry if this is a stupid/obvious question. I would like to display the current page title at the top of my application page. This addon is great for setting the document title but could I also use it to set the title within the layout template page? If so how do I go about it?

HTML comments inside the title

Hi, I'm having some trouble since this addon generates empty HTML comments inside the <title> tag which unfortunately shows up in Google.

<title><!---->My post title | <!---->Blog | <!---->Site title<!----></title>

In app.hbs I have:

{{document-title seperator=" β€” " prepend="true" title="Kunstjagd"}}

in blog.hbs:

{{document-title title="Blog"}}

and finally in blog/post.hbs:

{{document-title title=model.title}}

Any ideas?

An in-range update of ember-cli-babel is breaking the build 🚨

Version 6.4.2 of ember-cli-babel just got published.

Branch Build failing 🚨
Dependency ember-cli-babel
Current Version 6.4.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

ember-cli-babel is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 5 commits.

  • bf126fe v6.4.2
  • 3f9f223 Merge pull request #158 from dwickern/sourcemaps
  • 8119645 Respect babel sourceMaps option
  • 90cde9e Merge pull request #157 from rwjblue/add-plugin-info
  • b5aa0b3 Add info on adding custom plugins.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Cannot be consumed in an addon

If you wish to wrap this addon in another addon's dependencies the following error occurs when building your end app:

Cannot read property 'registry' of undefined
TypeError: Cannot read property 'registry' of undefined
    at Class.module.exports.included (/Users/ronco/github/page-title-consumer/node_modules/page-title-wrapper/node_modules/ember-page-title/index.js
:12:13)
    at /Users/ronco/github/page-title-consumer/node_modules/ember-cli/lib/models/addon.js:244:32
    at Array.map (native)
    at Class.eachAddonInvoke (/Users/ronco/github/page-title-consumer/node_modules/ember-cli/lib/models/addon.js:242:22)
    at Class.Addon.included (/Users/ronco/github/page-title-consumer/node_modules/ember-cli/lib/models/addon.js:349:8)
    at EmberApp.<anonymous> (/Users/ronco/github/page-title-consumer/node_modules/ember-cli/lib/broccoli/ember-app.js:413:15)
    at Array.filter (native)
    at EmberApp._notifyAddonIncluded (/Users/ronco/github/page-title-consumer/node_modules/ember-cli/lib/broccoli/ember-app.js:408:45)
    at new EmberApp (/Users/ronco/github/page-title-consumer/node_modules/ember-cli/lib/broccoli/ember-app.js:106:8)
    at module.exports (/Users/ronco/github/page-title-consumer/ember-cli-build.js:6:13)

In this context this is the addon, rather than the end app, and doesn't have this.app.

An in-range update of ember-cli-inject-live-reload is breaking the build 🚨

Version 1.7.0 of ember-cli-inject-live-reload just got published.

Branch Build failing 🚨
Dependency ember-cli-inject-live-reload
Current Version 1.6.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-cli-inject-live-reload is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

title does not update after initial load

I'm using ember-page-title in my application, and the title only updates once when first loading the application. It will set the title properly.
However, subsequent transitions do not alter the title.

At the moment I do not have a reproduction, but can work on one.
I am using liquid-fire, which I suspect might be related.

Cut new release?

Seeing deprecation warnings however I see that there have been 16 commits since the last release, is there anything holding up a new release?

Merge error: file app.scss exists

[jan@arch exam-schedule]$ ember v
version: 1.13.8
node: 3.2.0
npm: 2.13.4
os: linux x64
[jan@arch exam-schedule]$ ember s --host ::
version: 1.13.8
Livereload server on http://:::49152
Serving on http://:::4200/
Merge error: file app.scss exists in /home/jan/ember/exam-schedule/tmp/broccoli_merge_trees-input_base_path-pudC0ESO.tmp/23 and /home/jan/ember/exam-schedule/tmp/broccoli_merge_trees-input_base_path-pudC0ESO.tmp/25
Pass option { overwrite: true } to mergeTrees in order to have the latter file win.
Error: Merge error: file app.scss exists in /home/jan/ember/exam-schedule/tmp/broccoli_merge_trees-input_base_path-pudC0ESO.tmp/23 and /home/jan/ember/exam-schedule/tmp/broccoli_merge_trees-input_base_path-pudC0ESO.tmp/25
Pass option { overwrite: true } to mergeTrees in order to have the latter file win.
    at mergeRelativePath (/home/jan/ember/exam-schedule/node_modules/ember-component-css/node_modules/broccoli-merge-trees/index.js:118:19)
    at BroccoliMergeTrees.build (/home/jan/ember/exam-schedule/node_modules/ember-component-css/node_modules/broccoli-merge-trees/index.js:36:3)
    at /home/jan/ember/exam-schedule/node_modules/ember-component-css/node_modules/broccoli-merge-trees/node_modules/broccoli-plugin/read_compat.js:61:34
    at lib$rsvp$$internal$$tryCatch (/home/jan/ember/exam-schedule/node_modules/ember-component-css/node_modules/broccoli-merge-trees/node_modules/broccoli-plugin/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:493:16)
    at lib$rsvp$$internal$$invokeCallback (/home/jan/ember/exam-schedule/node_modules/ember-component-css/node_modules/broccoli-merge-trees/node_modules/broccoli-plugin/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:505:17)
    at lib$rsvp$$internal$$publish (/home/jan/ember/exam-schedule/node_modules/ember-component-css/node_modules/broccoli-merge-trees/node_modules/broccoli-plugin/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:476:11)
    at lib$rsvp$asap$$flush (/home/jan/ember/exam-schedule/node_modules/ember-component-css/node_modules/broccoli-merge-trees/node_modules/broccoli-plugin/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:1198:9)
    at doNTCallback0 (node.js:407:9)
    at process._tickCallback (node.js:336:13)
[jan@arch exam-schedule]$ cat package.json
{
  "name": "exam-schedule",
  "version": "0.0.0",
  "description": "Small description for exam-schedule goes here",
  "private": true,
  "directories": {
    "doc": "doc",
    "test": "tests"
  },
  "scripts": {
    "build": "ember build",
    "start": "ember server",
    "test": "ember test"
  },
  "repository": "",
  "engines": {
    "node": ">= 0.10.0"
  },
  "author": "",
  "license": "MIT",
  "devDependencies": {
    "broccoli-asset-rev": "^2.1.2",
    "ember-cli": "1.13.8",
    "ember-cli-app-version": "0.5.0",
    "ember-cli-autoprefixer": "0.5.0",
    "ember-cli-babel": "^5.1.3",
    "ember-cli-content-security-policy": "0.4.0",
    "ember-cli-dependency-checker": "^1.0.1",
    "ember-cli-emblem": "0.3.0",
    "ember-cli-htmlbars": "0.7.9",
    "ember-cli-htmlbars-inline-precompile": "^0.2.0",
    "ember-cli-ic-ajax": "0.2.1",
    "ember-cli-inject-live-reload": "^1.3.1",
    "ember-cli-mirage": "0.1.8",
    "ember-cli-qunit": "^1.0.0",
    "ember-cli-release": "0.2.3",
    "ember-cli-sass": "4.2.0",
    "ember-cli-simple-auth": "0.8.0",
    "ember-cli-simple-auth-token": "0.7.3",
    "ember-cli-sri": "^1.0.3",
    "ember-cli-uglify": "^1.2.0",
    "ember-component-css": "0.1.6",
    "ember-data": "1.13.8",
    "ember-disable-proxy-controllers": "^1.0.0",
    "ember-export-application-global": "^1.0.3",
    "ember-noscript": "2.0.0",
    "ember-page-title": "2.0.6",
    "ember-suave": "1.0.0",
    "liquid-fire": "0.21.2"
  }
}

Installing ember-page-title triggers the above error on build. I use a (non-empty) styles/app.sass file, if that matters.

Could this possibly be an incompatibility with another addon that uses the same hack?

As a temporary fix, this seems to work:

$ rm node_modules/ember-page-title/app/styles/app.scss

On a related note: What is the reason for this hack - what does this addon have to do with styles?

Deprecation warning & dependent keys

In reference to: #44 (comment)
I get the following warnings multiple times in a row and in the order presented here.

2x

WARNING: Dependent keys containing @each only work one level deep. You cannot use nested forms like [email protected] or [email protected][email protected]. Please create an intermediary computed property.

4x

DEPRECATION: A property of <g5-cms@view:-outlet::ember521> was modified inside the didInsertElement hook. You should never change properties on components, services or models during didInsertElement because it causes significant performance degradation. [deprecation id: ember-views.dispatching-modify-property]

How to get a tokenized title?

I'm using this incorrectly, what's the proper way?

Current usage:

App.ApplicationRoute = Ember.Route.extend({
    title: 'Home'
})

App.SearchRoute = Ember.Route.extend({
    title: 'Search'
})

That gives me a title of Search when on the search page.

I would like it to be Search | Home.

I tried using titleTokens but I think I'm just not seeing how to get a tokenized title from this mixin.

Best.

liquid-fire transitions

Let's say I have two pages, one with the title foo and one with the title bar and I'm using liquid-fire for outlet animations.

If i transition from foo to bar while the animation is occuring the page title is updated to bar | foo once complete the title is updated to bar.

That is not the behaviour I'd expect, I'd expect either an instant switch to bar or leave it as foo until the transition completes and then switch to bar.

Component - Uncaught TypeError: Cannot read property 'match' of undefined

Hi there. I'm getting this error when visiting routes that have a google-map component (from ember-google-map):

Uncaught TypeError: Cannot read property 'match' of undefined
ember-resolver.js line 192
podBasedComponentsInSubdir(
...
  if (parsedName.type === 'component' || parsedName.fullNameWithoutType.match(/^components/)) {...}
...
}

If I remove the ember-document-title dependency from package.js, those routes work again.

Not sure if this is an issue with the component or ember-document-title. If I can do something to help investigate it, please tell me. Your addon is awesome btw and I think it should be something that comes with ember by default.

Thanks

Doesn't work with [email protected]

$ ember v
ember-cli: 2.13.2
node: 8.0.0-pre
os: linux x64

$ cat package.json | jq '.devDependencies'
{
  "broccoli-asset-rev": "^2.4.5",
  "ember-ajax": "^3.0.0",
  "ember-cli": "2.13.2",
  "ember-cli-app-version": "^3.0.0",
  "ember-cli-babel": "^6.0.0",
  "ember-cli-dependency-checker": "^1.3.0",
  "ember-cli-eslint": "^3.0.0",
  "ember-cli-fastboot": "1.0.0-rc.1",
  "ember-cli-htmlbars": "^1.1.1",
  "ember-cli-htmlbars-inline-precompile": "^0.4.0",
  "ember-cli-inject-live-reload": "^1.4.1",
  "ember-cli-polyfill-io": "^1.2.2",
  "ember-cli-qunit": "^4.0.0",
  "ember-cli-shims": "^1.1.0",
  "ember-cli-sri": "^2.1.0",
  "ember-cli-uglify": "^1.2.0",
  "ember-data": "^2.13.0",
  "ember-export-application-global": "^2.0.0",
  "ember-intl": "^2.27.0",
  "ember-load-initializers": "^1.0.0",
  "ember-page-title": "^3.1.6",
  "ember-resolver": "^4.0.0",
  "ember-source": "~2.13.0",
  "loader.js": "^4.2.3"
}

$ ember serve
FastBoot build no longer supports /home/jan/github/buschtoens/node_modules/ember-page-title/app/(instance-)?initializers/browser structure. Please refer to www.ember-fastboot.com for a migration path.
Error: FastBoot build no longer supports /home/jan/github/buschtoens/node_modules/ember-page-title/app/(instance-)?initializers/browser structure. Please refer to www.ember-fastboot.com for a migration path.
    at _checkBrowserInitializers (/home/jan/github/buschtoens/node_modules/ember-cli-fastboot/lib/build-utilities/migrate-initializers.js:39:11)
    at project.addons.forEach (/home/jan/github/buschtoens/node_modules/ember-cli-fastboot/lib/build-utilities/migrate-initializers.js:97:5)
    at Array.forEach (native)
    at _migrateAddonInitializers (/home/jan/github/buschtoens/node_modules/ember-cli-fastboot/lib/build-utilities/migrate-initializers.js:94:18)
    at migrateInitializers (/home/jan/github/buschtoens/node_modules/ember-cli-fastboot/lib/build-utilities/migrate-initializers.js:121:3)
    at Class.included (/home/jan/github/buschtoens/node_modules/ember-cli-fastboot/index.js:58:5)
    at EmberApp.<anonymous> (/home/jan/github/buschtoens/node_modules/ember-cli/lib/broccoli/ember-app.js:517:17)
    at Array.filter (native)
    at EmberApp._notifyAddonIncluded (/home/jan/github/buschtoens/node_modules/ember-cli/lib/broccoli/ember-app.js:512:47)
    at new EmberApp (/home/jan/github/buschtoens/node_modules/ember-cli/lib/broccoli/ember-app.js:142:10)

Just so you know πŸ˜…

An in-range update of ember-disable-prototype-extensions is breaking the build 🚨

Version 1.1.3 of ember-disable-prototype-extensions just got published.

Branch Build failing 🚨
Dependency ember-disable-prototype-extensions
Current Version 1.1.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-disable-prototype-extensions is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 3 commits.

  • ef74794 1.1.3
  • a0449dd Merge pull request #12 from Turbo87/remove-bower
  • ca715c7 Remove unused "bower" dependency

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of ember-source is breaking the build 🚨

Version 2.13.1 of ember-source just got published.

Branch Build failing 🚨
Dependency ember-source
Current Version 2.13.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-source is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 15 commits.

  • 57b6b82 Release v2.13.1.
  • 637c0a4 Add 2.13.1 to CHANGELOG.
  • 566f5a8 Lock down testem version.
  • 0e51ff3 Lock down route-recognizer to 0.3.0.
  • a8931d1 [BUGFIX release] Ensure debug statements are no-ops in production builds.
  • 1cd162d fixup! [BUGFIX release] MODEL_FACTORY_INJECTIONS is now always false.
  • 20e0ba6 [BUGFIX release] Ensure nested custom elements render properly.
  • 005cff8 [BUGFIX release] MODEL_FACTORY_INJECTIONS is now always false.
  • c736afc [BUGFIX release] Remove reference to dist/ember.js file.
  • 2c23df8 [BUGFIX release] Fix EmberError import in system/router
  • d8c1641 [DOC release] correct casing of _routermicrolib deprecation url
  • bb57294 [BUGFIX Release]fix mocha blueprint service test filename
  • a4bfeea [BUGFIX beta] Fix double container destroy
  • b64ce22 [BUGFIX release] Ensure that it is possible to experiment with syntax.
  • c4e4415 Fix access to service:-document in engines

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of ember-cli-eslint is breaking the build 🚨

Version 4.1.0 of ember-cli-eslint just got published.

Branch Build failing 🚨
Dependency ember-cli-eslint
Current Version 4.0.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-cli-eslint is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 10 commits.

  • f4c6c28 4.1.0
  • ac04685 Update CHANGELOG
  • 9a5fb0f Adjust "rulesDir" default value
  • 991dcd0 Merge pull request #197 from thomblake/add_rulesdir_option
  • 9ef12b8 Add option to README
  • c28982c Merge pull request #198 from ember-cli/greenkeeper/ember-cli-2.13.3
  • 7c8f29f chore(package): update ember-cli to version 2.13.3
  • 9e889e7 Allow passthrough of rulesDir option to broccoli-lint-eslint
  • 9a11755 Merge pull request #196 from t-sauer/t-sauer-patch-1
  • 8f9887b Added install instructions for ESLint 4

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

loading route overtakes page title in browser history

If a route hits a loading sub-state before render, the browser history keeps the loading route's title, not the route's eventual title. The <title> tag is eventually updated with the correct page title but history only remembers the initial title from the loading route.

This is problematic when using a catch-all top-level loading route.

head.hbs template cannot be customized

Trying to create custom app/templates/head.hbs results in
The Broccoli Plugin: [BroccoliMergeTrees: addonPreprocessTree(template)] failed with: Error: Merge error: file project/templates/head.hbs exists in ..\tmp\broccoli_merge_trees-input_base_path-sznru7ev.tmp\0 and ..\tmp\broccoli_merge_trees-input_base_path-sznru7ev.tmp\1 Pass option { overwrite: true } to mergeTrees in order to have the latter file win. at BroccoliMergeTrees._mergeRelativePath

Doesn't work in latest release 3.0.2

Hello, this addon has stopped working for me when upgrading to 3.0.2 using ember 2.5.1

{{title "foo" separator=" | "}}
{{#app-main}}
  {{#left-nav showModal="showModal"}}{{/left-nav}}
  {{outlet}}
  {{outlet 'modal'}}
{{/app-main}}

doesnt show up but rather the title from my index.html file does

Fastboot + ember-page-title with freshly generated app fails

Steps to repro:

  1. Generate an app running Ember 2.13.3 (I used the --yarn flag as well).
  2. ember install fastboot
  3. ember install ember-page-title
  4. Remove the existing title tag from the index.html file
  5. Run ember serve and hit the index page.
  6. Get stack trace:
Error
    at assert (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:8031:1)
    at Object.assert (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:8244:1)
    at /home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:6717:1
    at Vertices.each (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:4775:1)
    at Vertices.topsort (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:4742:1)
    at DAG.topsort (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:4687:1)
    at Class._runInitializer (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:6733:1)
    at Class.runInstanceInitializers (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:6716:1)
    at Class._bootSync (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:4993:1)
    at /home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:6404:1
    at initializePromise (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:50230:1)
    at new Promise (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:50718:1)
    at Class.boot (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:6403:1)
    at buildAppInstance.then.appInstance (/home/ian/Code/super-hackage/node_modules/fastboot/src/ember-app.js:240:25)
    at tryCatch (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:50180:1)
    at invokeCallback (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:50195:1)
    at publish (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:50163:1)
    at /home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:40842:1
    at invokeWithOnError (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:2197:1)
    at Queue.flush (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:2256:1)
    at DeferredActionQueues.flush (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:2380:1)
    at Backburner.end (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:2450:1)
    at Timeout._onTimeout (/home/ian/Code/super-hackage/tmp/broccoli_merge_trees-output_path-jdMjWSLu.tmp/assets/vendor/ember/ember.debug.js:3016:1)
    at ontimeout (timers.js:386:14)
    at tryOnTimeout (timers.js:250:5)
    at Timer.listOnTimeout (timers.js:214:5)

An in-range update of ember-cli-htmlbars is breaking the build 🚨

Version 2.0.3 of ember-cli-htmlbars just got published.

Branch Build failing 🚨
Dependency ember-cli-htmlbars
Current Version 2.0.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

ember-cli-htmlbars is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 3 commits.

  • 42e8b03 v2.0.3
  • 78726fe Merge pull request #117 from ember-cli/avoid-mutating-config
  • 39ba921 Ensure ember-template-compiler does not mutate shared config object.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Glimmer release

Hi,

I'm just in the process of trying to update to Glimmer & was wondering if you are planning to publish a new version to npm soon or whether I should start by using this github repo for now.

Thanks.

Title and Screen Readers

I've noticed the title isn't updated until after the page loads.

When using a screen-reader this is problematic as the title is read before the page has finished loading. This initially gives an inaccurate description of the page.

If the title is static could it be set before the model?

property in path "headData" could not be found

Uncaught Error: Property set failed: object in path "headData" could not be found or was destroyed.

Hit it after updating to newest version.

line: page-title.js:9

Seems fastboot related, but I'm unfamiliar with it. Any ideas?

Uncaught TypeError: Cannot read property 'match' of undefined

This appears to be the same issue as brought up in #16, except I am matching the ember-document-title version (1.13.1) to the Ember version (1.13.5).

Versions:

Ember: 1.13.5
Ember Data: 1.13.7
ember-document-title: 1.13.1

The breakpoint points to this line in Ember.DefaultResolver definition:

    podBasedComponentsInSubdir: function(parsedName) {
      var podPrefix = this.namespace.podModulePrefix || this.namespace.modulePrefix;
      podPrefix = podPrefix + '/components';

      if (parsedName.type === 'component' || parsedName.fullNameWithoutType.match(/^components/)) { //<-- this line
        return this.podBasedLookupWithPrefix(podPrefix, parsedName);
      }
    },

Unfortunately, I'm not having luck getting a full traceback so I can see where this is being called from.

The particular usage that seems to be failing here is rendering into an existing view--in particular, a modal display. When creating the modal I'm following the same basic procedure as outlined in the cookbook in Ember Guides; i.e. programmatically rendering into an outlet: http://guides.emberjs.com/v1.12.0/cookbook/user_interface_and_interaction/using_modal_dialogs/ . The end result is that the modal component is not loaded/rendered.

Installing and including the addon causes this behavior without any further change; removing it restores the functionality of the modal.

Let me know if I can help with any more information.

Loading substates breaks titles in history

History does not contain title of nested route when loading substates are used for the route.

To reproduce:

  • Create application route with title "Application"
  • Create route post with title "Post", model hook should delay something like 100ms
  • Create route user with title "User", model hook should delay something like 100ms
  • Create loading substate for application route

Switch post and title few times, using link-to component. History (right click on browser back-button) contains records as "Application | " instead of "Application | Post" and "Application | User"

Integration tests for components using the helper fail

Since the fix introduced for #44, any integration test for a component which uses the helper internally will fail.

I made an example repository here which demonstrates the failure:
https://github.com/begedin/ember-page-title-bug

The temporary workaround is to do the following in a beforeEach for that component's integration test module:

getOwner(this).lookup('router:main').setupRouter();

The problem is, the helper does the following at https://github.com/tim-evans/ember-page-title/blob/master/addon/helpers/page-title.js#L34 πŸ‘

let activeTransition = getOwner(this).lookup('router:main').router.activeTransition;

However, in integration tests, the router has not been set up, so getOwner(this).lookup('router:main').router is undefined. A potential solution would be

let router = getOwner(this).lookup('router:main');
let activeTransition = get(router, 'router.activeTransition');

Enable setting a default separator

It would be great if the default separator could be overridden instead of having to remember to do it every time the {{title}} helper is invoked.

The simplest way might be to define it in the service, then an app could simply extend it:

// app/services/document-title-list.js
import TitleService from 'ember-document-title/services/document-title-list';

export default TitleService.extend({
  separator: ' > '
});

If this sounds reasonable I'll be able to make a pull request (or for an alternative implementation).

An in-range update of ember-resolver is breaking the build 🚨

Version 4.2.0 of ember-resolver just got published.

Branch Build failing 🚨
Dependency ember-resolver
Current Version 4.1.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-resolver is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 13 commits.

  • 218f83c v4.2.0
  • dd8a476 Merge pull request #199 from ember-cli/ember-cli
  • d041f7c Bump ember-cli (w/o eslint)
  • 6614e68 Merge pull request #198 from ember-cli/pass-referrer-v2
  • 5f425d6 Normalize referrer and lookupString, add config flag
  • d153cc8 Merge pull request #192 from 201-created/defaultType
  • aec0059 defaultType support, mv partials code to resolver
  • 9dec996 Merge pull request #190 from 201-created/no-normalize
  • 8d97d8b Assert against get, not normalize
  • d87ce8e Merge pull request #186 from ember-cli/typo
  • d0ad411 fix file name typo
  • 8ae3114 Merge pull request #184 from acorncom/patch-1
  • 5c20636 Fixes a small typo

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Not working in ember 2.11.2

Hello, I just noticed my page titles aren't working like they used to and not sure what's going on.. I have latest version of this package, also using ember-cli-meta-tags (not sure if that's a conflict)...

Separator added for null-titles

I have pages where the 'eventual' page title is inside of data pulls or other promises. This means that my page title looks like

Sitename |

While the resources load before becoming

Sitename | Smile

I think I'd prefer that segments with null (or at least undefined) are not added to the title array. It looks like this could be a small augmentation to the toString function if that's a direction this add-on is willing to go.

Conflict with ember-cli-meta-tags

I tried to use ember-cli-meta-tags and ember-page-title in same application, but looks like ember-page-title overrides ember-cli-head section and removes any meta tags added by ember-cli-meta-tags.

Is it possible to use both in same application?

I just want to add title and meta-description based on models to each route.

Cannot Import Addon

I am not able to import this NPM addon mixin, upon successful npm install. I get the following:

File: seangoresht/router.js
ENOENT, no such file or directory 'C:\Users\Sean\Documents\GitHub\seangoresht\tmp\tree_merger-tmp_dest_dir-Rt63Eug3.tmp\ember-document-title.js'
Error: ENOENT, no such file or directory 'C:\Users\Sean\Documents\GitHub\seangoresht\tmp\tree_merger-tmp_dest_dir-Rt63Eug3.tmp\ember-document-title.js'
  at Object.fs.statSync (fs.js:695:18)
  at addModule (C:\Users\Sean\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\broccoli-es6-concatenator\index.js:84:46)
  at addModule (C:\Users\Sean\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\broccoli-es6-concatenator\index.js:133:9)
  at addModule (C:\Users\Sean\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\broccoli-es6-concatenator\index.js:133:9)
  at C:\Users\Sean\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\broccoli-es6-concatenator\index.js:59:7
  at $$$internal$$tryCatch (C:\Users\Sean\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\rsvp\dist\rsvp.js:470:16)
  at $$$internal$$invokeCallback (C:\Users\Sean\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\rsvp\dist\rsvp.js:482:17)
  at $$$internal$$publish (C:\Users\Sean\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\rsvp\dist\rsvp.js:453:11)
  at $$rsvp$asap$$flush (C:\Users\Sean\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\rsvp\dist\rsvp.js:1531:9)
  at process._tickCallback (node.js:419:13)

My router.coffee:

`import Ember from "ember"`
`import DocumentTitle from "ember-document-title"`
`import config from "./config/environment"`

Router = Ember.Router.extend(location: config.locationType)
# ...

Excess separator is added when replace=true

First of all, thanks for this brilliant addon! This is just what I was looking for and implementing the title in the template is very elegant in my opinion.


Now onto the problem. It seems like replace=true does not "remove" the parent separator.

Consider these templates:

// application.hbs

{{#document-title prepend=true separator=" β˜… "}}Hollywood{{/document-title}}
// index.hbs

{{#document-title replace=true}}Hollywood β˜… Stars everywhere{{/document-title}}
// blog.hbs

{{#document-title}}Blog{{/document-title}}
  • Expected title for /blog: Blog β˜… Hollywood
    works alright
  • Expected title for /: Hollywood β˜… Stars everywhere
    Actual title: Hollywood β˜… Stars everywhere β˜…
    Note the trailing β˜….

A hotfix is to set separator="" in the child templates that replace the parent title.

Shouldn't prepend just prepend the element, not reverse entire order?

How to achieve the following:

Step 1 > Step 2 - Site Title

{{title "Site Title" separator=" - "  prepend=true}}   (application route)
{{title "Step 1" separator=" > " prepend=false }}    (step 1 route)
{{title "Step 2" separator=" ? "}}       (step1/step2 route)

Yields:
Site Title - Step 1 > Step 2

Whereas

{{title "Site Title" separator=" - "  prepend=true}}   (application route)
{{title "Step 1" separator=" > " }}    (step 1 route)
{{title "Step 2" separator=" ? "}}       (step1/step2 route)

Yields in reverse and only uses first defined separator:
Step 2 - Step 1 - Site Title

{{title "Site Title" separator=" - "}}   (application route)
{{title "Step 1" separator=" > " prepend=true }}    (step 1 route)
{{title "Step 2" separator=" ? "}}       (step1/step2 route)

Yields:
Site Title - Step 2 > Step 1

Don't update page title until transition is complete

When an app has loading sub-states between two routes the title updates twice - once to remove the current title & transitions to the parent title, then again when the transition is complete.

Eg.

  • /foos/bar - "My App / Foos / Bar"
  • /foos/-loading - "My App / Foos" <- don't want to see this one
  • /foos/baz - "My App / Foos / Baz"

This might be rather tricky, but it would be nice if we could detect we're transitioning through a loading state and not update the title until the transition is complete.

Collisions when rendering a property named `title` in templates

With this helper, rendering something named title will break the app, resulting in a very hard to track down stack trace.

{{title}}

Technically, this addon should work when invoked like so:

{{title title}}

Where the first title is the helper and the second title is the property in scope of the template. This likely needs help from the ember core team.

Make it work with engines

Hi,

I am trying out engines, and found out that this addon doesn't work in that scenario. First of all, it can't even be installed due to #31.

So I tried to circumvent this by basically disabling the {{title}} lookup in my engine with:

if (typeof this.app !== 'undefined' && typeof this.app.registry !== 'undefined') {
  this.app.registry.add('htmlbars-ast-plugin', {
    name: 'translate-title-helper-to-page-title-helper',
    plugin: TranslateHelperName
  });
}

So I could just use {{page-title}} in the engine. But it still didn't work, because of the way ember-cli-head works.

So I got it to work with a few workarounds - which might also be interesting for anyone else trying this.

1.) Define the header-data and page-title-list services as dependencies.
2.) In the engine, create a component head-content with the following content:

import Ember from 'ember';
import layout from 'my-host-app-name/templates/head';

const {
  inject,
  Component
} = Ember;

export default Component.extend({
  tagName: '',
  model: inject.service('head-data'),
  layout
});

3.) Now use {{page-title}} instead of {{title}} in your engine, and everything works!

Maybe this can somehow be simplified, or at least added to the readme. However, it depends on #31 being fixed first, otherwise the app can't even load.

Error installing ember-page-title on ember-cli 2.8.0

root@1b981a35323d:/ember/ember-quickstart# ember install ember-page-title
Installed packages for tooling via npm.
installing ember-page-title
The ember generate <entity-name> command requires an entity name to be specified. For more details, use ember help.

ember -v output:
ember-cli: 2.8.0
node: 6.5.0
os: linux x64

npm version 3.10.3

An in-range update of loader.js is breaking the build 🚨

Version 4.5.0 of loader.js just got published.

Branch Build failing 🚨
Dependency loader.js
Current Version 4.4.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As loader.js is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 7 commits.

  • 094e20b release v4.5.0 πŸŽ‰
  • db2f6a6 Merge pull request #126 from ember-cli/moduleId
  • 204838b rename mod.name => mod.id
  • 4fa0fe0 add require.moduleId to allow a module to know its ID
  • f62bc54 Merge pull request #121 from ember-cli/define-exports
  • d963886 Update README.md
  • 928e18f add define.exports

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.