Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kdujs/compiler-ssr-canary

Package Overview
Dependencies
Maintainers
0
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kdujs/compiler-ssr-canary - npm Package Compare versions

Comparing version 3.20240722.0 to 3.20240729.0-minor.0

173

dist/compiler-ssr.cjs.js

@@ -222,3 +222,3 @@ 'use strict';

const wipMap$3 = /* @__PURE__ */ new WeakMap();
const wipMap$2 = /* @__PURE__ */ new WeakMap();
function ssrTransformSuspense(node, context) {

@@ -232,24 +232,20 @@ return () => {

};
wipMap$3.set(node, wipEntry);
wipEntry.slotsExp = compilerDom.buildSlots(
node,
context,
(_props, _kForExp, children, loc) => {
const fn = compilerDom.createFunctionExpression(
[],
void 0,
// no return, assign body later
true,
// newline
false,
// suspense slots are not treated as normal slots
loc
);
wipEntry.wipSlots.push({
fn,
children
});
return fn;
}
).slots;
wipMap$2.set(node, wipEntry);
wipEntry.slotsExp = compilerDom.buildSlots(node, context, (_props, children, loc) => {
const fn = compilerDom.createFunctionExpression(
[],
void 0,
// no return, assign body later
true,
// newline
false,
// suspense slots are not treated as normal slots
loc
);
wipEntry.wipSlots.push({
fn,
children
});
return fn;
}).slots;
}

@@ -259,3 +255,3 @@ };

function ssrProcessSuspense(node, context) {
const wipEntry = wipMap$3.get(node);
const wipEntry = wipMap$2.get(node);
if (!wipEntry) {

@@ -566,3 +562,3 @@ return;

const wipMap$2 = /* @__PURE__ */ new WeakMap();
const wipMap$1 = /* @__PURE__ */ new WeakMap();
function ssrTransformTransitionGroup(node, context) {

@@ -588,6 +584,5 @@ return () => {

}
wipMap$2.set(node, {
wipMap$1.set(node, {
tag,
propsExp,
scopeId: context.scopeId || null
propsExp
});

@@ -598,5 +593,5 @@ }

function ssrProcessTransitionGroup(node, context) {
const entry = wipMap$2.get(node);
const entry = wipMap$1.get(node);
if (entry) {
const { tag, propsExp, scopeId } = entry;
const { tag, propsExp } = entry;
if (tag.type === 7) {

@@ -608,5 +603,2 @@ context.pushStringPart(`<`);

}
if (scopeId) {
context.pushStringPart(` ${scopeId}`);
}
context.pushStringPart(`>`);

@@ -633,5 +625,2 @@ processChildren(

}
if (scopeId) {
context.pushStringPart(` ${scopeId}`);
}
context.pushStringPart(`>`);

@@ -646,21 +635,2 @@ processChildren(node, context, false, true);

const wipMap$1 = /* @__PURE__ */ new WeakMap();
function ssrTransformTransition(node, context) {
return () => {
const appear = compilerDom.findProp(node, "appear", false, true);
wipMap$1.set(node, !!appear);
};
}
function ssrProcessTransition(node, context) {
node.children = node.children.filter((c) => c.type !== 3);
const appear = wipMap$1.get(node);
if (appear) {
context.pushStringPart(`<template>`);
processChildren(node, context, false, true);
context.pushStringPart(`</template>`);
} else {
processChildren(node, context, false, true);
}
}
const wipMap = /* @__PURE__ */ new WeakMap();

@@ -684,6 +654,5 @@ const WIP_SLOT = Symbol();

return ssrTransformSuspense(node, context);
} else if (component === compilerDom.TRANSITION_GROUP) {
}
if (component === compilerDom.TRANSITION_GROUP) {
return ssrTransformTransitionGroup(node, context);
} else if (component === compilerDom.TRANSITION) {
return ssrTransformTransition(node);
}

@@ -696,6 +665,4 @@ return;

if (clonedNode.children.length) {
compilerDom.buildSlots(clonedNode, context, (props, kFor, children) => {
knodeBranches.push(
createKNodeSlotBranch(props, kFor, children, context)
);
compilerDom.buildSlots(clonedNode, context, (props, children) => {
knodeBranches.push(createKNodeSlotBranch(props, children, context));
return compilerDom.createFunctionExpression(void 0);

@@ -719,3 +686,3 @@ });

wipMap.set(node, wipEntries);
const buildSSRSlotFn = (props, _kForExp, children, loc) => {
const buildSSRSlotFn = (props, children, loc) => {
const param0 = props && compilerDom.stringifyExpression(props) || `_`;

@@ -777,3 +744,3 @@ const fn = compilerDom.createFunctionExpression(

if (component === compilerDom.TRANSITION) {
return ssrProcessTransition(node, context);
node.children = node.children.filter((c) => c.type !== 3);
}

@@ -817,3 +784,3 @@ processChildren(node, context);

};
function createKNodeSlotBranch(props, kForExp, children, parentContext) {
function createKNodeSlotBranch(props, children, parentContext) {
const rawOptions = rawOptionsMap.get(parentContext.root);

@@ -838,4 +805,4 @@ const subOptions = {

isSelfClosing: false,
// important: provide k-slot="props" and k-for="exp" on the wrapper for
// proper scope analysis
// important: provide k-slot="props" on the wrapper for proper
// scope analysis
props: [

@@ -849,10 +816,2 @@ {

loc: compilerDom.locStub
},
{
type: 7,
name: "for",
exp: kForExp,
arg: void 0,
modifiers: [],
loc: compilerDom.locStub
}

@@ -1063,34 +1022,2 @@ ],

}
function processOption(plainNode) {
if (plainNode.tag === "option") {
if (plainNode.props.findIndex((p) => p.name === "selected") === -1) {
const value = findValueBinding(plainNode);
plainNode.ssrCodegenNode.elements.push(
compilerDom.createConditionalExpression(
compilerDom.createCallExpression(context.helper(SSR_INCLUDE_BOOLEAN_ATTR), [
compilerDom.createConditionalExpression(
compilerDom.createCallExpression(`Array.isArray`, [model]),
compilerDom.createCallExpression(context.helper(SSR_LOOSE_CONTAIN), [
model,
value
]),
compilerDom.createCallExpression(context.helper(SSR_LOOSE_EQUAL), [
model,
value
])
)
]),
compilerDom.createSimpleExpression(" selected", true),
compilerDom.createSimpleExpression("", true),
false
/* no newline */
)
);
}
} else if (plainNode.tag === "optgroup") {
plainNode.children.forEach(
(option) => processOption(option)
);
}
}
if (node.tagType === 0) {

@@ -1178,5 +1105,29 @@ const res = { props: [] };

} else if (node.tag === "select") {
node.children.forEach((child) => {
if (child.type === 1) {
processOption(child);
node.children.forEach((option) => {
if (option.type === 1) {
const plainNode = option;
if (plainNode.props.findIndex((p) => p.name === "selected") === -1) {
const value = findValueBinding(plainNode);
plainNode.ssrCodegenNode.elements.push(
compilerDom.createConditionalExpression(
compilerDom.createCallExpression(context.helper(SSR_INCLUDE_BOOLEAN_ATTR), [
compilerDom.createConditionalExpression(
compilerDom.createCallExpression(`Array.isArray`, [model]),
compilerDom.createCallExpression(context.helper(SSR_LOOSE_CONTAIN), [
model,
value
]),
compilerDom.createCallExpression(context.helper(SSR_LOOSE_EQUAL), [
model,
value
])
)
]),
compilerDom.createSimpleExpression(" selected", true),
compilerDom.createSimpleExpression("", true),
false
/* no newline */
)
);
}
}

@@ -1361,3 +1312,3 @@ });

on: compilerDom.transformOn,
// model and show have dedicated SSR handling
// model and show has dedicated SSR handling
model: ssrTransformModel,

@@ -1364,0 +1315,0 @@ show: ssrTransformShow,

{
"name": "@kdujs/compiler-ssr-canary",
"version": "3.20240722.0",
"version": "3.20240729.0-minor.0",
"description": "@kdujs/compiler-ssr",

@@ -31,5 +31,5 @@ "main": "dist/compiler-ssr.cjs.js",

"dependencies": {
"@kdujs/shared": "npm:@kdujs/shared-canary@3.20240722.0",
"@kdujs/compiler-dom": "npm:@kdujs/compiler-dom-canary@3.20240722.0"
"@kdujs/shared": "npm:@kdujs/shared-canary@3.20240729.0-minor.0",
"@kdujs/compiler-dom": "npm:@kdujs/compiler-dom-canary@3.20240729.0-minor.0"
}
}
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