{"_id":"babel-plugin-jsx-pragmatic","_rev":"7-8e4c3e451ca223ea2ab7e74f0e9ae5e2","name":"babel-plugin-jsx-pragmatic","description":"Insert code to load a module corresponding to JSX pragma.","dist-tags":{"latest":"1.0.2"},"versions":{"0.1.0":{"name":"babel-plugin-jsx-pragmatic","version":"0.1.0","main":"jsx-pragmatic.js","license":"MIT","author":{"name":"Jesse McCarthy","url":"http://software.jessemccarthy.net/"},"homepage":"https://github.com/jmm/babel-plugin-jsx-pragmatic","repository":{"type":"git","url":"git+https://github.com/jmm/babel-plugin-jsx-pragmatic.git"},"devDependencies":{"babel-core":"^5.0.0"},"files":["jsx-pragmatic.js","package.json","README.md","LICENSE"],"keywords":["babel-plugin","jsx","react"],"gitHead":"453384d9a3d64301227527ff957e8f5369c28b85","description":"babel / babelify has a `jsxPragma` option that will be used when transforming JSX to function calls instead of the default function `React.createElement`.","bugs":{"url":"https://github.com/jmm/babel-plugin-jsx-pragmatic/issues"},"_id":"babel-plugin-jsx-pragmatic@0.1.0","scripts":{},"_shasum":"e645e56f5118995fdb62979adddcd257cfef5a44","_from":".","_npmVersion":"2.9.0","_nodeVersion":"0.10.32","_npmUser":{"name":"jmm","email":"npm-public@jessemccarthy.net"},"maintainers":[{"name":"jmm","email":"npm-public@jessemccarthy.net"}],"dist":{"shasum":"e645e56f5118995fdb62979adddcd257cfef5a44","tarball":"https://registry.npmjs.org/babel-plugin-jsx-pragmatic/-/babel-plugin-jsx-pragmatic-0.1.0.tgz","integrity":"sha512-x9bZFC3/4ridjfbxkVheiSS57OsqmzHQDfBqqIzjpsd5vQekTKSgaBr44c1JWwfRrQloYp9NFhdRr8uCW7zCJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDak+GL7SweWwfpHAYdnVirRkQsxUTLfbSXNAS5ifkAKwIgVrm8fpRbV//Le2xUS0bZLZ3TWTzY8nLcVy04mjxFkBA="}]}},"0.1.1":{"name":"babel-plugin-jsx-pragmatic","version":"0.1.1","main":"jsx-pragmatic.js","license":"MIT","author":{"name":"Jesse McCarthy","url":"http://software.jessemccarthy.net/"},"homepage":"https://github.com/jmm/babel-plugin-jsx-pragmatic","repository":{"type":"git","url":"git+https://github.com/jmm/babel-plugin-jsx-pragmatic.git"},"devDependencies":{"babel-core":"^5.0.0"},"files":["jsx-pragmatic.js","package.json","README.md","LICENSE"],"keywords":["babel-plugin","jsx","react"],"gitHead":"47f284b2835a3e73bb61a81dc8ee62d486439d14","description":"babel / babelify has a `jsxPragma` option that will be used when transforming JSX to function calls instead of the default function `React.createElement`.","bugs":{"url":"https://github.com/jmm/babel-plugin-jsx-pragmatic/issues"},"_id":"babel-plugin-jsx-pragmatic@0.1.1","scripts":{},"_shasum":"557a24f74b086dbdc8e682840de129440595cb98","_from":".","_npmVersion":"2.9.0","_nodeVersion":"0.10.32","_npmUser":{"name":"jmm","email":"npm-public@jessemccarthy.net"},"maintainers":[{"name":"jmm","email":"npm-public@jessemccarthy.net"}],"dist":{"shasum":"557a24f74b086dbdc8e682840de129440595cb98","tarball":"https://registry.npmjs.org/babel-plugin-jsx-pragmatic/-/babel-plugin-jsx-pragmatic-0.1.1.tgz","integrity":"sha512-9vTmKjJnx2Mc1yaBbTEl3NabISaoWpwJC7uCa+ME71Q0mcfmTfgxrqV8FtLagB9brvIzXsKEsT/034R4iOze2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyaAZsL1/0sYjcq3/VOrTk6h0gcdIeeWdnILbHYgJjFQIgdOqupAHFkS0o7TRDDUvOSETCQk0CpYJPho1fYSQWyEs="}]}},"1.0.0":{"name":"babel-plugin-jsx-pragmatic","version":"1.0.0","main":"jsx-pragmatic.js","license":"MIT","author":{"name":"Jesse McCarthy","url":"http://software.jessemccarthy.net/"},"homepage":"https://github.com/jmm/babel-plugin-jsx-pragmatic","repository":{"type":"git","url":"git+https://github.com/jmm/babel-plugin-jsx-pragmatic.git"},"dependencies":{"babel-plugin-syntax-jsx":"^6.0.0"},"devDependencies":{"babel-core":"^6.0.0","babel-plugin-transform-react-jsx":"^6.0.0","babel-preset-es2015":"^6.0.0","lodash":"^3.10.0","mocha":"^2.3.0","sinon":"^1.17.0"},"files":["jsx-pragmatic.js","package.json","README.md","LICENSE"],"keywords":["babel-plugin","jsx","react"],"description":"Insert code to load a module corresponding to JSX pragma.","scripts":{"test":"mocha 'test/{unit,integration}.js'"},"gitHead":"2b0e1801124151c9474b27fc17bf09789751d108","bugs":{"url":"https://github.com/jmm/babel-plugin-jsx-pragmatic/issues"},"_id":"babel-plugin-jsx-pragmatic@1.0.0","_shasum":"bdc8286f47ef9a9d2e77cc6db4e41da2504d8880","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"jmm","email":"npm-public@jessemccarthy.net"},"maintainers":[{"name":"jmm","email":"npm-public@jessemccarthy.net"}],"dist":{"shasum":"bdc8286f47ef9a9d2e77cc6db4e41da2504d8880","tarball":"https://registry.npmjs.org/babel-plugin-jsx-pragmatic/-/babel-plugin-jsx-pragmatic-1.0.0.tgz","integrity":"sha512-KW8aNFccT3DTQF5iBluhAJiHfoKDm8Wk32Uj5uIFMY129iC/lpTj2mx7GGuYtgeeN9kCogNEqLmizISF7P4bcw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXHa64UeGmikiHXO9c0Bz291tL5t8qBakg9tfyI01bxwIhAMDx9rgNs/dU5BkmlaIYZeBcgseqDvlsXovwFcpQsm9O"}]}},"1.0.1":{"name":"babel-plugin-jsx-pragmatic","version":"1.0.1","main":"jsx-pragmatic.js","license":"MIT","author":{"name":"Jesse McCarthy","url":"http://software.jessemccarthy.net/"},"homepage":"https://github.com/jmm/babel-plugin-jsx-pragmatic","repository":{"type":"git","url":"git+https://github.com/jmm/babel-plugin-jsx-pragmatic.git"},"dependencies":{"babel-plugin-syntax-jsx":"^6.0.0"},"devDependencies":{"babel-core":"^6.0.0","babel-plugin-transform-react-jsx":"^6.0.0","babel-preset-es2015":"^6.0.0","lodash":"^3.10.0","mocha":"^2.3.0","sinon":"^1.17.0"},"files":["jsx-pragmatic.js","package.json","README.md","CHANGELOG.md","LICENSE"],"keywords":["babel-plugin","jsx","react"],"description":"Insert code to load a module corresponding to JSX pragma.","scripts":{"test":"mocha 'test/{unit,integration}.js'"},"gitHead":"414016cc4a6c46f7c6347b618791f2451853db0f","bugs":{"url":"https://github.com/jmm/babel-plugin-jsx-pragmatic/issues"},"_id":"babel-plugin-jsx-pragmatic@1.0.1","_shasum":"c574cd891365311b3d9ff7ecee358309f98fa341","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"jmm","email":"npm-public@jessemccarthy.net"},"maintainers":[{"name":"jmm","email":"npm-public@jessemccarthy.net"}],"dist":{"shasum":"c574cd891365311b3d9ff7ecee358309f98fa341","tarball":"https://registry.npmjs.org/babel-plugin-jsx-pragmatic/-/babel-plugin-jsx-pragmatic-1.0.1.tgz","integrity":"sha512-zlnL2q0AvFRa/6sWUPfUUp2+8ZmJcPFt2w4f2KDeHtbAGHBh9L2pt6+Dbcw8lSnCjYW2QrHwIrigxpOW1bsKIA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAivNgP1MFwTQ4Q/XOCsQ3QkyDuMnvPnyAqQj1OT9HDdAiBkssL4Z1/4lUcqNHUtdU2IfDF37mNCgFVbFXro7zeU1g=="}]}},"1.0.2":{"name":"babel-plugin-jsx-pragmatic","version":"1.0.2","main":"jsx-pragmatic.js","license":"MIT","author":{"name":"Jesse McCarthy","url":"http://software.jessemccarthy.net/"},"homepage":"https://github.com/jmm/babel-plugin-jsx-pragmatic","repository":{"type":"git","url":"git+https://github.com/jmm/babel-plugin-jsx-pragmatic.git"},"dependencies":{"babel-plugin-syntax-jsx":"^6.0.0"},"devDependencies":{"babel-core":"^6.0.0","babel-plugin-transform-react-jsx":"^6.0.0","babel-preset-es2015":"^6.0.0","lodash":"^3.10.0","mocha":"^2.3.0","sinon":"^1.17.0"},"files":["jsx-pragmatic.js","package.json","README.md","CHANGELOG.md","LICENSE"],"keywords":["babel-plugin","jsx","react"],"description":"Insert code to load a module corresponding to JSX pragma.","scripts":{"test":"mocha 'test/{unit,integration}.js'"},"gitHead":"f171928cd48e5abd5890fb452cc7725390e07cb9","bugs":{"url":"https://github.com/jmm/babel-plugin-jsx-pragmatic/issues"},"_id":"babel-plugin-jsx-pragmatic@1.0.2","_shasum":"41e2beb8642235f34b2a7ab12ca39e07201b8e59","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"jmm","email":"npm-public@jessemccarthy.net"},"maintainers":[{"name":"jmm","email":"npm-public@jessemccarthy.net"}],"dist":{"shasum":"41e2beb8642235f34b2a7ab12ca39e07201b8e59","tarball":"https://registry.npmjs.org/babel-plugin-jsx-pragmatic/-/babel-plugin-jsx-pragmatic-1.0.2.tgz","integrity":"sha512-+qeGXSbHZwinZzO6R3wP+6XDKup83Pgg2B3TQt2zwfDdgC7NqT9Kd3ws7iqk53zAO/8iOIRU6VUyUzt2LDE3Eg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3uFTSqjVK0njgMLuHQxP51bJiaRawY6B99XCMy0mPzwIhAOYQ84tk+3rBcEoNyejxO7S/DvfT5w03Ud+bN1gc2bJv"}]}}},"readme":"# About\n\n[babel-plugin-transform-react-jsx](https://www.npmjs.com/package/babel-plugin-transform-react-jsx) has a `pragma` option that's used when transforming JSX to function calls instead of the default function `React.createElement`.\n\nThis Babel plugin is a companion to that feature that allows you to dynamically load a module associated with the `pragma` value.\n\nFrom v1.0.0 this works with the Babel v6 plugin API, not v5.\n\nExample:\n\nGiven this file:\n\n```js\n<Some jsx=\"element\" />\n```\n\nbabel would normally transform the JSX to:\n\n```js\nReact.createElement(Some, { jsx: \"element\" });\n```\n\nBy setting the `pragma` option like this:\n\n```js\nbabel.transform(code, {\n  plugins: [\n    [\"babel-plugin-transform-react-jsx\", {\n      pragma: \"whatever\",\n    }],\n  ]\n})\n```\n\nIt would instead transform it to:\n\n```js\nwhatever(Some, { jsx: \"element\" });\n```\n\nHowever, you might need to load a module corresponding to `whatever` in each module containing JSX:\n\n```js\nimport whatever from \"whatever\";\n// or\nvar whatever = require(\"whatever\");\n```\n\nThis plugin allows you to make that part dynamic as well:\n\n```js\nbabel.transform(code, {\n  plugins: [\n    [\"babel-plugin-transform-react-jsx\", {\n      pragma: \"whatever\",\n    }],\n\n    [\"babel-plugin-jsx-pragmatic\", {\n      module: \"/something/whatever\",\n      import: \"whatever\"\n    }],\n  ]\n})\n```\n\nResults in:\n\n```js\nimport {default as whatever} from \"/something/whatever\";\n```\n\n## Options\n\n### `module`\n\nString. Module ID or pathname. The value of the `ModuleSpecifier` of an import. Required.\n\n### `import`\n\nString. The identifier that you want to import the `module` with. This should correspond to the root identifier of the `pragma` value. Required. Examples:\n\n```js\n{\n  plugins: [\n    [\"babel-plugin-transform-react-jsx\", {\n      pragma: \"x\",\n    }],\n\n    [\"babel-plugin-jsx-pragmatic\", {\n      module: \"/something/whatever\",\n      import: \"x\"\n    }],\n  ]\n}\n\n{\n  plugins: [\n    [\"babel-plugin-transform-react-jsx\", {\n      pragma: \"x.y\",\n    }],\n\n    [\"babel-plugin-jsx-pragmatic\", {\n      module: \"/something/whatever\",\n      import: \"x\"\n    }],\n  ]\n}\n```\n\n### `export`\n\nString. The export that you want to import as `import` from `module`. Default value is `default` (the default export). Examples:\n\n```js\n// Will import the default export (`default`)\n{\n  module: \"whatever\",\n  import: \"x\"\n}\n// import {default as x} from \"whatever\"\n\n\n// Will import the default export (`default`)\n{\n  module: \"whatever\",\n  import: \"x\",\n  export: \"default\",\n}\n// import {default as x} from \"whatever\"\n\n\n// Will import the export named `something`\n{\n  module: \"whatever\",\n  import: \"x\",\n  export: \"something\",\n}\n// import {something as x} from \"whatever\"\n```\n\n# Known Issues\n\n* Doesn't do anything special in the case that the file being transformed\n  already imports or declares an identifier with the same name as `import`.\n\n* Doesn't take into account when a file actually contains a JSX pragma comment.\n","maintainers":[{"name":"jmm","email":"npm-public@jessemccarthy.net"}],"time":{"modified":"2022-06-13T04:01:55.652Z","created":"2015-06-19T19:04:55.331Z","0.1.0":"2015-06-19T19:04:55.331Z","0.1.1":"2015-06-19T20:35:18.288Z","1.0.0":"2015-11-12T21:34:14.280Z","1.0.1":"2015-11-12T21:45:42.027Z","1.0.2":"2015-11-13T14:19:14.531Z"},"homepage":"https://github.com/jmm/babel-plugin-jsx-pragmatic","keywords":["babel-plugin","jsx","react"],"repository":{"type":"git","url":"git+https://github.com/jmm/babel-plugin-jsx-pragmatic.git"},"author":{"name":"Jesse McCarthy","url":"http://software.jessemccarthy.net/"},"bugs":{"url":"https://github.com/jmm/babel-plugin-jsx-pragmatic/issues"},"license":"MIT","readmeFilename":"README.md"}