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

Migrate hawtio-kubernetes-api to react (and remove angular dependency) #140

Closed
9 tasks done
Tracked by #138
phantomjinx opened this issue Jun 22, 2023 · 6 comments
Closed
9 tasks done
Tracked by #138
Assignees
Labels
v2 Issues related to Hawtio Online v2
Milestone

Comments

@phantomjinx
Copy link
Member

phantomjinx commented Jun 22, 2023

  • Ensure each sub-module contains a tsup.config.ts config file, thereby mandating a uniform standard of output naming. Define entry, and specify it as src/index.ts;

  • Every module should provide index.ts as its entrypoint. Then the main and types properties in the package.json will always be standardized;

  • Ensure correct module federation by adding @hawtio/react as a singleton in the webpack build configuration. This may well alleviate issues with js-logging not being defined;

  • Nest workspaces are still under investigation as valid configuration for yarn v2+ (see this). So avoid them for the moment. Any test apps should be hoisted to top level;

  • package.json dependencies / devDependencies are quite old everywhere. Need to upgrade them and remove unnecessary ones to keep up with hawtio-next;

  • File naming for independent plugin: not necessary to add plugin prefix to each file, as the plugin package should be independent with no concerns to taint global namespace;

  • eventemitter.d.ts is not required. The d.ts should be provided already from the lib;

  • urljs should be replaced. The project itself states, there's no reason to use this lib anymore;

  • Investigate extensions of the hawtio-next eventService to make it available for hawtio-k8s-api.

@tadayosi
Copy link
Member

Just FYI, I had investigated at #67 whether we could move from our own hawtio-k8s-api to some more official like https://github.com/kubernetes-client/javascript, but it turned out it's only for server-side (Node):

So we are sure we need to keep it and refresh it to React for hawtio-online v2.

@phantomjinx
Copy link
Member Author

phantomjinx commented Jun 23, 2023

What about this one -> https://github.com/godaddy/kubernetes-client ??

Seems to have an API and backends.

@phantomjinx
Copy link
Member Author

phantomjinx commented Jun 23, 2023

Consider using nock as a testing mock for a kubernetes cluster to return an API used by client. See example here.

@tadayosi
Copy link
Member

What about this one -> https://github.com/godaddy/kubernetes-client ??

When we consider 3rd party libs to substitute from our own impl, we should take sustainability into account, as we receive many security issues on a variety of components. If a 3rd party lib we use is abandoned, we'd need to end up patching it or rewrite it ourselves.

I'm concerned that this project hasn't been updated for 3 years. I think this time it's most straightforward to keep our own module and migrate hawtio-k8s-api to React or framework-free. Looking at the core part, it doesn't seem to depend so much on AngularJS. Simply removing the AngularJS API from the code doesn't seem to be so difficult.
https://github.com/hawtio/hawtio-kubernetes-api/blob/main/plugins/kubernetes-api/client.ts

@tadayosi
Copy link
Member

Consider using nock as a testing mock for a kubernetes cluster to return an API used by client. See example here.

On the other hand, we can consider using testing frameworks like this more easily as they should be dev only dependents and we can normally take security issues from those testing tools as moderate.

@tadayosi tadayosi added the v2 Issues related to Hawtio Online v2 label Jul 3, 2023
@phantomjinx phantomjinx self-assigned this Jul 12, 2023
phantomjinx added a commit that referenced this issue Jul 14, 2023
* Removes nested kubernetes-api workspace in favour of making its sub-modules
  first-class citizens of main root workspace.

* Only reason for nesting was to "hide" the k8-api testing app. However,
  given time this can be converted into one of the full testing apps for
  hawtio-online so hiding it is unnecessary.

Fixes #140 (4)
phantomjinx added a commit that referenced this issue Jul 14, 2023
* No longer required.

Fixes #140 .7
phantomjinx added a commit that referenced this issue Jul 14, 2023
* Installs the plugin-interactive-tools plugin to enable `upgrade-interactive`

* Executes upgrade on all sub-modules

Fixes #140 .5
@phantomjinx
Copy link
Member Author

Migrated to 2.x branch and then to be main

@lhein lhein added this to the 2.0.0 milestone Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 Issues related to Hawtio Online v2
Projects
Archived in project
Development

No branches or pull requests

3 participants