Reputation: 127
we are still on wicket 1.4, which is pretty much EOL.
I'm not an expert with Wicket and this is 5 year old code with parts from the SVN history missing due to branch restructuring, uncommented JIRA tasks for the changes and the original dev long gone.
I've started to look into migration to 1.5 and stumpled across the fact that this project uses patched JS like wicket-event.js, wicket-ajax.js. Additionally, it seems as someone manually added jquery libraries to have them minified and merged and updated manually in the project.
The mounts look like mountSharedResource("/js/wicket-event.js", new ResourceReference(WicketEventReference.class, "wicket-event.js").getSharedResourceKey());
I'm not really sure what to make of that.
The following questions arise:
Any input or follow-up questions on this scenario is very much appreciated. What are your thoughts?
How do I cope with those resource mounts? It is unclear why we have them in the first place, maybe only for the minifying? How does wicket find it's JS resources in the first place?
If I find that a patched JS resource makes sense, like patching it to attach custom classes to elements or add options for dropdown elements. How would I solve this now? Patch again? Use other means to achieve this?
EDIT: this is not only for JS resources, but also for CSS resources. It seems, that most mounts are really only done because we do that minification.
Upvotes: 1
Views: 97
Reputation: 17503
I'd recommend to remove all those custom mounts. This may break your app if you have customizations in wicket-xyz.js but it will most probably not work due to such custom modifications too. The best way for such custom modifications is to use monkey patching.
Once you see that your application works with Wicket 1.5 I'd recommend to upgrade to latest 6.x. Wicket 6.x has a lot of improvements in the management of resources - e.g. it will load some.js
in DEV mode and some.min.js
in PROD mode automatically.
See http://wicketinaction.com/2012/07/wicket-6-resource-management/ and http://wicketinaction.com/2012/07/wicket-6-javascript-improvements/ for more details.
Upvotes: 1