Skip to content

Commit

Permalink
update head to 0.4.1 (ronco#71)
Browse files Browse the repository at this point in the history
* update ember-cli-head to 0.4.1
  • Loading branch information
snewcomer authored and cibernox committed Jun 1, 2021
1 parent 7de2ffb commit 3a408bf
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 30 deletions.
47 changes: 26 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ correctly.
This add-on is perfect for combining with a prerendering
server side solution such as [prerender.io](http://www.prerender.io)
or with
[Ember Fastboot](https://github.com/tildeio/ember-cli-fastboot) (Fastboot compatibility requires ember-cli-meta-tags v2+ and Ember 2.7+ (currently beta)).
[Ember FastBoot](https://github.com/tildeio/ember-cli-fastboot) (FastBoot compatibility requires ember-cli-meta-tags v2+ and Ember 2.7+ (currently beta)).

## Usage

Expand All @@ -24,15 +24,19 @@ In your Ember CLI project directory run:
ember install ember-cli-meta-tags
```

### Using with Ember Fastboot
### Upgrading to 5.x

Version 4.0+ of this addon is designed to work with Fastboot >= 1.0.0-rc1. If you use
Version 5.0 of this addon depends on [ember-cli-head](https://github.com/ronco/ember-cli-head) 0.4.0, which adds the requirement that the `{{head-layout}}` is added once in an application-wide template (usually `app/templates/application.hbs`). For more info, see the [ember-cli-head 0.4 upgrade note](https://github.com/ronco/ember-cli-head#upgrade-to-04x).

### Using with Ember FastBoot

Version 4.0+ of this addon is designed to work with FastBoot >= 1.0.0-rc1. If you use
an order version of fastboot stick with 3.X.

Version 2.0+ of this addon is built upon
[ember-cli-head](https://github.com/ronco/ember-cli-head) and as a
result is will work automatically out of the box with Ember Fastboot
if you are running a version of ember >= 2.7.
result it will work automatically out of the box with Ember FastBoot
if you are running a version of Ember >= 2.7.

#### Using with other ember-cli-head addons

Expand Down Expand Up @@ -94,9 +98,9 @@ the didTransition event.
###### Example: static headTags property on the route
```javascript
// app/routes/some-page.js
import Ember from 'ember';
import Route from '@ember/routing/route';

export default Ember.Route.extend({
export default Route.extend({
headTags: [{
type: 'meta',
tagId: 'meta-og-name',
Expand All @@ -118,12 +122,14 @@ export default Ember.Route.extend({

###### Example: Setting the headTags property in afterModel
```javascript
export default Ember.Route.extend({
afterModel: function(model) {
import Route from '@ember/routing/route';

export default Route.extend({
afterModel(model) {
this.setHeadTags(model);
},

setHeadTags: function(model) {
setHeadTags(model) {
let headTags = [{
type: 'meta',
tagId: 'meta-description-tag',
Expand All @@ -147,10 +153,10 @@ that returns the appropriate head tags.

```javascript
// app/routes/some-page.js
import Ember from 'ember';
import Route from '@ember/routing/route';

export default Ember.Route.extend({
headTags: function() {
export default Route.extend({
headTags() {
// here we are pulling meta data from the model for this route
let model = this.modelFor(this.routeName);
return [{
Expand Down Expand Up @@ -190,10 +196,10 @@ all of the headTags in the current route hierarchy will be re-built.

```javascript
// app/routes/some-page.js
import Ember from 'ember';
import Route from '@ember/routing/route';

export default Ember.Route.extend(RouteMetaMixin, {
headTags: function() {
export default Route.extend(RouteMetaMixin, {
headTags() {
let controller = this.controllerFor(this.routeName);
// value of head tags updates with value of `era` on this
// route's controller
Expand All @@ -210,9 +216,9 @@ export default Ember.Route.extend(RouteMetaMixin, {


// app/controller/some-page.js
import Ember from 'ember';
import Controller from '@ember/controller';

export default Ember.Controller.extend({
export default Controller.extend({
headTagsService: Ember.inject.service('head-tags'),
queryParameters: {
era: 'e'
Expand Down Expand Up @@ -240,17 +246,16 @@ Instructions for developing on this add-on.

* `git clone` this repository
* `npm install`
* `bower install`

### Running

* `ember server`
* `ember serve`
* Visit your app at http://localhost:4200.

### Running Tests

* `ember test`
* `ember test --server`
* `ember test --serve`

### Building

Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"dependencies": {
"ember-cli-babel": "^6.6.0",
"ember-cli-head": "^0.3.0",
"ember-cli-head": "^0.4.1",
"ember-cli-htmlbars": "^2.0.1"
},
"devDependencies": {
Expand Down Expand Up @@ -57,6 +57,10 @@
"node": "^4.5 || 6.* || >= 7.*"
},
"ember-addon": {
"configPath": "tests/dummy/config"
"configPath": "tests/dummy/config",
"after": "ember-cli-head",
"versionCompatibility": {
"ember": ">2.10.0"
}
}
}
2 changes: 2 additions & 0 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{head-layout}}

<h2 id="title">Welcome to Ember.js</h2>

<ul>
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ electron-to-chromium@^1.3.47:
version "1.3.48"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.48.tgz#d3b0d8593814044e092ece2108fc3ac9aea4b900"

ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.0.0-beta.7, ember-cli-babel@^6.1.0, ember-cli-babel@^6.11.0, ember-cli-babel@^6.12.0, ember-cli-babel@^6.3.0, ember-cli-babel@^6.6.0, ember-cli-babel@^6.8.1, ember-cli-babel@^6.8.2:
ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.0.0-beta.7, ember-cli-babel@^6.11.0, ember-cli-babel@^6.12.0, ember-cli-babel@^6.3.0, ember-cli-babel@^6.6.0, ember-cli-babel@^6.8.1, ember-cli-babel@^6.8.2:
version "6.14.1"
resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-6.14.1.tgz#796339229035910b625593caffbc2683792ada68"
dependencies:
Expand Down Expand Up @@ -1907,12 +1907,12 @@ ember-cli-get-component-path-option@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/ember-cli-get-component-path-option/-/ember-cli-get-component-path-option-1.0.0.tgz#0d7b595559e2f9050abed804f1d8eff1b08bc771"

ember-cli-head@^0.3.0:
version "0.3.1"
resolved "https://registry.yarnpkg.com/ember-cli-head/-/ember-cli-head-0.3.1.tgz#a407df4880f235280371c437bb5b0b5cbdaea646"
ember-cli-head@^0.4.0:
version "0.4.1"
resolved "https://registry.yarnpkg.com/ember-cli-head/-/ember-cli-head-0.4.1.tgz#28b7ee86439746640834b232a3b34ab1329f3cf3"
dependencies:
ember-cli-babel "^6.1.0"
ember-cli-htmlbars "^2.0.1"
ember-cli-babel "^6.11.0"
ember-cli-htmlbars "^2.0.3"

ember-cli-htmlbars-inline-precompile@^1.0.0:
version "1.0.3"
Expand All @@ -1924,7 +1924,7 @@ ember-cli-htmlbars-inline-precompile@^1.0.0:
heimdalljs-logger "^0.1.9"
silent-error "^1.1.0"

ember-cli-htmlbars@^2.0.1:
ember-cli-htmlbars@^2.0.1, ember-cli-htmlbars@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/ember-cli-htmlbars/-/ember-cli-htmlbars-2.0.3.tgz#e116e1500dba12f29c94b05b9ec90f52cb8bb042"
dependencies:
Expand Down

0 comments on commit 3a408bf

Please sign in to comment.