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

chore: Exports utils directory for consumption by hawtio-online #397

Closed
wants to merge 1 commit into from

Conversation

phantomjinx
Copy link
Member

  • Utilities that were originally provided by hawtio-core are still required in hawtio-online so need to be exported

* Utilities that were originally provided by hawtio-core are still required
  in hawtio-online so need to be exported
Copy link
Member

@tadayosi tadayosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't expose all functions from util. Exposing functions and types from index.ts means exposing them as the API hawtio-next provides. I don't think tiny util functions like isString are something hawtio-next should provide as API. As far as I can see so far, probably only functions from jolokia.ts can be justifiable as part of hawtio-next's API.

Also, deciding to keep all such common utils across the hawtio-related components in hawtio-next would make those components unnecessarily tightly-coupled with each other. For example, if we want to change some util function from hawtio-next at hawtio-online, it would require to patch hawtio-next and wait for a next release of the package to finally consume the change at hawtio-online. It's unnecessarily long distance for generic util functions.

So what should we do instead? If we were careless about security issues we would have used common util packages such as lodash. So, for generic util functions which are substitutable with lodash, we can instead just duplicate the same functions at hawtio-online and maintain them in their own project.

I'd like to know what list of util functions from hawtio-next hawtio-online is currently required to depend on? So that we can further examine which utils should be really exposed and which should be just duplicated.

@tadayosi
Copy link
Member

tadayosi commented Jul 1, 2023

As far as I can see so far, probably only functions from jolokia.ts can be justifiable as part of hawtio-next's API.

Talking a bit further about jolokia.ts, for even this file, probably hawtio-next is not the best place to put them for shared usages. Maybe we should move them to jolokia.js project as companion helper functions for the official jolokia.js, so that both hawtio-next and hawtio-online (and possibly even other projects such as artemis-self-provisioning-plugin) can share them.

@phantomjinx
Copy link
Member Author

I wouldn't expose all functions from util. Exposing functions and types from index.ts means exposing them as the API hawtio-next provides. I don't think tiny util functions like isString are something hawtio-next should provide as API. As far as I can see so far, probably only functions from jolokia.ts can be justifiable as part of hawtio-next's API.

Also, deciding to keep all such common utils across the hawtio-related components in hawtio-next would make those components unnecessarily tightly-coupled with each other. For example, if we want to change some util function from hawtio-next at hawtio-online, it would require to patch hawtio-next and wait for a next release of the package to finally consume the change at hawtio-online. It's unnecessarily long distance for generic util functions.

So what should we do instead? If we were careless about security issues we would have used common util packages such as lodash. So, for generic util functions which are substitutable with lodash, we can instead just duplicate the same functions at hawtio-online and maintain them in their own project.

I'd like to know what list of util functions from hawtio-next hawtio-online is currently required to depend on? So that we can further examine which utils should be really exposed and which should be just duplicated.

I'd agree. Duplication is the only thing stopping me from re-adding them to hawtio-online. Here is the list:

So if you're good with duplicating them then I'll close this PR. Does help me since I don't have to keep publishing hawtio-next locally.

@tadayosi
Copy link
Member

tadayosi commented Jul 3, 2023

They are small enough to be duplicated at hawtio-online. Please go ahead.

@tadayosi
Copy link
Member

tadayosi commented Jul 4, 2023

Closing as discussed.

@tadayosi tadayosi closed this Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants