Socket
Socket
Sign inDemoInstall

@quasar/ssr-helpers

Package Overview
Dependencies
Maintainers
6
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@quasar/ssr-helpers - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

26

create-renderer.js

@@ -6,2 +6,4 @@ /*

const { extname } = require('path')
const serialize = require('serialize-javascript')
const createBundle = require('./lib/create-bundle')

@@ -107,3 +109,14 @@

function renderScripts(renderContext, usedAsyncFiles) {
const autoRemove = 'var currentScript=document.currentScript;currentScript.parentNode.removeChild(currentScript)'
function renderVuexState (ssrContext, nonce) {
if (ssrContext.state !== void 0) {
const state = serialize(ssrContext.state, { isJSON: true })
return `<script${nonce}>window.__INITIAL_STATE__=${state};${autoRemove}</script>`
}
return ''
}
function renderScripts(renderContext, usedAsyncFiles, nonce) {
if (renderContext.preloadFiles.length > 0) {

@@ -114,3 +127,3 @@ const initial = renderContext.preloadFiles.filter(({ file }) => jsRE.test(file))

return [ initial[0] ].concat(async, initial.slice(1))
.map(({ file }) => `<script src="${renderContext.publicPath}${file}" defer></script>`)
.map(({ file }) => `<script${nonce} src="${renderContext.publicPath}${file}" defer></script>`)
.join('')

@@ -154,6 +167,13 @@ }

const nonce = ssrContext.nonce !== void 0
? ` nonce="${ ssrContext.nonce }" `
: ''
Object.assign(ssrContext._meta, {
resourceApp,
resourceStyles: renderStyles(renderContext, usedAsyncFiles, ssrContext),
resourceScripts: renderScripts(renderContext, usedAsyncFiles)
resourceScripts: (
renderVuexState(ssrContext, nonce)
+ renderScripts(renderContext, usedAsyncFiles, nonce)
)
})

@@ -160,0 +180,0 @@

5

package.json
{
"name": "@quasar/ssr-helpers",
"version": "1.0.0",
"version": "1.1.0",
"description": "Quasar Framework helper package for SSR",

@@ -28,4 +28,5 @@ "author": {

"dependencies": {
"hash-sum": "^2.0.0"
"hash-sum": "^2.0.0",
"serialize-javascript": "^5.0.1"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc