Socket
Socket
Sign inDemoInstall

@emotion/sheet

Package Overview
Dependencies
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emotion/sheet - npm Package Compare versions

Comparing version 1.0.0-next.3 to 1.0.0-next.4

6

CHANGELOG.md
# @emotion/sheet
## 1.0.0-next.4
### Patch Changes
- [`39be057b`](https://github.com/emotion-js/emotion/commit/39be057b1a0c6b76f2cb7a455cb8bc35fe875ba0) [#1997](https://github.com/emotion-js/emotion/pull/1997) Thanks [@Andarist](https://github.com/Andarist)! - Reverted the change that has started to add an empty `<style/>` element eagerly in non-production environments that has been introduced in [`v1.0.0-next.3`](https://github.com/emotion-js/emotion/blob/next/packages/sheet/CHANGELOG.md#100-next3) as this has found to be problematic for websites using `Content-Security-Policy` and a `nonce`. Instead of this `@emotion/cache` will from now on insert an empty rule in non-production environments but it will only do that if an empty rule gets actually created by the user.
## 1.0.0-next.3

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

20

dist/sheet.browser.cjs.js

@@ -45,4 +45,2 @@ 'use strict';

var isBrowser = "object" !== 'undefined';
function createStyleElement(options) {

@@ -86,19 +84,3 @@ var tag = document.createElement('style');

this.prepend = options.prepend;
this.before = null; // insert a single empty style eagerly in dev
// so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
if (process.env.NODE_ENV !== 'production' && isBrowser) {
var tag = createStyleElement(this);
if (this.isSpeedy) {
// avoid extra style tag in speedy mode
// it's a harmless hack to make `this.insert` grab this tag created here instead of creating a new one
this.ctr++;
} else {
// non-speedy styles won't be reused, add this just for informational purposes and less surprising snapshots
tag.setAttribute('data-eager-key', 'true');
}
this._insertTag(tag);
}
this.before = null;
}

@@ -105,0 +87,0 @@

@@ -41,4 +41,2 @@ /*

var isBrowser = "object" !== 'undefined';
function createStyleElement(options) {

@@ -82,19 +80,3 @@ var tag = document.createElement('style');

this.prepend = options.prepend;
this.before = null; // insert a single empty style eagerly in dev
// so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
if (process.env.NODE_ENV !== 'production' && isBrowser) {
var tag = createStyleElement(this);
if (this.isSpeedy) {
// avoid extra style tag in speedy mode
// it's a harmless hack to make `this.insert` grab this tag created here instead of creating a new one
this.ctr++;
} else {
// non-speedy styles won't be reused, add this just for informational purposes and less surprising snapshots
tag.setAttribute('data-eager-key', 'true');
}
this._insertTag(tag);
}
this.before = null;
}

@@ -101,0 +83,0 @@

@@ -45,4 +45,2 @@ 'use strict';

var isBrowser = typeof document !== 'undefined';
function createStyleElement(options) {

@@ -86,19 +84,3 @@ var tag = document.createElement('style');

this.prepend = options.prepend;
this.before = null; // insert a single empty style eagerly in dev
// so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
if (process.env.NODE_ENV !== 'production' && isBrowser) {
var tag = createStyleElement(this);
if (this.isSpeedy) {
// avoid extra style tag in speedy mode
// it's a harmless hack to make `this.insert` grab this tag created here instead of creating a new one
this.ctr++;
} else {
// non-speedy styles won't be reused, add this just for informational purposes and less surprising snapshots
tag.setAttribute('data-eager-key', 'true');
}
this._insertTag(tag);
}
this.before = null;
}

@@ -105,0 +87,0 @@

@@ -41,4 +41,2 @@ /*

var isBrowser = typeof document !== 'undefined';
function createStyleElement(options) {

@@ -82,19 +80,3 @@ var tag = document.createElement('style');

this.prepend = options.prepend;
this.before = null; // insert a single empty style eagerly in dev
// so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
if (process.env.NODE_ENV !== 'production' && isBrowser) {
var tag = createStyleElement(this);
if (this.isSpeedy) {
// avoid extra style tag in speedy mode
// it's a harmless hack to make `this.insert` grab this tag created here instead of creating a new one
this.ctr++;
} else {
// non-speedy styles won't be reused, add this just for informational purposes and less surprising snapshots
tag.setAttribute('data-eager-key', 'true');
}
this._insertTag(tag);
}
this.before = null;
}

@@ -101,0 +83,0 @@

{
"name": "@emotion/sheet",
"version": "1.0.0-next.3",
"version": "1.0.0-next.4",
"description": "emotion's stylesheet",

@@ -5,0 +5,0 @@ "main": "dist/sheet.cjs.js",

@@ -50,4 +50,2 @@ // @flow

let isBrowser = typeof document !== 'undefined'
function createStyleElement(options: {

@@ -88,18 +86,2 @@ key: string,

this.before = null
// insert a single empty style eagerly in dev
// so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
if (process.env.NODE_ENV !== 'production' && isBrowser) {
const tag = createStyleElement(this)
if (this.isSpeedy) {
// avoid extra style tag in speedy mode
// it's a harmless hack to make `this.insert` grab this tag created here instead of creating a new one
this.ctr++
} else {
// non-speedy styles won't be reused, add this just for informational purposes and less surprising snapshots
tag.setAttribute('data-eager-key', 'true')
}
this._insertTag(tag)
}
}

@@ -106,0 +88,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