jsx-dom-runtime
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -1,26 +0,20 @@ | ||
const { realpathSync } = require('fs'); | ||
const { resolve } = require('path'); | ||
const { declare } = require('@babel/helper-plugin-utils'); | ||
const transformReactJSX = require('@babel/plugin-transform-react-jsx'); | ||
const createPlugin = require('@babel/plugin-transform-react-jsx/lib/create-plugin').default; | ||
module.exports = declare((api, opts) => { | ||
module.exports = declare((api, { useBuiltIns, useSpread }) => { | ||
api.assertVersion(7); | ||
const devDir = realpathSync(resolve(__dirname, '..', 'dev')); | ||
const isDev = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test'; | ||
const isDev = process.env.NODE_ENV === 'development'; | ||
const { | ||
throwIfNamespace = true, | ||
useBuiltIns, | ||
useSpread, | ||
} = opts; | ||
return { | ||
plugins: [ | ||
[ | ||
transformReactJSX, | ||
createPlugin({ | ||
name: 'jsx-dom-runtime', | ||
development: isDev, | ||
}), | ||
{ | ||
runtime: 'automatic', | ||
importSource: isDev ? devDir : 'jsx-dom-runtime', | ||
throwIfNamespace, | ||
importSource: 'jsx-dom-runtime', | ||
throwIfNamespace: true, | ||
useBuiltIns, | ||
@@ -27,0 +21,0 @@ useSpread, |
{ | ||
"name": "jsx-dom-runtime", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "JSX syntax for DOM Element", | ||
"main": "jsx-runtime/jsxRuntime.cjs.js", | ||
"module": "jsx-runtime/jsxRuntime.module.js", | ||
"main": "dist/index.cjs.js", | ||
"module": "dist/index.module.js", | ||
"esmodule": "dist/index.js", | ||
"source": "dist/index.js", | ||
"sideEffects": false, | ||
"scripts": { | ||
"lint": "eslint src/** tests/**", | ||
"lint": "eslint 'src/**/*.{js,ts}' 'tests/**/*.{js,ts,tsx}'", | ||
"test": "jest", | ||
@@ -23,4 +25,6 @@ "build": "rollup -c", | ||
"@babel/preset-env": "^7.13.9", | ||
"@babel/preset-typescript": "^7.13.0", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-replace": "^2.4.1", | ||
"@rollup/plugin-commonjs": "^17.1.0", | ||
"@rollup/plugin-node-resolve": "^11.2.0", | ||
"@size-limit/preset-small-lib": "^4.10.1", | ||
@@ -33,7 +37,6 @@ "@testing-library/dom": "^7.29.6", | ||
"babel-jest": "^26.6.3", | ||
"eslint": "^7.21.0", | ||
"eslint": "^7.22.0", | ||
"fs-extra": "^9.1.0", | ||
"husky": "^4.3.8", | ||
"jest": "^26.6.3", | ||
"rollup": "^2.41.1", | ||
"rollup": "^2.41.2", | ||
"rollup-plugin-terser": "^7.0.2", | ||
@@ -45,3 +48,4 @@ "size-limit": "^4.10.1", | ||
"src", | ||
"dev", | ||
"dist", | ||
"jsx-dev-runtime", | ||
"jsx-runtime", | ||
@@ -57,7 +61,2 @@ "babel-preset", | ||
], | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "npm test" | ||
} | ||
}, | ||
"size-limit": [ | ||
@@ -64,0 +63,0 @@ { |
@@ -30,4 +30,6 @@ # jsx-dom-runtime | ||
```js | ||
import { createRef } from 'jsx-dom-runtime'; | ||
const App = () => { | ||
const List = { current: null }; | ||
const List = createRef(); | ||
@@ -34,0 +36,0 @@ const addItem = () => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
25338
26
707
65
1
19