jstuyts commented on PR #1385:
URL: https://github.com/apache/wicket/pull/1385#issuecomment-4069048113

   @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](https://preactjs.com/) because this would 
also give more efficient DOM updates, but ran into 2 problems:
   
   * Because elements are not replaced but updated, listeners were registered 
multiple times.
   * I could not get XML replacement to work reliably.
   
   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 `AjaxRequestTarget` and can use it without interfering with each other.
   
   The logic for replacing markup is:
   
   * Use the default jQuery method if no replacement method is specified. This 
ensures all current code behaves the same.
   * Use a registered replacement method if one is registered for the 
identifier.
   * Throw an error if an identifier in the response does not have a 
replacement method registered for it.
   
   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to