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

@crystallize/react-image

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crystallize/react-image - npm Package Compare versions

Comparing version 3.0.0-beta.7 to 3.0.0-beta.8

.cache/02/de4b9440b39f172567e3d853a66d0a.json

18

build/index.js

@@ -62,6 +62,7 @@ "use strict";

variants = _restOfAllProps$varia === void 0 ? [] : _restOfAllProps$varia,
alt = restOfAllProps.altText,
altText = restOfAllProps.altText,
className = restOfAllProps.className,
rest = _objectWithoutProperties(restOfAllProps, ["url", "sizes", "variants", "altText", "className"]);
var alt = rest.alt || altText;
var hasVariants = variants.length > 0; // Determine srcSet

@@ -86,5 +87,6 @@

sizes: sizes,
alt: alt,
className: className
}, rest));
}, rest, {
alt: alt
}));
}

@@ -94,2 +96,7 @@

warn("You have provided variants, but not sizes. This has a negative impact on performance. Check out https://crystallize.com/blog/react-image-sizes-attribute-for-fast-ecommerce");
} // Check alt for null or undefined
if (alt == null) {
warn("Missing alt attribute");
}

@@ -109,5 +116,6 @@

src: src,
sizes: sizes,
sizes: sizes
}, rest, {
alt: alt
}, rest)));
})));
};

@@ -114,0 +122,0 @@

@@ -0,1 +1,8 @@

## 3.0.0-beta.8 (2019-07-25)
* Updated readme ([29eeaa5](https://github.com/CrystallizeAPI/react-image/commit/29eeaa5))
* Warn if no alt attr ([2e9b02f](https://github.com/CrystallizeAPI/react-image/commit/2e9b02f))
## 3.0.0-beta.7 (2019-07-24)

@@ -2,0 +9,0 @@

{
"name": "@crystallize/react-image",
"description": "A React package to output an image with different source variations from Crystallize",
"version": "3.0.0-beta.7",
"version": "3.0.0-beta.8",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": {

@@ -32,3 +32,3 @@ ![alt text](https://raw.githubusercontent.com/snowballdigital/react-image/HEAD/media/logo.png "An illustration of an atom")

## Render child
## Render child function

@@ -46,3 +46,3 @@ ```

>
{({ src, srcSet, srcSetWebp, ...rest }) => {
{({ src, srcSet, srcSetWebp, sizes, ...rest }) => {
// Roll your own render

@@ -56,3 +56,2 @@ return (

type="image/webp"
sizes={sizes}
/>

@@ -65,7 +64,6 @@ )}

type="image/jpg"
sizes={sizes}
/>
)}
<img src={src} {...rest} />
<img src={src} sizes={sizes} {...rest} />
</picture>

@@ -72,0 +70,0 @@ )

@@ -34,6 +34,9 @@ import React from "react";

variants = [],
altText: alt,
altText,
className,
...rest
} = restOfAllProps;
const alt = rest.alt || altText;
const hasVariants = variants.length > 0;

@@ -56,5 +59,5 @@

sizes,
alt,
className,
...rest
...rest,
alt
});

@@ -69,2 +72,7 @@ }

// Check alt for null or undefined
if (alt == null) {
warn("Missing alt attribute");
}
return (

@@ -79,3 +87,3 @@ <picture className={className}>

<img src={src} sizes={sizes} alt={alt} {...rest} />
<img src={src} sizes={sizes} {...rest} alt={alt} />
</picture>

@@ -82,0 +90,0 @@ );

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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