From 20cff55c1635b8d09471f38f0cf70b103d853f80 Mon Sep 17 00:00:00 2001 From: Harri Lehtola Date: Thu, 26 Sep 2024 08:26:33 +0300 Subject: [PATCH 1/2] fix: Remove unnecessary peer dependencies from Feast UI Rationale: ### Clear peer dependencies react, react-dom: These are needed for any React web app, and having a single React version across your app is highly recommended. ### Possible peer dependencies @elastic/eui, @emotion/react: If you are adding custom tabs, it makes sense to use the same component library and CSS-in-JS solution as Feast UI, and preferably the same versions and/or single instances (though I don't know how important that is). Though using only @elastic/eui of these may well be enough. And you don't need these if you only want a custom projectListPromise. So I'd mark these as optional peer dependencies. ### Not peer dependencies @elastic/datemath, d3, inter-ui, moment, prop-types, query-string, react-query, react-router-dom, react-scripts, use-query-params, zod: These packages are for more specific purposes, and many of them you wouldn't necessarily need in your app with the current customization possibilities, and you could use different versions or even other alternatives. Signed-off-by: Harri Lehtola --- ui/package.json | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/ui/package.json b/ui/package.json index bc2a71378a1..9524944db5f 100644 --- a/ui/package.json +++ b/ui/package.json @@ -9,21 +9,18 @@ "types": "./dist/FeastUI.d.ts", "module": "./dist/feast-ui.module.js", "peerDependencies": { - "@elastic/datemath": "^5.0.3", "@elastic/eui": "^55.0.1", "@emotion/react": "^11.7.1", - "d3": "^7.3.0", - "inter-ui": "^3.19.3", - "moment": "^2.29.1", - "prop-types": "^15.8.1", - "query-string": "^7.1.1", "react": "^17.0.2", - "react-dom": "^17.0.2", - "react-query": "^3.34.12", - "react-router-dom": "<6.4.0", - "react-scripts": "^5.0.0", - "use-query-params": "^1.2.3", - "zod": "^3.11.6" + "react-dom": "^17.0.2" + }, + "peerDependenciesMeta": { + "@elastic/eui": { + "optional": true + }, + "@emotion/react": { + "optional": true + } }, "dependencies": { "@elastic/datemath": "^5.0.3", From 3ec94caee3074761dec5e6c08246893767b33ddf Mon Sep 17 00:00:00 2001 From: Harri Lehtola Date: Thu, 26 Sep 2024 09:13:23 +0300 Subject: [PATCH 2/2] docs: Update Feast UI peer dependency documentation Signed-off-by: Harri Lehtola --- docs/reference/alpha-web-ui.md | 7 +++++-- ui/README.md | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/reference/alpha-web-ui.md b/docs/reference/alpha-web-ui.md index 2caeed9e2ad..02dd107f1b4 100644 --- a/docs/reference/alpha-web-ui.md +++ b/docs/reference/alpha-web-ui.md @@ -45,11 +45,14 @@ Start with bootstrapping a React app with `create-react-app` npx create-react-app your-feast-ui ``` -Then, in your app folder, install Feast UI and its peer dependencies. Assuming you use yarn +Then, in your app folder, install Feast UI and optionally its peer dependencies. Assuming you use yarn ``` yarn add @feast-dev/feast-ui -yarn add @elastic/eui @elastic/datemath @emotion/react moment prop-types inter-ui react-query react-router-dom use-query-params zod typescript query-string d3 @types/d3 +# For custom UI using the Elastic UI Framework (optional): +yarn add @elastic/eui +# For general custom styling (optional): +yarn add @emotion/react ``` Edit `index.js` in the React app to use Feast UI. diff --git a/ui/README.md b/ui/README.md index 852bddc2960..a2326e1a9ef 100644 --- a/ui/README.md +++ b/ui/README.md @@ -21,11 +21,14 @@ Start with bootstrapping a React app with `create-react-app` npx create-react-app your-feast-ui ``` -Then, in your app folder, install Feast UI and its peer dependencies. Assuming you use yarn +Then, in your app folder, install Feast UI and optionally its peer dependencies. Assuming you use yarn ``` yarn add @feast-dev/feast-ui -yarn add @elastic/eui @elastic/datemath @emotion/react moment prop-types inter-ui react-query react-router-dom use-query-params zod typescript query-string d3 @types/d3 +# For custom UI using the Elastic UI Framework (optional): +yarn add @elastic/eui +# For general custom styling (optional): +yarn add @emotion/react ``` Edit `index.js` in the React app to use Feast UI.