@nguniversal/express-engine
Advanced tools
Comparing version 11.0.1 to 11.1.0-next.0
@@ -314,2 +314,3 @@ (function (global, factory) { | ||
return function (filePath, options, callback) { | ||
var _a, _b, _c, _d; | ||
try { | ||
@@ -326,2 +327,4 @@ var renderOptions = Object.assign({}, options); | ||
renderOptions.providers = __spread((renderOptions.providers || []), [getReqResProviders(req, res)]); | ||
renderOptions.publicPath = (_b = (_a = renderOptions.publicPath) !== null && _a !== void 0 ? _a : setupOptions.publicPath) !== null && _b !== void 0 ? _b : (_c = options.settings) === null || _c === void 0 ? void 0 : _c.views, | ||
renderOptions.inlineCriticalCss = (_d = renderOptions.inlineCriticalCss) !== null && _d !== void 0 ? _d : setupOptions.inlineCriticalCss; | ||
engine$1.render(renderOptions) | ||
@@ -328,0 +331,0 @@ .then(function (html) { return callback(null, html); }) |
@@ -15,3 +15,3 @@ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@nguniversal/common/engine"),require("@nguniversal/express-engine/tokens")):"function"==typeof define&&define.amd?define("@nguniversal/express-engine",["exports","@nguniversal/common/engine","@nguniversal/express-engine/tokens"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).nguniversal=e.nguniversal||{},e.nguniversal.expressEngine={}),e.nguniversal.common.engine,e.nguniversal.expressEngine.tokens)}(this,(function(e,n,r){"use strict"; | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function o(e,n){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,t,i=r.call(e),s=[];try{for(;(void 0===n||n-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return s}function t(e,n){var o=[{provide:r.REQUEST,useValue:e}];return n&&o.push({provide:r.RESPONSE,useValue:n}),o} | ||
***************************************************************************** */function i(e,n){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,o,t=r.call(e),s=[];try{for(;(void 0===n||n-- >0)&&!(i=t.next()).done;)s.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(r=t.return)&&r.call(t)}finally{if(o)throw o.error}}return s}function o(e,n){var i=[{provide:r.REQUEST,useValue:e}];return n&&i.push({provide:r.RESPONSE,useValue:n}),i} | ||
/** | ||
@@ -30,2 +30,2 @@ * @license | ||
* found in the LICENSE file at https://angular.io/license | ||
*/e.ngExpressEngine=function i(e){var r=new n.ɵCommonEngine(e.bootstrap,e.providers);return function(n,i,s){try{var u=Object.assign({},i);if(!e.bootstrap&&!u.bootstrap)throw new Error("You must pass in a NgModule or NgModuleFactory to be bootstrapped");var a=u.req,l=u.res||a.res;u.url=u.url||a.protocol+"://"+(a.get("host")||"")+a.originalUrl,u.documentFilePath=u.documentFilePath||n,u.providers=function c(){for(var e=[],n=0;n<arguments.length;n++)e=e.concat(o(arguments[n]));return e}(u.providers||[],[t(a,l)]),r.render(u).then((function(e){return s(null,e)})).catch(s)}catch(e){s(e)}}},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
*/e.ngExpressEngine=function t(e){var r=new n.ɵCommonEngine(e.bootstrap,e.providers);return function(n,t,s){var l,u,a,c;try{var p=Object.assign({},t);if(!e.bootstrap&&!p.bootstrap)throw new Error("You must pass in a NgModule or NgModuleFactory to be bootstrapped");var v=p.req,d=p.res||v.res;p.url=p.url||v.protocol+"://"+(v.get("host")||"")+v.originalUrl,p.documentFilePath=p.documentFilePath||n,p.providers=function g(){for(var e=[],n=0;n<arguments.length;n++)e=e.concat(i(arguments[n]));return e}(p.providers||[],[o(v,d)]),p.publicPath=null!==(u=null!==(l=p.publicPath)&&void 0!==l?l:e.publicPath)&&void 0!==u?u:null===(a=t.settings)||void 0===a?void 0:a.views,p.inlineCriticalCss=null!==(c=p.inlineCriticalCss)&&void 0!==c?c:e.inlineCriticalCss,r.render(p).then((function(e){return s(null,e)})).catch(s)}catch(e){s(e)}}},Object.defineProperty(e,"__esModule",{value:!0})})); |
@@ -9,2 +9,3 @@ import { ɵCommonEngine as CommonEngine } from '@nguniversal/common/engine'; | ||
return function (filePath, options, callback) { | ||
var _a, _b, _c, _d; | ||
try { | ||
@@ -21,2 +22,4 @@ const renderOptions = Object.assign({}, options); | ||
renderOptions.providers = [...(renderOptions.providers || []), getReqResProviders(req, res)]; | ||
renderOptions.publicPath = (_b = (_a = renderOptions.publicPath) !== null && _a !== void 0 ? _a : setupOptions.publicPath) !== null && _b !== void 0 ? _b : (_c = options.settings) === null || _c === void 0 ? void 0 : _c.views, | ||
renderOptions.inlineCriticalCss = (_d = renderOptions.inlineCriticalCss) !== null && _d !== void 0 ? _d : setupOptions.inlineCriticalCss; | ||
engine.render(renderOptions) | ||
@@ -49,2 +52,2 @@ .then(html => callback(null, html)) | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL21vZHVsZXMvZXhwcmVzcy1lbmdpbmUvc3JjL21haW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBVUEsT0FBTyxFQUFFLGFBQWEsSUFBSSxZQUFZLEVBQWtCLE1BQU0sNEJBQTRCLENBQUM7QUFDM0YsT0FBTyxFQUFFLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxvQ0FBb0MsQ0FBQztBQWtCdkU7O0dBRUc7QUFDSCxNQUFNLFVBQVUsZUFBZSxDQUFDLFlBQXNDO0lBQ3BFLE1BQU0sTUFBTSxHQUFHLElBQUksWUFBWSxDQUFDLFlBQVksQ0FBQyxTQUFTLEVBQUUsWUFBWSxDQUFDLFNBQVMsQ0FBQyxDQUFDO0lBRWhGLE9BQU8sVUFBVSxRQUFnQixFQUNoQixPQUFlLEVBQ2YsUUFBcUQ7UUFDcEUsSUFBSTtZQUNGLE1BQU0sYUFBYSxHQUFHLGtCQUFLLE9BQU8sQ0FBbUIsQ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B0aW9ucy5pbmxpbmVDcml0aWNhbENzcztcblxuICAgICAgZW5naW5lLnJlbmRlcihyZW5kZXJPcHRpb25zKVxuICAgICAgICAudGhlbihodG1sID0+IGNhbGxiYWNrKG51bGwsIGh0bWwpKVxuICAgICAgICAuY2F0Y2goY2FsbGJhY2spO1xuICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgY2FsbGJhY2soZXJyKTtcbiAgICB9XG4gIH07XG59XG5cbi8qKlxuICogR2V0IHByb3ZpZGVycyBvZiB0aGUgcmVxdWVzdCBhbmQgcmVzcG9uc2VcbiAqL1xuZnVuY3Rpb24gZ2V0UmVxUmVzUHJvdmlkZXJzKHJlcTogUmVxdWVzdCwgcmVzPzogUmVzcG9uc2UpOiBTdGF0aWNQcm92aWRlcltdIHtcbiAgY29uc3QgcHJvdmlkZXJzOiBTdGF0aWNQcm92aWRlcltdID0gW1xuICAgIHtcbiAgICAgIHByb3ZpZGU6IFJFUVVFU1QsXG4gICAgICB1c2VWYWx1ZTogcmVxXG4gICAgfVxuICBdO1xuICBpZiAocmVzKSB7XG4gICAgcHJvdmlkZXJzLnB1c2goe1xuICAgICAgcHJvdmlkZTogUkVTUE9OU0UsXG4gICAgICB1c2VWYWx1ZTogcmVzXG4gICAgfSk7XG4gIH1cblxuICByZXR1cm4gcHJvdmlkZXJzO1xufVxuIl19 |
@@ -10,3 +10,3 @@ /** | ||
/** Current version of Angular NgUniversal. */ | ||
export const VERSION = new Version('11.0.1'); | ||
export const VERSION = new Version('11.1.0-next.0'); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL21vZHVsZXMvZXhwcmVzcy1lbmdpbmUvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRXhDLDhDQUE4QztBQUM5QyxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsSUFBSSxPQUFPLENBQUMsbUJBQW1CLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCBHb29nbGUgTExDIEFsbCBSaWdodHMgUmVzZXJ2ZWQuXG4gKlxuICogVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgYW4gTUlULXN0eWxlIGxpY2Vuc2UgdGhhdCBjYW4gYmVcbiAqIGZvdW5kIGluIHRoZSBMSUNFTlNFIGZpbGUgYXQgaHR0cHM6Ly9hbmd1bGFyLmlvL2xpY2Vuc2VcbiAqL1xuXG5pbXBvcnQgeyBWZXJzaW9uIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbi8qKiBDdXJyZW50IHZlcnNpb24gb2YgQW5ndWxhciBOZ1VuaXZlcnNhbC4gKi9cbmV4cG9ydCBjb25zdCBWRVJTSU9OID0gbmV3IFZlcnNpb24oJzAuMC4wLVBMQUNFSE9MREVSJyk7XG4iXX0= |
import { NgModuleFactory } from '@angular/core'; | ||
import { Request as Request_2 } from 'express'; | ||
import { Response as Response_2 } from 'express'; | ||
import { StaticProvider } from '@angular/core'; | ||
import { Type } from '@angular/core'; | ||
import { ɵRenderOptions } from '@nguniversal/common/engine'; | ||
@@ -17,6 +14,3 @@ | ||
*/ | ||
export declare interface NgSetupOptions { | ||
bootstrap: Type<{}> | NgModuleFactory<{}>; | ||
providers?: StaticProvider[]; | ||
} | ||
export declare type NgSetupOptions = Pick<ɵRenderOptions, 'bootstrap' | 'providers' | 'publicPath' | 'inlineCriticalCss'>; | ||
@@ -23,0 +17,0 @@ /** |
@@ -10,2 +10,3 @@ import { ɵCommonEngine } from '@nguniversal/common/engine'; | ||
return function (filePath, options, callback) { | ||
var _a, _b, _c, _d; | ||
try { | ||
@@ -22,2 +23,4 @@ const renderOptions = Object.assign({}, options); | ||
renderOptions.providers = [...(renderOptions.providers || []), getReqResProviders(req, res)]; | ||
renderOptions.publicPath = (_b = (_a = renderOptions.publicPath) !== null && _a !== void 0 ? _a : setupOptions.publicPath) !== null && _b !== void 0 ? _b : (_c = options.settings) === null || _c === void 0 ? void 0 : _c.views, | ||
renderOptions.inlineCriticalCss = (_d = renderOptions.inlineCriticalCss) !== null && _d !== void 0 ? _d : setupOptions.inlineCriticalCss; | ||
engine.render(renderOptions) | ||
@@ -24,0 +27,0 @@ .then(html => callback(null, html)) |
{ | ||
"name": "@nguniversal/express-engine", | ||
"version": "11.0.1", | ||
"version": "11.1.0-next.0", | ||
"description": "Express Engine for running Server Angular Apps", | ||
@@ -15,9 +15,9 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@angular/common": "^11.0.3", | ||
"@angular/core": "^11.0.3", | ||
"@angular/platform-server": "^11.0.3", | ||
"@angular/common": "^11.1.0-next.2", | ||
"@angular/core": "^11.1.0-next.2", | ||
"@angular/platform-server": "^11.1.0-next.2", | ||
"express": "^4.15.2" | ||
}, | ||
"dependencies": { | ||
"@nguniversal/common": "11.0.1", | ||
"@nguniversal/common": "11.1.0-next.0", | ||
"tslib": "^2.0.0" | ||
@@ -24,0 +24,0 @@ }, |
@@ -42,3 +42,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
name: '@nguniversal/express-engine', | ||
version: '^11.0.1', | ||
version: '^11.1.0-next.0', | ||
}); | ||
@@ -45,0 +45,0 @@ dependencies_1.addPackageJsonDependency(host, { |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
131704
1
100
1070
2
+ Added@nguniversal/common@11.1.0-next.0(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedatob@2.1.2(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcritters@0.0.6(transitive)
+ Addedcss@3.0.0(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedparse5@6.0.1(transitive)
+ Addedparse5-htmlparser2-tree-adapter@6.0.1(transitive)
+ Addedpretty-bytes@5.6.0(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsource-map-resolve@0.6.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
- Removed@nguniversal/common@11.0.1(transitive)