Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
fary-vue-ssr
Advanced tools
这是一个用来处理vue服务端渲染的Koa中间件
安装:
npm i fary-vue-ssr -S
使用:
const Koa = require('koa')
const faryVueSSR = require('fary-vue-ssr')
const app = new Koa()
app.use(faryVueSSR(options))
是否启用服务端渲染
vue-server-renderer
中使用的模块,可以在webpack中使用vue-ssr-webpack-plugin
生成。
该参数还可以传入一个方法,返回一个Promise,Promise中resolve需要使用的bundle信息
vue-server-renderer
配置中对应的clientManifest内容,可以由vue-server-renderer/client-plugin
生成。
该参数还可以传入一个方法,返回一个Promise,Promise中resolve需要使用的manifest信息
渲染内容时用到的模板文件,中间件使用ejs进行渲染,渲染参数如下:
{
style: string, // 行内样式
scripts: string, // 客户端javascripts,需要clientManifest
title: string, // 从路由配置的meta中读取
meta: object, // 路由配置的meta
appString: string, // 服务端渲染的html内容
initialState: object, // store的state
initialLocalState: object, // 使用的localData
preLoadAndFetch: string, // 预加载的静态文件,需要clientManifest
}
不需要使用服务端渲染的路由
如果为true,使用LRU缓存,object和function则为自定义的缓存配置
是否每次都在新的执行环境执行,为true较为消耗性能,如果能保证js代码不会修改global内容,可以选择设置为false
请参考这里
FAQs
vue server side rendering
The npm package fary-vue-ssr receives a total of 6 weekly downloads. As such, fary-vue-ssr popularity was classified as not popular.
We found that fary-vue-ssr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.