Comparing version 1.0.0-rc.7 to 1.0.0
{ | ||
"name": "fastboot", | ||
"version": "1.0.0-rc.7", | ||
"version": "1.0.0", | ||
"description": "Library for rendering Ember apps in node.js", | ||
@@ -29,19 +29,17 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"chalk": "^0.5.1", | ||
"cookie": "^0.2.3", | ||
"chalk": "^2.0.1", | ||
"cookie": "^0.3.1", | ||
"debug": "^2.1.0", | ||
"exists-sync": "0.0.3", | ||
"express": "^4.13.3", | ||
"express-cluster": "0.0.4", | ||
"minimist": "^1.2.0", | ||
"exists-sync": "0.0.4", | ||
"najax": "^1.0.2", | ||
"rsvp": "^3.0.16", | ||
"simple-dom": "^0.3.0", | ||
"simple-dom": "^1.0.0", | ||
"source-map-support": "^0.4.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"chai-as-promised": "^5.2.0", | ||
"fs-promise": "^0.5.0", | ||
"mocha": "^2.4.5", | ||
"chai": "^4.1.0", | ||
"chai-as-promised": "^7.1.1", | ||
"express": "^4.13.3", | ||
"fs-promise": "^2.0.3", | ||
"mocha": "^3.4.2", | ||
"mocha-jshint": "^2.3.1", | ||
@@ -48,0 +46,0 @@ "rimraf": "^2.5.4", |
# FastBoot | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/ember-fastboot/fastboot.svg)](https://greenkeeper.io/) | ||
[![npm version](https://badge.fury.io/js/fastboot.svg)](https://badge.fury.io/js/fastboot) | ||
[![Build Status](https://travis-ci.org/ember-fastboot/fastboot.svg?branch=master)](https://travis-ci.org/ember-fastboot/ember-fastboot-server) | ||
![Ember Version](https://embadge.io/v1/badge.svg?start=2.3.0) | ||
@@ -26,6 +28,10 @@ FastBoot is a library for rendering Ember.js applications in Node.js. | ||
let app = new FastBoot({ | ||
distPath: 'path/to/dist' | ||
distPath: 'path/to/dist', | ||
// optional boolean flag when set to true does not reject the promise if there are rendering errors (defaults to false) | ||
resilient: <boolean>, | ||
sandbox: 'path/to/sandbox/class', // optional sandbox class (defaults to vm-sandbox) | ||
sandboxGlobals: {...} // optional map of key value pairs to expose in the sandbox | ||
}); | ||
app.visit('/photos') | ||
app.visit('/photos', options) | ||
.then(result => result.html()) | ||
@@ -39,2 +45,14 @@ .then(html => res.send(html)); | ||
### Additional configuration | ||
`app.visit` takes a second parameter as `options` above which a map and allows to define additional optional per request | ||
configuration: | ||
- `resilient`: whether to reject the returned promise if there is an error during rendering. If not defined, defaults to the app's resilient setting. | ||
- `html`: the HTML document to insert the rendered app into. Uses the built app's index.html by default. | ||
- `metadata`: per request meta data that is exposed in the app via the [fastboot service](https://github.com/ember-fastboot/ember-cli-fastboot/blob/master/app/services/fastboot.js). | ||
- `shouldRender`: boolean to indicate whether the app should do rendering or not. If set to false, it puts the app in routing-only. Defaults to true. | ||
- `disableShoebox`: boolean to indicate whether we should send the API data in the shoebox. If set to false, it will not send the API data used for rendering the app on server side in the index.html. Defaults to false. | ||
- `destroyAppInstanceInMs`: whether to destroy the instance in the given number of ms. This is a failure mechanism to not wedge the Node process | ||
### Build Your App | ||
@@ -62,8 +80,4 @@ | ||
You can start a simple HTTP server that responds to incoming requests by | ||
rendering your Ember.js application using the `ember-fastboot` command: | ||
rendering your Ember.js application using the [FastBoot App Server](https://github.com/ember-fastboot/fastboot-app-server#ember-fastboot-app-server) | ||
``` | ||
$ ember-fastboot path/to/dist --port 80 | ||
``` | ||
### Debugging | ||
@@ -70,0 +84,0 @@ |
@@ -240,3 +240,2 @@ 'use strict'; | ||
}) | ||
.then(() => result.instanceBooted = true) | ||
.then(() => instance.visit(path, bootOptions)) | ||
@@ -243,0 +242,0 @@ .then(() => fastbootInfo.deferredPromise) |
@@ -10,3 +10,3 @@ 'use strict'; | ||
this.protocol = request.protocol; | ||
this.protocol = `${request.protocol}:`; | ||
this.headers = new FastBootHeaders(request.headers); | ||
@@ -13,0 +13,0 @@ this.queryParams = request.query; |
@@ -13,3 +13,2 @@ 'use strict'; | ||
constructor(options) { | ||
this.instanceBooted = false; | ||
this._instanceDestroyed = false; | ||
@@ -89,3 +88,3 @@ this._doc = options.doc; | ||
_finalizeMetadata(instance) { | ||
if (this.instanceBooted) { | ||
if (instance._booted) { | ||
this.url = instance.getURL(); | ||
@@ -92,0 +91,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8
0
119
42369
8
17
896
+ Added@simple-dom/document@1.4.0(transitive)
+ Added@simple-dom/interface@1.4.0(transitive)
+ Added@simple-dom/parser@1.4.0(transitive)
+ Added@simple-dom/serializer@1.4.0(transitive)
+ Added@simple-dom/void-map@1.4.0(transitive)
+ Addedansi-styles@3.2.1(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcookie@0.3.1(transitive)
+ Addedexists-sync@0.0.4(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedsimple-dom@1.4.0(transitive)
+ Addedsupports-color@5.5.0(transitive)
- Removedexpress@^4.13.3
- Removedexpress-cluster@0.0.4
- Removedminimist@^1.2.0
- Removedaccepts@1.3.8(transitive)
- Removedansi-regex@0.2.1(transitive)
- Removedansi-styles@1.1.0(transitive)
- Removedarray-flatten@1.1.1(transitive)
- Removedbody-parser@1.20.3(transitive)
- Removedbytes@3.1.2(transitive)
- Removedchalk@0.5.1(transitive)
- Removedcontent-disposition@0.5.4(transitive)
- Removedcontent-type@1.0.5(transitive)
- Removedcookie@0.2.40.6.0(transitive)
- Removedcookie-signature@1.0.6(transitive)
- Removeddepd@2.0.0(transitive)
- Removeddestroy@1.2.0(transitive)
- Removedee-first@1.1.1(transitive)
- Removedencodeurl@1.0.22.0.0(transitive)
- Removedescape-html@1.0.3(transitive)
- Removedetag@1.8.1(transitive)
- Removedexists-sync@0.0.3(transitive)
- Removedexpress@4.21.0(transitive)
- Removedexpress-cluster@0.0.4(transitive)
- Removedfinalhandler@1.3.1(transitive)
- Removedforwarded@0.2.0(transitive)
- Removedfresh@0.5.2(transitive)
- Removedhas-ansi@0.1.0(transitive)
- Removedhttp-errors@2.0.0(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedinherits@2.0.4(transitive)
- Removedipaddr.js@1.9.1(transitive)
- Removedmedia-typer@0.3.0(transitive)
- Removedmerge-descriptors@1.0.3(transitive)
- Removedmethods@1.1.2(transitive)
- Removedmime@1.6.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedminimist@1.2.8(transitive)
- Removedms@2.1.3(transitive)
- Removednegotiator@0.6.3(transitive)
- Removedon-finished@2.4.1(transitive)
- Removedparseurl@1.3.3(transitive)
- Removedpath-to-regexp@0.1.10(transitive)
- Removedproxy-addr@2.0.7(transitive)
- Removedrange-parser@1.2.1(transitive)
- Removedraw-body@2.5.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsend@0.19.0(transitive)
- Removedserve-static@1.16.2(transitive)
- Removedsetprototypeof@1.2.0(transitive)
- Removedsimple-dom@0.3.2(transitive)
- Removedstatuses@2.0.1(transitive)
- Removedstrip-ansi@0.3.0(transitive)
- Removedsupports-color@0.2.0(transitive)
- Removedtoidentifier@1.0.1(transitive)
- Removedtype-is@1.6.18(transitive)
- Removedunpipe@1.0.0(transitive)
- Removedutils-merge@1.0.1(transitive)
- Removedvary@1.1.2(transitive)
Updatedchalk@^2.0.1
Updatedcookie@^0.3.1
Updatedexists-sync@0.0.4
Updatedsimple-dom@^1.0.0