kweb-core icon indicating copy to clipboard operation
kweb-core copied to clipboard

Using the same fomantic plugin instance in multiple Kweb instances fails to decorate HTML pages

Open mkit opened this issue 5 years ago • 8 comments

I used 0.7.17 version of core and the fomantic styles are not applied in my application. I am using JDK8 (cannot upgrade). Is there any change between 0.7.11 and 0.7.12 that would alter the way fomantic styles are applied? I want to use the latest version but lacking fomantic styles prevents me from doing that.

mkit avatar Jun 23 '20 23:06 mkit

Hmm, that's not good.

Do you see the styling applied in this Demo app? http://demo.kweb.io:7659/lists/7c5b34 It's using a recent version of Kweb.

JDK8 shouldn't be an issue.

sanity avatar Jun 24 '20 14:06 sanity

Thanks for coming back. The demo works fine. Not sure what is happening but the FomanticUIPlugin executes the decorate method but the final (i.e. rendered website) does not have header as "enriched" by the decorate method. It seems like the header was created ignoring the FomanticUIPlugin. I have the plugin in the list of plugins.

mkit avatar Jun 24 '20 23:06 mkit

OK, I found the reason. I started multiple instances of the Kweb server in a single JVM. This causes the plugin (which is a singleton) to go crazy. Do you think it would be possible to address this in a future release? Thanks in advance for your reply.

mkit avatar Jun 24 '20 23:06 mkit

Oh, hmm, I can definitely remove the singletons - although I'm not sure why using a singleton would cause a problem, that may be a bug in its own right. I'm guessing maybe the StaticFilesPlugin, or some weirdness in plugin dependency resolution. The plugins should be fairly stateless.

sanity avatar Jun 25 '20 02:06 sanity

One quick non-breaking way to get rid of the singletons would be something like val fomantic get() = FomanticUIPlugin().

sanity avatar Jun 25 '20 02:06 sanity

Not sure what is causing it if you try to run two instances of the Kweb. :-(

mkit avatar Jun 25 '20 11:06 mkit

Thanks a lot for your help.

mkit avatar Jun 25 '20 23:06 mkit

No problem, I'm going to leave this open to investigate why the singleton plugins were causing problems.

sanity avatar Jun 26 '20 12:06 sanity

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 10 '22 03:10 github-actions[bot]