vaadin / osgi

OSGi support for the latest Vaadin version
https://vaadin.com/docs/latest/flow/integrations/osgi/basic
Other
3 stars 1 forks source link

Feature requests : @JsModule and @CssImport for views located outside of web application bundle #73

Open antoniodeb opened 3 years ago

antoniodeb commented 3 years ago

Description of the bug / feature

I would like to build an application composed of more than a single OSGi bundle. The first OSGi bundle would contain the main application layout and the others OSGi bundles can would register extra views in the main layout. It is basically the same than help-view in the vaadin-flow-karaf-example, except that I need to put some css and vaadin designers layouts into the help-view.

Versions:

- Vaadin / Flow version: 21.0.2
- Java version:11
denis-anisimov commented 3 years ago

Unfortunately this is impossible in the current design.

All frontend resources (js module and css files are frontend resources) are compiled by the webpack and one frontend bundle is created which is served by the one application OSGi bundle. So there is simply no way to have frontend resources defined in other OSGi bundles: they won't be compiled at the build time and the application won't know about this .

This is a known limitation and the behavior may not be changed until Flow uses webpack in its current way.

The support should be done on the Flow side and this is a huge enhancement which will require dramatic frontend tools reworking. It might be there will be no any changes in OSGi integration side at all once this is supported by Flow.

denis-anisimov commented 3 years ago

Just a note: you may already now put frontend resources to other bundles/modules. But they should be directly referenced by the main application which will copy them at the build time and use them without possibility of dynamic loading (which I believe you request).

juduf24 commented 3 years ago

Hello @denis-anisimov, does your answer mean that, it is not possible with Vaadin Designer + Flow to build a modular frontend with OSGi bundles?

denis-anisimov commented 3 years ago

yes. Designer doesn't provide any additional functionality to Flow. It just generates the code which is executed by Flow. Flow doesn't support modular frontend. So Designer is just extra tool here.