Skip to content
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

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

Open
antoniodeb opened this issue Oct 18, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@antoniodeb
Copy link

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
@antoniodeb antoniodeb changed the title Feature requests : @JsModule an @CssImport for views located outside of web application bundle Feature requests : @JsModule and @CssImport for views located outside of web application bundle Oct 18, 2021
@denis-anisimov
Copy link

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 denis-anisimov added the enhancement New feature or request label Oct 18, 2021
@denis-anisimov
Copy link

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
Copy link

juduf24 commented Oct 18, 2021

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants