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

Ease new module creation by structuring modules as a tree #1666

Closed
DamnClin opened this issue May 9, 2022 · 7 comments
Closed

Ease new module creation by structuring modules as a tree #1666

DamnClin opened this issue May 9, 2022 · 7 comments
Labels
area: feature request 💡 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ generator: internal $300 https://www.jhipster.tech/bug-bounties/

Comments

@DamnClin
Copy link
Collaborator

DamnClin commented May 9, 2022

Most of current modules have a parent -> child relationship (with some modules being root). The idea would be to enforce that with an interface to define a new module, here's a very incomplete idea:

public interface JHipsterModule {
  ModuleKey key();
  ModuleKey parent();
}

public interface ModuleKey {
  String get();
}

public class RootKey implements ModuleKey {
  public String get() {
    return "root";
  }
}

This enforced parent -> child relationship will allow us to define a dependencies tree between modules those allowing:

  • Automatic HATEOAS API generation;
  • Generic (no new code for a new module) JHipster Lite front end part using the HATEOAS API (we'll need some form definition mechanism for that).

I think this can be a great facilitator to create new modules!

@antarus
Copy link
Contributor

antarus commented Jun 9, 2022

Is the notion of parent sufficient?

For example the postgresql module needs:

  • init
  • maven
  • java base (for test dependency)
  • spring boots

the oauth2 security module additionally requires spring mvc.

Current errors are not very clear when trying to run a module without one of its prerequisites

@pascalgrimaud
Copy link
Member

It should not be mandatory @antarus

Supposing I created a new project, using my personal starter, I'd like to add PostgreSQL, without the requirement to use init, maven, java base.

That's why I think building a tree can help but should not be mandatory. Each developer should know what he/she adds to the project when using each feature of JHLite

@antarus
Copy link
Contributor

antarus commented Jun 9, 2022

@pascalgrimaud I completely agree that it shouldn't be mandatory.
But jhipster-lite needs to be clearer on what a module needs and maybe what it will add/modify.
For example, I had to switch to debug mode to see the error and determine the files that were missing to add the oauth2. Then I had to look for the modules which added its files.

To be studied, but I think that with the new module system, we can maintain a list of files that each module adds / update. This could provide solutions to errors related to missing files for example.

@pascalgrimaud pascalgrimaud added $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $300 https://www.jhipster.tech/bug-bounties/ labels Aug 5, 2022
@pascalgrimaud
Copy link
Member

I'm adding a bounty on this as it's important to ease the use of module

@pascalgrimaud pascalgrimaud pinned this issue Aug 5, 2022
This was referenced Aug 9, 2022
@DamnClin
Copy link
Collaborator Author

I think this is covered by #3022

@hdurix
Copy link
Member

hdurix commented Aug 18, 2022

I also think so. We can close this issue. Don't forget the bounty @DamnClin.

@hdurix hdurix closed this as completed Aug 18, 2022
@hdurix hdurix unpinned this issue Aug 18, 2022
@DamnClin
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: feature request 💡 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ generator: internal $300 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

No branches or pull requests

4 participants