@nguniversal/socket-engine
Advanced tools
Comparing version 7.0.2 to 7.1.0
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('fs'), require('@angular/compiler'), require('@angular/core'), require('@angular/platform-server'), require('net')) : | ||
typeof define === 'function' && define.amd ? define('@nguniversal/socket-engine', ['exports', 'fs', '@angular/compiler', '@angular/core', '@angular/platform-server', 'net'], factory) : | ||
(factory((global.nguniversal = global.nguniversal || {}, global.nguniversal.socketEngine = {}),global.fs,global.ng.compiler,global.ng.core,global.ng.platformServer,global.net)); | ||
}(this, (function (exports,fs,compiler,core,platformServer,net) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('fs'), require('tslib'), require('@angular/compiler'), require('@angular/core'), require('@angular/platform-server'), require('net')) : | ||
typeof define === 'function' && define.amd ? define('@nguniversal/socket-engine', ['exports', 'fs', 'tslib', '@angular/compiler', '@angular/core', '@angular/platform-server', 'net'], factory) : | ||
(factory((global.nguniversal = global.nguniversal || {}, global.nguniversal.socketEngine = {}),global.fs,global.tslib,global.ng.compiler,global.ng.core,global.ng.platformServer,global.net)); | ||
}(this, (function (exports,fs,tslib_1,compiler,core,platformServer,net) { 'use strict'; | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** ResourceLoader implementation for loading files */ | ||
var FileLoader = /** @class */ (function () { | ||
function FileLoader() { | ||
} | ||
FileLoader.prototype.get = function (url) { | ||
return new Promise(function (resolve, reject) { | ||
fs.readFile(url, function (err, buffer) { | ||
if (err) { | ||
return reject(err); | ||
} | ||
resolve(buffer.toString()); | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** ResourceLoader implementation for loading files */ | ||
var FileLoader = /** @class */ (function () { | ||
function FileLoader() { | ||
} | ||
FileLoader.prototype.get = function (url) { | ||
return new Promise(function (resolve, reject) { | ||
fs.readFile(url, function (err, buffer) { | ||
if (err) { | ||
return reject(err); | ||
} | ||
resolve(buffer.toString()); | ||
}); | ||
}); | ||
}); | ||
}; | ||
return FileLoader; | ||
}()); | ||
}; | ||
return FileLoader; | ||
}()); | ||
var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator$1 = (undefined && undefined.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [0, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __read = (undefined && undefined.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
var __spread = (undefined && undefined.__spread) || function () { | ||
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); | ||
return ar; | ||
}; | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* A common rendering engine utility. This abstracts the logic | ||
* for handling the platformServer compiler, the module cache, and | ||
* the document loader | ||
*/ | ||
var CommonEngine = /** @class */ (function () { | ||
function CommonEngine(moduleOrFactory, providers) { | ||
if (providers === void 0) { providers = []; } | ||
this.moduleOrFactory = moduleOrFactory; | ||
this.providers = providers; | ||
this.factoryCacheMap = new Map(); | ||
this.templateCache = {}; | ||
} | ||
/** Return an instance of the platformServer compiler */ | ||
CommonEngine.prototype.getCompiler = function () { | ||
var compilerFactory = platformServer.platformDynamicServer().injector.get(core.CompilerFactory); | ||
return compilerFactory.createCompiler([ | ||
{ providers: [{ provide: compiler.ResourceLoader, useClass: FileLoader, deps: [] }] } | ||
]); | ||
}; | ||
/** | ||
* Render an HTML document for a specific URL with specified | ||
* render options | ||
* A common rendering engine utility. This abstracts the logic | ||
* for handling the platformServer compiler, the module cache, and | ||
* the document loader | ||
*/ | ||
CommonEngine.prototype.render = function (opts) { | ||
return __awaiter$1(this, void 0, void 0, function () { | ||
var doc, _a, extraProviders, factory; | ||
return __generator$1(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
_a = opts.document; | ||
if (_a) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, this.getDocument(opts.documentFilePath)]; | ||
case 1: | ||
_a = (_b.sent()); | ||
_b.label = 2; | ||
case 2: | ||
doc = _a; | ||
extraProviders = __spread((opts.providers || []), (this.providers || []), [ | ||
{ | ||
provide: platformServer.INITIAL_CONFIG, | ||
useValue: { | ||
document: doc, | ||
url: opts.url | ||
var CommonEngine = /** @class */ (function () { | ||
function CommonEngine(moduleOrFactory, providers) { | ||
if (providers === void 0) { providers = []; } | ||
this.moduleOrFactory = moduleOrFactory; | ||
this.providers = providers; | ||
this.factoryCacheMap = new Map(); | ||
this.templateCache = {}; | ||
} | ||
/** Return an instance of the platformServer compiler */ | ||
CommonEngine.prototype.getCompiler = function () { | ||
var compilerFactory = platformServer.platformDynamicServer().injector.get(core.CompilerFactory); | ||
return compilerFactory.createCompiler([ | ||
{ providers: [{ provide: compiler.ResourceLoader, useClass: FileLoader, deps: [] }] } | ||
]); | ||
}; | ||
/** | ||
* Render an HTML document for a specific URL with specified | ||
* render options | ||
*/ | ||
CommonEngine.prototype.render = function (opts) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var doc, _a, extraProviders, factory; | ||
return tslib_1.__generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
_a = opts.document; | ||
if (_a) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, this.getDocument(opts.documentFilePath)]; | ||
case 1: | ||
_a = (_b.sent()); | ||
_b.label = 2; | ||
case 2: | ||
doc = _a; | ||
extraProviders = tslib_1.__spread((opts.providers || []), (this.providers || []), [ | ||
{ | ||
provide: platformServer.INITIAL_CONFIG, | ||
useValue: { | ||
document: doc, | ||
url: opts.url | ||
} | ||
} | ||
} | ||
]); | ||
return [4 /*yield*/, this.getFactory()]; | ||
case 3: | ||
factory = _b.sent(); | ||
return [2 /*return*/, platformServer.renderModuleFactory(factory, { extraProviders: extraProviders })]; | ||
} | ||
]); | ||
return [4 /*yield*/, this.getFactory()]; | ||
case 3: | ||
factory = _b.sent(); | ||
return [2 /*return*/, platformServer.renderModuleFactory(factory, { extraProviders: extraProviders })]; | ||
} | ||
}); | ||
}); | ||
}); | ||
}; | ||
/** Return the factory for a given engine instance */ | ||
CommonEngine.prototype.getFactory = function () { | ||
var _this = this; | ||
// If module has been compiled AoT | ||
var moduleOrFactory = this.moduleOrFactory; | ||
if (moduleOrFactory instanceof core.NgModuleFactory) { | ||
return Promise.resolve(moduleOrFactory); | ||
} | ||
else { | ||
// we're in JIT mode | ||
var moduleFactory = this.factoryCacheMap.get(moduleOrFactory); | ||
// If module factory is cached | ||
if (moduleFactory) { | ||
return Promise.resolve(moduleFactory); | ||
}; | ||
/** Return the factory for a given engine instance */ | ||
CommonEngine.prototype.getFactory = function () { | ||
var _this = this; | ||
// If module has been compiled AoT | ||
var moduleOrFactory = this.moduleOrFactory; | ||
if (moduleOrFactory instanceof core.NgModuleFactory) { | ||
return Promise.resolve(moduleOrFactory); | ||
} | ||
// Compile the module and cache it | ||
return this.getCompiler().compileModuleAsync(moduleOrFactory) | ||
.then(function (factory) { | ||
_this.factoryCacheMap.set(moduleOrFactory, factory); | ||
return factory; | ||
}); | ||
} | ||
}; | ||
/** Retrieve the document from the cache or the filesystem */ | ||
CommonEngine.prototype.getDocument = function (filePath) { | ||
var doc = this.templateCache[filePath] = this.templateCache[filePath] || | ||
fs.readFileSync(filePath).toString(); | ||
// As promise so we can change the API later without breaking | ||
return Promise.resolve(doc); | ||
}; | ||
return CommonEngine; | ||
}()); | ||
else { | ||
// we're in JIT mode | ||
var moduleFactory = this.factoryCacheMap.get(moduleOrFactory); | ||
// If module factory is cached | ||
if (moduleFactory) { | ||
return Promise.resolve(moduleFactory); | ||
} | ||
// Compile the module and cache it | ||
return this.getCompiler().compileModuleAsync(moduleOrFactory) | ||
.then(function (factory) { | ||
_this.factoryCacheMap.set(moduleOrFactory, factory); | ||
return factory; | ||
}); | ||
} | ||
}; | ||
/** Retrieve the document from the cache or the filesystem */ | ||
CommonEngine.prototype.getDocument = function (filePath) { | ||
var doc = this.templateCache[filePath] = this.templateCache[filePath] || | ||
fs.readFileSync(filePath).toString(); | ||
// As promise so we can change the API later without breaking | ||
return Promise.resolve(doc); | ||
}; | ||
return CommonEngine; | ||
}()); | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (undefined && undefined.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [0, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
function startSocketEngine(moduleOrFactory, providers, host, port) { | ||
var _this = this; | ||
if (providers === void 0) { providers = []; } | ||
if (host === void 0) { host = 'localhost'; } | ||
if (port === void 0) { port = 9090; } | ||
return new Promise(function (resolve, _reject) { | ||
var engine = new CommonEngine(moduleOrFactory, providers); | ||
var server = net.createServer(function (socket) { | ||
socket.on('data', function (buff) { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
var message, renderOptions, html, error_1; | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
message = buff.toString(); | ||
renderOptions = JSON.parse(message); | ||
_a.label = 1; | ||
case 1: | ||
_a.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, engine.render(renderOptions)]; | ||
case 2: | ||
html = _a.sent(); | ||
socket.write(JSON.stringify({ html: html, id: renderOptions.id })); | ||
return [3 /*break*/, 4]; | ||
case 3: | ||
error_1 = _a.sent(); | ||
// send the error down to the client then rethrow it | ||
socket.write(JSON.stringify({ html: null, | ||
id: renderOptions.id, error: error_1 })); | ||
throw error_1; | ||
case 4: return [2 /*return*/]; | ||
} | ||
}); | ||
}); }); | ||
}); | ||
server.listen(port, host); | ||
resolve({ close: function () { return server.close(); } }); | ||
}); | ||
} | ||
}; | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
function startSocketEngine(moduleOrFactory, providers, host, port) { | ||
var _this = this; | ||
if (providers === void 0) { providers = []; } | ||
if (host === void 0) { host = 'localhost'; } | ||
if (port === void 0) { port = 9090; } | ||
return new Promise(function (resolve, _reject) { | ||
var engine = new CommonEngine(moduleOrFactory, providers); | ||
var server = net.createServer(function (socket) { | ||
socket.on('data', function (buff) { return __awaiter(_this, void 0, void 0, function () { | ||
var message, renderOptions, html, error_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
message = buff.toString(); | ||
renderOptions = JSON.parse(message); | ||
_a.label = 1; | ||
case 1: | ||
_a.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, engine.render(renderOptions)]; | ||
case 2: | ||
html = _a.sent(); | ||
socket.write(JSON.stringify({ html: html, id: renderOptions.id })); | ||
return [3 /*break*/, 4]; | ||
case 3: | ||
error_1 = _a.sent(); | ||
// send the error down to the client then rethrow it | ||
socket.write(JSON.stringify({ html: null, | ||
id: renderOptions.id, error: error_1 })); | ||
throw error_1; | ||
case 4: return [2 /*return*/]; | ||
} | ||
}); | ||
}); }); | ||
}); | ||
server.listen(port, host); | ||
resolve({ close: function () { return server.close(); } }); | ||
}); | ||
} | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* Generated bundle index. Do not edit. | ||
*/ | ||
/** | ||
* Generated bundle index. Do not edit. | ||
*/ | ||
exports.startSocketEngine = startSocketEngine; | ||
exports.startSocketEngine = startSocketEngine; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
}))); | ||
//# sourceMappingURL=socket-engine.umd.js.map |
@@ -1,31 +0,45 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("fs"),require("@angular/compiler"),require("@angular/core"),require("@angular/platform-server"),require("net")):"function"==typeof define&&define.amd?define("@nguniversal/socket-engine",["exports","fs","@angular/compiler","@angular/core","@angular/platform-server","net"],t):t((e.nguniversal=e.nguniversal||{},e.nguniversal.socketEngine={}),e.fs,e.ng.compiler,e.ng.core,e.ng.platformServer,e.net)}(this,function(e,t,r,n,o,i){"use strict"; | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("fs"),require("tslib"),require("@angular/compiler"),require("@angular/core"),require("@angular/platform-server"),require("net")):"function"==typeof define&&define.amd?define("@nguniversal/socket-engine",["exports","fs","tslib","@angular/compiler","@angular/core","@angular/platform-server","net"],r):r((e.nguniversal=e.nguniversal||{},e.nguniversal.socketEngine={}),e.fs,e.tslib,e.ng.compiler,e.ng.core,e.ng.platformServer,e.net)}(this,function(e,r,t,n,o,i,a){"use strict"; | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/var a=function(){function e(){}return e.prototype.get=function(e){return new Promise(function(r,n){t.readFile(e,function(e,t){if(e)return n(e);r(t.toString())})})},e}(),u=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},c=function(){function e(e,t){void 0===t&&(t=[]),this.moduleOrFactory=e,this.providers=t,this.factoryCacheMap=new Map,this.templateCache={}}return e.prototype.getCompiler=function(){return o.platformDynamicServer().injector.get(n.CompilerFactory).createCompiler([{providers:[{provide:r.ResourceLoader,useClass:a,deps:[]}]}])},e.prototype.render=function(e){return t=this,void 0,n=function(){var t,r,n;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function c(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=n[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(i){switch(i.label){case 0:return(t=e.document)?[3,2]:[4,this.getDocument(e.documentFilePath)];case 1:t=i.sent(),i.label=2;case 2:return r=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(u(arguments[t]));return e}(e.providers||[],this.providers||[],[{provide:o.INITIAL_CONFIG,useValue:{document:t,url:e.url}}]),[4,this.getFactory()];case 3:return n=i.sent(),[2,o.renderModuleFactory(n,{extraProviders:r})]}})},new((r=void 0)||(r=Promise))(function(e,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(t){t.done?e(t.value):new r(function(e){e(t.value)}).then(i,a)}u((n=n.apply(t,[])).next())});var t,r,n},e.prototype.getFactory=function(){var e=this,t=this.moduleOrFactory;if(t instanceof n.NgModuleFactory)return Promise.resolve(t);var r=this.factoryCacheMap.get(t);return r?Promise.resolve(r):this.getCompiler().compileModuleAsync(t).then(function(r){return e.factoryCacheMap.set(t,r),r})},e.prototype.getDocument=function(e){var r=this.templateCache[e]=this.templateCache[e]||t.readFileSync(e).toString();return Promise.resolve(r)},e}(); | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/var s=function(){function e(){}return e.prototype.get=function(e){return new Promise(function(t,n){r.readFile(e,function(e,r){if(e)return n(e);t(r.toString())})})},e}(),u=function(){function e(e,r){void 0===r&&(r=[]),this.moduleOrFactory=e,this.providers=r,this.factoryCacheMap=new Map,this.templateCache={}}return e.prototype.getCompiler=function(){return i.platformDynamicServer().injector.get(o.CompilerFactory).createCompiler([{providers:[{provide:n.ResourceLoader,useClass:s,deps:[]}]}])},e.prototype.render=function(e){return t.__awaiter(this,void 0,void 0,function(){var r,n,o;return t.__generator(this,function(a){switch(a.label){case 0:return(r=e.document)?[3,2]:[4,this.getDocument(e.documentFilePath)];case 1:r=a.sent(),a.label=2;case 2:return n=t.__spread(e.providers||[],this.providers||[],[{provide:i.INITIAL_CONFIG,useValue:{document:r,url:e.url}}]),[4,this.getFactory()];case 3:return o=a.sent(),[2,i.renderModuleFactory(o,{extraProviders:n})]}})})},e.prototype.getFactory=function(){var e=this,r=this.moduleOrFactory;if(r instanceof o.NgModuleFactory)return Promise.resolve(r);var t=this.factoryCacheMap.get(r);return t?Promise.resolve(t):this.getCompiler().compileModuleAsync(r).then(function(t){return e.factoryCacheMap.set(r,t),t})},e.prototype.getDocument=function(e){var t=this.templateCache[e]=this.templateCache[e]||r.readFileSync(e).toString();return Promise.resolve(t)},e}(); | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
e.startSocketEngine= | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
function l(e,t,r,n){var o=this;return void 0===t&&(t=[]),void 0===r&&(r="localhost"),void 0===n&&(n=9090),new Promise(function(a,u){var l=new c(e,t),s=i.createServer(function(e){e.on("data",function(t){return r=o,void 0,i=function(){var r,n,o,i;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function c(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=n[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,function(a){switch(a.label){case 0:r=t.toString(),n=JSON.parse(r),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,l.render(n)];case 2:return o=a.sent(),e.write(JSON.stringify({html:o,id:n.id})),[3,4];case 3:throw i=a.sent(),e.write(JSON.stringify({html:null,id:n.id,error:i})),i;case 4:return[2]}})},new((n=void 0)||(n=Promise))(function(e,t){function o(e){try{u(i.next(e))}catch(e){t(e)}}function a(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){t.done?e(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(r,[])).next())});var r,n,i})});s.listen(n,r),a({close:function(){return s.close()}})})},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
function c(e,r,n,o){var i=this;return void 0===r&&(r=[]),void 0===n&&(n="localhost"),void 0===o&&(o=9090),new Promise(function(s,c){var l=new u(e,r),f=a.createServer(function(e){e.on("data",function(r){return t.__awaiter(i,void 0,void 0,function(){var n,o,i,a;return t.__generator(this,function(t){switch(t.label){case 0:n=r.toString(),o=JSON.parse(n),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,l.render(o)];case 2:return i=t.sent(),e.write(JSON.stringify({html:i,id:o.id})),[3,4];case 3:throw a=t.sent(),e.write(JSON.stringify({html:null,id:o.id,error:a})),a;case 4:return[2]}})})})});f.listen(o,n),s({close:function(){return f.close()}})})},Object.defineProperty(e,"__esModule",{value:!0})}); |
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -13,3 +13,2 @@ /** | ||
export { startSocketEngine } from './public_api'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9tb2R1bGVzL3NvY2tldC1lbmdpbmUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFPQSxrQ0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIExMQyBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljX2FwaSc7XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiLi4vLi4vIiwic291cmNlcyI6WyJtb2R1bGVzL3NvY2tldC1lbmdpbmUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFPQSxrQ0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIExMQyBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljX2FwaSc7XG4iXX0= |
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
export { startSocketEngine } from './src/main'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL21vZHVsZXMvc29ja2V0LWVuZ2luZS9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFPQSxPQUFPLEVBQUUsaUJBQWlCLEVBQW1ELE1BQU0sWUFBWSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5leHBvcnQgeyBzdGFydFNvY2tldEVuZ2luZSwgU29ja2V0RW5naW5lUmVzcG9uc2UsIFNvY2tldEVuZ2luZVJlbmRlck9wdGlvbnMgfSBmcm9tICcuL3NyYy9tYWluJztcbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIuLi8uLi8iLCJzb3VyY2VzIjpbIm1vZHVsZXMvc29ja2V0LWVuZ2luZS9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0FBT0EsT0FBTyxFQUFFLGlCQUFpQixFQUFtRCxNQUFNLFlBQVksQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCBHb29nbGUgTExDIEFsbCBSaWdodHMgUmVzZXJ2ZWQuXG4gKlxuICogVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgYW4gTUlULXN0eWxlIGxpY2Vuc2UgdGhhdCBjYW4gYmVcbiAqIGZvdW5kIGluIHRoZSBMSUNFTlNFIGZpbGUgYXQgaHR0cHM6Ly9hbmd1bGFyLmlvL2xpY2Vuc2VcbiAqL1xuZXhwb3J0IHsgc3RhcnRTb2NrZXRFbmdpbmUsIFNvY2tldEVuZ2luZVJlc3BvbnNlLCBTb2NrZXRFbmdpbmVSZW5kZXJPcHRpb25zIH0gZnJvbSAnLi9zcmMvbWFpbic7XG4iXX0= |
@@ -5,3 +5,2 @@ /** | ||
export * from './index'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29ja2V0LWVuZ2luZV9wdWJsaWNfaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9tb2R1bGVzL3NvY2tldC1lbmdpbmUvc29ja2V0LWVuZ2luZV9wdWJsaWNfaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29ja2V0LWVuZ2luZV9wdWJsaWNfaW5kZXguanMiLCJzb3VyY2VSb290IjoiLi4vLi4vIiwic291cmNlcyI6WyJtb2R1bGVzL3NvY2tldC1lbmdpbmUvc29ja2V0LWVuZ2luZV9wdWJsaWNfaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0= |
@@ -1,13 +0,13 @@ | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
import * as tslib_1 from "tslib"; | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
import { ɵCommonEngine as CommonEngine } from '@nguniversal/common/engine'; | ||
@@ -19,3 +19,3 @@ import * as net from 'net'; | ||
export function SocketEngineServer() { } | ||
function SocketEngineServer_tsickle_Closure_declarations() { | ||
if (false) { | ||
/** @type {?} */ | ||
@@ -28,3 +28,3 @@ SocketEngineServer.prototype.close; | ||
export function SocketEngineRenderOptions() { } | ||
function SocketEngineRenderOptions_tsickle_Closure_declarations() { | ||
if (false) { | ||
/** @type {?} */ | ||
@@ -37,3 +37,3 @@ SocketEngineRenderOptions.prototype.id; | ||
export function SocketEngineResponse() { } | ||
function SocketEngineResponse_tsickle_Closure_declarations() { | ||
if (false) { | ||
/** @type {?} */ | ||
@@ -55,15 +55,20 @@ SocketEngineResponse.prototype.id; | ||
return new Promise((resolve, _reject) => { | ||
const /** @type {?} */ engine = new CommonEngine(moduleOrFactory, providers); | ||
const /** @type {?} */ server = net.createServer(socket => { | ||
socket.on('data', (buff) => __awaiter(this, void 0, void 0, function* () { | ||
const /** @type {?} */ message = buff.toString(); | ||
const /** @type {?} */ renderOptions = /** @type {?} */ (JSON.parse(message)); | ||
/** @type {?} */ | ||
const engine = new CommonEngine(moduleOrFactory, providers); | ||
/** @type {?} */ | ||
const server = net.createServer(socket => { | ||
socket.on('data', (buff) => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
/** @type {?} */ | ||
const message = buff.toString(); | ||
/** @type {?} */ | ||
const renderOptions = (/** @type {?} */ (JSON.parse(message))); | ||
try { | ||
const /** @type {?} */ html = yield engine.render(renderOptions); | ||
socket.write(JSON.stringify(/** @type {?} */ ({ html, id: renderOptions.id }))); | ||
/** @type {?} */ | ||
const html = yield engine.render(renderOptions); | ||
socket.write(JSON.stringify((/** @type {?} */ ({ html, id: renderOptions.id })))); | ||
} | ||
catch (/** @type {?} */ error) { | ||
catch (error) { | ||
// send the error down to the client then rethrow it | ||
socket.write(JSON.stringify(/** @type {?} */ ({ html: null, | ||
id: renderOptions.id,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ZU9yRmFjdG9yeSwgcHJvdmlkZXJzKTtcblxuICAgIGNvbnN0IHNlcnZlciA9IG5ldC5jcmVhdGVTZXJ2ZXIoc29ja2V0ID0+IHtcbiAgICAgIHNvY2tldC5vbignZGF0YScsIGFzeW5jIGJ1ZmYgPT4ge1xuICAgICAgICBjb25zdCBtZXNzYWdlID0gYnVmZi50b1N0cmluZygpO1xuICAgICAgICBjb25zdCByZW5kZXJPcHRpb25zID0gSlNPTi5wYXJzZShtZXNzYWdlKSBhcyBTb2NrZXRFbmdpbmVSZW5kZXJPcHRpb25zO1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGNvbnN0IGh0bWwgPSBhd2FpdCBlbmdpbmUucmVuZGVyKHJlbmRlck9wdGlvbnMpO1xuICAgICAgICAgIHNvY2tldC53cml0ZShKU09OLnN0cmluZ2lmeSh7aHRtbCwgaWQ6IHJlbmRlck9wdGlvbnMuaWR9IGFzIFNvY2tldEVuZ2luZVJlc3BvbnNlKSk7XG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgLy8gc2VuZCB0aGUgZXJyb3IgZG93biB0byB0aGUgY2xpZW50IHRoZW4gcmV0aHJvdyBpdFxuICAgICAgICAgIHNvY2tldC53cml0ZShKU09OLnN0cmluZ2lmeSh7aHRtbDogbnVsbCxcbiAgICAgICAgICAgIGlkOiByZW5kZXJPcHRpb25zLmlkLCBlcnJvcn0gYXMgU29ja2V0RW5naW5lUmVzcG9uc2UpKTtcbiAgICAgICAgICB0aHJvdyBlcnJvcjtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfSk7XG5cbiAgICBzZXJ2ZXIubGlzdGVuKHBvcnQsIGhvc3QpO1xuICAgIHJlc29sdmUoe2Nsb3NlOiAoKSA9PiBzZXJ2ZXIuY2xvc2UoKX0pO1xuICB9KTtcbn1cblxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvd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ZXIoc29ja2V0ID0+IHtcbiAgICAgIHNvY2tldC5vbignZGF0YScsIGFzeW5jIGJ1ZmYgPT4ge1xuICAgICAgICBjb25zdCBtZXNzYWdlID0gYnVmZi50b1N0cmluZygpO1xuICAgICAgICBjb25zdCByZW5kZXJPcHRpb25zID0gSlNPTi5wYXJzZShtZXNzYWdlKSBhcyBTb2NrZXRFbmdpbmVSZW5kZXJPcHRpb25zO1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGNvbnN0IGh0bWwgPSBhd2FpdCBlbmdpbmUucmVuZGVyKHJlbmRlck9wdGlvbnMpO1xuICAgICAgICAgIHNvY2tldC53cml0ZShKU09OLnN0cmluZ2lmeSh7aHRtbCwgaWQ6IHJlbmRlck9wdGlvbnMuaWR9IGFzIFNvY2tldEVuZ2luZVJlc3BvbnNlKSk7XG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgLy8gc2VuZCB0aGUgZXJyb3IgZG93biB0byB0aGUgY2xpZW50IHRoZW4gcmV0aHJvdyBpdFxuICAgICAgICAgIHNvY2tldC53cml0ZShKU09OLnN0cmluZ2lmeSh7aHRtbDogbnVsbCxcbiAgICAgICAgICAgIGlkOiByZW5kZXJPcHRpb25zLmlkLCBlcnJvcn0gYXMgU29ja2V0RW5naW5lUmVzcG9uc2UpKTtcbiAgICAgICAgICB0aHJvdyBlcnJvcjtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfSk7XG5cbiAgICBzZXJ2ZXIubGlzdGVuKHBvcnQsIGhvc3QpO1xuICAgIHJlc29sdmUoe2Nsb3NlOiAoKSA9PiBzZXJ2ZXIuY2xvc2UoKX0pO1xuICB9KTtcbn1cblxuIl19 |
@@ -10,2 +10,2 @@ /** | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uL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vKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIExMQyBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cbmV4cG9ydCB7IHN0YXJ0U29ja2V0RW5naW5lLCBTb2NrZXRFbmdpbmVSZXNwb25zZSwgU29ja2V0RW5naW5lUmVuZGVyT3B0aW9ucyB9IGZyb20gJy4vc3JjL21haW4nO1xuIl19 |
@@ -6,2 +6,2 @@ /** | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29ja2V0LWVuZ2luZV9wdWJsaWNfaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9tb2R1bGVzL3NvY2tldC1lbmdpbmUvc29ja2V0LWVuZ2luZV9wdWJsaWNfaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29ja2V0LWVuZ2luZV9wdWJsaWNfaW5kZXguanMiLCJzb3VyY2VSb290IjoiLi4vLi4vIiwic291cmNlcyI6WyJtb2R1bGVzL3NvY2tldC1lbmdpbmUvc29ja2V0LWVuZ2luZV9wdWJsaWNfaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0= |
@@ -1,36 +0,2 @@ | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [0, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
import * as tslib_1 from "tslib"; | ||
/** | ||
@@ -53,5 +19,5 @@ * @license | ||
var server = net.createServer(function (socket) { | ||
socket.on('data', function (buff) { return __awaiter(_this, void 0, void 0, function () { | ||
socket.on('data', function (buff) { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
var message, renderOptions, html, error_1; | ||
return __generator(this, function (_a) { | ||
return tslib_1.__generator(this, function (_a) { | ||
switch (_a.label) { | ||
@@ -85,2 +51,2 @@ case 0: | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL21vZHVsZXMvc29ja2V0LWVuZ2luZS9zcmMvbWFpbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBOzs7Ozs7R0FNRztBQUNILE9BQU8sRUFBRSxhQUFhLElBQUksWUFBWSxFQUNILE1BQU0sNEJBQTRCLENBQUM7QUFFdEUsT0FBTyxLQUFLLEdBQUcsTUFBTSxLQUFLLENBQUM7QUFnQjNCLE1BQU0sNEJBQ0osZUFBK0MsRUFDL0MsU0FBZ0MsRUFDaEMsSUFBa0IsRUFDbEIsSUFBVztJQUpiLGlCQTRCQztJQTFCQywwQkFBQSxFQUFBLGNBQWd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biAgICBzZXJ2ZXIubGlzdGVuKHBvcnQsIGhvc3QpO1xuICAgIHJlc29sdmUoe2Nsb3NlOiAoKSA9PiBzZXJ2ZXIuY2xvc2UoKX0pO1xuICB9KTtcbn1cblxuIl19 |
@@ -1,29 +0,163 @@ | ||
import { ɵCommonEngine } from '@nguniversal/common/engine'; | ||
import { readFile, readFileSync } from 'fs'; | ||
import { __awaiter } from 'tslib'; | ||
import { ResourceLoader } from '@angular/compiler'; | ||
import { NgModuleFactory, CompilerFactory } from '@angular/core'; | ||
import { INITIAL_CONFIG, renderModuleFactory, platformDynamicServer } from '@angular/platform-server'; | ||
import { createServer } from 'net'; | ||
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @record | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* ResourceLoader implementation for loading files | ||
*/ | ||
class FileLoader { | ||
/** | ||
* @param {?} url | ||
* @return {?} | ||
*/ | ||
get(url) { | ||
return new Promise((resolve, reject) => { | ||
readFile(url, (err, buffer) => { | ||
if (err) { | ||
return reject(err); | ||
} | ||
resolve(buffer.toString()); | ||
}); | ||
}); | ||
} | ||
} | ||
/** | ||
* @record | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* A common rendering engine utility. This abstracts the logic | ||
* for handling the platformServer compiler, the module cache, and | ||
* the document loader | ||
*/ | ||
class CommonEngine { | ||
/** | ||
* @param {?} moduleOrFactory | ||
* @param {?=} providers | ||
*/ | ||
constructor(moduleOrFactory, providers = []) { | ||
this.moduleOrFactory = moduleOrFactory; | ||
this.providers = providers; | ||
this.factoryCacheMap = new Map(); | ||
this.templateCache = {}; | ||
} | ||
/** | ||
* Return an instance of the platformServer compiler | ||
* @return {?} | ||
*/ | ||
getCompiler() { | ||
/** @type {?} */ | ||
const compilerFactory = platformDynamicServer().injector.get(CompilerFactory); | ||
return compilerFactory.createCompiler([ | ||
{ providers: [{ provide: ResourceLoader, useClass: FileLoader, deps: [] }] } | ||
]); | ||
} | ||
/** | ||
* Render an HTML document for a specific URL with specified | ||
* render options | ||
* @param {?} opts | ||
* @return {?} | ||
*/ | ||
render(opts) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
// if opts.document dosen't exist then opts.documentFilePath must | ||
/** @type {?} */ | ||
const doc = opts.document || (yield this.getDocument((/** @type {?} */ ((/** @type {?} */ (opts)).documentFilePath)))); | ||
/** @type {?} */ | ||
const extraProviders = [ | ||
...(opts.providers || []), | ||
...(this.providers || []), | ||
{ | ||
provide: INITIAL_CONFIG, | ||
useValue: { | ||
document: doc, | ||
url: opts.url | ||
} | ||
} | ||
]; | ||
/** @type {?} */ | ||
const factory = yield this.getFactory(); | ||
return renderModuleFactory(factory, { extraProviders }); | ||
}); | ||
} | ||
/** | ||
* Return the factory for a given engine instance | ||
* @return {?} | ||
*/ | ||
getFactory() { | ||
// If module has been compiled AoT | ||
/** @type {?} */ | ||
const moduleOrFactory = this.moduleOrFactory; | ||
if (moduleOrFactory instanceof NgModuleFactory) { | ||
return Promise.resolve(moduleOrFactory); | ||
} | ||
else { | ||
// we're in JIT mode | ||
/** @type {?} */ | ||
let moduleFactory = this.factoryCacheMap.get(moduleOrFactory); | ||
// If module factory is cached | ||
if (moduleFactory) { | ||
return Promise.resolve(moduleFactory); | ||
} | ||
// Compile the module and cache it | ||
return this.getCompiler().compileModuleAsync(moduleOrFactory) | ||
.then((factory) => { | ||
this.factoryCacheMap.set(moduleOrFactory, factory); | ||
return factory; | ||
}); | ||
} | ||
} | ||
/** | ||
* Retrieve the document from the cache or the filesystem | ||
* @private | ||
* @param {?} filePath | ||
* @return {?} | ||
*/ | ||
getDocument(filePath) { | ||
/** @type {?} */ | ||
const doc = this.templateCache[filePath] = this.templateCache[filePath] || | ||
readFileSync(filePath).toString(); | ||
// As promise so we can change the API later without breaking | ||
return Promise.resolve(doc); | ||
} | ||
} | ||
/** | ||
* @record | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @param {?} moduleOrFactory | ||
@@ -37,15 +171,20 @@ * @param {?=} providers | ||
return new Promise((resolve, _reject) => { | ||
const /** @type {?} */ engine$$1 = new ɵCommonEngine(moduleOrFactory, providers); | ||
const /** @type {?} */ server = createServer(socket => { | ||
/** @type {?} */ | ||
const engine = new CommonEngine(moduleOrFactory, providers); | ||
/** @type {?} */ | ||
const server = createServer(socket => { | ||
socket.on('data', (buff) => __awaiter(this, void 0, void 0, function* () { | ||
const /** @type {?} */ message = buff.toString(); | ||
const /** @type {?} */ renderOptions = /** @type {?} */ (JSON.parse(message)); | ||
/** @type {?} */ | ||
const message = buff.toString(); | ||
/** @type {?} */ | ||
const renderOptions = (/** @type {?} */ (JSON.parse(message))); | ||
try { | ||
const /** @type {?} */ html = yield engine$$1.render(renderOptions); | ||
socket.write(JSON.stringify(/** @type {?} */ ({ html, id: renderOptions.id }))); | ||
/** @type {?} */ | ||
const html = yield engine.render(renderOptions); | ||
socket.write(JSON.stringify((/** @type {?} */ ({ html, id: renderOptions.id })))); | ||
} | ||
catch (/** @type {?} */ error) { | ||
catch (error) { | ||
// send the error down to the client then rethrow it | ||
socket.write(JSON.stringify(/** @type {?} */ ({ html: null, | ||
id: renderOptions.id, error }))); | ||
socket.write(JSON.stringify((/** @type {?} */ ({ html: null, | ||
id: renderOptions.id, error })))); | ||
throw error; | ||
@@ -62,3 +201,3 @@ } | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
@@ -68,11 +207,4 @@ | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
@@ -79,0 +211,0 @@ /** |
import { readFile, readFileSync } from 'fs'; | ||
import { __awaiter, __generator, __spread } from 'tslib'; | ||
import { ResourceLoader } from '@angular/compiler'; | ||
import { CompilerFactory, NgModuleFactory } from '@angular/core'; | ||
import { INITIAL_CONFIG, platformDynamicServer, renderModuleFactory } from '@angular/platform-server'; | ||
import { NgModuleFactory, CompilerFactory } from '@angular/core'; | ||
import { INITIAL_CONFIG, renderModuleFactory, platformDynamicServer } from '@angular/platform-server'; | ||
import { createServer } from 'net'; | ||
@@ -31,65 +32,3 @@ | ||
var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator$1 = (undefined && undefined.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [0, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __read = (undefined && undefined.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
var __spread = (undefined && undefined.__spread) || function () { | ||
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); | ||
return ar; | ||
}; | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/** | ||
* A common rendering engine utility. This abstracts the logic | ||
@@ -119,5 +58,5 @@ * for handling the platformServer compiler, the module cache, and | ||
CommonEngine.prototype.render = function (opts) { | ||
return __awaiter$1(this, void 0, void 0, function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var doc, _a, extraProviders, factory; | ||
return __generator$1(this, function (_b) { | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
@@ -207,44 +146,2 @@ case 0: | ||
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (undefined && undefined.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [0, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
function startSocketEngine(moduleOrFactory, providers, host, port) { | ||
@@ -251,0 +148,0 @@ var _this = this; |
{ | ||
"name": "@nguniversal/socket-engine", | ||
"version": "v7.0.2", | ||
"version": "7.1.0", | ||
"description": "Socket Engine for running Server Angular Apps", | ||
@@ -12,4 +12,4 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@nguniversal/common": "v7.0.2", | ||
"@angular/core": ">=6.0.0" | ||
"@nguniversal/common": "7.1.0", | ||
"@angular/core": "^7.1.4" | ||
}, | ||
@@ -41,2 +41,2 @@ "ng-update": { | ||
"es2015": "./fesm2015/socket-engine.js" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
6
94293
861
4