I was wondering if it would be possible to have all Add-Ons provide OSGi metadata in their package. While Vaadin itself is packaged in a JAR with OSGi metadata and can be used a s a bundle in an OSGi container, the addons I’m using (CustomFIeld and CodeMirror) are not.
If Add-On packages are provided by authors, maybe their manifest could be enhanced with OSGi entries before providing them as a download.
Ticket created (note: in our internal issue tracker). Obviously no ETA, but I linked here, so hopefully someone will update this ticket when the issue progresses.
I try to use vaadin together with vaadin addons as normal OSGi bundles. To add non-OSGi vaadin addons to OSGi is not difficle. Simple create lib dir, put addon inside, in MANIFEST add jar(s) to class path and reexport content of jars
The problem is to redistribute widgets from addon to host vaadin bundle dynamically (without recompiling). Vaadin based on the GWT. GWT creates one compilled cache (java script) for whole application (vaadin + addons).
I see two ways to update a cache by addon activation/deactivation.
First one is to recompile a cache after activation/deactivation of vaadin-bundles → to slow
Second is merge already compiled caches from vaadin and activated addon bundles on fly.
The main problem there is names of global variables and functions in vaadin cache and addons cache. Theoretically it’s possible to change equal names in caches and adapt calls onLoad(). Rhiho js-parser from mozilla can help there.
The best solution is of course if GWT will support “including” mechanism for js-caches.