WICKET-7177: alternative replacment method support#1385
WICKET-7177: alternative replacment method support#1385jstuyts wants to merge 1 commit intoapache:masterfrom
Conversation
…he initial implementation.
|
I am not doing web development since many years. The code looks OK but I am not the best person to review it at the moment. |
|
So if I understand it correctly, the whole idea behind this patch is to allow to overcome a limitation jQuery has? When looking at the code the only thing I've noticed is the absence of a default legacy method to be used when no replacementMethod is available? - this might be a problem for anyone that did some manual JS to talk to wicket before, wouldn't it be? |
|
@kbachl Yes, jQuery does not support XML, so a different way of replacing markup is needed. I do not mind removing jQuery, but that seems like a much larger change for supporting a very narrow use case. Also, the replacement of jQuery must be 100% compatible. If developers are already sending SVG or MathML (possibly surrounded by HTML) in their responses, a replacement must not change the semantics. So even with a jQuery replacement, alternative replacement methods will still be needed. Side note: I first tried Preact because this would also give more efficient DOM updates, but ran into 2 problems:
This implementation was also chosen because I want to be able to mix existing (third-party) Ajax code with replacement-method aware code. Both get the same The logic for replacing markup is:
The changes can only be used if you are aware they are there. Existing JavaScript that calls Wicket directly will continue to work, and will see the current behavior. |
One implementation supporting the replacement of XML is provided.