jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.54k stars 4.02k forks source link

No default frontend framework for microservice #19340

Closed paris0120 closed 2 years ago

paris0120 commented 2 years ago
Overview of the issue

If no framework is set for microservice, micro frontend won't generate.

Motivation for or Use Case

Micro frontend generation

Reproduce the error

There is no webapp folder generated for blog due to the lack of clientFramework value with the following jdl profile

application {
  config {
    baseName gateway
    reactive true
    packageName com.okta.developer.gateway
    applicationType gateway
    authenticationType oauth2
    buildTool gradle
    clientFramework react
    prodDatabaseType postgresql
    serviceDiscoveryType eureka
    testFrameworks [cypress]
    microfrontends [blog, store]
  }
}

application {
  config {
    baseName blog
    reactive true
    packageName com.okta.developer.blog
    applicationType microservice
    authenticationType oauth2
    buildTool gradle
    databaseType neo4j
    devDatabaseType neo4j
    prodDatabaseType neo4j
    enableHibernateCache false
    serverPort 8081
    serviceDiscoveryType eureka
    testFrameworks [cypress]
  }
  entities Blog, Post, Tag
}

application {
  config {
    baseName store
    reactive true
    packageName com.okta.developer.store
    applicationType microservice
    authenticationType oauth2
    buildTool gradle
    clientFramework react
    databaseType mongodb
    devDatabaseType mongodb
    prodDatabaseType mongodb
    enableHibernateCache false
    serverPort 8082
    serviceDiscoveryType eureka
    testFrameworks [cypress]
  }
  entities Product
}

entity Blog {
  name String required minlength(3)
  handle String required minlength(2)
}

entity Post {
  title String required
  content TextBlob required
  date Instant required
}

entity Tag {
  name String required minlength(2)
}

entity Product {
  title String required
  price BigDecimal required min(0)
  image ImageBlob
}
Related issues
Suggest a Fix

Set a default client framework if it's not set (angularX?)

JHipster Version(s)

7.9.2

JHipster configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
deepu105 commented 2 years ago

could you please follow the issue template and provide more info. Issues like these are hard to reproduce for us

paris0120 commented 2 years ago

could you please follow the issue template and provide more info. Issues like these are hard to reproduce for us

Sorry. Updated.

mshima commented 2 years ago

Microservice without clientFramework is a traditional microservice.

paris0120 commented 2 years ago

Microservice without clientFramework is a traditional microservice.

If so why there is microfrontends value on the gateway server? Isn't it duplicated and conflicting? You can just keep one of them for microfontend, either microfrontends in the gateway or client framework in the microservice.

mshima commented 2 years ago

If we try to integrate applications config (which aren’t integrated) and you extract the application out of the jdl, the application looses information and is not reproducible. With microfrontends, you can generate each application separately (each has its own jdl).

paris0120 commented 2 years ago

commented

Then the microfontend option for gateway is duplicated. Gateway can decide to generate which entity with 'entities' option. One thing always bothering me is that if I want to update one application I have to either have a separate jdl file or generate all the applications. I'm wondering if you can add an argument for jdl to generate only one specific application from like 'jhipster jdl xxx.jdl -a blog'. Then we can have one single integrated jdl but can generate individual application from it and have a more consistent jdl structure.