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

vite experiment of kubernetes-api-app produces errors #147

Open
phantomjinx opened this issue Aug 4, 2023 · 3 comments
Open

vite experiment of kubernetes-api-app produces errors #147

phantomjinx opened this issue Aug 4, 2023 · 3 comments

Comments

@phantomjinx
Copy link
Member

Transition of kubernetes-api-app package to vite build system produces errors when both executing the dev server and serving a full build. This might suggest a couple of extra properties need defining in the config file or could be something more fundamental.

See experimental branch here -> https://github.com/hawtio/hawtio-online/tree/experiment-vite/packages/kubernetes-api-app

  1. yarn start

vite-start

  1. yarn build && yarn serve
    vite-serve-after-build
@tadayosi
Copy link
Member

@phantomjinx thanks for the investigation. One thing I noticed during my experiment with Vite is that the @module-federation/utilities module that we use for the dynamic plugin mechanism in @hawtio/react seems to only work with Webpack plugin for Module Federation. Since Vite uses a different plugin than Webpack's ModuleFederationPlugin, if we want to migrate to Vite we'd need to update @hawtio/react as well.

Btw, your branch doesn't seem to use a right plugin for Module Federation. You can find examples for how to use MF with Vite here:
https://github.com/module-federation/module-federation-examples/tree/master/vite-react-microfrontends
What we need to use should be this plugn: https://github.com/module-federation/vite and modfiy this part in a way that it supports dynamic module loading for the Vite plugin:
https://github.com/hawtio/hawtio-next/blob/6a799e25a35f68391793bbbfadb72fbeecc8e80d/packages/hawtio/src/core/core.ts#L148-L180

@tadayosi
Copy link
Member

Thinking of it a bit further, I feel it's not healthy that the core part of @hawtio/react depends so much on a build tool (i.e. Webpack, Vite, etc.) and we need to modify the core whenever we just want to switch the build tool we use at the last stage of the frontend console assembly. I wonder if we can come up with an abstraction at @hawtio/react so that we can easily switch the build tools or even support multiple ones (Webpack or Vite) by users' preferences.

@tadayosi
Copy link
Member

Again, thinking of it a bit further, what's most important now should be compatibility with OpenShift dynamic plugins because we want hawtio-online to be deployed as a dynamic plugin on OpenShift eventually. So, we need to make sure the technology we choose works well with OpenShift dynamic plugins, and in this regard keeping Webpack module federation might be the best bet for now.

@tadayosi tadayosi added this to the Future milestone Nov 6, 2023
@lhein lhein removed this from the Future milestone Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

3 participants