Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to enable resilient mode #93

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
language: node_js
node_js:
- "4"
- "stable"
- "6"
- "8"
- "10"

env:
- CXX=g++-4.8 WORKER_COUNT=2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"chalk": "^2.0.1",
"compression": "^1.6.2",
"express": "^4.13.3",
"fastboot": "^1.1.4-beta.1",
"fastboot": "^2.0.0",
"fastboot-express-middleware": "^1.1.1",
"fs-promise": "^2.0.3",
"request": "^2.81.0"
Expand Down
2 changes: 2 additions & 0 deletions src/fastboot-app-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class FastBootAppServer {
this.afterMiddleware = options.afterMiddleware;
this.sandboxGlobals = options.sandboxGlobals;
this.chunkedResponse = options.chunkedResponse;
this.resilient = options.resilient;

if (!this.ui) {
let UI = require('./ui');
Expand All @@ -48,6 +49,7 @@ class FastBootAppServer {
afterMiddleware: this.afterMiddleware,
sandboxGlobals: this.sandboxGlobals,
chunkedResponse: this.chunkedResponse,
resilient: this.resilient,
});

this.worker.start();
Expand Down
2 changes: 2 additions & 0 deletions src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Worker {
this.afterMiddleware = options.afterMiddleware;
this.sandboxGlobals = options.sandboxGlobals;
this.chunkedResponse = options.chunkedResponse;
this.resilient = options.resilient;

if (!this.httpServer) {
this.httpServer = new ExpressHTTPServer({
Expand Down Expand Up @@ -74,6 +75,7 @@ class Worker {
this.fastboot = new FastBoot({
distPath: this.distPath,
sandboxGlobals: this.sandboxGlobals,
resilient: this.resilient,
});

return fastbootMiddleware({
Expand Down
84 changes: 76 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@
# yarn lockfile v1


"@simple-dom/document@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@simple-dom/document/-/document-1.4.0.tgz#af60855f957f284d436983798ef1006cca1a1678"
dependencies:
"@simple-dom/interface" "^1.4.0"

"@simple-dom/interface@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@simple-dom/interface/-/interface-1.4.0.tgz#e8feea579232017f89b0138e2726facda6fbb71f"

"@simple-dom/parser@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@simple-dom/parser/-/parser-1.4.0.tgz#b1fee1a23f48a37d6bdd98f5242db0cab5b67abc"
dependencies:
"@simple-dom/interface" "^1.4.0"

"@simple-dom/serializer@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@simple-dom/serializer/-/serializer-1.4.0.tgz#98470f357f418d72b1a1ec78d68191e60aefe215"
dependencies:
"@simple-dom/interface" "^1.4.0"

"@simple-dom/void-map@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@simple-dom/void-map/-/void-map-1.4.0.tgz#f15f07568fe1076740407266aa5e6eac249bc78c"

abbrev@1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f"
Expand Down Expand Up @@ -1376,6 +1402,12 @@ [email protected], debug@^3.0.0:
dependencies:
ms "2.0.0"

debug@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
dependencies:
ms "^2.1.1"

decamelize@^1.0.0, decamelize@^1.1.2:
version "1.2.0"
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
Expand Down Expand Up @@ -1938,17 +1970,17 @@ fastboot@^1.1.2:
simple-dom "^1.0.0"
source-map-support "^0.5.0"

fastboot@^1.1.4-beta.1:
version "1.1.4-beta.1"
resolved "https://registry.yarnpkg.com/fastboot/-/fastboot-1.1.4-beta.1.tgz#860f8af2bd032b3a7477fdf6e1a64b034a02829f"
fastboot@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/fastboot/-/fastboot-2.0.1.tgz#f8fc0d14379e69a250045708f58268c98943f115"
dependencies:
chalk "^2.0.1"
cookie "^0.3.1"
debug "^3.0.0"
exists-sync "0.0.4"
najax "^1.0.2"
rsvp "^4.7.0"
simple-dom "^1.0.0"
debug "^4.1.0"
najax "^1.0.3"
resolve "^1.8.1"
rsvp "^4.8.0"
simple-dom "^1.4.0"
source-map-support "^0.5.0"

faye-websocket@~0.10.0:
Expand Down Expand Up @@ -3163,6 +3195,10 @@ [email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"

ms@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"

mustache@^2.2.1:
version "2.3.0"
resolved "https://registry.yarnpkg.com/mustache/-/mustache-2.3.0.tgz#4028f7778b17708a489930a6e52ac3bca0da41d0"
Expand All @@ -3187,6 +3223,14 @@ najax@^1.0.2:
lodash.defaultsdeep "^4.6.0"
qs "^6.2.0"

najax@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/najax/-/najax-1.0.4.tgz#63fd8dbf15d18f24dc895b3a16fec66c136b8084"
dependencies:
jquery-deferred "^0.3.0"
lodash.defaultsdeep "^4.6.0"
qs "^6.2.0"

nan@^2.3.0:
version "2.8.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a"
Expand Down Expand Up @@ -3462,6 +3506,10 @@ path-parse@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"

path-parse@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"

path-posix@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/path-posix/-/path-posix-1.0.0.tgz#06b26113f56beab042545a23bfa88003ccac260f"
Expand Down Expand Up @@ -3766,6 +3814,12 @@ resolve@^1.1.6, resolve@^1.3.0, resolve@^1.3.3:
dependencies:
path-parse "^1.0.5"

resolve@^1.8.1:
version "1.10.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba"
dependencies:
path-parse "^1.0.6"

restore-cursor@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541"
Expand Down Expand Up @@ -3804,6 +3858,10 @@ rsvp@^4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.7.0.tgz#dc1b0b1a536f7dec9d2be45e0a12ad4197c9fd96"

rsvp@^4.8.0:
version "4.8.4"
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.4.tgz#b50e6b34583f3dd89329a2f23a8a2be072845911"

rsvp@~3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.2.1.tgz#07cb4a5df25add9e826ebc67dcc9fd89db27d84a"
Expand Down Expand Up @@ -3927,6 +3985,16 @@ simple-dom@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/simple-dom/-/simple-dom-1.0.0.tgz#6349e429d7eeb665a4f67ab1c93a95a66e3d53c9"

simple-dom@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/simple-dom/-/simple-dom-1.4.0.tgz#78ad1f41b8b70d16f82b7e0d458441c9262565b7"
dependencies:
"@simple-dom/document" "^1.4.0"
"@simple-dom/interface" "^1.4.0"
"@simple-dom/parser" "^1.4.0"
"@simple-dom/serializer" "^1.4.0"
"@simple-dom/void-map" "^1.4.0"

slash@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
Expand Down