New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@astrojs/solid-js

Package Overview
Dependencies
Maintainers
4
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@astrojs/solid-js - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

LICENSE

6

CHANGELOG.md
# @astrojs/solid-js
## 0.1.3
### Patch Changes
- [#3455](https://github.com/withastro/astro/pull/3455) [`e9a77d86`](https://github.com/withastro/astro/commit/e9a77d861907adccfa75811f9aaa555f186d78f8) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Update client hydration to check for `ssr` attribute. Requires `astro@^1.0.0-beta.36`.
## 0.1.2

@@ -4,0 +10,0 @@

59

client.js
import { sharedConfig } from 'solid-js';
import { hydrate, createComponent } from 'solid-js/web';
import { hydrate, render, createComponent } from 'solid-js/web';
export default (element) => (Component, props, childHTML) => {
// Prepare global object expected by Solid's hydration logic
if (!window._$HY) {
window._$HY = { events: [], completed: new WeakSet(), r: {} };
}
// Perform actual hydration
let children;
hydrate(
() =>
createComponent(Component, {
...props,
get children() {
if (childHTML != null) {
// hydrating
if (sharedConfig.context) children = element.querySelector('astro-fragment');
export default (element) =>
(Component, props, childHTML, { client }) => {
// Prepare global object expected by Solid's hydration logic
if (!window._$HY) {
window._$HY = { events: [], completed: new WeakSet(), r: {} };
}
if (!element.hasAttribute('ssr')) return;
if (children == null) {
children = document.createElement('astro-fragment');
children.innerHTML = childHTML;
const fn = client === 'only' ? render : hydrate;
// Perform actual hydration
let children;
fn(
() =>
createComponent(Component, {
...props,
get children() {
if (childHTML != null) {
// hydrating
if (sharedConfig.context) {
children = element.querySelector('astro-fragment');
}
if (children == null) {
children = document.createElement('astro-fragment');
children.innerHTML = childHTML;
}
}
}
return children;
},
}),
element
);
};
return children;
},
}),
element
);
};
{
"name": "@astrojs/solid-js",
"version": "0.1.2",
"version": "0.1.3",
"description": "Use Solid components within Astro",

@@ -28,14 +28,9 @@ "type": "module",

},
"scripts": {
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
"build:ci": "astro-scripts build \"src/**/*.ts\"",
"dev": "astro-scripts dev \"src/**/*.ts\""
},
"dependencies": {
"babel-preset-solid": "^1.3.13"
"babel-preset-solid": "^1.4.2"
},
"devDependencies": {
"astro": "workspace:*",
"astro-scripts": "workspace:*",
"solid-js": "^1.3.14"
"astro": "1.0.0-beta.38",
"astro-scripts": "0.0.4",
"solid-js": "^1.4.3"
},

@@ -47,3 +42,8 @@ "peerDependencies": {

"node": "^14.15.0 || >=16.0.0"
},
"scripts": {
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
"build:ci": "astro-scripts build \"src/**/*.ts\"",
"dev": "astro-scripts dev \"src/**/*.ts\""
}
}
}

@@ -5,8 +5,4 @@ import { renderToString, ssr, createComponent } from 'solid-js/web';

if (typeof Component !== 'function') return false;
try {
const { html } = renderToStaticMarkup(Component, props, children);
return typeof html === 'string';
} catch (err) {
return false;
}
const { html } = renderToStaticMarkup(Component, props, children);
return typeof html === 'string';
}

@@ -13,0 +9,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