Comparing version 3.0.0-beta.3 to 3.0.0
@@ -0,1 +1,15 @@ | ||
## v3.0.0 (2020-01-31) | ||
#### :boom: Breaking Change | ||
* [#258](https://github.com/ember-fastboot/fastboot/pull/258) Drop Node 8 support ([@rwjblue](https://github.com/rwjblue)) | ||
#### :rocket: Enhancement | ||
* [#252](https://github.com/ember-fastboot/fastboot/pull/252) Expose option to allow a new sandbox per visit ([@rwjblue](https://github.com/rwjblue)) | ||
#### :house: Internal | ||
* [#259](https://github.com/ember-fastboot/fastboot/pull/259) Update various dependencies to latest versions. ([@rwjblue](https://github.com/rwjblue)) | ||
#### Committers: 1 | ||
- Robert Jackson ([@rwjblue](https://github.com/rwjblue)) | ||
## v3.0.0-beta.3 (2019-11-01) | ||
@@ -2,0 +16,0 @@ |
@@ -21,2 +21,3 @@ 'use strict'; | ||
/* eslint-disable-next-line node/no-unsupported-features/node-builtins */ | ||
const inspector = require('inspector'); | ||
@@ -23,0 +24,0 @@ const path = require('path'); |
{ | ||
"name": "fastboot", | ||
"version": "3.0.0-beta.3", | ||
"version": "3.0.0", | ||
"description": "Library for rendering Ember apps in node.js", | ||
@@ -28,8 +28,8 @@ "keywords": [ | ||
"dependencies": { | ||
"chalk": "^2.4.2", | ||
"chalk": "^3.0.0", | ||
"cookie": "^0.4.0", | ||
"debug": "^4.1.1", | ||
"resolve": "^1.12.0", | ||
"resolve": "^1.15.0", | ||
"simple-dom": "^1.4.0", | ||
"source-map-support": "^0.5.13" | ||
"source-map-support": "^0.5.16" | ||
}, | ||
@@ -39,19 +39,19 @@ "devDependencies": { | ||
"chai-as-promised": "^7.1.1", | ||
"eslint": "^6.5.1", | ||
"eslint-config-prettier": "^6.4.0", | ||
"eslint-plugin-chai-expect": "^2.0.1", | ||
"eslint-plugin-mocha": "^6.2.0", | ||
"eslint-plugin-node": "^10.0.0", | ||
"eslint-plugin-prettier": "^3.1.1", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.10.0", | ||
"eslint-plugin-chai-expect": "^2.1.0", | ||
"eslint-plugin-mocha": "^6.2.2", | ||
"eslint-plugin-node": "^11.0.0", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"express": "^4.17.1", | ||
"lerna-changelog": "^0.8.2", | ||
"mocha": "^6.2.2", | ||
"prettier": "^1.18.2", | ||
"release-it": "^12.2.1", | ||
"lerna-changelog": "^1.0.0", | ||
"mocha": "^7.0.1", | ||
"prettier": "^1.19.1", | ||
"release-it": "^12.4.3", | ||
"release-it-lerna-changelog": "^1.0.3", | ||
"rimraf": "^3.0.0", | ||
"temp": "^0.9.0" | ||
"rimraf": "^3.0.1", | ||
"temp": "^0.9.1" | ||
}, | ||
"engines": { | ||
"node": "^8.10.0 || 10.* || >=12" | ||
"node": "10.* || >=12" | ||
}, | ||
@@ -58,0 +58,0 @@ "publishConfig": { |
@@ -71,2 +71,3 @@ # FastBoot | ||
- `destroyAppInstanceInMs`: whether to destroy the instance in the given number of ms. This is a failure mechanism to not wedge the Node process | ||
- `buildSandboxPerVisit`: whether to create a new sandbox context per-visit (slows down each visit, but guarantees no prototype leakages can occur), or reuse the existing sandbox (faster per-request, but each request shares the same set of prototypes). Defaults to false. | ||
@@ -73,0 +74,0 @@ ### Build Your App |
@@ -186,4 +186,5 @@ 'use strict'; | ||
destroy() { | ||
// TODO: expose as public api (through the top level) so that we can | ||
// cleanup pre-warmed visits | ||
if (this._applicationInstance) { | ||
this._applicationInstance.destroy(); | ||
} | ||
} | ||
@@ -246,8 +247,23 @@ | ||
* @param {Object} result | ||
* @param {Boolean} buildSandboxPerVisit if true, a new sandbox will | ||
* **always** be created, otherwise one | ||
* is created for the first request | ||
* only | ||
* @return {Promise<instance>} instance | ||
*/ | ||
async visitRoute(path, fastbootInfo, bootOptions, result) { | ||
let app = await this.buildApp(); | ||
result.applicationInstance = app; | ||
async _visit(path, fastbootInfo, bootOptions, result, buildSandboxPerVisit) { | ||
let shouldBuildApp = buildSandboxPerVisit || this._applicationInstance === undefined; | ||
let app = shouldBuildApp ? await this.buildApp() : this._applicationInstance; | ||
if (buildSandboxPerVisit) { | ||
// entangle the specific application instance to the result, so it can be | ||
// destroyed when result._destroy() is called (after the visit is | ||
// completed) | ||
result.applicationInstance = app; | ||
} else { | ||
// save the created application instance so that we can clean it up when | ||
// this instance of `src/ember-app.js` is destroyed (e.g. reload) | ||
this._applicationInstance = app; | ||
} | ||
await app.boot(); | ||
@@ -283,2 +299,3 @@ | ||
* @param {Integer} [options.destroyAppInstanceInMs] whether to destroy the instance in the given number of ms. This is a failure mechanism to not wedge the Node process (See: https://github.com/ember-fastboot/fastboot/issues/90) | ||
* @param {Boolean} [options.buildSandboxPerVisit] whether to create a new sandbox context per-visit, or reuse the existing sandbox | ||
* @param {ClientRequest} | ||
@@ -320,3 +337,9 @@ * @param {ClientResponse} | ||
try { | ||
await this.visitRoute(path, fastbootInfo, bootOptions, result); | ||
await this._visit( | ||
path, | ||
fastbootInfo, | ||
bootOptions, | ||
result, | ||
options.buildSandboxPerVisit === true | ||
); | ||
@@ -323,0 +346,0 @@ if (!disableShoebox) { |
@@ -78,2 +78,3 @@ 'use strict'; | ||
* @param {Integer} [options.destroyAppInstanceInMs] whether to destroy the instance in the given number of ms. This is a failure mechanism to not wedge the Node process (See: https://github.com/ember-fastboot/fastboot/issues/90) | ||
* @param {Boolean} [options.buildSandboxPerVisit=false] whether to create a new sandbox context per-visit (slows down each visit, but guarantees no prototype leakages can occur), or reuse the existing sandbox (faster per-request, but each request shares the same set of prototypes) | ||
* @returns {Promise<Result>} result | ||
@@ -80,0 +81,0 @@ */ |
Sorry, the diff of this file is not supported yet
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
33539967
1198
0
144
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@3.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedsupports-color@5.5.0(transitive)
Updatedchalk@^3.0.0
Updatedresolve@^1.15.0
Updatedsource-map-support@^0.5.16