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

@emotion/babel-plugin-jsx-pragmatic

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emotion/babel-plugin-jsx-pragmatic - npm Package Compare versions

Comparing version 0.1.5 to 0.2.0

dist/emotion-babel-plugin-jsx-pragmatic.cjs.dev.js

22

package.json
{
"name": "@emotion/babel-plugin-jsx-pragmatic",
"version": "0.1.5",
"version": "0.2.0",
"description": "Insert code to load a module corresponding to JSX pragma.",
"main": "dist/babel-plugin-jsx-pragmatic.cjs.js",
"module": "dist/babel-plugin-jsx-pragmatic.esm.js",
"main": "dist/emotion-babel-plugin-jsx-pragmatic.cjs.js",
"module": "dist/emotion-babel-plugin-jsx-pragmatic.esm.js",
"exports": {
".": {
"module": "./dist/emotion-babel-plugin-jsx-pragmatic.esm.js",
"default": "./dist/emotion-babel-plugin-jsx-pragmatic.cjs.js"
},
"./package.json": "./package.json"
},
"license": "MIT",
"repository": "https://github.com/emotion-js/emotion/tree/master/packages/babel-plugin-jsx-pragmatic",
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/babel-plugin-jsx-pragmatic",
"scripts": {
"test:typescript": "exit 0"
},
"dependencies": {
"@babel/plugin-syntax-jsx": "^7.2.0"
"@babel/plugin-syntax-jsx": "^7.17.12"
},

@@ -23,4 +33,4 @@ "peerDependencies": {

"devDependencies": {
"@babel/core": "^7.5.5"
"@babel/core": "^7.18.5"
}
}

@@ -9,3 +9,3 @@ # @emotion/babel-plugin-jsx-pragmatic

[@babel/plugin-transform-react-jsx](https://babeljs.io/docs/en/next/babel-plugin-transform-react-jsx.html) has a `pragma` option that's used when transforming JSX to function calls instead of the default function `React.createElement`.
[@babel/plugin-transform-react-jsx](https://babeljs.io/docs/en/babel-plugin-transform-react-jsx.html) has a `pragma` option that's used when transforming JSX to function calls instead of the default function `React.createElement`.

@@ -31,6 +31,6 @@ This Babel plugin is a companion to that feature that allows you to dynamically load a module associated with the `pragma` value.

```js
babel.transform(code, {
babel.transformSync(code, {
plugins: [
[
'babel-plugin-transform-react-jsx',
'@babel/plugin-transform-react-jsx',
{

@@ -61,6 +61,6 @@ pragma: 'whatever'

```js
babel.transform(code, {
babel.transformSync(code, {
plugins: [
[
'babel-plugin-transform-react-jsx',
'@babel/plugin-transform-react-jsx',
{

@@ -102,3 +102,3 @@ pragma: 'whatever'

[
'babel-plugin-transform-react-jsx',
'@babel/plugin-transform-react-jsx',
{

@@ -122,3 +122,3 @@ pragma: 'x'

[
'babel-plugin-transform-react-jsx',
'@babel/plugin-transform-react-jsx',
{

@@ -125,0 +125,0 @@ pragma: 'x.y'

@@ -37,3 +37,3 @@ import syntaxJsx from '@babel/plugin-syntax-jsx'

inherits: syntaxJsx,
pre: function() {
pre: function () {
if (!(this.opts.module && this.opts.import)) {

@@ -47,3 +47,3 @@ throw new Error(

Program: {
exit: function(path, state) {
exit: function (path, state) {
if (!state.get('jsxDetected')) return

@@ -54,6 +54,6 @@ addPragmaImport(path, state)

JSXElement: function(path, state) {
JSXElement: function (path, state) {
state.set('jsxDetected', true)
},
JSXFragment: function(path, state) {
JSXFragment: function (path, state) {
state.set('jsxDetected', true)

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