-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Ability to skip layers and REST methods #14416
Comments
My idea would be to have different sub generators:
These sub generators can be composed with Yeoman. So instead of skipping stuff, I'd prefer:
If you want the domain object and the entity:
Later, we can have a Kafka consumer instead of resource:
|
Hello Deepu! This solution could work but instead of skipping, I'd rather take the opposite approach (the rails one): select what should be generated instead of what should be skipped. |
I'm faster than you @MathieuAA 🍻 |
Hey both, yes that was my first thought as well, but then I started thinking about our average users who want us to provide an opinionated defaults. What you are suggesting would be good for power users and senior devs, but for someone using JHipster to learn or to quickly get something with all bells and whistles, it would be lot of friction for them to pick and choose everything. IMO, the success of JHipster is mainly due to the fact that we cater to not-so rock star devs (average devs) and we provide an opinionated stack where everything works so IMO, JHipster by default should still be providing fully working CRUD apps and provide ability for power users to customize and pick and choose So I don't care if it is by exclusion or inclusions as long we dont force everyone to pick and choose all the time |
Yes, the goal would be to keep the behavior like today, and it should not change :
Only, the internal stuff must change:
|
We should keep the behaviour as is today in V7, and maybe switch only in V8 with the 'hexagonal' approach |
no need to wait v8, it can be done progressively. I already have small sub generators:
By composing these 3 sub generators, it's similar to what we can have with Spring Initializr, but it's better (because of editorconfig, prettier) By composing the init+maven, I can build a java library (already used for my current customer) These sub generators are like module in fact, nothing new here |
By the way this is already somewhat supported.
|
Yes I know about those, well I added those originally 😜, but this is to
take it even further so that we can do the same for other layers as well.
Probably this is in line with what Pascal has in mind as well. So lets wait
for his full proposal.
…On Mon, 22 Mar 2021, 6:47 pm Marcelo Shima, ***@***.***> wrote:
Currently for an entity we generate the clinet side, REST resource,
service, and Repository layers and for every entity we also create CRUD +
Partial update methods. This is is good for many usecases but wen you are
trying to build some minimal services or microservices, there is a lot of
boilerplate.
Since we do everything with templates, its quite easy for us to skip
layers or parts altogether based on options in JDL
This can be quite useful to cut down on some of the boilerplate (which IMO
keeps increasing with each version of JHipster 😢 I just updated a poject
to v7 and it added like 1000s of lines of code, most from the partialUpdate
method and stuff which is useless to me in the application)
@skipResource | @skipService | @skipRepository | @skipDto | @skipClient
@skipRestMethods(PATCH, DELETE)
entity Product {
}
By the way this is already somewhat supported.
Since dto and service are disabled by default this should work:
@service @dto @SkipClient
entity Product {
}
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14416 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIOKF33S3DD6LZLDAV4VBDTE57B5ANCNFSM4ZTOW7XQ>
.
|
So what should be the list of filters?
Something else? If so please copy paste and complete the list! |
Me again :-), I'm also in favour of the first suggestion of @pascalgrimaud (inclusive option) instead of using skip*: I think that this is the only solution to keep being consistent across all options. No mention => Jhipster reasonable default. Specifying like this will permit to keep being consistent between binary and unary options.
|
This issue is stale because it has been open 30 days with no activity. |
Keep open
…On Fri, 4 Jun 2021, 2:25 am github-actions[bot], ***@***.***> wrote:
This issue is stale because it has been open 30 days with no activity.
Our core developers tend to be more verbose on denying. If there is no
negative comment, possibly this feature will be accepted.
We are accepting PRs 😃.
Comment or this will be closed in 7 days
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14416 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIOKFY6WIAQL7FMWWXFKV3TRAMQZANCNFSM4ZTOW7XQ>
.
|
Just my thoughts as a blueprint developer: This seems ok and possibly It would be the frictionless way not requiring many changes to the blueprints.
Blueprint developers could (maybe optionally?) implement the sub-generators to allow skipping. |
This issue is stale because it has been open 30 days with no activity. |
Keep open |
This issue is stale because it has been open 30 days with no activity. |
See RFC: #18152 |
Currently for an entity we generate the clinet side, REST resource, service, and Repository layers and for every entity we also create CRUD + Partial update methods. This is is good for many usecases but wen you are trying to build some minimal services or microservices, there is a lot of boilerplate.
Since we do everything with templates, its quite easy for us to skip layers or parts altogether based on options in JDL
This can be quite useful to cut down on some of the boilerplate (which IMO keeps increasing with each version of JHipster 😢 I just updated a poject to v7 and it added like 1000s of lines of code, most from the partialUpdate method and stuff which is useless to me in the application)
something like this (ping @MathieuAA )
WDYT @jhipster/developers
The text was updated successfully, but these errors were encountered: