Skip to content
This repository has been archived by the owner on Mar 21, 2021. It is now read-only.

Vuejs component propeties can be protected instead of private #461

Open
antonioortizpola opened this issue Oct 2, 2019 · 4 comments
Open
Labels
good first issue Good for newcomers

Comments

@antonioortizpola
Copy link
Contributor

Overview of the feature request

While I was working on my post with JHipster + VueJS side by side, I realized that the VueJS generator does not generate the components with protected properties.

This was also true for some time for Angular, but after some discussion it was merged

jhipster/generator-jhipster#8839

I open this issue to know if there is a particular reason to keep the fields private, or if we can try to change it, at least for the entities.

Motivation for or Use Case

The same reasons behind the change in Angular

jhipster/generator-jhipster#8839

Related issues or PR

jhipster/generator-jhipster#8839

jhipster/generator-jhipster#8844

  • [ X ] Checking this box is mandatory (this is just to show you read everything)
@atomfrede
Copy link
Member

For me that sound like a reasonable change helping doing side-by-side approach and customizing the frontend. @deepu105 This also sounds like a good hacktoberfest candidate

@atomfrede atomfrede added the good first issue Good for newcomers label Oct 15, 2019
@hdurix
Copy link
Member

hdurix commented Dec 10, 2019

Hi @antonioortizpola, I'm not against the idea but it seems that fields are generated as public and not as private. Can you give some example where you would like any change like this?

BTW, for me, that's not a big issue that fields are public in Vue.js components because they are not used in other components, as opposed to utility classes for instance. And exposing them are easier to unit test the class (without creating any getter/setter).

@antonioortizpola
Copy link
Contributor Author

antonioortizpola commented Dec 19, 2019

Sorry, I have been busy because of work and a small accident, I will check tonight with the plugin updated to the last version

@antonioortizpola
Copy link
Contributor Author

Can you give some example where you would like any change like this?

@hdurix The properties inside the update components for example, it could made easier to make JHipster side by side, for example, in a VehicleColorUpdate.ts component:

  @Inject('alertService') private alertService: () => AlertService;
  @Inject('vehicleColorService') private vehicleColorService: () => VehicleColorService;

And almost all injections could be protected instead of private.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants