Comparing version
# FastBoot Changelog | ||
### 1.1.1 | ||
* Implement `unknownProperty` in FastbootHeaders to prevent users mistakenly use `Ember.get(headers, headerName)` | ||
### 1.1.0 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "fastboot", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Library for rendering Ember apps in node.js", | ||
@@ -34,5 +34,5 @@ "main": "src/index.js", | ||
"najax": "^1.0.2", | ||
"rsvp": "^3.0.16", | ||
"rsvp": "^4.7.0", | ||
"simple-dom": "^1.0.0", | ||
"source-map-support": "^0.4.18" | ||
"source-map-support": "^0.5.0" | ||
}, | ||
@@ -42,5 +42,6 @@ "devDependencies": { | ||
"chai-as-promised": "^7.1.1", | ||
"ember-source": "2.16.2", | ||
"express": "^4.15.4", | ||
"fs-promise": "^2.0.3", | ||
"mocha": "^3.4.2", | ||
"mocha": "^4.0.0", | ||
"mocha-jshint": "^2.3.1", | ||
@@ -47,0 +48,0 @@ "rimraf": "^2.6.2", |
'use strict'; | ||
// Partially implements Headers from the Fetch API | ||
@@ -94,4 +93,9 @@ // https://developer.mozilla.org/en-US/docs/Web/API/Headers | ||
} | ||
unknownProperty(maybeHeader) { | ||
console.warn(`You called \`Ember.get(headers, '${maybeHeader}')\` with a FastBootHeaders instance as first argument. FastBootHeader is not an Ember object and you should use \`headers.get('${maybeHeader}')\` instead.`); | ||
return this.get(maybeHeader); | ||
} | ||
} | ||
module.exports = FastBootHeaders; |
@@ -45,3 +45,3 @@ 'use strict'; | ||
return insertIntoIndexHTML(this._html, this._head, this._body); | ||
return insertIntoIndexHTML(this._html, this._head, this._body, this._bodyAttributes); | ||
} | ||
@@ -113,2 +113,8 @@ | ||
if (body.attributes.length > 0) { | ||
this._bodyAttributes = HTMLSerializer.attributes(body.attributes); | ||
} else { | ||
this._bodyAttributes = null; | ||
} | ||
if (head) { | ||
@@ -129,3 +135,3 @@ head = HTMLSerializer.serializeChildren(head); | ||
function insertIntoIndexHTML(html, head, body) { | ||
function insertIntoIndexHTML(html, head, body, bodyAttributes) { | ||
if (!html) { return Promise.resolve(html); } | ||
@@ -146,2 +152,8 @@ let isBodyReplaced = false; | ||
if (bodyAttributes) { | ||
html = html.replace(/<body[^>]*/i, function(match) { | ||
return match + ' ' + bodyAttributes; | ||
}); | ||
} | ||
if (head && !isHeadReplaced) { | ||
@@ -148,0 +160,0 @@ return missingTag('<!--EMBER_CLI_FASTBOOT_HEAD-->'); |
Sorry, the diff of this file is not supported yet
8
-42.86%79321
-42.6%9
12.5%18
-37.93%940
-48.49%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated
Updated