@vue/server-renderer
Advanced tools
Comparing version 3.0.0-alpha.5 to 3.0.0-alpha.6
@@ -56,43 +56,2 @@ 'use strict'; | ||
function normalizeStyle(value) { | ||
if (isArray(value)) { | ||
const res = {}; | ||
for (let i = 0; i < value.length; i++) { | ||
const normalized = normalizeStyle(value[i]); | ||
if (normalized) { | ||
for (const key in normalized) { | ||
res[key] = normalized[key]; | ||
} | ||
} | ||
} | ||
return res; | ||
} | ||
else if (isObject(value)) { | ||
return value; | ||
} | ||
} | ||
function normalizeClass(value) { | ||
let res = ''; | ||
if (isString(value)) { | ||
res = value; | ||
} | ||
else if (isArray(value)) { | ||
for (let i = 0; i < value.length; i++) { | ||
res += normalizeClass(value[i]) + ' '; | ||
} | ||
} | ||
else if (isObject(value)) { | ||
for (const name in value) { | ||
if (value[name]) { | ||
res += name + ' '; | ||
} | ||
} | ||
} | ||
return res.trim(); | ||
} | ||
// These tag configs are shared between compiler-dom and runtime-dom, so they | ||
const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr'; | ||
const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS); | ||
// On the client we only need to offer special cases for boolean attributes that | ||
@@ -142,2 +101,59 @@ // have different names from their corresponding dom properties: | ||
function normalizeStyle(value) { | ||
if (isArray(value)) { | ||
const res = {}; | ||
for (let i = 0; i < value.length; i++) { | ||
const normalized = normalizeStyle(value[i]); | ||
if (normalized) { | ||
for (const key in normalized) { | ||
res[key] = normalized[key]; | ||
} | ||
} | ||
} | ||
return res; | ||
} | ||
else if (isObject(value)) { | ||
return value; | ||
} | ||
} | ||
function stringifyStyle(styles) { | ||
let ret = ''; | ||
if (!styles) { | ||
return ret; | ||
} | ||
for (const key in styles) { | ||
const value = styles[key]; | ||
const normalizedKey = key.indexOf(`--`) === 0 ? key : hyphenate(key); | ||
if (isString(value) || | ||
(typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) { | ||
// only render valid values | ||
ret += `${normalizedKey}:${value};`; | ||
} | ||
} | ||
return ret; | ||
} | ||
function normalizeClass(value) { | ||
let res = ''; | ||
if (isString(value)) { | ||
res = value; | ||
} | ||
else if (isArray(value)) { | ||
for (let i = 0; i < value.length; i++) { | ||
res += normalizeClass(value[i]) + ' '; | ||
} | ||
} | ||
else if (isObject(value)) { | ||
for (const name in value) { | ||
if (value[name]) { | ||
res += name + ' '; | ||
} | ||
} | ||
} | ||
return res.trim(); | ||
} | ||
// These tag configs are shared between compiler-dom and runtime-dom, so they | ||
const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr'; | ||
const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS); | ||
const escapeRE = /["'&<>]/; | ||
@@ -297,3 +313,5 @@ function escapeHtml(string) { | ||
else if (isSSRSafeAttrName(attrKey)) { | ||
return ` ${attrKey}="${escapeHtml(value)}"`; | ||
return value === '' | ||
? ` ${attrKey}` | ||
: ` ${attrKey}="${escapeHtml(value)}"`; | ||
} | ||
@@ -331,13 +349,3 @@ else { | ||
const styles = normalizeStyle(raw); | ||
let ret = ''; | ||
for (const key in styles) { | ||
const value = styles[key]; | ||
const normalizedKey = key.indexOf(`--`) === 0 ? key : hyphenate(key); | ||
if (isString(value) || | ||
(typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) { | ||
// only render valid values | ||
ret += `${normalizedKey}:${value};`; | ||
} | ||
} | ||
return escapeHtml(ret); | ||
return escapeHtml(stringifyStyle(styles)); | ||
} | ||
@@ -344,0 +352,0 @@ |
@@ -22,43 +22,2 @@ 'use strict'; | ||
function normalizeStyle(value) { | ||
if (isArray(value)) { | ||
const res = {}; | ||
for (let i = 0; i < value.length; i++) { | ||
const normalized = normalizeStyle(value[i]); | ||
if (normalized) { | ||
for (const key in normalized) { | ||
res[key] = normalized[key]; | ||
} | ||
} | ||
} | ||
return res; | ||
} | ||
else if (isObject(value)) { | ||
return value; | ||
} | ||
} | ||
function normalizeClass(value) { | ||
let res = ''; | ||
if (isString(value)) { | ||
res = value; | ||
} | ||
else if (isArray(value)) { | ||
for (let i = 0; i < value.length; i++) { | ||
res += normalizeClass(value[i]) + ' '; | ||
} | ||
} | ||
else if (isObject(value)) { | ||
for (const name in value) { | ||
if (value[name]) { | ||
res += name + ' '; | ||
} | ||
} | ||
} | ||
return res.trim(); | ||
} | ||
// These tag configs are shared between compiler-dom and runtime-dom, so they | ||
const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr'; | ||
const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS); | ||
// On the client we only need to offer special cases for boolean attributes that | ||
@@ -108,2 +67,59 @@ // have different names from their corresponding dom properties: | ||
function normalizeStyle(value) { | ||
if (isArray(value)) { | ||
const res = {}; | ||
for (let i = 0; i < value.length; i++) { | ||
const normalized = normalizeStyle(value[i]); | ||
if (normalized) { | ||
for (const key in normalized) { | ||
res[key] = normalized[key]; | ||
} | ||
} | ||
} | ||
return res; | ||
} | ||
else if (isObject(value)) { | ||
return value; | ||
} | ||
} | ||
function stringifyStyle(styles) { | ||
let ret = ''; | ||
if (!styles) { | ||
return ret; | ||
} | ||
for (const key in styles) { | ||
const value = styles[key]; | ||
const normalizedKey = key.indexOf(`--`) === 0 ? key : hyphenate(key); | ||
if (isString(value) || | ||
(typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) { | ||
// only render valid values | ||
ret += `${normalizedKey}:${value};`; | ||
} | ||
} | ||
return ret; | ||
} | ||
function normalizeClass(value) { | ||
let res = ''; | ||
if (isString(value)) { | ||
res = value; | ||
} | ||
else if (isArray(value)) { | ||
for (let i = 0; i < value.length; i++) { | ||
res += normalizeClass(value[i]) + ' '; | ||
} | ||
} | ||
else if (isObject(value)) { | ||
for (const name in value) { | ||
if (value[name]) { | ||
res += name + ' '; | ||
} | ||
} | ||
} | ||
return res.trim(); | ||
} | ||
// These tag configs are shared between compiler-dom and runtime-dom, so they | ||
const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr'; | ||
const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS); | ||
const escapeRE = /["'&<>]/; | ||
@@ -261,3 +277,5 @@ function escapeHtml(string) { | ||
else if (isSSRSafeAttrName(attrKey)) { | ||
return ` ${attrKey}="${escapeHtml(value)}"`; | ||
return value === '' | ||
? ` ${attrKey}` | ||
: ` ${attrKey}="${escapeHtml(value)}"`; | ||
} | ||
@@ -295,13 +313,3 @@ else { | ||
const styles = normalizeStyle(raw); | ||
let ret = ''; | ||
for (const key in styles) { | ||
const value = styles[key]; | ||
const normalizedKey = key.indexOf(`--`) === 0 ? key : hyphenate(key); | ||
if (isString(value) || | ||
(typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) { | ||
// only render valid values | ||
ret += `${normalizedKey}:${value};`; | ||
} | ||
} | ||
return escapeHtml(ret); | ||
return escapeHtml(stringifyStyle(styles)); | ||
} | ||
@@ -308,0 +316,0 @@ |
{ | ||
"name": "@vue/server-renderer", | ||
"version": "3.0.0-alpha.5", | ||
"version": "3.0.0-alpha.6", | ||
"description": "@vue/server-renderer", | ||
@@ -30,7 +30,7 @@ "main": "index.js", | ||
"peerDependencies": { | ||
"vue": "3.0.0-alpha.5" | ||
"vue": "3.0.0-alpha.6" | ||
}, | ||
"dependencies": { | ||
"@vue/compiler-ssr": "3.0.0-alpha.5" | ||
"@vue/compiler-ssr": "3.0.0-alpha.6" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
50281
1327
2
+ Added@vue/compiler-core@3.0.0-alpha.6(transitive)
+ Added@vue/compiler-dom@3.0.0-alpha.6(transitive)
+ Added@vue/compiler-ssr@3.0.0-alpha.6(transitive)
+ Added@vue/reactivity@3.0.0-alpha.6(transitive)
+ Added@vue/runtime-core@3.0.0-alpha.6(transitive)
+ Added@vue/runtime-dom@3.0.0-alpha.6(transitive)
+ Addedvue@3.0.0-alpha.6(transitive)
- Removed@vue/compiler-core@3.0.0-alpha.5(transitive)
- Removed@vue/compiler-dom@3.0.0-alpha.5(transitive)
- Removed@vue/compiler-ssr@3.0.0-alpha.5(transitive)
- Removed@vue/reactivity@3.0.0-alpha.5(transitive)
- Removed@vue/runtime-core@3.0.0-alpha.5(transitive)
- Removed@vue/runtime-dom@3.0.0-alpha.5(transitive)
- Removedvue@3.0.0-alpha.5(transitive)