Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of duplicate peer dependencies at Feast UI #3785

Closed
usersavchenko opened this issue Oct 9, 2023 · 6 comments · Fixed by #4577
Closed

Get rid of duplicate peer dependencies at Feast UI #3785

usersavchenko opened this issue Oct 9, 2023 · 6 comments · Fixed by #4577

Comments

@usersavchenko
Copy link

usersavchenko commented Oct 9, 2023

Currently there is problem, Feast UI Obliges us to download a pile of various peer dependencies. They are duplicates of "dependencies" as you can see from my screenshot. What the use of this approach ? Can we release users from downloading all of these ones ?

image

@usersavchenko usersavchenko added the kind/feature New feature or request label Oct 9, 2023
@jeremyary jeremyary added kind/discussion kind/techdebt and removed kind/feature New feature or request labels Mar 4, 2024
@lokeshrangineni
Copy link
Contributor

lokeshrangineni commented Apr 19, 2024

@usersavchenko - i don't consider myself a UI developer so please take my comment with grain of salt.

Feast UI can be used as a standalone project or a plugin in an existing react project. AFAIK peer dependencies are downloaded if the feast is used as plugin.

If you are using feast as a standalone project then only dependencies list will be downloaded.

The expectation is only either peerDepedencies or dependencies used depending on how you are using feast UI components.

Could you check what do you get with the command npm list? see if the dependencies are downloaded twice.

My comment is based on the stackoverflow discussion.

@peruukki
Copy link
Contributor

I was also wondering about the large number of peer dependencies, thanks for the clarification.

Maybe the peerDependencies list could still be trimmed down a bit. They are meant for framework-like dependencies that should be managed by the "host" app, and usually there needs to be a single instance of them. dependencies are always installed regardless of how the package is used.

At least the @types, react-scripts and typescript packages are only required for the Feast UI development, so they don't necessarily need to be installed by the application. From the runtime dependencies, possibly at least moment, prop-types, query-string, use-query-params or zod could be omitted.

@shuchu
Copy link
Collaborator

shuchu commented Sep 14, 2024 via email

@peruukki
Copy link
Contributor

I suppose the first step would be to eject and make the setup work with that. Then it would be possible to remove unnecessary depedencies and possibly switch any outdated ones..

@peruukki
Copy link
Contributor

peruukki commented Sep 25, 2024

I've been trying to narrow down the peer dependencies, it's a bit tricky because how many of them you need depends on how much you want to customize. But I'd categorize the current peer dependencies like this:

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 (actually I don't think is used by Feast UI anymore), 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.

Does this make sense? I could create a PR.

@tokoko
Copy link
Collaborator

tokoko commented Sep 25, 2024

+1 for aggressively trimming down the list. I doubt anyone is actually using the UI as a plugin today, we can worry about the peer dependencies when we actually run into some problems. Feel free to open a PR, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants