subapp-server
Advanced tools
Comparing version 1.3.15 to 1.3.16
@@ -26,6 +26,9 @@ "use strict"; | ||
{ templateFile, tokenHandlers, cacheId, cacheKey, options }, | ||
routeOptions | ||
routeOptions, | ||
request | ||
) { | ||
cacheKey = cacheKey || (cacheId && `${templateFile}#${cacheId}`) || templateFile; | ||
const url = _.get(request, "url.path", request.url); | ||
cacheKey = cacheKey || `${templateFile}#${cacheId}#${url}`; | ||
let asyncTemplate = routeOptions._templateCache[cacheKey]; | ||
@@ -58,4 +61,7 @@ if (asyncTemplate) { | ||
const templateModule = require(templateFullPath); // eslint-disable-line | ||
const template = _.get(templateModule, "default", templateModule); | ||
const templateExp = templateModule.templateTags || templateModule.default || templateModule; | ||
const template = typeof templateExp === "function" ? templateExp(routeOptions) : templateExp; | ||
if (template.$$typeof === xarcJsxElement || template.children) { | ||
@@ -72,5 +78,4 @@ // JSX | ||
// Tag | ||
const templateTags = _.get(template, "templateTags", template); | ||
asyncTemplate = new TagRenderer({ | ||
templateTags, | ||
templateTags: template, | ||
tokenHandlers: finalTokenHandlers.map(x => loadTokenModuleHandler(x)), | ||
@@ -109,3 +114,3 @@ insertTokenIds: routeOptions.insertTokenIds, | ||
} | ||
const asyncTemplate = initializeTemplate(selection, routeOptions); | ||
const asyncTemplate = initializeTemplate(selection, routeOptions, options.request); | ||
return asyncTemplate.render(options); | ||
@@ -112,0 +117,0 @@ }; |
{ | ||
"name": "subapp-server", | ||
"version": "1.3.15", | ||
"version": "1.3.16", | ||
"description": "Electrode SubApp app server support", | ||
@@ -32,9 +32,9 @@ "main": "lib/index.js", | ||
"@hapi/boom": "^7.4.1", | ||
"@xarc/index-page": "^1.0.9", | ||
"@xarc/jsx-renderer": "^1.0.9", | ||
"@xarc/tag-renderer": "^1.0.8", | ||
"@xarc/index-page": "^1.0.10", | ||
"@xarc/jsx-renderer": "^1.0.10", | ||
"@xarc/tag-renderer": "^1.0.9", | ||
"filter-scan-dir": "^1.0.9", | ||
"http-status-codes": "^1.3.0", | ||
"optional-require": "^1.0.0", | ||
"subapp-util": "^1.1.2", | ||
"optional-require": "^1.1.6", | ||
"subapp-util": "^1.1.3", | ||
"xaa": "^1.4.0" | ||
@@ -41,0 +41,0 @@ }, |
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
46274
1149
5
Updated@xarc/index-page@^1.0.10
Updated@xarc/jsx-renderer@^1.0.10
Updated@xarc/tag-renderer@^1.0.9
Updatedoptional-require@^1.1.6
Updatedsubapp-util@^1.1.3