Repository navigation
chore!: Make shared base package name be more specific - #3217
Conversation
Makes shared module package name to be more specific. com.vaadin.flow.component package name already used in flow-server so it produces a conflicts when used in OSGi environments. Also, export directive was missing, which also produces errors.
| * the License. | ||
| */ | ||
| package com.vaadin.flow.component; | ||
| package com.vaadin.flow.component.shared.base; |
There was a problem hiding this comment.
Not happy with the package name in general. Are there any alternatives in how we use OSGI to keep the current package name? This will impact DX, as these classes are public API for developers, and it's going to be weird that some mixin interfaces have to be imported from com.vaadin.flow.component and others from com.vaadin.flow.component.shared.base. Besides the name is very non-descript for being so specific.
If we have to change it, why use com.vaadin.flow.component.shared.base instead of com.vaadin.flow.component.shared? If package names create collisions with OSGI, how can we be sure that the new name will not conflict with anything from Flow in the future?
There was a problem hiding this comment.
Renamed to com.vaadin.flow.component.shared.
OSGi exports bundle context by specifying the packages.
I don't know how to tell OSGi to which bundle to look, if it's possible at all.
It can be so that OSGi finds the package match and looks for a class in the first bundle containing such a package.
Having commonly used classes in *.shared package is not a bad idea IMO.
There was a problem hiding this comment.
It would be good to have some sanity test checking that no packages from different JARs have such a conflicts, but I don't know so far how to do it rather than run the OSGi starter project and check if it's started well.
There was a problem hiding this comment.
We discussed this in the team and for now it seems using a different package is the only option short-term. Reusing the same package between multiple OSGI bundles is not intended (see https://developer.ibm.com/articles/osgi-demystified-part-4-dont-bungle-your-bundles/), and while there are workarounds (see same article) it seems they would be challenging to apply to our module structure.
In terms of DX we still think developers would expect interfaces like HasClearButton to be in the same package as HasLabel, so we might want to revisit this for a future major, for example by actually combining all the com.vaadin.flow.components classes in the same Maven module, in either repository.
There was a problem hiding this comment.
Yes, the similar question is raised in SO https://stackoverflow.com/a/47327573/16650110 .
Alternative is to use OSGi Fragments (SO provides a link to docs).
But this solution looks a bit unpredictable on the first glance and would rely on the OSGi container.
The support of this Fragment feature might change in the future and we again fall back to the same issue.
At least this Fragments approach needs an investigation and tests.
I agree that the package name is better to be same for mixins.
A random idea: could we transfer them to the Flow?
Technically the shared module doesn't depend on components, so it's possible.
There was a problem hiding this comment.
Agree, fragments don't seem to be a great solution, and we might run into issues with how our projects depend on each other.
A random idea: could we transfer them to the Flow?
That would be an option, or there might also be an option to move com.vaadin.flow.components to flow-components. There are some concerns in that the interfaces we introduced are more specific to Vaadin components, while the ones in the Flow repository are more of a general nature. So we felt this requires more thought, and we should use the separate package for now, and deal with a breaking change later (which would have limited impact, since the new interfaces are probably not going to get a lot of use).
|
|
|
Kudos, SonarCloud Quality Gate passed!
|
|
Hi @mshabarov and @mshabarov, when i performed cherry-pick to this commit to 23.1, i have encountered the following issue. Can you take a look and pick it manually? |
Makes shared module package name to be more specific. com.vaadin.flow.component package name already used in flow-server so it produces a conflicts when used in OSGi environments. Also, export directive was missing, which also produces errors. Fixes vaadin/base-starter-flow-osgi#224 Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
…: 23.1) (#3224) * refactor!: Make shared base package name be more specific (#3217) Makes shared module package name to be more specific. com.vaadin.flow.component package name already used in flow-server so it produces a conflicts when used in OSGi environments. Also, export directive was missing, which also produces errors. Fixes vaadin/base-starter-flow-osgi#224 Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com> Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com> Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
|
This ticket/PR has been released with Vaadin 23.1.0.rc1 and is also targeting the upcoming stable 23.1.0 version. |
|
This ticket/PR has been released with Vaadin 23.2.0.alpha1 and is also targeting the upcoming stable 23.2.0 version. |








Description
Makes shared module package name to be more specific.
com.vaadin.flow.component package name already used in flow-server
so it produces a conflicts when used in OSGi environments.
Also, export directive was missing, which also produces errors.
Fixes vaadin/base-starter-flow-osgi#224
Type of change
Checklist
Additional for
Featuretype of change