Socket
Socket
Sign inDemoInstall

@astrojs/vue

Package Overview
Dependencies
Maintainers
4
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@astrojs/vue - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

18

package.json
{
"name": "@astrojs/vue",
"version": "2.1.1",
"version": "2.2.0",
"description": "Use Vue components within Astro",

@@ -30,2 +30,8 @@ "type": "module",

},
"files": [
"dist",
"client.js",
"server.js",
"static-html.js"
],
"dependencies": {

@@ -39,12 +45,12 @@ "@vitejs/plugin-vue": "^4.0.0",

"@types/chai": "^4.3.3",
"astro": "2.2.0",
"astro-scripts": "0.0.14",
"chai": "^4.3.6",
"linkedom": "^0.14.17",
"mocha": "^9.2.2",
"vite": "^4.2.1",
"vue": "^3.2.37"
"vite": "^4.3.1",
"vue": "^3.2.37",
"astro": "2.5.0",
"astro-scripts": "0.0.14"
},
"peerDependencies": {
"astro": "^2.2.0",
"astro": "^2.5.0",
"vue": "^3.2.30"

@@ -51,0 +57,0 @@ },

@@ -10,6 +10,12 @@ import { h, createSSRApp } from 'vue';

async function renderToStaticMarkup(Component, props, slotted) {
async function renderToStaticMarkup(Component, props, slotted, metadata) {
const slots = {};
for (const [key, value] of Object.entries(slotted)) {
slots[key] = () => h(StaticHtml, { value, name: key === 'default' ? undefined : key });
slots[key] = () =>
h(StaticHtml, {
value,
name: key === 'default' ? undefined : key,
// Adjust how this is hydrated only when the version of Astro supports `astroStaticSlot`
hydrate: metadata.astroStaticSlot ? !!metadata.hydrate : true,
});
}

@@ -25,2 +31,3 @@ const app = createSSRApp({ render: () => h(Component, props, slots) });

renderToStaticMarkup,
supportsAstroStaticSlot: true,
};

@@ -13,6 +13,8 @@ import { h, defineComponent } from 'vue';

name: String,
hydrate: Boolean,
},
setup({ name, value }) {
setup({ name, value, hydrate }) {
if (!value) return () => null;
return () => h('astro-slot', { name, innerHTML: value });
let tagName = hydrate ? 'astro-slot' : 'astro-static-slot';
return () => h(tagName, { name, innerHTML: value });
},

@@ -19,0 +21,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