diff --git a/packages/boundingclientrect/package.json b/packages/boundingclientrect/package.json index 4cf847a070..f2e3114d62 100644 --- a/packages/boundingclientrect/package.json +++ b/packages/boundingclientrect/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React Hooks package for boundingclientrect", "name": "@rooks/use-boundingclientrect", "homepage": "https://react-hooks.org/hook/use-boundingclientrect", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/boundingclientrect/src/index.js b/packages/boundingclientrect/src/index.js index 03901f1f94..22d8cc03ea 100644 --- a/packages/boundingclientrect/src/index.js +++ b/packages/boundingclientrect/src/index.js @@ -15,16 +15,13 @@ function useBoundingclientRect(ref) { setValue(getBoundingClientRect()); } - useEffect( - () => { - update(); - }, - [ref.current] - ); + useEffect(() => { + update(); + }, [ref.current]); useMutationObserver(ref, update); return value; } -module.exports = useBoundingclientRect; +export default useBoundingclientRect; diff --git a/packages/counter/package.json b/packages/counter/package.json index 8a81482b89..74df105edf 100644 --- a/packages/counter/package.json +++ b/packages/counter/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React Hooks package for counter", "name": "@rooks/use-counter", "homepage": "https://react-hooks.org/hook/use-counter", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/counter/src/index.js b/packages/counter/src/index.js index 2a1ff1e0d1..201d96f074 100644 --- a/packages/counter/src/index.js +++ b/packages/counter/src/index.js @@ -64,4 +64,4 @@ function useCounter(initialValue) { }; } -module.exports = useCounter; +export default useCounter; diff --git a/packages/did-mount/package.json b/packages/did-mount/package.json index d937e9264c..5fca23aacf 100644 --- a/packages/did-mount/package.json +++ b/packages/did-mount/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React hooks package for componentDidMount", "name": "@rooks/use-did-mount", "homepage": "https://react-hooks.org/hook/use-did-mount", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/did-mount/src/index.js b/packages/did-mount/src/index.js index 88f0473fcb..e08f7d161f 100644 --- a/packages/did-mount/src/index.js +++ b/packages/did-mount/src/index.js @@ -12,4 +12,4 @@ function useDidMount(callback) { }, []); } -module.exports = useDidMount; +export default useDidMount; diff --git a/packages/did-update/package.json b/packages/did-update/package.json index 89d831264a..53e6ccfc6b 100644 --- a/packages/did-update/package.json +++ b/packages/did-update/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "componentDidUpdate hook for react", "name": "@rooks/use-did-update", "homepage": "https://react-hooks.org/hook/use-did-update", @@ -10,7 +11,7 @@ }, "scripts": { "test": "jest", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/did-update/src/index.js b/packages/did-update/src/index.js index 7fcff0fdc4..195801505f 100644 --- a/packages/did-update/src/index.js +++ b/packages/did-update/src/index.js @@ -27,4 +27,4 @@ function useDidUpdate(callback, conditions) { }, conditions); } -module.exports = useDidUpdate; +export default useDidUpdate; diff --git a/packages/input/package.json b/packages/input/package.json index 7a17719f80..eb289f9fb1 100644 --- a/packages/input/package.json +++ b/packages/input/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React Hooks package for input", "name": "@rooks/use-input", "homepage": "https://react-hooks.org/hook/use-input", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/input/src/index.js b/packages/input/src/index.js index 1df194d147..55db10a2bf 100644 --- a/packages/input/src/index.js +++ b/packages/input/src/index.js @@ -36,14 +36,11 @@ function useInput(initialValue = "", opts = defaultOptions) { } } //sync with default value - useEffect( - () => { - setValue(initialValue); - }, - [initialValue] - ); + useEffect(() => { + setValue(initialValue); + }, [initialValue]); return { value, onChange }; } -module.exports = useInput; +export default useInput; diff --git a/packages/interval/package.json b/packages/interval/package.json index 29c9eef044..ea5963e54e 100644 --- a/packages/interval/package.json +++ b/packages/interval/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A react hook for using setInterval", "name": "@rooks/use-interval", "homepage": "https://react-hooks.org/hook/use-interval", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/interval/src/index.js b/packages/interval/src/index.js index 7573633d7f..ee013ece56 100644 --- a/packages/interval/src/index.js +++ b/packages/interval/src/index.js @@ -13,18 +13,15 @@ function useInterval(cb, intervalDuration, startImmediate = false) { } } - useEffect( - () => { - if (isRunning) { - const _intervalId = setInterval(cb, intervalDuration); - setIntervalId(_intervalId); - return () => { - clearInterval(_intervalId); - }; - } - }, - [isRunning] - ); + useEffect(() => { + if (isRunning) { + const _intervalId = setInterval(cb, intervalDuration); + setIntervalId(_intervalId); + return () => { + clearInterval(_intervalId); + }; + } + }, [isRunning]); return { start, @@ -33,4 +30,4 @@ function useInterval(cb, intervalDuration, startImmediate = false) { }; } -module.exports = useInterval; +export default useInterval; diff --git a/packages/key/package.json b/packages/key/package.json index 322c210390..b4adf4ff66 100644 --- a/packages/key/package.json +++ b/packages/key/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "Keyboard key handler hook for react", "name": "@rooks/use-key", "homepage": "https://react-hooks.org/hook/use-key", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/key/src/index.js b/packages/key/src/index.js index 58c9208ea6..682ce81d34 100644 --- a/packages/key/src/index.js +++ b/packages/key/src/index.js @@ -35,4 +35,4 @@ function useKey(keyList = [], handler, opts) { }, [when, eventTypes, keyList, targetNode, handler]); } -module.exports = useKey; +export default useKey; diff --git a/packages/localstorage/package.json b/packages/localstorage/package.json index ffd784bd54..0e5d24dc6e 100644 --- a/packages/localstorage/package.json +++ b/packages/localstorage/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "Local Storage hook for React", "name": "@rooks/use-localstorage", "homepage": "https://react-hooks.org/hook/use-localstorage", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/localstorage/src/index.js b/packages/localstorage/src/index.js index b5c4d936b0..b76568516a 100644 --- a/packages/localstorage/src/index.js +++ b/packages/localstorage/src/index.js @@ -63,4 +63,4 @@ function useLocalStorage(key, defaultValue = null) { }; } -module.exports = useLocalStorage; +export default useLocalStorage; diff --git a/packages/mouse/package.json b/packages/mouse/package.json index 2e40e95852..c4b4838d9b 100644 --- a/packages/mouse/package.json +++ b/packages/mouse/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React Hooks package for mouse", "name": "@rooks/use-mouse", "homepage": "https://react-hooks.org/hook/use-mouse", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/mutation-observer/package.json b/packages/mutation-observer/package.json index d8df46050e..f34cc6bf7b 100644 --- a/packages/mutation-observer/package.json +++ b/packages/mutation-observer/package.json @@ -1,5 +1,7 @@ { "main": "lib/index.js", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "license": "MIT", "description": "A React Hooks package for mutation-observer", "name": "@rooks/use-mutation-observer", @@ -11,7 +13,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/mutation-observer/src/index.js b/packages/mutation-observer/src/index.js index 3e82a94ba8..38c3ff1644 100644 --- a/packages/mutation-observer/src/index.js +++ b/packages/mutation-observer/src/index.js @@ -7,22 +7,21 @@ var config = { childList: true }; -module.exports = function(ref, callback, options = config) { - useEffect( - () => { - // Create an observer instance linked to the callback function - if (ref.current) { - const observer = new MutationObserver((mutationList, observer) => { - callback(mutationList, observer); - }); +function useMutationObserver(ref, callback, options = config) { + useEffect(() => { + // Create an observer instance linked to the callback function + if (ref.current) { + const observer = new MutationObserver((mutationList, observer) => { + callback(mutationList, observer); + }); - // Start observing the target node for configured mutations - observer.observe(ref.current, options); - return () => { - observer.disconnect(); - }; - } - }, - [ref.current, callback, options] - ); -}; + // Start observing the target node for configured mutations + observer.observe(ref.current, options); + return () => { + observer.disconnect(); + }; + } + }, [ref.current, callback, options]); +} + +export default useMutationObserver; diff --git a/packages/navigator-language/package.json b/packages/navigator-language/package.json index d2d7aea370..577927d831 100644 --- a/packages/navigator-language/package.json +++ b/packages/navigator-language/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React Hooks package for navigator-language", "name": "@rooks/use-navigator-language", "homepage": "https://react-hooks.org/hook/use-navigator-language", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/online/package.json b/packages/online/package.json index 0ce1d89d81..725f9958e1 100644 --- a/packages/online/package.json +++ b/packages/online/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React Hooks package for online", "name": "@rooks/use-online", "homepage": "https://react-hooks.org/hook/use-online", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/online/src/index.js b/packages/online/src/index.js index 30d3f01858..601291e12d 100644 --- a/packages/online/src/index.js +++ b/packages/online/src/index.js @@ -41,4 +41,4 @@ function useOnline() { return online; } -module.exports = useOnline; +export default useOnline; diff --git a/packages/outside-click/package.json b/packages/outside-click/package.json index 16a53f3b53..8d9390581b 100644 --- a/packages/outside-click/package.json +++ b/packages/outside-click/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "React hook for tracking clicks outside a ref", "name": "@rooks/use-outside-click", "homepage": "https://react-hooks.org/hook/use-outside-click", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/outside-click/src/index.js b/packages/outside-click/src/index.js index c6a33b9fed..b543066f8a 100644 --- a/packages/outside-click/src/index.js +++ b/packages/outside-click/src/index.js @@ -6,17 +6,14 @@ function useOutsideClick(ref, handler, when = true) { handler(e); } } - useLayoutEffect( - () => { - if (when) { - document.addEventListener("click", handle); - return () => { - document.removeEventListener("click", handle); - }; - } - }, - [ref, handler, when] - ); + useLayoutEffect(() => { + if (when) { + document.addEventListener("click", handle); + return () => { + document.removeEventListener("click", handle); + }; + } + }, [ref, handler, when]); } -module.exports = useOutsideClick; +export default useOutsideClick; diff --git a/packages/previous/package.json b/packages/previous/package.json index e22eb1876f..0f1a72dc53 100644 --- a/packages/previous/package.json +++ b/packages/previous/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "Access the previous value of a variable with this React hook", "name": "@rooks/use-previous", "homepage": "https://react-hooks.org/hook/use-previous", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/previous/src/index.js b/packages/previous/src/index.js index 0968e22cb8..6e5e8fdcaa 100644 --- a/packages/previous/src/index.js +++ b/packages/previous/src/index.js @@ -11,19 +11,16 @@ function usePrevious(currentValue) { const [curr, setCurr] = useState(currentValue); const [prev, setPrev] = useState(undefined); const [hasMounted, setHasMounted] = useState(false); - useEffect( - () => { - if (hasMounted) { - setPrev(curr); - setCurr(currentValue); - } - }, - [currentValue] - ); + useEffect(() => { + if (hasMounted) { + setPrev(curr); + setCurr(currentValue); + } + }, [currentValue]); useDidMount(() => { setHasMounted(true); }); return prev; } -module.exports = usePrevious; +export default usePrevious; diff --git a/packages/raf/package.json b/packages/raf/package.json index a00003ea94..6a15b25840 100644 --- a/packages/raf/package.json +++ b/packages/raf/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A continuously running requestAnimationFrame hook for React", "name": "@rooks/use-raf", "homepage": "https://react-hooks.org/hook/use-raf", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/raf/src/index.js b/packages/raf/src/index.js index 2e6b916714..bb38f31eea 100644 --- a/packages/raf/src/index.js +++ b/packages/raf/src/index.js @@ -14,20 +14,17 @@ import raf from "raf"; */ function useRaf(callback, isActive = true) { let [rafId, setRafId] = useState(null); - useLayoutEffect( - () => { - if (isActive) { - let _rafId = raf(() => { - callback(); - setRafId(_rafId); - }); - return () => { - raf.cancel(rafId); - }; - } - }, - [callback, isActive, rafId] - ); + useLayoutEffect(() => { + if (isActive) { + let _rafId = raf(() => { + callback(); + setRafId(_rafId); + }); + return () => { + raf.cancel(rafId); + }; + } + }, [callback, isActive, rafId]); return rafId; } -module.exports = useRaf; +export default useRaf; diff --git a/packages/rooks/package.json b/packages/rooks/package.json index 320de669f8..0d83913d0b 100644 --- a/packages/rooks/package.json +++ b/packages/rooks/package.json @@ -5,7 +5,7 @@ "author": "Bhargav Ponnapalli (https://github.com/imbhargav5)", "homepage": "https://github.com/react-hooks-org/rooks#readme", "license": "MIT", - "main": "lib/rooks.cjs.js", + "main": "lib/rooks.js", "jsnext:main": "lib/rooks.esm.js", "module": "lib/rooks.esm.js", "directories": { @@ -20,7 +20,7 @@ "url": "git+https://github.com/react-hooks-org/rooks.git" }, "scripts": { - "build": "rollup -c", + "build": "rollup -c rollup.config.js", "prebuild": "rimraf lib", "lint": "eslint src test", "test": "jest" @@ -41,5 +41,31 @@ "resolutions": { "terser": "3.14" }, - "gitHead": "fd72a06e765d201d5ca9fea0e4b89368273fa54c" + "gitHead": "fd72a06e765d201d5ca9fea0e4b89368273fa54c", + "dependencies": { + "@rooks/use-boundingclientrect": "1.0.17", + "@rooks/use-counter": "1.0.17", + "@rooks/use-did-mount": "1.0.17", + "@rooks/use-did-update": "1.0.1", + "@rooks/use-input": "1.1.7", + "@rooks/use-interval": "1.1.10", + "@rooks/use-key": "1.0.19", + "@rooks/use-localstorage": "1.0.16", + "@rooks/use-mouse": "1.0.16", + "@rooks/use-mutation-observer": "1.0.16", + "@rooks/use-navigator-language": "1.0.16", + "@rooks/use-online": "1.0.17", + "@rooks/use-outside-click": "1.0.16", + "@rooks/use-previous": "1.0.7", + "@rooks/use-raf": "1.0.10", + "@rooks/use-select": "1.0.18", + "@rooks/use-sessionstorage": "1.0.16", + "@rooks/use-time-ago": "1.0.16", + "@rooks/use-timeout": "1.1.10", + "@rooks/use-toggle": "1.0.16", + "@rooks/use-visibility-sensor": "1.0.16", + "@rooks/use-will-unmount": "1.0.17", + "@rooks/use-window-size": "1.0.16", + "@rooks/use-worker": "1.0.14" + } } diff --git a/packages/rooks/rollup.config.js b/packages/rooks/rollup.config.js index c6ccca9baf..5c73034ad0 100644 --- a/packages/rooks/rollup.config.js +++ b/packages/rooks/rollup.config.js @@ -32,7 +32,9 @@ const commonPlugins = [ // }), sourceMaps(), json(), - nodeResolve(), + nodeResolve({ + module: true + }), babel({ exclude: ["node_modules/**", "../../node_modules/**"], plugins: ["@babel/plugin-external-helpers"] @@ -58,17 +60,16 @@ const prodPlugins = [ }) ]; +const globals = { react: "React", "react-dom": "ReactDOM" }; + const configBase = { input: "./src/index.js", // \0 is rollup convention for generated in memory modules - external: id => - !id.startsWith("\0") && !id.startsWith(".") && !id.startsWith("/"), + external: Object.keys(globals), plugins: commonPlugins }; -const globals = { react: "React", "react-dom": "ReactDOM" }; - const standaloneBaseConfig = { ...configBase, input: "./src/index-standalone.js", @@ -76,7 +77,7 @@ const standaloneBaseConfig = { file: "lib/rooks.js", format: "umd", globals, - name: "styled", + name: "rooks", sourcemap: true }, external: Object.keys(globals), diff --git a/packages/select/package.json b/packages/select/package.json index d2b72e961d..f0f6d6ed73 100644 --- a/packages/select/package.json +++ b/packages/select/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React Hooks package for select", "name": "@rooks/use-select", "homepage": "https://react-hooks.org/hook/use-select", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/select/src/index.js b/packages/select/src/index.js index 703b33480d..6862103ad9 100644 --- a/packages/select/src/index.js +++ b/packages/select/src/index.js @@ -36,4 +36,4 @@ function useSelect(list, initialIndex = 0) { }; } -module.exports = useSelect; +export default useSelect; diff --git a/packages/sessionstorage/package.json b/packages/sessionstorage/package.json index 0b5e70ffbe..3703915b39 100644 --- a/packages/sessionstorage/package.json +++ b/packages/sessionstorage/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "Session storage react hook. Easily manage session storage values", "name": "@rooks/use-sessionstorage", "homepage": "https://react-hooks.org/hook/use-sessionstorage", @@ -11,7 +12,7 @@ "scripts": { "test": "jest -c jest.config.js", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/sessionstorage/src/index.js b/packages/sessionstorage/src/index.js index b7a92af36f..91d5c9f9c2 100644 --- a/packages/sessionstorage/src/index.js +++ b/packages/sessionstorage/src/index.js @@ -80,4 +80,4 @@ function useSessionStorage(key, defaultValue = null) { }; } -module.exports = useSessionStorage; +export default useSessionStorage; diff --git a/packages/time-ago/package.json b/packages/time-ago/package.json index 2440c255a7..a5bbb2373f 100644 --- a/packages/time-ago/package.json +++ b/packages/time-ago/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React Hook to get time ago for timestamp millisecond value", "name": "@rooks/use-time-ago", "homepage": "https://react-hooks.org/hook/use-time-ago", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/time-ago/src/index.js b/packages/time-ago/src/index.js index ab76dcf8ff..2cd0b3f7e1 100644 --- a/packages/time-ago/src/index.js +++ b/packages/time-ago/src/index.js @@ -41,15 +41,12 @@ function useTimeAgo(input, argOpts) { } } - useEffect( - () => { - dispatcher({ - type: "update" - }); - }, - [input, argOpts] - ); + useEffect(() => { + dispatcher({ + type: "update" + }); + }, [input, argOpts]); return state.timeAgo; } -module.exports = useTimeAgo; +export default useTimeAgo; diff --git a/packages/timeout/package.json b/packages/timeout/package.json index fe5ccec2c0..1715d653d0 100644 --- a/packages/timeout/package.json +++ b/packages/timeout/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React Hooks package for timeout", "name": "@rooks/use-timeout", "homepage": "https://react-hooks.org/hook/use-timeout", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/timeout/src/index.js b/packages/timeout/src/index.js index 3d516ccfef..eaa3dab978 100644 --- a/packages/timeout/src/index.js +++ b/packages/timeout/src/index.js @@ -10,21 +10,18 @@ function useTimeout(cb, timeoutDelayMs = 0) { setIsTimeoutRunning(true); } - useLayoutEffect( - () => { - if (isTimeoutRunning) { - const timeout = window.setTimeout(cb, timeoutDelayMs); - return () => { - window.clearTimeout(timeout); - }; - } - }, - [isTimeoutRunning] - ); + useLayoutEffect(() => { + if (isTimeoutRunning) { + const timeout = window.setTimeout(cb, timeoutDelayMs); + return () => { + window.clearTimeout(timeout); + }; + } + }, [isTimeoutRunning]); return { clear, start }; } -module.exports = useTimeout; +export default useTimeout; diff --git a/packages/toggle/package.json b/packages/toggle/package.json index df7b3e2919..5aa7857387 100644 --- a/packages/toggle/package.json +++ b/packages/toggle/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React Hooks package for toggle", "name": "@rooks/use-toggle", "homepage": "https://react-hooks.org/hook/use-toggle", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/visibility-sensor/package.json b/packages/visibility-sensor/package.json index d08fd34fc6..ecf48af0a8 100644 --- a/packages/visibility-sensor/package.json +++ b/packages/visibility-sensor/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React Hooks package for visibility-sensor", "name": "@rooks/use-visibility-sensor", "homepage": "https://react-hooks.org/hook/use-visibility-sensor", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/visibility-sensor/src/index.js b/packages/visibility-sensor/src/index.js index 4a297278fb..bffe331ad6 100644 --- a/packages/visibility-sensor/src/index.js +++ b/packages/visibility-sensor/src/index.js @@ -148,19 +148,16 @@ function useVisbilitySensor(ref, opts) { }, []); // If interval check is needed - useEffect( - () => { - if (intervalCheck && intervalCheck > 0) { - const intervalTimer = setInterval(() => { - updateIsVisible(); - }, intervalCheck); - return () => { - clearInterval(intervalTimer); - }; - } - }, - [intervalCheck] - ); + useEffect(() => { + if (intervalCheck && intervalCheck > 0) { + const intervalTimer = setInterval(() => { + updateIsVisible(); + }, intervalCheck); + return () => { + clearInterval(intervalTimer); + }; + } + }, [intervalCheck]); function createListener(event, debounce, throttle) { const container = getContainer(); @@ -205,4 +202,4 @@ function useVisbilitySensor(ref, opts) { }, []); return localState; } -module.exports = useVisbilitySensor; +export default useVisbilitySensor; diff --git a/packages/will-unmount/package.json b/packages/will-unmount/package.json index 9087147ad2..c954b4f264 100644 --- a/packages/will-unmount/package.json +++ b/packages/will-unmount/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React hook for componentWillUnmount lifecycle method", "name": "@rooks/use-will-unmount", "homepage": "https://react-hooks.org/hook/use-will-unmount", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "keywords": [ diff --git a/packages/will-unmount/src/index.js b/packages/will-unmount/src/index.js index 7a0ea12c64..635f860436 100644 --- a/packages/will-unmount/src/index.js +++ b/packages/will-unmount/src/index.js @@ -12,4 +12,4 @@ function useWillUnmount(callback) { }, []); } -module.exports = useWillUnmount; +export default useWillUnmount; diff --git a/packages/window-size/package.json b/packages/window-size/package.json index 4b4a952bf3..4d67f0d630 100644 --- a/packages/window-size/package.json +++ b/packages/window-size/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React Hooks package for window-size", "name": "@rooks/use-window-size", "homepage": "https://react-hooks.org/hook/use-window-size", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "test:example": "parcel test/index.html", "prepublish": "yarn run build" }, diff --git a/packages/window-size/src/index.js b/packages/window-size/src/index.js index 2d798632d8..660e9adea3 100644 --- a/packages/window-size/src/index.js +++ b/packages/window-size/src/index.js @@ -36,4 +36,4 @@ function useWindowSize() { return windowSize; } -module.exports = useWindowSize; +export default useWindowSize; diff --git a/packages/worker/package.json b/packages/worker/package.json index 0c18e8878d..63191c3db0 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,6 +1,7 @@ { "main": "lib/index.js", - "license": "MIT", + "jsnext:main": "lib/index.esm.js", + "module": "lib/index.esm.js", "description": "A React Hooks package for worker", "name": "@rooks/use-worker", "homepage": "https://react-hooks.org/hook/use-worker", @@ -11,7 +12,7 @@ "scripts": { "test": "jest", "lint": "eslint src test", - "build": "babel src --out-dir lib", + "build": "rollup -c ../../scripts/rollup.config.js", "prepublish": "yarn run build" }, "version": "1.1.0-alpha.0", diff --git a/scripts/rollup.config.js b/scripts/rollup.config.js new file mode 100644 index 0000000000..0fd1b8bfe6 --- /dev/null +++ b/scripts/rollup.config.js @@ -0,0 +1,139 @@ +import nodeResolve from "rollup-plugin-node-resolve"; +import replace from "rollup-plugin-replace"; +import commonjs from "rollup-plugin-commonjs"; +import babel from "rollup-plugin-babel"; +import json from "rollup-plugin-json"; +import flow from "rollup-plugin-flow"; +import { terser } from "rollup-plugin-terser"; +import sourceMaps from "rollup-plugin-sourcemaps"; + +// rollup-plugin-ignore stopped working, so we'll just remove the import lines 😐 +const propTypeIgnore = { "import PropTypes from 'prop-types';": "'';" }; + +const cjs = { + exports: "named", + format: "cjs", + sourcemap: true +}; + +const esm = { + format: "esm", + sourcemap: true +}; + +const getCJS = override => ({ ...cjs, ...override }); +const getESM = override => ({ ...esm, ...override }); + +const commonPlugins = [ + // flow({ + // // needed for sourcemaps to be properly generated + // pretty: true, + // }), + sourceMaps(), + json(), + nodeResolve(), + babel({ + exclude: ["node_modules/**", "../../node_modules/**"], + plugins: ["@babel/plugin-external-helpers"] + }), + commonjs({ + ignoreGlobal: true, + exclude: ["node_modules/**", "../../node_modules/**"], + namedExports: { + "react-is": ["isElement", "isValidElementType", "ForwardRef"] + } + }) +]; + +const prodPlugins = [ + replace({ + ...propTypeIgnore, + "process.env.NODE_ENV": JSON.stringify("production") + }), + terser({ + sourcemap: true + }) +]; + +const configBase = { + input: "./src/index.js", + + // \0 is rollup convention for generated in memory modules + external: id => + !id.startsWith("\0") && !id.startsWith(".") && !id.startsWith("/"), + plugins: commonPlugins +}; + +const globals = { react: "React", "react-dom": "ReactDOM" }; + +const standaloneBaseConfig = { + ...configBase, + input: "./src/index.js", + output: { + file: "lib/index.js", + format: "umd", + globals, + name: "styled", + sourcemap: true + }, + external: Object.keys(globals), + plugins: configBase.plugins.concat( + replace({ + __SERVER__: JSON.stringify(false) + }) + ) +}; + +const standaloneConfig = { + ...standaloneBaseConfig, + plugins: standaloneBaseConfig.plugins.concat( + replace({ + "process.env.NODE_ENV": JSON.stringify("development") + }) + ) +}; + +const standaloneProdConfig = { + ...standaloneBaseConfig, + output: { + ...standaloneBaseConfig.output, + file: "lib/index.min.js" + }, + plugins: standaloneBaseConfig.plugins.concat(prodPlugins) +}; + +const serverConfig = { + ...configBase, + output: [ + getESM({ file: "lib/index.esm.js" }), + getCJS({ file: "lib/index.cjs.js" }) + ], + plugins: configBase.plugins.concat( + replace({ + __SERVER__: JSON.stringify(true) + }) + ) +}; + +const browserConfig = { + ...configBase, + output: [ + getESM({ file: "lib/index.browser.esm.js" }), + getCJS({ file: "lib/index.browser.cjs.js" }) + ], + plugins: configBase.plugins.concat( + replace({ + __SERVER__: JSON.stringify(false) + }) + ) +}; + +export default [ + standaloneConfig, + standaloneProdConfig, + serverConfig, + browserConfig + // nativeConfig, + // primitivesConfig, + // macroConfig, +]; diff --git a/yarn.lock b/yarn.lock index 8b751e7a3d..099f8ef7fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1560,11 +1560,142 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== +"@rooks/use-boundingclientrect@1.0.17": + version "1.0.17" + resolved "https://registry.yarnpkg.com/@rooks/use-boundingclientrect/-/use-boundingclientrect-1.0.17.tgz#353690152684ba261b629de6faf0e9c05077b8fc" + integrity sha512-tI6nZl8e4gPOEsK8Dltpx8SSmiPb8rRgvcQ/5/hPb6VA0NEKr2CtSFjgNbkBRiTK+BYJnKajrkH/ROYYqC+EnA== + dependencies: + "@rooks/use-mutation-observer" "^1.0.16" + +"@rooks/use-counter@1.0.17": + version "1.0.17" + resolved "https://registry.yarnpkg.com/@rooks/use-counter/-/use-counter-1.0.17.tgz#adb6772097f2df8d667e20d978863caf353778d9" + integrity sha512-RU5Gi/OkaHiByVniLin0NG3f1lPi5eMC+PYl8dK8A5y0Hucl6bIkV4laRGttvur12TcuSBjeIcOmEIs88pxu+g== + +"@rooks/use-did-mount@1.0.17", "@rooks/use-did-mount@^1.0.17": + version "1.0.17" + resolved "https://registry.yarnpkg.com/@rooks/use-did-mount/-/use-did-mount-1.0.17.tgz#9374d694122af3501afae9dbcb10decd90484b0a" + integrity sha512-MTJ3Nfh55/InPdApV8HPhiXg2wDVJJRwjRnJpWiRYAAsoCdkQP+KSZKYOITGqxmTRNHw9UUFruFIQW8m4KfOXw== + +"@rooks/use-did-update@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rooks/use-did-update/-/use-did-update-1.0.1.tgz#488fb5972851ebec19b812347dde0a54afd3d574" + integrity sha512-0wELTjO23OjmGRmPZ33ABJbLMcq2YBcJ1+0+b3FFwumoZ7i3p3meRFoYu7zpeQYkHJmsD73Swh/WjQYRPPdRbA== + dependencies: + "@rooks/use-did-mount" "^1.0.17" + +"@rooks/use-input@1.1.7": + version "1.1.7" + resolved "https://registry.yarnpkg.com/@rooks/use-input/-/use-input-1.1.7.tgz#68ef9ee58ba711a259b48f382e441bbfe7f021cd" + integrity sha512-3MDRB+MheYm7yhMZqnez3njNmRY2W9lmnzEveRx4him6CJyGpqWjjEUCadEFfMkavuyOVWbPCc7vQj32lDpl0g== + +"@rooks/use-interval@1.1.10": + version "1.1.10" + resolved "https://registry.yarnpkg.com/@rooks/use-interval/-/use-interval-1.1.10.tgz#4bfd8686a64cb83a582fbf6f622648e6c7105d47" + integrity sha512-WKazlPO8OCaTWpM6Avzj319zMNiEoNhGl6I2Pgj4lVUqtABm96JX+vxHMUox9zae4SB23tRtFhFmJGsADOb4Ug== + "@rooks/use-interval@^0.1.5": version "0.1.5" resolved "https://registry.yarnpkg.com/@rooks/use-interval/-/use-interval-0.1.5.tgz#e89dfe5f74c1fe36972603c0e343a1d3366394be" integrity sha512-bqP8LifNCAFJD4OLL9fKnVoktiK7nwMUArlvs/8H2LzrDazQbt930B2yZmv0vv3vnkry4fCVQXxVt0xpNnou9Q== +"@rooks/use-key@1.0.19": + version "1.0.19" + resolved "https://registry.yarnpkg.com/@rooks/use-key/-/use-key-1.0.19.tgz#22dc8244247c462faf16fdb3d7e7019089f6be56" + integrity sha512-4ID8I+wdJb4XhOgnqtFpHA8TASJ4iOL59ba9IqFE1jr8TpKfGQlBlCNmnsqasA9b1IuvvgxkZCopQqUY34JHWQ== + +"@rooks/use-localstorage@1.0.16": + version "1.0.16" + resolved "https://registry.yarnpkg.com/@rooks/use-localstorage/-/use-localstorage-1.0.16.tgz#75f729ab6af1c5b243c5fb28cec31963d1edd810" + integrity sha512-picZb9c2Qs0VutVkhC1PZMEAafj/IdQ1jfxipHb5BETQBisPSSUIXsy6YKyG76RUSAco8bLZTSDVTPKexQJF3g== + +"@rooks/use-mouse@1.0.16": + version "1.0.16" + resolved "https://registry.yarnpkg.com/@rooks/use-mouse/-/use-mouse-1.0.16.tgz#36c40cef19a94b2bcfc9848d9e6f7b732f9e19e8" + integrity sha512-ItQEOKfy20ltU6vJ+JmPQkOQX0VAJkRqHGNPlmS9YkhHHjDnC+WoCFJYY0Hqnfu8xPnj1x0q/6dQ9nO4cHTgmQ== + +"@rooks/use-mutation-observer@1.0.16", "@rooks/use-mutation-observer@^1.0.16": + version "1.0.16" + resolved "https://registry.yarnpkg.com/@rooks/use-mutation-observer/-/use-mutation-observer-1.0.16.tgz#78eb1e6faec45f2029413b35eeb364cdde266138" + integrity sha512-VmwdJNHYEIfrLh7MrZk3ViFSBQ/OpmhzKVnwMRl8xNsOZ8CI7xN/fwf7NCJTqOaeQ4AR90y/2q/zwKkF4jKk9Q== + +"@rooks/use-navigator-language@1.0.16": + version "1.0.16" + resolved "https://registry.yarnpkg.com/@rooks/use-navigator-language/-/use-navigator-language-1.0.16.tgz#164b8bf44549825eae393a41e7401397746b0d8a" + integrity sha512-89jsDGOP/QxMFD+XpNEc0+7NpY1iC+pd/Jl+hxBpuAT2JM4iWcb3mz6AhoUKVdfT4tgcWlp9ttZ37fXq/ONX4w== + +"@rooks/use-online@1.0.17": + version "1.0.17" + resolved "https://registry.yarnpkg.com/@rooks/use-online/-/use-online-1.0.17.tgz#89e8e43be02d5bce43f306d0710667771c0c9f20" + integrity sha512-hfDMlVyLX6Za3Krdtb+J9tzasvDXrmg6dN2i5XaxWVc9sfe6LjQOk9S3L1PZekMvosk0twqBFxhDJFkQdoJLTg== + +"@rooks/use-outside-click@1.0.16": + version "1.0.16" + resolved "https://registry.yarnpkg.com/@rooks/use-outside-click/-/use-outside-click-1.0.16.tgz#825c2f305df5edd576ce1f1f758cf2e516be4a55" + integrity sha512-JnvgKIV5fXfAxYno4TwNA4eEE6lKEFkxJzOaulNdRZp9rK5G1l7Fv8QvOfQNcxehShCke8BzHHbed+n0y6cEPQ== + +"@rooks/use-previous@1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@rooks/use-previous/-/use-previous-1.0.7.tgz#96f74cc12c7c9323fe531b07c6a9a5564426b8b2" + integrity sha512-AgjAmGt1NJzk6zJ4lBT8IuU7oH+Tb7rIXiU3Ci9PXd0Mj5UkPjdDeBUVUGYd3c9o1HXO4IpFHeT5npVbq1TcnQ== + dependencies: + "@rooks/use-did-mount" "^1.0.17" + +"@rooks/use-raf@1.0.10": + version "1.0.10" + resolved "https://registry.yarnpkg.com/@rooks/use-raf/-/use-raf-1.0.10.tgz#cf08a122619f5334ced24881e1f3af93dff3a903" + integrity sha512-qukuid0ohvrnN+erW5xaFxAe8DnwYeWYH7WWUnJvghrFfLjK0k4uw0o0ZtSAYzVLtCacCh+cDhVGVLHAojhP6w== + dependencies: + raf "3.4.1" + +"@rooks/use-select@1.0.18": + version "1.0.18" + resolved "https://registry.yarnpkg.com/@rooks/use-select/-/use-select-1.0.18.tgz#4e9e4df259ec962d98ffcf2e84ed6b1902f3a25d" + integrity sha512-z7jz6WDZ+kI0ZCc+8O79vvv+gDvfJ25OcZYACb9mRFNm0zxJRlQBt13hN+f8cQ7bh0AkHMxiUmw0zT7Z2xYs5A== + +"@rooks/use-sessionstorage@1.0.16": + version "1.0.16" + resolved "https://registry.yarnpkg.com/@rooks/use-sessionstorage/-/use-sessionstorage-1.0.16.tgz#22f4d8583ff93b32dcf13b0e27dc79d10b7a2367" + integrity sha512-iWsdmY0j8q5rfaAozP0rN/UVogYV6XJVtQqjUohYVK3XBmv4xP5NWeIsChuLYvlZCmejPNQZQwBgZbanINAPIA== + +"@rooks/use-time-ago@1.0.16": + version "1.0.16" + resolved "https://registry.yarnpkg.com/@rooks/use-time-ago/-/use-time-ago-1.0.16.tgz#566d8e2846465cd7aeca497f02dee2ae8223a297" + integrity sha512-Di0A6iux2tAyUvCDvMW5CABoqaxDN0IpEzjjC0iW8A3uhOsp8HuqWw25tYDqJ6lgYMKTktpK0hlm+XFXFON7NA== + dependencies: + "@rooks/use-interval" "^0.1.5" + timeago.js "4.0.0-beta.1" + +"@rooks/use-timeout@1.1.10": + version "1.1.10" + resolved "https://registry.yarnpkg.com/@rooks/use-timeout/-/use-timeout-1.1.10.tgz#1971f829917bf9c42c3af13cb434569d79685aca" + integrity sha512-DsUjxwE2/247FyF5S4hAEzsb6Gv4nXoA1+CyvXX3KrgP7h24pA9nhrXYTW9lGfgXTRDFDRZHAW+JteoPN35Dow== + +"@rooks/use-toggle@1.0.16": + version "1.0.16" + resolved "https://registry.yarnpkg.com/@rooks/use-toggle/-/use-toggle-1.0.16.tgz#3015149c63870c9fced0a36b72f42b7f65339d55" + integrity sha512-0Jx0iZ4HXysIsGHhRVLS8ubIhRAkKhWbj7AyUnzpT4bxhrh3hlmnY73mGfXHR/tLRUbMnnm1HsZzJL0wRuKm3A== + +"@rooks/use-visibility-sensor@1.0.16": + version "1.0.16" + resolved "https://registry.yarnpkg.com/@rooks/use-visibility-sensor/-/use-visibility-sensor-1.0.16.tgz#a9e20fbc10f58b0e98aafa977d8757cb0b1cbfff" + integrity sha512-UAdAyMA/jDcfhURzFFwfqx0HKQKKr7SrXMKG1+Q3jF4rm+5KRd6UDdvPDpt819+SwTb8Vx8XRdFqbBwR1hDXXA== + +"@rooks/use-will-unmount@1.0.17": + version "1.0.17" + resolved "https://registry.yarnpkg.com/@rooks/use-will-unmount/-/use-will-unmount-1.0.17.tgz#ef948054dfc01a54cf65c335e7f1cd531fd9c32f" + integrity sha512-t8TlFye4y4cxDVpABY4a9py/mVbZWbkJ+cMgDhLm+cuUejTLO7CZ4Ipvo06t4m2VDEZ4NSd4GaAHwAHQ8ae0rg== + +"@rooks/use-window-size@1.0.16": + version "1.0.16" + resolved "https://registry.yarnpkg.com/@rooks/use-window-size/-/use-window-size-1.0.16.tgz#4e5451bb606c40babc41cdcb6f0bc99cf7aca98d" + integrity sha512-doute6x+kK6IS/VZ1h+A7xeJ9dNuXqymbg6Z+cZDn65K0CPDkZLC1DEWxTPiV2Pa/1dmEOMXhIW2g31Ef+SF5w== + +"@rooks/use-worker@1.0.14": + version "1.0.14" + resolved "https://registry.yarnpkg.com/@rooks/use-worker/-/use-worker-1.0.14.tgz#e948f0240cc3708229510571200414fe08035c27" + integrity sha512-a/ki9gDLNyE4fqtrguHJ5tULgyUr+fOMpncaxflXb/kYUIpVa3RlfY0EF5FtTYUPHhMHsSwHjHrpB4PuBNKOhQ== + "@sheerun/mutationobserver-shim@^0.3.2": version "0.3.2" resolved "https://registry.yarnpkg.com/@sheerun/mutationobserver-shim/-/mutationobserver-shim-0.3.2.tgz#8013f2af54a2b7d735f71560ff360d3a8176a87b"