react-waterfall-render
Advanced tools
Comparing version 2.0.0 to 3.0.0
{ | ||
"name": "react-waterfall-render", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Renders nested React components with asynchronous cached loading; useful for GraphQL clients and server side rendering.", | ||
@@ -29,19 +29,15 @@ "license": "MIT", | ||
"files": [ | ||
"public" | ||
"waterfallRender.mjs", | ||
"WaterfallRenderContext.mjs" | ||
], | ||
"sideEffects": false, | ||
"main": "public", | ||
"exports": { | ||
".": { | ||
"import": "./public/index.mjs", | ||
"require": "./public/index.js" | ||
}, | ||
"./public/*": "./public/*", | ||
"./package": "./package.json", | ||
"./package.json": "./package.json" | ||
"./package.json": "./package.json", | ||
"./waterfallRender.mjs": "./waterfallRender.mjs", | ||
"./WaterfallRenderContext.mjs": "./WaterfallRenderContext.mjs" | ||
}, | ||
"engines": { | ||
"node": "^12.20 || >= 14.13" | ||
"node": "^12.22.0 || ^14.17.0 || >= 16.0.0" | ||
}, | ||
"browserslist": "Node 12.20 - 13 and Node < 13, Node >= 14.13, > 0.5%, not OperaMini all, not IE > 0, not dead", | ||
"browserslist": "Node 12.22 - 13 and Node < 13, Node 14.17 - 15 and Node < 15, Node >= 16, > 0.5%, not OperaMini all, not IE > 0, not dead", | ||
"peerDependencies": { | ||
@@ -52,29 +48,29 @@ "react": "16.14 - 17" | ||
"coverage-node": "^5.0.1", | ||
"esbuild": "^0.12.0", | ||
"eslint": "^7.26.0", | ||
"eslint-config-env": "^20.0.0", | ||
"esbuild": "^0.14.0", | ||
"eslint": "^8.3.0", | ||
"eslint-config-env": "^23.0.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-compat": "^3.9.0", | ||
"eslint-plugin-import": "^2.23.2", | ||
"eslint-plugin-jsdoc": "^34.7.0", | ||
"eslint-plugin-compat": "^4.0.0", | ||
"eslint-plugin-import": "^2.25.3", | ||
"eslint-plugin-jsdoc": "^37.0.3", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"eslint-plugin-react": "^7.23.2", | ||
"eslint-plugin-react-hooks": "^4.2.0", | ||
"gzip-size": "^6.0.0", | ||
"jsdoc-md": "^11.0.0", | ||
"prettier": "^2.3.0", | ||
"react": "^17.0.1", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"eslint-plugin-react": "^7.27.1", | ||
"eslint-plugin-react-hooks": "^4.3.0", | ||
"gzip-size": "^7.0.0", | ||
"jsdoc-md": "^11.0.2", | ||
"prettier": "^2.5.0", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"test-director": "^6.0.0" | ||
"test-director": "^7.0.0" | ||
}, | ||
"scripts": { | ||
"jsdoc": "jsdoc-md", | ||
"test": "npm run test:eslint && npm run test:prettier && npm run test:jsdoc && npm run test:api", | ||
"test:eslint": "eslint --ext mjs,js .", | ||
"test:prettier": "prettier -c .", | ||
"test:jsdoc": "jsdoc-md -c", | ||
"test:api": "coverage-node test/index.mjs", | ||
"docs-update": "jsdoc-md", | ||
"docs-check": "jsdoc-md -c", | ||
"eslint": "eslint .", | ||
"prettier": "prettier -c .", | ||
"tests": "coverage-node test.mjs", | ||
"test": "npm run eslint && npm run prettier && npm run docs-check && npm run tests", | ||
"prepublishOnly": "npm test" | ||
} | ||
} |
@@ -9,3 +9,3 @@ # react-waterfall-render | ||
## Setup | ||
## Installation | ||
@@ -20,5 +20,5 @@ To install with [npm](https://npmjs.com/get-npm), run: | ||
## Support | ||
## Requirements | ||
- [Node.js](https://nodejs.org): `^12.20 || >= 14.13` | ||
- [Node.js](https://nodejs.org): `^12.22.0 || ^14.17.0 || >= 16.0.0` | ||
- [Browsers](https://npm.im/browserslist): `> 0.5%, not OperaMini all, not IE > 0, not dead` | ||
@@ -52,30 +52,16 @@ | ||
_Ways to `import`._ | ||
_How to import._ | ||
> ```js | ||
> import { waterfallRender } from 'react-waterfall-render'; | ||
> import waterfallRender from "react-waterfall-render/waterfallRender.mjs"; | ||
> ``` | ||
> | ||
> ```js | ||
> import waterfallRender from 'react-waterfall-render/public/waterfallRender.js'; | ||
> ``` | ||
_Ways to `require`._ | ||
> ```js | ||
> const { waterfallRender } = require('react-waterfall-render'); | ||
> ``` | ||
> | ||
> ```js | ||
> const waterfallRender = require('react-waterfall-render/public/waterfallRender.js'); | ||
> ``` | ||
_How to server side render a [React](https://reactjs.org) app in [Node.js](https://nodejs.org)._ | ||
> ```jsx | ||
> import { renderToStaticMarkup } from 'react-dom/server.js'; | ||
> import waterfallRender from 'react-waterfall-render/public/waterfallRender.js'; | ||
> import App from './components/App.mjs'; | ||
> import ReactDOMServer from "react-dom/server.js"; | ||
> import waterfallRender from "react-waterfall-render/waterfallRender.mjs"; | ||
> import App from "./components/App.mjs"; | ||
> | ||
> waterfallRender(<App />, renderToStaticMarkup).then((html) => { | ||
> waterfallRender(<App />, ReactDOMServer.renderToStaticMarkup).then((html) => { | ||
> // Do something with the HTML string… | ||
@@ -100,31 +86,17 @@ > }); | ||
_Ways to `import`._ | ||
_How to import._ | ||
> ```js | ||
> import { WaterfallRenderContext } from 'react-waterfall-render'; | ||
> import WaterfallRenderContext from "react-waterfall-render/WaterfallRenderContext.mjs"; | ||
> ``` | ||
> | ||
> ```js | ||
> import WaterfallRenderContext from 'react-waterfall-render/public/WaterfallRenderContext.js'; | ||
> ``` | ||
_Ways to `require`._ | ||
> ```js | ||
> const { WaterfallRenderContext } = require('react-waterfall-render'); | ||
> ``` | ||
> | ||
> ```js | ||
> const WaterfallRenderContext = require('react-waterfall-render/public/WaterfallRenderContext.js'); | ||
> ``` | ||
_Use within a component with the [`useContext`](https://reactjs.org/docs/hooks-reference.html#usecontext) [React](https://reactjs.org) hook._ | ||
> ```js | ||
> import { useContext } from 'react'; | ||
> import WaterfallRenderContext from 'react-waterfall-render/public/WaterfallRenderContext.js'; | ||
> import React from "react"; | ||
> import WaterfallRenderContext from "react-waterfall-render/WaterfallRenderContext.mjs"; | ||
> ``` | ||
> | ||
> ```js | ||
> const declareLoading = useContext(WaterfallRenderContext); | ||
> const declareLoading = React.useContext(WaterfallRenderContext); | ||
> ``` | ||
@@ -149,9 +121,9 @@ | ||
> ```jsx | ||
> import { useContext } from 'react'; | ||
> import WaterfallRenderContext from 'react-waterfall-render/public/WaterfallRenderContext.js'; | ||
> import useUserProfileData from '../hooks/useUserProfileData.mjs'; | ||
> import UserProfile from './UserProfile.mjs'; | ||
> import React from "react"; | ||
> import WaterfallRenderContext from "react-waterfall-render/WaterfallRenderContext.mjs"; | ||
> import useUserProfileData from "../hooks/useUserProfileData.mjs"; | ||
> import UserProfile from "./UserProfile.mjs"; | ||
> | ||
> export default function UserPage({ userId }) { | ||
> const declareLoading = useContext(WaterfallRenderContext); | ||
> const declareLoading = React.useContext(WaterfallRenderContext); | ||
> const { load, loading, cache } = useUserProfileData(userId); | ||
@@ -178,3 +150,3 @@ > | ||
> | ||
> return 'Loading…'; | ||
> return "Loading…"; | ||
> } | ||
@@ -181,0 +153,0 @@ > ``` |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1
15405
4
160
156
1